/[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 2 by dpavlin, Tue Sep 7 08:37:14 2004 UTC revision 5 by dpavlin, Tue Sep 7 09:16:24 2004 UTC
# Line 3  Line 3 
3     Dobrica Pavlinusic, dpavlin@rot13.org 2004-09-06     Dobrica Pavlinusic, dpavlin@rot13.org 2004-09-06
4  */  */
5    
6  var debug = 1;  var debug = 0;
7    
8  function bfilter_init() {  function bfilter_init() {
9          show_status();          show_status();
# Line 129  function bfilter(document, id, find, arr Line 129  function bfilter(document, id, find, arr
129          if (find.length == min_len) {          if (find.length == min_len) {
130                  var html = '';                  var html = '';
131                  for (var i = 0; i < arr[part].length; i++) {                  for (var i = 0; i < arr[part].length; i++) {
132                          html += "<li>"+i+": "+arr[part][i]+"</li>\n";                          html += "<li>";
133                            if (debug) { $html += i+": "; }
134                            html += arr[part][i]+"</li>\n";
135                          hits++;                          hits++;
136                  }                  }
137                  results(html);                  results(html);
# Line 140  function bfilter(document, id, find, arr Line 142  function bfilter(document, id, find, arr
142                  if (from != null) {                  if (from != null) {
143                                    
144                          if (debug) { results("loop "+from+" ... "+arr[part].length)+"<br>\n"; }                          if (debug) { results("loop "+from+" ... "+arr[part].length)+"<br>\n"; }
145    
146                            var html = '';
147    
148                          for(var i = from ; i < arr[part].length ; i++) {                          for(var i = from ; i < arr[part].length ; i++) {
149                                  if (arr[part][i].substring(0,find.length).toLowerCase() != find_lc) {                                  if (arr[part][i].substring(0,find.length).toLowerCase() != find_lc) {
150                                          break;                                          break;
151                                  }                                  }
152                                  results(i+": "+arr[part][i]+"<br>\n");                                  if (debug) { html += i+": "; }
153                                    html += arr[part][i]+"<br>\n";
154                                  hits++;                                  hits++;
155                          }                          }
156    
157                            results(html);
158                  } else {                  } else {
159                          // clean results list                          // clean results list
160  //                      results("",1);  //                      results("",1);

Legend:
Removed from v.2  
changed lines
  Added in v.5

  ViewVC Help
Powered by ViewVC 1.1.26