Permalink
Browse files

Slowed down events refresh

  • Loading branch information...
1 parent 434c4ca commit faafd2588341071b30061f614373fe7d1eff7fbb @NyckJohnson NyckJohnson committed Nov 7, 2011
Showing with 19 additions and 18 deletions.
  1. +1 −3 main.html
  2. +18 −15 static/main.js
View
@@ -9,8 +9,6 @@
</head>
<body id="body">
- <div id="reloadcount">&nbsp;</div>
-
<div id="top">
<table width="100%"><tr>
<td>
@@ -33,7 +31,7 @@ <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>
+ <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
@@ -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,28 @@ function jiggly() {
return 10-Math.floor(Math.round(Math.random() * 20));
}
-function refreshPage() {
+function refreshStaff() {
+ $.ajax({
+ url: 'http://hackerdojo-signin.appspot.com/staff',
+ success: function(data) {
+ $('#staff').src(data);
+ window.oldStaffInt = setInterval(refreshPage, 2 * minutes);
+ }
+ });
+}
+
+function refreshEvent() {
$.ajax({
- url: '/',
+ url: 'http://events.hackerdojo.com/?base=mini',
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);
+ $('#events').src(data);
+ window.oldEventsInt = setInterval(refreshPage, 6 * 60 * minutes);
}
});
}
$(document).ready(function(){
- window.i = 0;
- window.oldint = setInterval(refreshPage,2 * 60 * 1000);
+ window.oldStaffInt = setInterval(refreshPage,2 * minutes);
+ window.oldEventsInt = setInterval(refreshPage,6 * 60 * minutes);
letsDance();
});

0 comments on commit faafd25

Please sign in to comment.