Mercurial > hg > nodescore
comparison www/m/js/nodescore-client.js @ 20:9daa1ac0af33
seperated content to external html (seta) and fixed thumbnail generation and preview context
author | tzara <rc-web@kiben.net> |
---|---|
date | Tue, 10 Jul 2012 14:16:12 +0100 |
parents | a56434dee146 |
children | aaf429469697 |
comparison
equal
deleted
inserted
replaced
19:a56434dee146 | 20:9daa1ac0af33 |
---|---|
36 // update the stopwatch value on the client page in line with server | 36 // update the stopwatch value on the client page in line with server |
37 socket.on("chronFromServer", function(chron) { | 37 socket.on("chronFromServer", function(chron) { |
38 $("div#client_chronometer").text(chron); | 38 $("div#client_chronometer").text(chron); |
39 }); | 39 }); |
40 | 40 |
41 | |
42 | |
43 | |
44 ///////////////////////////////////////////////// | |
45 // countdown to change | |
46 | |
47 socket.on("countinFromServer", countinClient); | |
48 function countinClient(groupID, currentseconds,mm,text,colour,background){ | |
49 var groupPage=document.getElementById('group').value | |
50 if (groupID == groupPage) { | |
51 console.log(currentseconds); | |
52 document.getElementById("countinnumber").style.visibility="visible"; | |
53 document.getElementById("countinnumber").style.visibility="visible"; | |
54 //$("#countin").text(text); | |
55 $("#countinnumber").text(currentseconds); | |
56 $("#countinnumber").css('background-color', background); | |
57 | |
58 document.getElementById("countinnumber").style.color=colour; | |
59 | |
60 if ( currentseconds == 0) { | |
61 document.getElementById("countinnumber").style.visibility='hidden'; | |
62 // document.getElementById("countin").style.visibility='hidden'; | |
63 } | |
64 }} | |
65 | |
41 ///////////////////////////////////////////////// | 66 ///////////////////////////////////////////////// |
42 | 67 |
43 function pageFlip(unit) { | 68 function pageFlip(unit) { |
44 console.log("flipping page:"+ unit); | 69 console.log("flipping page:"+ unit); |
45 $('#sections').trigger('goto', [parseFloat(unit)]); | 70 $('#sections').trigger('goto', [parseFloat(unit)]); |
65 //console.log("fromservercommand has been executed on client"); | 90 //console.log("fromservercommand has been executed on client"); |
66 if (group == groupPage) { | 91 if (group == groupPage) { |
67 var g= pad2(group); | 92 var g= pad2(group); |
68 var p= pad2(unit); | 93 var p= pad2(unit); |
69 // pageFlip(unit); | 94 // pageFlip(unit); |
70 pageTurnB(p) | 95 pageTurnB(unit) |
71 | 96 |
72 } | 97 } |
73 else { | 98 else { |
74 console.log("not for this group... ignoring... for group:" + group ); | 99 console.log("not for this group... ignoring... for group:" + group ); |
75 } | 100 } |
76 } | 101 } |
77 | 102 |
78 ///////////////////////////////////////////////// | |
79 | |
80 function pageTurnB(unit) { | 103 function pageTurnB(unit) { |
81 console.log("HOP TURN" + unit); | 104 var units=6 |
82 $("#live").html($("#unit"+unit).html()); | 105 |
83 | 106 var next=(((unit+1)%units)+units)%units |
107 console.log("HOP TURN" + unit+ "next:" + next); | |
108 // $("#live").html($("#unit"+unit).html()); | |
109 $("#live").load("seta.html #"+unit +" *"); | |
110 | |
111 $("#preview").html('<img src=' + "img/thumbs/"+next + ".png" + '>'); | |
84 } | 112 } |
85 | 113 |
86 //////////////////////////////////////////////// | 114 //////////////////////////////////////////////// |
87 // keyboard controls | 115 |
88 // SPACE to toggle visibilty of preview | 116 /* |
89 // etc | 117 |
90 // etc | 118 keyboard controls |
91 //////////////////////////////////////////////// | 119 +++++++++++++++++++++++++ |
120 | |
121 SPACE to toggle visibilty of preview | |
122 m to toggle visibilty of metronome | |
123 s to toggle visibilty of stopwatch | |
124 h to hide all above | |
125 | |
126 */ | |
127 | |
92 function toggle_visibility(id) { | 128 function toggle_visibility(id) { |
93 var e = document.getElementById(id); | 129 var e = document.getElementById(id); |
94 if(e.style.display == 'block') | 130 if(e.style.display == 'block') |
95 e.style.display = 'none'; | 131 e.style.display = 'none'; |
96 else | 132 else |