From da19e9ec5dd3105bf21ea56e7b516a88062d3834 Mon Sep 17 00:00:00 2001 From: Jan Hartig <jan.hartig@ptb.de> Date: Fri, 17 Nov 2023 15:45:11 +0100 Subject: [PATCH] Enable pressing enter to submit room name --- roomunlock.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roomunlock.html b/roomunlock.html index 61dbef3..fecee89 100644 --- a/roomunlock.html +++ b/roomunlock.html @@ -98,6 +98,10 @@ const urlTime = document.getElementById('urlTime'); const roomUrl = document.getElementById('roomUrl'); + roomField.addEventListener("keydown", ({ key }) => { + if (key === "Enter") { process_form() } + }) + let room = window.location.href.substring(window.location.href.lastIndexOf('/') + 1) if (room !== "raumfreischaltung" && room !== "") { roomField.value = room; @@ -122,7 +126,7 @@ } else { _body = "{}" } - + fetch(baseUrl + "/unlockroom", { method: "POST", body: _body, -- GitLab