From 1c02caeaabfc9b85145692a45fb557b5c2b84aec Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 21 Aug 2020 00:27:50 +0200 Subject: [PATCH] Rename the class of the main div from "user" to "content" This makes more sense and does not cause confusion because user is also a name of a template. --- templates/hello.html | 2 +- templates/main.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/hello.html b/templates/hello.html index 0e709ce..509ef08 100644 --- a/templates/hello.html +++ b/templates/hello.html @@ -1,5 +1,5 @@
-
+

Hack me: https://rtime.felk.cvut.cz/gitweb/coffee/main.git

Debug:

diff --git a/templates/main.js b/templates/main.js index 9add69a..9cc11f5 100644 --- a/templates/main.js +++ b/templates/main.js @@ -73,7 +73,7 @@ function hiddenUpdateRemote(json, time = new Date()) { break; case "rfid": if (identifier_registration) { - ajax("POST", "user/identifier/add", JSON.stringify({ id: msg.uid }), "user"); + ajax("POST", "user/identifier/add", JSON.stringify({ id: msg.uid }), "content"); addIdentifier_finish(); } else { @@ -165,14 +165,14 @@ function ajax(method, route, data, id) { function login(id) { - ajax("POST", "login", id, "user"); + ajax("POST", "login", id, "content"); id_user = id; countingTimeLogout(120); } function logout() { sendReset(); - ajax("GET", "logout", "", "user"); + ajax("GET", "logout", "", "content"); id_user = undefined; timeToLogout = undefined; identifier_registration = false; @@ -192,7 +192,7 @@ function countingTimeLogout(count_time) } function renameUser() { - ajax("GET", "user/rename?name=" + document.getElementById("username").value, "", "user"); + ajax("GET", "user/rename?name=" + document.getElementById("username").value, "", "content"); } function getFlavor(letter) { @@ -211,7 +211,7 @@ function addCoffee(flavor, time = new Date()) { flavor: flavor }); if (id_user) { - ajax("POST", "coffee/add", data, "user"); + ajax("POST", "coffee/add", data, "content"); flavorChosen = flavor; id_user = undefined; countingTimeLogout(10); //mean 10 seconds @@ -227,7 +227,7 @@ function addEvent(event_name, action_msg, time = new Date()) { }); if (id_user) { eventMsg = "You have " + action_msg + ". Thanks!" - ajax("POST", "event", data, "user"); + ajax("POST", "event", data, "content"); window.scrollTo(0, 0); // Scroll up } } @@ -248,7 +248,7 @@ function addIdentifier_finish() { } function disableIdentifier(id) { - ajax("POST", "user/identifier/disable", JSON.stringify({ id: id }), "user"); + ajax("POST", "user/identifier/disable", JSON.stringify({ id: id }), "content"); } function renameIdentifier(i) { @@ -257,7 +257,7 @@ function renameIdentifier(i) { name: document.getElementById("identifier_name_" + i).value }); - ajax("POST", "user/identifier/rename", data, "user"); + ajax("POST", "user/identifier/rename", data, "content"); } function sendLog(json) { -- 2.39.2