From: Sebastian Hammer Date: Wed, 18 Apr 2007 03:42:29 +0000 (+0000) Subject: Messing with the refresh timer to make things feel snappier. X-Git-Tag: PAZPAR2.1.0.0~273 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=8d6c6bb0ee0afc8721dba2f6596d4dba9c39cd3f;p=pazpar2-moved-to-github.git Messing with the refresh timer to make things feel snappier. --- diff --git a/js/pz2.js b/js/pz2.js index 5870bae..6fa568e 100644 --- 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) diff --git a/www/masterkey/index.html b/www/masterkey/index.html index c7fcde9..92f9b06 100755 --- a/www/masterkey/index.html +++ b/www/masterkey/index.html @@ -4,7 +4,7 @@ MasterKey Power Search - +