aboutsummaryrefslogtreecommitdiff
path: root/static/js/timer.js
diff options
context:
space:
mode:
authorFChannel <>2022-06-19 12:47:32 -0700
committerFChannel <>2022-06-19 16:03:29 -0700
commitb02f813e519dc890f2eb4827ff52cff3ff90c828 (patch)
treed020fbdefda52542aab3f4250bf93533e9f38504 /static/js/timer.js
parentcd99df8d6781c3f0a191d119ea0ddf8c4a16089f (diff)
v0.1.0
Diffstat (limited to 'static/js/timer.js')
-rw-r--r--static/js/timer.js38
1 files changed, 0 insertions, 38 deletions
diff --git a/static/js/timer.js b/static/js/timer.js
deleted file mode 100644
index d8be9de..0000000
--- a/static/js/timer.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var timerCount;
-var timerToggle = false;
-var timer;
-const contentLoadHandler = function(event){
- timerToggle = !!document.getElementById("autoreload-checkbox").checked;
- if(timerToggle){
- timerCount = 45;
- document.getElementById("autoreload-countdown").innerHTML = "45";
- document.getElementById("autoreload-countdown").style.visibility = "visible";
- timer = setInterval(timerFunction, 1000);
- document.removeEventListener("DOMContentLoaded", contentLoadHandler, false);
- }
-};
-
-document.addEventListener("DOMContentLoaded", contentLoadHandler, false);
-
-function timerFunction(){
- timerCount--;
- document.getElementById("autoreload-countdown").innerHTML = timerCount;
- if(timerCount <= 0){
- document.getElementById("autoreload-countdown").innerHTML = "Refreshing...";
- clearInterval(timer);
- location.reload();
- }
-}
-
-function autoTimer(){
- timerToggle = !timerToggle;
- if(timerToggle === true){
- timerCount = 45;
- document.getElementById("autoreload-countdown").innerHTML = "45";
- document.getElementById("autoreload-countdown").style.visibility = "visible";
- timer = setInterval(timerFunction, 1000);
- }else{
- clearInterval(timer);
- document.getElementById("autoreload-countdown").style.visibility = "hidden";
- }
-}