diff options
author | LarsVomMars | 2020-10-10 11:41:06 +0200 |
---|---|---|
committer | LarsVomMars | 2020-10-10 11:41:06 +0200 |
commit | 7a4ade2036140203cee39cc7622f835114862515 (patch) | |
tree | e0cef3a1d21c81f58cbdd42ef50afb1f38929d4f /quotes | |
parent | ba16ce3b92379c31afd060fa5b7c1e3a37aac995 (diff) | |
parent | ad2d5dd284dc733a5fbd2a9f60c30fa1b7a0da73 (diff) |
Merge branch 'master' of github.com:marvinborner/abizeugs into master
Diffstat (limited to 'quotes')
-rw-r--r-- | quotes/index.js | 2 | ||||
-rw-r--r-- | quotes/public/script.js | 6 | ||||
-rw-r--r-- | quotes/public/style.css | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/quotes/index.js b/quotes/index.js index 5aa0646..0e0717b 100644 --- a/quotes/index.js +++ b/quotes/index.js @@ -11,7 +11,7 @@ app.post("/api/add", checkUser, async (req, res) => { await db.query("INSERT INTO quotes (user_id, author_id, quote) VALUE (?,?,?)", [ req.session.uid, parseInt(req.body.author), - req.body.quote, + req.body.quote.replace(/</g, "<").replace(/>/g, ">"), ]); res.redirect("/quotes"); } catch (e) { diff --git a/quotes/public/script.js b/quotes/public/script.js index 55eeb5f..d848814 100644 --- a/quotes/public/script.js +++ b/quotes/public/script.js @@ -1,5 +1,5 @@ const dropdown = document.getElementById("author"); -const classes = ["TGM13.1", "TGM13.2", "TGTM13.1", "TGI13.1", "TGI13.2", "Lehrer"]; +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>`); @@ -11,7 +11,7 @@ function appendOption(response) { (response[i - 1 < 0 ? 0 : i - 1]["class_id"] !== elem["class_id"] ? `<option disabled>--${classes[elem["class_id"] - 1]}--</option>` : "") + - `<option value="${elem["id"]}">${elem["name"]} ${elem["middlename"] ? elem["middlename"] : " "}${ + `<option value="${elem["id"]}">${elem["name"]} ${elem["middlename"] ? elem["middlename"] + " " : ""}${ elem["surname"] }</option>`, ); @@ -24,7 +24,7 @@ function appendQuote(response) { .getElementById(elem["class"]) .insertAdjacentHTML( "beforeend", - `<li>${elem["name"]} ${elem["middlename"] ? elem["middlename"] : ""}${elem["surname"]}: ${ + `<li>${elem["name"]} ${elem["middlename"] ? elem["middlename"] + " " : ""}${elem["surname"]}: ${ elem["quote"] }${elem["owner"] ? ' <span data-id="' + elem["id"] + '">[x]</span></li>' : ""}`, ); diff --git a/quotes/public/style.css b/quotes/public/style.css index 0336774..a4e85ea 100644 --- a/quotes/public/style.css +++ b/quotes/public/style.css @@ -15,7 +15,7 @@ div { main { position: absolute; max-height: 80%; - overflow-y: scroll; + overflow-y: auto; width: 30%; left: 50%; top: 50%; |