32 |
// self.document.getElementById('textfilter').select(); |
// self.document.getElementById('textfilter').select(); |
33 |
self.document.myfilter = new BFilter(headlines); |
self.document.myfilter = new BFilter(headlines); |
34 |
|
|
35 |
|
// define some regexps |
36 |
|
self.document.myfilter.star_regex = new RegExp(/ *\* */); |
37 |
|
self.document.myfilter.htmlent_regex = new RegExp(/(&[a-z][a-z]*;)/i); |
38 |
|
|
39 |
|
self.document.myfilter.text_ent = function (str) { |
40 |
|
if (str.match(this.htmlent_regex)) { |
41 |
|
var e = self.document.createElement("span"); |
42 |
|
e.innerHTML = str; |
43 |
|
return e; |
44 |
|
} else { |
45 |
|
return self.document.createTextNode(str); |
46 |
|
} |
47 |
|
} |
48 |
|
|
49 |
self.document.myfilter.result = function (arr) { |
self.document.myfilter.result = function (arr) { |
50 |
var r_div = element_id('results'); |
var r_div = element_id('results'); |
51 |
if (r_div) { |
if (r_div) { |
54 |
var pic = null; |
var pic = null; |
55 |
|
|
56 |
e.setAttribute("href","hijerarhija.html?o="+arr[1]+"#mfn"+arr[1]); |
e.setAttribute("href","hijerarhija.html?o="+arr[1]+"#mfn"+arr[1]); |
57 |
var regex = new RegExp(/ *\* */); |
if (arr[0].match(this.star_regex)) { |
58 |
if (arr[0].match(regex)) { |
e.appendChild(this.text_ent(arr[2].replace(this.star_regex,' '))); |
|
e.appendChild(self.document.createTextNode(arr[2].replace(regex,' '))); |
|
59 |
pic = self.document.createElement("img"); |
pic = self.document.createElement("img"); |
60 |
pic.src = 'img/crovoc.png'; |
pic.src = 'img/crovoc.png'; |
61 |
pic.border = 0; |
pic.border = 0; |
62 |
e.appendChild(pic); |
e.appendChild(pic); |
63 |
} else { |
} else { |
64 |
e.appendChild(self.document.createTextNode(arr[2])); |
e.appendChild(this.text_ent(arr[2])); |
65 |
} |
} |
66 |
li.appendChild(e); |
li.appendChild(e); |
67 |
|
|