--- trunk2/eurovoc/abecedno.html 2004/10/18 18:43:57 519 +++ trunk2/eurovoc/abecedno.html 2004/10/19 18:15:53 531 @@ -18,23 +18,39 @@ self.document.myfilter = new BFilter(headlines); self.document.myfilter.result = function (arr) { - var r = element_id('results'); - if (r) { + var r_div = element_id('results'); + if (r_div) { + var li = self.document.createElement("li"); var e = self.document.createElement("a"); e.setAttribute("href","hijerarhija.html?o="+arr[1]+"#mfn"+arr[1]); - e.appendChild(self.document.createTextNode(arr[0])); - r.appendChild(e); + var regex = new RegExp(/ *\* */); + if (arr[0].match(regex)) { + e.appendChild(self.document.createTextNode(arr[0].replace(regex,' '))); + var pic = self.document.createElement("img"); + pic.src = 'img/crovoc.png'; + pic.border = 0; + e.appendChild(pic); + } else { + e.appendChild(self.document.createTextNode(arr[0])); + } + li.appendChild(e); - r.appendChild(self.document.createTextNode(" ")); + li.appendChild(self.document.createTextNode(" ")); e = self.document.createElement("a"); e.setAttribute("href","thes/"+arr[1]+".html"); e.setAttribute("target","popup"); e.onclick = function() { return popup(e) }; - e.appendChild(self.document.createTextNode("\u00bb")); - r.appendChild(e); + var pic = self.document.createElement("img"); + pic.src = 'img/listic.png'; + pic.border = 0; + e.appendChild(pic); + li.appendChild(e); - r.appendChild(self.document.createElement("br")); + li.appendChild(self.document.createElement("br")); + + // append li + r_div.appendChild(li); } else { alert("can't find results div!"); @@ -52,6 +68,24 @@ return null; // return ''; } + + self.document.myfilter.show_status = function (status) { + var html; + if (this.hits > 0) { + html = "Pronađeno "+this.hits+" zapisa"; + } else { + html = "Nije pronađen niti jedan zapis"; + } + if (! status) { + html = "Unesite "+this.min_len+" znaka za pretraživanje."; + status = ""; + } else { + status = " za "+status+"."; + } + + var el = this.element_id("status"); + el.innerHTML = html+status+"\n"; + } } var lang2thes = { @@ -74,20 +108,25 @@ set_cookie('w2_lang', lang); element_id('lang').disabled = true; element_id('textfilter').disabled = true; - element_id('status').innerHTML = "Učitavanje podataka za jezik. Molimo, pričekate"; + element_id('status').innerHTML = "Učitavanje podataka za jezik. Molimo, pričekate..."; self.document.myfilter = null; load_js(lang2thes[lang], 'headlines', 'load_lang_finished();' ); } +function do_filter(filter) { + element_id('status').innerHTML = "Pretraživanje u tijeku..."; + if (self.document.myfilter) self.document.myfilter.filter(filter); +} + function load_lang_finished() { //alert("loaded "+lang); myfilter(); self.document.myfilter.arr=headlines; element_id('lang').disabled = false; element_id('textfilter').disabled = false; - if (self.document.myfilter) self.document.myfilter.filter(element_id('textfilter').value); + do_filter(element_id('textfilter').value); return false; } @@ -278,7 +317,7 @@ // --> - + @@ -290,8 +329,8 @@ --> -
-
+