Mercurial > hg > nodescore
annotate www/emma/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 | d8f494bdbb18 |
children |
rev | line source |
---|---|
rc-web@66 | 1 ///////////////////////////////////////////////// |
rc-web@66 | 2 // countdown to change |
rc-web@66 | 3 var socket = io.connect(); |
rc-web@66 | 4 |
rc-web@66 | 5 socket.on("countinFromServer", countinClient); |
rc-web@66 | 6 function countinClient(groupID, currentseconds,mm,text,colour,background){ |
rc-web@66 | 7 var groupPage=document.getElementById('group').value |
rc-web@66 | 8 if (groupID == groupPage) { |
rc-web@66 | 9 console.log(currentseconds); |
rc-web@66 | 10 document.getElementById("countinnumber").style.visibility="visible"; |
rc-web@66 | 11 document.getElementById("countinnumber").style.visibility="visible"; |
rc-web@66 | 12 //$("#countin").text(text); |
rc-web@66 | 13 $("#countinnumber").text(currentseconds); |
rc-web@66 | 14 $("#countinnumber").css('background-color', background); |
rc-web@66 | 15 |
rc-web@66 | 16 document.getElementById("countinnumber").style.color=colour; |
rc-web@66 | 17 |
rc-web@66 | 18 if ( currentseconds == 0) { |
rc-web@66 | 19 document.getElementById("countinnumber").style.visibility='hidden'; |
rc-web@66 | 20 // document.getElementById("countin").style.visibility='hidden'; |
rc-web@66 | 21 } |
rc-web@66 | 22 }} |
rc-web@66 | 23 |
rc-web@66 | 24 ///////////////////////////////////////////////// |