annotate www/oi/js/countin.js @ 101:52e44ee1c791
tip master
enabled all scores in autostart script
author |
Rob Canning <rc@kiben.net> |
date |
Tue, 21 Apr 2015 16:20:57 +0100 |
parents |
d802954248a7 |
children |
|
rev |
line source |
rob@100
|
1 /////////////////////////////////////////////////
|
rob@100
|
2 // countdown to change
|
rob@100
|
3 var socket = io.connect();
|
rob@100
|
4
|
rob@100
|
5 socket.on("countinFromServer", countinClient);
|
rob@100
|
6 function countinClient(groupID, currentseconds,mm,text,colour,background){
|
rob@100
|
7 var groupPage=document.getElementById('group').value
|
rob@100
|
8 if (groupID == groupPage) {
|
rob@100
|
9 console.log(currentseconds);
|
rob@100
|
10 document.getElementById("countinnumber").style.visibility="visible";
|
rob@100
|
11 document.getElementById("countinnumber").style.visibility="visible";
|
rob@100
|
12 //$("#countin").text(text);
|
rob@100
|
13 $("#countinnumber").text(currentseconds);
|
rob@100
|
14 $("#countinnumber").css('background-color', background);
|
rob@100
|
15
|
rob@100
|
16 document.getElementById("countinnumber").style.color=colour;
|
rob@100
|
17
|
rob@100
|
18 if ( currentseconds == 0) {
|
rob@100
|
19 document.getElementById("countinnumber").style.visibility='hidden';
|
rob@100
|
20 // document.getElementById("countin").style.visibility='hidden';
|
rob@100
|
21 }
|
rob@100
|
22 }}
|
rob@100
|
23
|
rob@100
|
24 ///////////////////////////////////////////////// |