/[bfilter]/trunk/bfilter.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bfilter.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by dpavlin, Fri Sep 10 12:42:58 2004 UTC revision 12 by dpavlin, Sat Sep 11 08:21:57 2004 UTC
# Line 96  BFilter.prototype.debug = function (html Line 96  BFilter.prototype.debug = function (html
96          var debug_div = this.element_id("debug",1);          var debug_div = this.element_id("debug",1);
97          if (! debug_div) { return; }          if (! debug_div) { return; }
98    
99          if (debug_div.innerHTML) {          debug_div.innerHTML += html + "<br>\n";
                 debug_div.innerHTML =+ html + "x<br>\n";  
         } else {  
                 debug_div.innerHTML = html + "y<br>\n";  
         }  
100  }  }
101    
102    
# Line 118  BFilter.prototype.binarySearch = functio Line 114  BFilter.prototype.binarySearch = functio
114                  var aTry = (mid < 1) ? 0 : parseInt(mid);                  var aTry = (mid < 1) ? 0 : parseInt(mid);
115                    
116                  var curr = arr[aTry][1].substr(0,find.length).toLowerCase();                  var curr = arr[aTry][1].substr(0,find.length).toLowerCase();
117                  this.debug("low="+low+" high="+high+" lastTry="+lastTry+" "+aTry+": "+curr+"<br>");                  this.debug("low="+low+" high="+high+" lastTry="+lastTry+" "+aTry+": "+curr);
118                  if (curr < find) {                  if (curr < find) {
119                          low = aTry + 1;                          low = aTry + 1;
120                          continue;                          continue;
# Line 134  BFilter.prototype.binarySearch = functio Line 130  BFilter.prototype.binarySearch = functio
130                  }                  }
131                  return aTry;                  return aTry;
132          }          }
133          this.debug("lastTry="+lastTry+"<br>");          this.debug("lastTry="+lastTry);
134    
135          if (typeof (lastTry) != "undefined") {          if (typeof (lastTry) != "undefined") {
136                  return lastTry;                  return lastTry;
# Line 153  BFilter.prototype.filter = function (doc Line 149  BFilter.prototype.filter = function (doc
149                  return;                  return;
150          }          }
151    
152          this.debug("filter: '"+find+"'<br>");          this.debug("filter: '"+find+"'");
153    
154          var find_lc = find.toLowerCase();          var find_lc = find.toLowerCase();
155    
# Line 190  BFilter.prototype.filter = function (doc Line 186  BFilter.prototype.filter = function (doc
186    
187                  if (from != null) {                  if (from != null) {
188                                    
189                          this.debug("loop "+from+" ... "+this.arr[part].length)+"<br>\n";                          this.debug("loop "+from+" ... "+this.arr[part].length);
190    
191                          var html = '';                          var html = '';
192    

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26