mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
changed style and clearTimeout
This commit is contained in:
parent
9e6c42f221
commit
e74c7b8219
3 changed files with 20 additions and 5 deletions
|
|
@ -78,7 +78,7 @@ if(!Chuck) var Chuck = {};
|
|||
html += "<a href='#" + channel.name + "'>";
|
||||
html += channel.name
|
||||
html += "</a></td><td>death match</td></tr>";
|
||||
};
|
||||
};
|
||||
} else {
|
||||
html += "<tr><td colspan='2'>No channels found.</td></tr>";
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ if(!Chuck) var Chuck = {};
|
|||
function startTimer(seconds) {
|
||||
var now = new Date();
|
||||
var end = new Date(now.getTime() + seconds * 1000);
|
||||
setInterval(function() {
|
||||
channelDestructionTimeout = setInterval(function() {
|
||||
now = new Date();
|
||||
var diff = new Date(end.getTime() - now.getTime());
|
||||
if(diff.getTime() < 0) {
|
||||
|
|
@ -263,6 +263,15 @@ if(!Chuck) var Chuck = {};
|
|||
$("#menu").style.display = "none";
|
||||
$("#game").style.display = "block";
|
||||
Chuck.run(channelName, nickname);
|
||||
|
||||
if(refreshInterval) {
|
||||
clearInterval(refreshInterval);
|
||||
}
|
||||
|
||||
if(channelDestructionTimeout) {
|
||||
clearInterval(channelDestructionTimeout);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -301,7 +310,8 @@ if(!Chuck) var Chuck = {};
|
|||
|
||||
$("#refresh").onclick = refresh;
|
||||
refresh();
|
||||
setInterval(refresh, 5000);
|
||||
var channelDestructionTimeout = null;
|
||||
var refreshInterval = setInterval(refresh, 5000);
|
||||
|
||||
Chuck.menu = {
|
||||
show: show
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue