-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesk.html
34 lines (34 loc) · 1.48 KB
/
desk.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<head>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://api.trello.com/1/client.js?key=83fbbffdca68e9e5655f409d9b204618"></script>
<!-- python -m http.server -->
</head>
<body>
<div id="ceva"></div>
<script>
var sec = {"desk":0,"1":0, "2":0, "3":0, "4":0, "5":0, "6":0, "7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0 };
function pad ( val ) { return val > 9 ? val : "0" + val; }
masa = "desk";
var setMasa= function(masaxxx){
masa = masaxxx;
};
(function() {
text ="";
text=text + "<table><tr><td><div id='desk' onclick='setMasa(\"desk\")'>desk <span id='minutes'>00</span>:<span id='seconds'/>00</span></div></td></tr>";
for(i = 1; i <= 5; i++){
text=text + "<tr>";
text=text + "<td><div id='"+(i*2-1)+"'onclick='setMasa(\""+(i*2-1)+"\")'>"+(i*2-1)+" <span id='minutes'>00</span>:<span id='seconds'/>00</span></div></td>";
text=text + "<td><div id='"+(i*2)+"' onclick='setMasa(\""+(i*2)+"\")'>"+(i*2)+" <span id='minutes'>00</span>:<span id='seconds'/>00</span></div></td>";
text=text + "</tr>";
}
text = text + "</table>";
document.getElementById("ceva").innerHTML = text;
setInterval( function(){
document.getElementById(masa).childNodes[3].innerHTML=pad(++sec[masa]%60);
document.getElementById(masa).childNodes[1].innerHTML=pad(parseInt(sec[masa]/60,10));
}, 1000);
})();
</script>
</body>