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