display the total duration of the current play timer. will make it count later

This commit is contained in:
Andy Janata 2012-03-16 18:35:13 -07:00
parent a8e7273e13
commit c6659b3abb
2 changed files with 5 additions and 0 deletions

View File

@ -91,6 +91,7 @@ HttpSession hSession = request.getSession(true);
<input type="button" id="start_game" class="hide" value="Start Game" />
</div>
<div id="menubar_right">
Current timer duration: <span id="current_timer">0</span> seconds
<input type="button" id="logout" value="Log out" />
</div>
</div>

View File

@ -113,6 +113,10 @@ cah.longpoll.done = function(data_list) {
cah.log.error(cah.$.ErrorCode_msg[errorCode]);
}
} else {
// FIXME giant hack
if (data[cah.$.LongPollResponse.PLAY_TIMER]) {
$("#current_timer").text(data[cah.$.LongPollResponse.PLAY_TIMER] / 1000);
}
var event = data[cah.$.LongPollResponse.EVENT];
if (cah.longpoll.EventHandlers[event]) {
cah.longpoll.EventHandlers[event](data);