From 588c4ceb78fae443ca8f9446d256f5474a3bf66a Mon Sep 17 00:00:00 2001 From: Debulois Date: Sat, 7 May 2022 12:23:11 +0200 Subject: Ré-écriture du JS pour le rendre CSP compliant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Static/Js/message.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Static/Js/message.js') diff --git a/Static/Js/message.js b/Static/Js/message.js index 0c09120..ed5d846 100644 --- a/Static/Js/message.js +++ b/Static/Js/message.js @@ -11,7 +11,7 @@ // **************************************************************************** function start_timer(page) { let seconds = 2; - let text = document.getElementById("redirect").innerHTML; + let text = document.getElementById("redirect").innerHTML; setInterval(() => { if (seconds > 0) { document.getElementById("redirect").innerHTML = text + seconds + " ."; @@ -23,3 +23,12 @@ function start_timer(page) { }, 1000); } + + +// On essaie de récupérer la division pour rediriger avec un timer +let rTimer = document.getElementById("rTimer"); + +// Si elle existe on redirige vers la page indiquée +if (rTimer) { + start_timer(rTimer.getAttribute("data-page")); +} -- cgit v1.2.3