From 3b8173e94b9228b0761e45174190b237b41d1db8 Mon Sep 17 00:00:00 2001 From: Irma Lahtinen Date: Tue, 12 Dec 2023 01:19:38 +0200 Subject: Adding "link to clipboard" functionality and forcing questions to consist printable characters. --- static/alert-timeout.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'static/alert-timeout.js') diff --git a/static/alert-timeout.js b/static/alert-timeout.js index 6fe6def..e20106f 100644 --- a/static/alert-timeout.js +++ b/static/alert-timeout.js @@ -1,13 +1,8 @@ -Array.from(document.getElementsByClassName('kysAlert')).forEach( (a) => { - a.addEventListener('click', (event) => { - event.target.remove(); - }) - setTimeout( () => { - Array.from(document.getElementsByClassName('kysAlert')) - .forEach( (a) => { - if (a.style.transition=="opacity 2s") a.remove() - a.style.transition="opacity 2s" - a.style.opacity=0; - } ) - }, 5000) - }) +setInterval( () => { + Array.from(document.getElementsByClassName('kysAlert')).forEach( (a)=>{ + a.addEventListener('click', (event) => { event.target.remove() } ) + if (a.style.transition=="opacity 2s") a.remove() + a.style.transition="opacity 2s" + a.style.opacity=0; + } ) +}, 5000) -- cgit v1.2.3