From 70b247c640b506e407bc7f3daa48a6662a893cad Mon Sep 17 00:00:00 2001 From: Tiia Soikkeli Date: Tue, 12 Dec 2023 02:51:56 +0200 Subject: Adding nick resetting functionality. --- static/nick-lift.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 static/nick-lift.js (limited to 'static/nick-lift.js') 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 -- cgit v1.2.3