aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth/index.js3
-rw-r--r--poll/public/script.js4
-rw-r--r--quotes/public/script.js9
3 files changed, 11 insertions, 5 deletions
diff --git a/auth/index.js b/auth/index.js
index febb296..5f5db63 100644
--- a/auth/index.js
+++ b/auth/index.js
@@ -44,7 +44,8 @@ app.use("/api/logout", (req, res) => req.session.destroy() & res.redirect("/"));
app.post("/api/password", checkUser, async (req, res) => {
const { oldPassword, newPassword, newPasswordRep } = req.body;
- if (!oldPassword || !newPassword || !newPasswordRep || newPassword !== newPasswordRep || newPassword.length < 8) return res.send("error");
+ if (!oldPassword || !newPassword || !newPasswordRep || newPassword !== newPasswordRep || newPassword.length < 8)
+ return res.send("error");
const user = (await db.query("SELECT id, password FROM users WHERE id = ?", [req.session.uid]))[0];
if (!user || !user.password) return res.send("error");
if (!(await bcrypt.compare(oldPassword, user.password))) return res.send("error");
diff --git a/poll/public/script.js b/poll/public/script.js
index 09f8c93..5cca71a 100644
--- a/poll/public/script.js
+++ b/poll/public/script.js
@@ -7,7 +7,9 @@ if (!["teacher", "pupil"].includes(type)) window.location.href = "/";
dropdown.insertAdjacentHTML(
"beforeend",
- '<option selected="true" disabled>' + (type == "teacher" ? "Lehrer" : "Schüler") + "/in auswählen...</option>",
+ '<option value="" selected="true" disabled>' +
+ (type == "teacher" ? "Lehrer" : "Schüler") +
+ "/in auswählen...</option>",
);
document.querySelector("legend").innerText = type == "teacher" ? "Lehrer-Ranking" : "Schüler-Ranking";
document.querySelector("p").innerText = "Welche/r " + (type == "teacher" ? "Lehrer/in" : "Schüler/in") + "...";
diff --git a/quotes/public/script.js b/quotes/public/script.js
index d848814..4c19953 100644
--- a/quotes/public/script.js
+++ b/quotes/public/script.js
@@ -1,15 +1,18 @@
const dropdown = document.getElementById("author");
const classes = ["TGM13.1", "TGM13.2", "TGTM13.1", "TGI13.1", "TGI13.2", "teacher"];
-dropdown.insertAdjacentHTML("beforeend", '<option selected="true" disabled>Author auswählen...</option>');
-dropdown.insertAdjacentHTML("beforeend", `<option disabled>--${classes[0]}--</option>`);
+dropdown.insertAdjacentHTML(
+ "beforeend",
+ '<option disabled value="" selected="true" disabled>Author auswählen...</option>',
+);
+dropdown.insertAdjacentHTML("beforeend", `<option disabled value="">--${classes[0]}--</option>`);
function appendOption(response) {
response.forEach((elem, i) => {
dropdown.insertAdjacentHTML(
"beforeend",
(response[i - 1 < 0 ? 0 : i - 1]["class_id"] !== elem["class_id"]
- ? `<option disabled>--${classes[elem["class_id"] - 1]}--</option>`
+ ? `<option disabled value="">--${classes[elem["class_id"] - 1]}--</option>`
: "") +
`<option value="${elem["id"]}">${elem["name"]} ${elem["middlename"] ? elem["middlename"] + " " : ""}${
elem["surname"]