3 // The countdown script.
5 // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0
6 // Copyright (C) 2017, 2024 Balthasar SzczepaĆski
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
24 window.onload = function () {
34 e_h = document.getElementById("ongh");
35 e_m = document.getElementById("ongm");
36 e_s = document.getElementById("ongs");
42 timer = document.getElementById("timer");
43 timer.onclick = function () {
47 if (e_h == null || e_m == null || e_s == null) {
48 // window.alert("NUL");
51 countdown = setInterval (function() {
52 if(isNaN(h) || isNaN(m) || isNaN(s)) {
53 // window.alert("NAN");
54 clearInterval(countdown);
79 if (h == 0 && m == 0 && s == 0) {
83 // window.alert("ONG");
84 clearInterval(countdown);
88 e_h.innerHTML = ((h < 10) ? "0" : "") + h;
89 e_m.innerHTML = ((m < 10) ? "0" : "") + m;
90 e_s.innerHTML = ((s < 10) ? "0" : "") + s;