diff show.php @ 139:75cf14ee99a7

More work on party information system.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Oct 2013 23:58:41 +0300
parents aeebfedb5709
children d2e9285b69ad
line wrap: on
line diff
--- a/show.php	Tue Oct 22 22:05:00 2013 +0300
+++ b/show.php	Tue Oct 22 23:58:41 2013 +0300
@@ -11,14 +11,7 @@
 
 stSetupCacheControl();
 
-// Initiate SQL database connection
-if (!stConnectSQLDB())
-  die("Could not connect to SQL database.");
-
-// Fetch non-"hardcoded" settings from SQL database
-stReloadSettings();
-
-cmPrintPageHeader("PARTY DISPLAY", "", FALSE);
+cmPrintPageHeader("PARTY INFORMATION DISPLAY SYSTEM", "", FALSE);
 stCommonAJAX("showajax.php", "show.php", TRUE);
 ?>
 
@@ -35,18 +28,8 @@
   </div>
 </noscript>
 
-<div class="showView" id="mainView0">
-  <div class="showHeader">
-    <img src="img/fapsm.png" />
-  </div>
-  <div class="showText">
-    <h1>Next up</h1>
-    <h2>4k intro competition</h2>
-  </div>
-</div>
-
-<div class="showView" id="mainView1">
-</div>
+<div class="showView" id="mainView0"></div>
+<div class="showView" id="mainView1"></div>
 
 <!-- ========================== -->
 
@@ -92,7 +75,7 @@
     updateView(txt);
   }
 
-  sendPOSTRequest("mode=get", msuccess, displayError);
+  sendPOSTRequest("action=get", msuccess, displayError);
 }
 
 
@@ -105,15 +88,28 @@
   {
     failCount = 0;
     if (txt == "changed")
+    {
       viewChanged();
+      setTimeout("tickMain();", 500);
+    }
+    else
+    {
+      setTimeout("tickMain();", 2000);
+    }
+  }
+  
+  var mfail = function(txt)
+  {
+    displayError();
+    setTimeout("tickMain();", 5000);
   }
 
-  sendPOSTRequest("mode=check", msuccess, displayError);
+  sendPOSTRequest("action=check", msuccess, mfail);
 }
 
 
-setTimeout("tickMain();", 500);
-setTimeout("tickAnim();", 20);
+setTimeout("tickMain();", 1000);
+setInterval("tickAnim();", 25);
 
 </script>
 <?