8 |
<script type="text/javascript" src="js/bfilter.js"></script> |
<script type="text/javascript" src="js/bfilter.js"></script> |
9 |
<script type="text/javascript" src="js/popup.js"></script> |
<script type="text/javascript" src="js/popup.js"></script> |
10 |
<script type="text/javascript" src="js/load_js.js"></script> |
<script type="text/javascript" src="js/load_js.js"></script> |
11 |
<script type="text/javascript" src="DescriptorHR.js"></script> |
<script type="text/javascript" src="js/cookies.js"></script> |
12 |
<script type="text/javascript"> |
<script type="text/javascript"> |
13 |
|
// <!-- |
14 |
function myfilter() { |
function myfilter() { |
15 |
// self.document.getElementById('textfilter').focus(); |
// self.document.getElementById('textfilter').focus(); |
16 |
// self.document.getElementById('textfilter').caretPos=1; |
// self.document.getElementById('textfilter').caretPos=1; |
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 |
|
li.appendChild(self.document.createElement("br")); |
51 |
|
|
52 |
r.appendChild(self.document.createElement("br")); |
// append li |
53 |
|
r_div.appendChild(li); |
54 |
|
|
55 |
} else { |
} else { |
56 |
alert("can't find results div!"); |
alert("can't find results div!"); |
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+" znakova 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 = { |
92 |
|
'hr' : 'DescriptorHR.js', |
93 |
|
'en' : 'DescriptorEN.js', |
94 |
|
'fr' : 'DescriptorFR.js', |
95 |
|
'ge' : 'DescriptorGE.js' |
96 |
|
}; |
97 |
|
|
98 |
|
var lang = get_cookie('w2_lang'); |
99 |
|
if (! lang) lang = 'hr'; |
100 |
|
|
101 |
|
var headlines = null; |
102 |
|
self.document.myfilter = null; |
103 |
|
|
104 |
|
function load_lang(lang) { |
105 |
|
// reset results |
106 |
|
if (self.document.myfilter) element_id('results').innerHTML = ""; |
107 |
|
|
108 |
|
set_cookie('w2_lang', lang); |
109 |
|
element_id('lang').disabled = true; |
110 |
|
element_id('textfilter').disabled = true; |
111 |
|
element_id('status').innerHTML = "Učitavanje podataka za jezik. Molimo, pričekate"; |
112 |
|
|
113 |
|
self.document.myfilter = null; |
114 |
|
|
115 |
|
load_js(lang2thes[lang], 'headlines', 'load_lang_finished();' ); |
116 |
|
} |
117 |
|
|
118 |
|
function load_lang_finished() { |
119 |
|
//alert("loaded "+lang); |
120 |
|
myfilter(); |
121 |
|
self.document.myfilter.arr=headlines; |
122 |
|
element_id('lang').disabled = false; |
123 |
|
element_id('textfilter').disabled = false; |
124 |
|
if (self.document.myfilter) self.document.myfilter.filter(element_id('textfilter').value); |
125 |
|
return false; |
126 |
} |
} |
127 |
|
|
128 |
|
function select_option(value,text,selected) { |
129 |
|
document.write('<option value="'+value+'"'); |
130 |
|
if (value == selected) document.write(' selected'); |
131 |
|
document.write('>'+text+'</option>'); |
132 |
|
} |
133 |
|
// --> |
134 |
</script> |
</script> |
135 |
<script type="text/javascript" src="js/hide.js"></script> |
<script type="text/javascript" src="js/hide.js"></script> |
|
|
|
136 |
</head> |
</head> |
137 |
|
|
138 |
<body onload="myfilter(); "> |
<body onload="load_lang(lang);"> |
139 |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
140 |
<tr> |
<tr> |
141 |
<td colspan="3" class="hdr" height="10"> |
<td colspan="3" class="hdr" height="10"> |
294 |
|
|
295 |
|
|
296 |
<div style="float: right; width: 10em; text-align: center; margin: 0.5m"> |
<div style="float: right; width: 10em; text-align: center; margin: 0.5m"> |
297 |
<a href="#" onClick="toggle_display('debug');">debug</a> |
<a href="#" onclick="toggle_display('debug');">debug</a> |
298 |
|
<div style="text-align: left; border: 1px dashed #c0c0c0; display: none;" id="debug"> |
299 |
<div style="text-align: left; border: 1px dashed #c0c0c0; display: none;" id="debug"> |
</div> |
300 |
</div> |
</div> |
301 |
|
|
302 |
</div> |
<form method="get" onsubmit="return false;" action="?"> |
|
|
|
|
|
|
|
<form method="get" onSubmit="return false;"> |
|
303 |
<div class="filters"> |
<div class="filters"> |
304 |
<select name="headlines_name" onChange="load_js(this.options[this.selectedIndex].value); self.document.myfilter.arr=headlines;"> |
<script type="text/javascript"> |
305 |
<option value="DescriptorHR.js">Hrvatski</option> |
// <!-- |
306 |
<option value="DescriptorEN.js">Engleski</option> |
document.write('<select id="lang" name="lang" onchange="load_lang(this.options[this.selectedIndex].value);">'); |
307 |
<option value="DescriptorFR.js">Francuski</option> |
select_option("hr","Hrvatski",lang); |
308 |
<option value="DescriptorGE.js">Njemački</option> |
select_option("en","Engleski",lang); |
309 |
</select> |
select_option("fr","Francuski",lang); |
310 |
<input autocomplete="off" class="filters" id="textfilter" title="enter a regular expression to filter by" onKeyUp="self.document.myfilter.filter(this.value);"> |
select_option("ge","Njemački",lang); |
311 |
|
document.write('</select>'); |
312 |
|
// --> |
313 |
|
</script> |
314 |
|
|
315 |
|
<input autocomplete="off" class="filters" id="textfilter" title="enter a regular expression to filter by" onkeyup="self.document.myfilter.filter(this.value);" /> |
316 |
<!-- this button is strictly for looks --> |
<!-- this button is strictly for looks --> |
317 |
<input class="filters" value="filter" type="button"> |
<input class="filters" value="filter" type="button" disabled="true"/> |
318 |
</div> |
</div> |
319 |
</form> |
</form> |
320 |
|
|
324 |
--> |
--> |
325 |
</div> |
</div> |
326 |
|
|
327 |
<div id="results"> |
<ul id="results"> |
328 |
</div> |
</ul> |
329 |
|
|
330 |
</td> |
</td> |
331 |
</tr> |
</tr> |
332 |
</table> |
</table> |
333 |
|
|
334 |
</body> |
</body> |
|
|
|
|
|
|
|
|
|
335 |
</html> |
</html> |
|
|
|
|
|
|