Messing with the refresh timer to make things feel snappier.
authorSebastian Hammer <quinn@indexdata.com>
Wed, 18 Apr 2007 03:42:29 +0000 (03:42 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Wed, 18 Apr 2007 03:42:29 +0000 (03:42 +0000)
js/pz2.js
www/masterkey/index.html

index 5870bae..6fa568e 100644 (file)
--- a/js/pz2.js
+++ b/js/pz2.js
@@ -1,5 +1,5 @@
 /*
-** $Id: pz2.js,v 1.7 2007-04-15 03:24:18 quinn Exp $
+** $Id: pz2.js,v 1.8 2007-04-18 03:42:30 quinn Exp $
 ** pz2.js - pazpar2's javascript client library.
 */
 
@@ -75,6 +75,7 @@ var pz2 = function(paramArray) {
     __myself.termTimer = null;
     __myself.showTime = paramArray.showtime || 1000;
     __myself.showTimer = null;
+    __myself.showFastCount = 4;
     __myself.bytargetTime = paramArray.bytargettime || 1000;
     __myself.bytargetTimer = null;
 
@@ -278,8 +279,12 @@ pz2.prototype = {
                     }
                     __myself.showCallback(show);
                     __myself.showCounter++;
+                   var delay = __myself.showTime;
+                   if (__myself.showCounter > __myself.showFastCount)
+                           delay *= 2;
+                           alert(delay);
                     if (activeClients > 0)
-                        __myself.showTimer = setTimeout("__myself.show()", (__myself.showTime + __myself.showCounter*__myself.dumpFactor));
+                        __myself.showTimer = setTimeout("__myself.show()", delay);
                 }
                 else
                     // if it gets here the http return code was 200 (pz2 errors are 417)
index c7fcde9..92f9b06 100755 (executable)
@@ -4,7 +4,7 @@
     <title>MasterKey Power Search</title>
     <link rel="author" href="http://www.indexdata.dk" />
     <link href="css/styles.css" rel="stylesheet" type="text/css" media="screen, all" />
-    <script type="text/javascript" src="js/jquery.pack.js"></script>
+    <script type="text/javascript" src="js/jquery.js"></script>
     <script type="text/javascript" src="js/pz2.js"></script>
     <script type="text/javascript" src="js/pzQuery.js"></script>
     <script type="text/javascript" src="js/client.js"></script>