From fac115f9b720a4442ddec918dd7508db4daf3015 Mon Sep 17 00:00:00 2001 From: Pingger Shikkoken <felix.homa@udo.edu> Date: Sun, 31 Oct 2021 20:59:35 +0100 Subject: [PATCH] Added autoreload using `?autoreload=1` --- AKPlan/templates/AKPlan/plan_wall.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/AKPlan/templates/AKPlan/plan_wall.html b/AKPlan/templates/AKPlan/plan_wall.html index 2ff5eeaf..0034af43 100644 --- a/AKPlan/templates/AKPlan/plan_wall.html +++ b/AKPlan/templates/AKPlan/plan_wall.html @@ -70,7 +70,25 @@ } }); </script> - + <script> + // function from: https://stackoverflow.com/questions/5448545/how-to-retrieve-get-parameters-from-javascript/ + function findGetParameter(parameterName) { + var result = null, + tmp = []; + location.search + .substr(1) + .split("&") + .forEach(function (item) { + tmp = item.split("="); + if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); + }); + return result; + } + if(findGetParameter("autoreload")==1) { + window.setTimeout ( function() { window.location.reload(true); }, 300000); + console.log("Autoreload active"); + } + </script> </head> <body> {% timezone event.timezone %} -- GitLab