4 // The countdown script.
6 // Copyright (C) 2017 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/>.
21 window.onload = function () {
30 ongh = document.getElementById("ongh");
31 ongm = document.getElementById("ongm");
32 ongs = document.getElementById("ongs");
34 if(ongh == null || ongm == null || ongs == null) {
35 // window.alert("NUL");
38 timer = setInterval (function() {
39 ongvh = +(ongh.innerHTML);
40 ongvm = +(ongm.innerHTML);
41 ongvs = +(ongs.innerHTML);
43 if(isNaN(ongvh) || isNaN(ongvm) || isNaN(ongvs)) {
44 // window.alert("NAN");
69 if(ongvh == 0 && ongvm == 0 && ongvs == 0) {
70 ongh.innerHTML = "00";
71 ongm.innerHTML = "00";
72 ongs.innerHTML = "NG";
73 // window.alert("ONG");
78 ongh.innerHTML = ((ongvh<10)?"0":"")+ongvh;
79 ongm.innerHTML = ((ongvm<10)?"0":"")+ongvm;
80 ongs.innerHTML = ((ongvs<10)?"0":"")+ongvs;