mirror of
https://codeberg.org/metamuffin/abrechenbarkeit.git
synced 2024-12-29 16:14:36 +00:00
unignore script
This commit is contained in:
parent
4c6601a232
commit
d69402120b
3 changed files with 14 additions and 22 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,5 +2,6 @@
|
|||
!/gnix.yaml
|
||||
!/readme.md
|
||||
!/abrechenbarkeit.lua
|
||||
!/script.js
|
||||
!/.gitignore
|
||||
!/collapse_log.lua
|
||||
|
|
|
@ -51,30 +51,11 @@ local path = os.getenv("PATH_INFO")
|
|||
local method = os.getenv("REQUEST_METHOD")
|
||||
local query = parse_query(os.getenv("QUERY_STRING"))
|
||||
|
||||
local stylesheet = io.open("a.css"):read("a")
|
||||
-- local stylesheet = [[
|
||||
-- /* body { background-color: #161616; }
|
||||
-- h1, h2, h3, h4, h5, h6, p, label, a { color: #e2e2e2; } */
|
||||
-- .amount-presets form { display: inline-block; width: 60px }
|
||||
-- .amount-pos { color: green; }
|
||||
-- .amount-neg { color: red; }
|
||||
-- nav h2 { display: inline-block }
|
||||
-- .notif { padding: 0.5em; margin: 0.5em; background-color: #ddd; }
|
||||
-- .notif.error { background-color: #faa; }
|
||||
-- .notif p { margin: 5px; }
|
||||
-- form.box { border: 2px solid grey; padding: 0.5em; margin: 0.5em; display: inline-block; }
|
||||
-- form h3 { margin: 5px; }
|
||||
-- ]]
|
||||
local stylesheet = io.open("style.css"):read("a")
|
||||
local script = io.open("script.js"):read("a")
|
||||
|
||||
local script = [[
|
||||
document.addEventListener("keypress", ev => {
|
||||
if (!(document.activeElement instanceof HTMLInputElement)) {
|
||||
if (ev.code.startsWith("Digit"))
|
||||
document.forms.buy_product.product.value += ev.code.substring(5)
|
||||
if (ev.code == "Enter")
|
||||
document.forms.buy_product.submit()
|
||||
}
|
||||
})
|
||||
|
||||
]]
|
||||
|
||||
local function respond(status, title, body)
|
||||
|
|
10
script.js
Normal file
10
script.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
/// <reference lib="dom" />
|
||||
|
||||
document.addEventListener("keypress", ev => {
|
||||
if (!(document.activeElement instanceof HTMLInputElement)) {
|
||||
if (ev.code.startsWith("Digit"))
|
||||
document.forms.buy_product.product.value += ev.code.substring(5)
|
||||
if (ev.code == "Enter")
|
||||
document.forms.buy_product.submit()
|
||||
}
|
||||
})
|
Loading…
Reference in a new issue