aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xabrechenbarkeit.lua1
-rw-r--r--script.js6
2 files changed, 6 insertions, 1 deletions
diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua
index ae1b38a..e607541 100755
--- a/abrechenbarkeit.lua
+++ b/abrechenbarkeit.lua
@@ -224,6 +224,7 @@ local function r_user_post(username)
local pcode = nil
local pcount = nil
local powner = nil
+ local powner_comment = nil
if data.pcode then
for p_barcode, p_amount, p_name, p_owner in read_products() do
if p_barcode == data.pcode then
diff --git a/script.js b/script.js
index 27de46e..2c23133 100644
--- a/script.js
+++ b/script.js
@@ -1,9 +1,10 @@
/// <reference lib="dom" />
document.addEventListener("keydown", ev => {
+ if (ev.ctrlKey || ev.altKey) return
if (!(document.activeElement instanceof HTMLInputElement)) {
if (ev.code.startsWith("Digit")) {
- if (document.forms.buy_product.pcode)
+ if (document.forms.buy_product)
return document.forms.buy_product.pcode.value += ev.code.substring(5)
} else if (ev.code == "Enter") {
if (document.forms.buy_product)
@@ -16,6 +17,9 @@ document.addEventListener("keydown", ev => {
} else if (ev.code == "Backspace") {
if (document.forms.user_creation)
return document.forms.user_creation.create_user.value = ""
+ } else if (ev.code == "Escape") {
+ window.location.href = "/"
+ ev.preventDefault()
}
}
})