diff options
author | Tiia Soikkeli <tsoikkel@local> | 2023-12-12 02:51:56 +0200 |
---|---|---|
committer | Tiia Soikkeli <tsoikkel@local> | 2023-12-12 02:51:56 +0200 |
commit | 70b247c640b506e407bc7f3daa48a6662a893cad (patch) | |
tree | 446209951815bf994359243dbfc759f484e1f770 /static | |
parent | 84d1277c408038ab0df6179659c68ac7f08a098f (diff) |
Adding nick resetting functionality.
Diffstat (limited to 'static')
-rw-r--r-- | static/nick-lift.js | 7 | ||||
-rw-r--r-- | static/pages.json | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/static/nick-lift.js b/static/nick-lift.js new file mode 100644 index 0000000..343608a --- /dev/null +++ b/static/nick-lift.js @@ -0,0 +1,7 @@ +var nickTimeout +Array.from(document.getElementsByClassName('kysNick')).forEach( (a) => { + a.addEventListener('mousedown', (event) => { nickTimeout = setTimeout( + () => { document.location = '/#nick_reset'}, 5000) }) + a.addEventListener('mouseup', (event) => { clearTimeout (nickTimeout) }) + a.addEventListener('mouseout', (event) => { clearTimeout (nickTimeout) }) +})
\ No newline at end of file diff --git a/static/pages.json b/static/pages.json index 8d0d376..d9374c3 100644 --- a/static/pages.json +++ b/static/pages.json @@ -45,6 +45,11 @@ "pageTitle": "Luodaanko uusi kyselmä?", "URL": "pages/quiz.html", "hidden": "yes" + }, + "nick_reset": { + "pageTitle": "Resetoidaanko nimimerkki?", + "URL": "pages/nick_reset.html", + "hidden": "yes" } } } |