# HG changeset patch # User tzara # Date 1341996665 -3600 # Node ID bb02a593b7d5ba88be6e49e75c0325f7a899c17c # Parent aaf429469697c565114efb27cf64d84d3458f1eb server side push of datetime to client diff -r aaf429469697 -r bb02a593b7d5 nodescore.js --- a/nodescore.js Tue Jul 10 22:34:11 2012 +0100 +++ b/nodescore.js Wed Jul 11 09:51:05 2012 +0100 @@ -72,6 +72,20 @@ socket.emit('chronFromServer', chron) } + var ding + function dateTime() { + + ding = setInterval( function () { + var datetime= new Date(); + var now=datetime.toString() +// console.log(now); + socket.broadcast.emit("dateTime", now); + socket.emit("dateTime", now);}, 1000)} + + clearInterval(ding); + dateTime() + + function chronometer() { if (chronstate==1){ diff -r aaf429469697 -r bb02a593b7d5 www/m/5.html --- a/www/m/5.html Tue Jul 10 22:34:11 2012 +0100 +++ b/www/m/5.html Wed Jul 11 09:51:05 2012 +0100 @@ -24,6 +24,7 @@
+
diff -r aaf429469697 -r bb02a593b7d5 www/m/controls.html --- a/www/m/controls.html Tue Jul 10 22:34:11 2012 +0100 +++ b/www/m/controls.html Wed Jul 11 09:51:05 2012 +0100 @@ -71,6 +71,8 @@

0ms

+
+ diff -r aaf429469697 -r bb02a593b7d5 www/m/css/nodescore.css --- a/www/m/css/nodescore.css Tue Jul 10 22:34:11 2012 +0100 +++ b/www/m/css/nodescore.css Wed Jul 11 09:51:05 2012 +0100 @@ -91,6 +91,20 @@ background-color: blue; } +#datetime{ + opacity: 0.6; + height: 30px; + width: 700px; + font-size:2em; + color: white; + border: 1px solid white; + position: absolute; + float: left; + bottom: 1px; + padding: 5px 5px 5px 5px ; + background-color: blue; +} + .metrocase { position: absolute; top: 10px; @@ -104,7 +118,7 @@ height: 60px; z-index: 2; padding: 5px 5px 5px 5px; - border: 1px solid gray; + border: 1px solid blue; } #metronome0 { width: 60px; height: 60px; border-radius: 30px; float:left; } @@ -121,7 +135,7 @@ } #client_chronometer{ - border: 2px solid gray ; + border: 1px solid blue ; background-color: black; color: #666; font-size: 6em; @@ -148,9 +162,6 @@ height: 800px; } - - - #content-txt { // padding: 2px 2px 2px 2px; font-size: 3em; diff -r aaf429469697 -r bb02a593b7d5 www/m/js/nodescore-client.js --- a/www/m/js/nodescore-client.js Tue Jul 10 22:34:11 2012 +0100 +++ b/www/m/js/nodescore-client.js Wed Jul 11 09:51:05 2012 +0100 @@ -39,6 +39,15 @@ }); +// server time + +//var groupPage=document.getElementById('group').value +//if (groupID == groupPage) { + socket.on("dateTime", function(datetime) { +// console.log(datetime) + $("div#datetime").text("server time: " +datetime); + + }); ///////////////////////////////////////////////// diff -r aaf429469697 -r bb02a593b7d5 www/m/seta/img/thumbs/1.png Binary file www/m/seta/img/thumbs/1.png has changed diff -r aaf429469697 -r bb02a593b7d5 www/m/seta/img/thumbs/2.png Binary file www/m/seta/img/thumbs/2.png has changed diff -r aaf429469697 -r bb02a593b7d5 www/m/seta/img/thumbs/3.png Binary file www/m/seta/img/thumbs/3.png has changed diff -r aaf429469697 -r bb02a593b7d5 www/m/seta/img/thumbs/4.png Binary file www/m/seta/img/thumbs/4.png has changed diff -r aaf429469697 -r bb02a593b7d5 www/m/seta/img/thumbs/5.png Binary file www/m/seta/img/thumbs/5.png has changed diff -r aaf429469697 -r bb02a593b7d5 www/m/seta/img/thumbs/6.png Binary file www/m/seta/img/thumbs/6.png has changed