/[webpac]/trunk2/eurovoc/abecedno.html
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 /trunk2/eurovoc/abecedno.html

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

revision 518 by dpavlin, Mon Oct 18 18:00:57 2004 UTC revision 531 by dpavlin, Tue Oct 19 18:15:53 2004 UTC
# Line 18  function myfilter() { Line 18  function myfilter() {
18          self.document.myfilter = new BFilter(headlines);          self.document.myfilter = new BFilter(headlines);
19    
20          self.document.myfilter.result = function (arr) {          self.document.myfilter.result = function (arr) {
21                  var r = element_id('results');                  var r_div = element_id('results');
22                  if (r) {                  if (r_div) {
23                            var li = self.document.createElement("li");
24                          var e = self.document.createElement("a");                          var e = self.document.createElement("a");
25                          e.setAttribute("href","hijerarhija.html?o="+arr[1]+"#mfn"+arr[1]);                          e.setAttribute("href","hijerarhija.html?o="+arr[1]+"#mfn"+arr[1]);
26                          e.appendChild(self.document.createTextNode(arr[0]));                          var regex = new RegExp(/ *\* */);
27                          r.appendChild(e);                          if (arr[0].match(regex)) {
28                                    e.appendChild(self.document.createTextNode(arr[0].replace(regex,' ')));
29                                    var pic = self.document.createElement("img");
30                                    pic.src = 'img/crovoc.png';
31                                    pic.border = 0;
32                                    e.appendChild(pic);
33                            } else {
34                                    e.appendChild(self.document.createTextNode(arr[0]));
35                            }
36                            li.appendChild(e);
37    
38                          r.appendChild(self.document.createTextNode(" "));                          li.appendChild(self.document.createTextNode(" "));
39    
40                          e = self.document.createElement("a");                          e = self.document.createElement("a");
41                          e.setAttribute("href","thes/"+arr[1]+".html");                          e.setAttribute("href","thes/"+arr[1]+".html");
42                          e.setAttribute("target","popup");                          e.setAttribute("target","popup");
43                          e.onclick = function() { return popup(e) };                          e.onclick = function() { return popup(e) };
44                          e.appendChild(self.document.createTextNode("\u00bb"));                          var pic = self.document.createElement("img");
45                          r.appendChild(e);                          pic.src = 'img/listic.png';
46                            pic.border = 0;
47                            e.appendChild(pic);
48                            li.appendChild(e);
49    
50                          r.appendChild(self.document.createElement("br"));                          li.appendChild(self.document.createElement("br"));
51    
52                            // append li
53                            r_div.appendChild(li);
54    
55                  } else {                  } else {
56                          alert("can't find results div!");                          alert("can't find results div!");
# Line 52  function myfilter() { Line 68  function myfilter() {
68                  return null;                  return null;
69  //              return '<ul>'+html+'</ul>';  //              return '<ul>'+html+'</ul>';
70          }          }
71    
72            self.document.myfilter.show_status = function (status) {
73                    var html;
74                    if (this.hits > 0) {
75                            html = "Pronađeno "+this.hits+" zapisa";
76                    } else {
77                            html = "Nije pronađen niti jedan zapis";
78                    }
79                    if (! status) {
80                            html = "Unesite "+this.min_len+" znaka za pretraživanje.";
81                            status = "";
82                    } else {
83                            status = " za <em>"+status+"</em>.";
84                    }
85    
86                    var el = this.element_id("status");
87                    el.innerHTML = html+status+"\n";
88            }
89  }  }
90    
91  var lang2thes = {  var lang2thes = {
# Line 69  self.document.myfilter = null; Line 103  self.document.myfilter = null;
103    
104  function load_lang(lang) {  function load_lang(lang) {
105          // reset results          // reset results
106          if (self.document.myfilter) self.document.myfilter.filter('');          if (self.document.myfilter) element_id('results').innerHTML = "";
107    
108          set_cookie('w2_lang', lang);          set_cookie('w2_lang', lang);
109          element_id('lang').disabled = true;          element_id('lang').disabled = true;
110          element_id('textfilter').disabled = true;          element_id('textfilter').disabled = true;
111          element_id('status').innerHTML = "Učitavanje podataka za jezik. Molimo, pričekate";          element_id('status').innerHTML = "Učitavanje podataka za jezik. Molimo, pričekate...";
112    
113          self.document.myfilter = null;          self.document.myfilter = null;
114    
115          load_js(lang2thes[lang], 'headlines', 'load_lang_finished();' );          load_js(lang2thes[lang], 'headlines', 'load_lang_finished();' );
116  }  }
117    
118    function do_filter(filter) {
119            element_id('status').innerHTML = "Pretraživanje u tijeku...";
120            if (self.document.myfilter) self.document.myfilter.filter(filter);
121    }
122    
123  function load_lang_finished() {  function load_lang_finished() {
124          //alert("loaded "+lang);          //alert("loaded "+lang);
125          myfilter();          myfilter();
126          self.document.myfilter.arr=headlines;          self.document.myfilter.arr=headlines;
127          element_id('lang').disabled = false;          element_id('lang').disabled = false;
128          element_id('textfilter').disabled = false;          element_id('textfilter').disabled = false;
129          if (self.document.myfilter) self.document.myfilter.filter(element_id('textfilter').value);          do_filter(element_id('textfilter').value);
130          return false;          return false;
131  }  }
132    
# Line 278  function select_option(value,text,select Line 317  function select_option(value,text,select
317          // -->          // -->
318    </script>    </script>
319    
320          <input autocomplete="off" class="filters" id="textfilter" title="enter a regular expression to filter by" onkeyup="self.document.myfilter.filter(this.value);" />          <input autocomplete="off" class="filters" id="textfilter" title="enter a regular expression to filter by" onkeyup="do_filter(this.value);" />
321          <!-- this button is strictly for looks -->          <!-- this button is strictly for looks -->
322          <input class="filters" value="filter" type="button" disabled="true"/>          <input class="filters" value="filter" type="button" disabled="true"/>
323  </div>  </div>
# Line 290  Enter few letters to filter by them Line 329  Enter few letters to filter by them
329  -->  -->
330  </div>  </div>
331    
332  <div id="results">  <ul id="results">
333  </div>  </ul>
334    
335          </td>          </td>
336  </tr>  </tr>

Legend:
Removed from v.518  
changed lines
  Added in v.531

  ViewVC Help
Powered by ViewVC 1.1.26