Permalink
Browse files

Fix refresh on kiosk

  • Loading branch information...
dustball committed Mar 2, 2011
1 parent fedcc69 commit 434c4ca441638b8c82c7c4764c74bf34156c9dfc
Showing with 14 additions and 2 deletions.
  1. +3 −1 main.html
  2. +9 −1 static/main.js
  3. +2 −0 static/style.css
View
@@ -9,14 +9,16 @@
</head>
<body id="body">
+ <div id="reloadcount">&nbsp;</div>
+
<div id="top">
<table width="100%"><tr>
<td>
<img class="jiggle" src="/static/logo345.png" width="345" height="122" alt="Hacker Dojo" />
</td>
<td>
<h1 class="jiggle">Welcome to Hacker Dojo</h1>
- <h3 class="jiggle">Please sign in at the main desk :)</h3>
+ <h3 id="motd" class="jiggle">Please sign in at the main desk :)</h3>
</td>
</tr></table>
</div>
View
@@ -14,15 +14,23 @@ function refreshPage() {
$.ajax({
url: '/',
success: function(data) {
+ var tmp = window.i;
if (window.oldint) {
clearTimeout(window.oldint);
}
$('#body').html(data);
+ if (window.oldint) {
+ clearTimeout(window.oldint);
+ }
+ window.i = tmp + 1;
+ $('#reloadcount').html(" "+window.i);
+ window.oldint = setInterval(refreshPage, 2 * 60 * 1000);
}
});
}
$(document).ready(function(){
- window.oldint = setInterval(refreshPage,3 * 60 * 1000);
+ window.i = 0;
+ window.oldint = setInterval(refreshPage,2 * 60 * 1000);
letsDance();
});
View
@@ -27,3 +27,5 @@ h1,h2,h3 {margin-top:0;margin-bottom:.5em}
.openline, .closeline {padding-top:.7em; font-size:12px; width:100%; text-align:center}
.openline {color:green;}
.closeline {color:red;}
+
+#reloadcount {position:absolute; top:3px; right:3px; color:#ddd}

0 comments on commit 434c4ca

Please sign in to comment.