Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from NyckJohnson/master

Bandaid
  • Loading branch information...
commit 6aa81db26041bd0618c6d487f434c91451c394d5 2 parents 434c4ca + 7c84784
@dustball dustball authored
Showing with 23 additions and 23 deletions.
  1. +3 −3 main.html
  2. +19 −19 static/main.js
  3. +1 −1  static/style.css
View
6 main.html
@@ -9,8 +9,6 @@
</head>
<body id="body">
- <div id="reloadcount">&nbsp;</div>
-
<div id="top">
<table width="100%"><tr>
<td>
@@ -26,6 +24,7 @@ <h3 id="motd" class="jiggle">Please sign in at the main desk :)</h3>
<div id="left">
<div class="jiggle" style="height:100%">
<h2 class="sectionhead">Currently Staffing</h2>
+ <div class="reloadcount" id="staffReloadCount">&nbsp;0</div>
<iframe style="border:none" id="staff" border="0" height="80%" width="100%" src="http://hackerdojo-signin.appspot.com/staff"></iframe>
</div>
</div>
@@ -33,7 +32,8 @@ <h2 class="sectionhead">Currently Staffing</h2>
<div id="right">
<div class="jiggle" style="height:100%">
<h2 class="sectionhead">Schedule</h2>
- <iframe src="http://events.hackerdojo.com/?base=mini" style="border-width:0;" width="100%" height="90%" frameborder="0" scrolling="no"></iframe>
+ <div class="reloadcount" id="eventsReloadCount">&nbsp;0</div>
+ <iframe id="events" src="http://events.hackerdojo.com/?base=mini" style="border-width:0;" width="100%" height="90%" frameborder="0" scrolling="no"></iframe>
</div>
</div>
View
38 static/main.js
@@ -1,3 +1,5 @@
+var minutes = 60000; /*number of milliseconds in a minute*/
+
function letsDance() {
$(".jiggle").each(function(i) {
this.style.position = "relative";
@@ -10,27 +12,25 @@ function jiggly() {
return 10-Math.floor(Math.round(Math.random() * 20));
}
-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);
- }
- });
+function refreshStaff() {
+ $('#staff').attr('src', 'http://hackerdojo-signin.appspot.com/staff');
+ window.StaffCount++;
+ $('#staffReloadCount').html(" "+window.StaffCount);
+ window.oldStaffInt = setTimeout(refreshStaff, 2 * minutes);
+ letsDance();
+}
+
+function refreshEvents() {
+ $('#events').attr('src', 'http://events.hackerdojo.com/?base=mini');
+ window.EventsCount++;
+ $('#eventsReloadCount').html(" "+window.EventsCount);
+ window.oldEventsInt = setTimeout(refreshEvents, 6 * 60 * minutes);
}
$(document).ready(function(){
- window.i = 0;
- window.oldint = setInterval(refreshPage,2 * 60 * 1000);
+ window.EventsCount = 0;
+ window.StaffCount = 0;
+ window.oldStaffInt = setTimeout(refreshStaff,0.25 * minutes);
+ window.oldEventsInt = setTimeout(refreshEvents,6 * 60 * minutes);
letsDance();
});
View
2  static/style.css
@@ -28,4 +28,4 @@ h1,h2,h3 {margin-top:0;margin-bottom:.5em}
.openline {color:green;}
.closeline {color:red;}
-#reloadcount {position:absolute; top:3px; right:3px; color:#ddd}
+.reloadcount {position:absolute; top:3px; right:3px; color:#ddd}
Please sign in to comment.
Something went wrong with that request. Please try again.