/[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 484 by dpavlin, Sun Sep 26 22:14:56 2004 UTC revision 546 by dpavlin, Tue Oct 26 18:59:38 2004 UTC
# Line 8  Line 8 
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" src="js/l2_unescape.js"></script>
13    <script type="text/javascript" src="js/unac.js"></script>
14  <script type="text/javascript">  <script type="text/javascript">
15    // <!--
16    
17    var lang2thes = {
18            'hr' : 'DescriptorHR.js',
19            'en' : 'DescriptorEN.js',
20            'fr' : 'DescriptorFR.js',
21            'ge' : 'DescriptorGE.js'
22    };
23    
24    var lang = get_cookie('w2_lang');
25    
26    var headlines = null;
27    self.document.myfilter = null;
28    
29  function myfilter() {  function myfilter() {
30  //      self.document.getElementById('textfilter').focus();  //      self.document.getElementById('textfilter').focus();
# Line 18  function myfilter() { Line 33  function myfilter() {
33          self.document.myfilter = new BFilter(headlines);          self.document.myfilter = new BFilter(headlines);
34    
35          self.document.myfilter.result = function (arr) {          self.document.myfilter.result = function (arr) {
36                  var r = element_id('results');                  var r_div = element_id('results');
37                  if (r) {                  if (r_div) {
38                            var li = self.document.createElement("li");
39                          var e = self.document.createElement("a");                          var e = self.document.createElement("a");
40                            var pic = null;
41                            
42                          e.setAttribute("href","hijerarhija.html?o="+arr[1]+"#mfn"+arr[1]);                          e.setAttribute("href","hijerarhija.html?o="+arr[1]+"#mfn"+arr[1]);
43                          e.appendChild(self.document.createTextNode(arr[0]));                          var regex = new RegExp(/ *\* */);
44                          r.appendChild(e);                          if (arr[0].match(regex)) {
45                                    e.appendChild(self.document.createTextNode(arr[2].replace(regex,' ')));
46                                    pic = self.document.createElement("img");
47                                    pic.src = 'img/crovoc.png';
48                                    pic.border = 0;
49                                    e.appendChild(pic);
50                            } else {
51                                    e.appendChild(self.document.createTextNode(arr[2]));
52                            }
53                            li.appendChild(e);
54    
55                          r.appendChild(self.document.createTextNode(" "));                          li.appendChild(self.document.createTextNode(" "));
56    
57                          e = self.document.createElement("a");                          e = self.document.createElement("a");
58                          e.setAttribute("href","thes/"+arr[1]+".html");                          e.setAttribute("href","thes/"+arr[1]+".html");
59                          e.setAttribute("target","popup");                          e.setAttribute("target","popup");
60                          e.onclick = function() { return popup(e) };                          e.onclick = function() { return popup(e) };
61                          e.appendChild(self.document.createTextNode("\u00bb"));                          pic = self.document.createElement("img");
62                          r.appendChild(e);                          pic.src = 'img/listic.png';
63                            pic.border = 0;
64                            e.appendChild(pic);
65                            li.appendChild(e);
66    
67                          r.appendChild(self.document.createElement("br"));                          li.appendChild(self.document.createElement("br"));
68    
69                            // append li
70                            r_div.appendChild(li);
71    
72                  } else {                  } else {
73                          alert("can't find results div!");                          alert("can't find results div!");
# Line 52  function myfilter() { Line 85  function myfilter() {
85                  return null;                  return null;
86  //              return '<ul>'+html+'</ul>';  //              return '<ul>'+html+'</ul>';
87          }          }
88    
89            self.document.myfilter.show_status = function (status) {
90                    var html;
91                    if (this.hits > 0) {
92                            html = "Pronađeno "+this.hits+" zapisa";
93                    } else {
94                            html = "Nije pronađen niti jedan zapis";
95                    }
96                    if (! status) {
97                            html = "Unesite "+this.min_len+" znaka za pretraživanje.";
98                            status = "";
99                    } else {
100                            status = " za <em>"+status+"</em>.";
101                    }
102    
103                    var el = this.element_id("status");
104                    el.innerHTML = html+status+"\n";
105            }
106    }
107    
108    function load_lang(lang) {
109            // reset results
110            if (self.document.myfilter) element_id('results').innerHTML = "";
111    
112            // default language or fallback from all to hr
113            if (! lang || lang == 'all') lang = 'hr';
114    
115            if (! lang2thes[lang]) {
116                    alert("Jezik "+lang+" nije podržan");
117            }
118    
119            set_cookie('w2_lang', lang);
120            element_id('lang').disabled = true;
121            element_id('textfilter').disabled = true;
122            element_id('status').innerHTML = "Učitavanje podataka za jezik. Molimo, pričekate...";
123    
124            self.document.myfilter = null;
125    
126            load_js(lang2thes[lang], 'headlines', 'load_lang_finished();' );
127    }
128    
129    function do_filter(filter) {
130            element_id('status').innerHTML = "Pretraživanje u tijeku...";
131            var f = l2_unescape(filter);
132            f = f.substr(0,2) + unac(f.substr(2,f.length-2));
133            if (self.document.myfilter) self.document.myfilter.filter(f);
134    }
135    
136    function load_lang_finished() {
137            //alert("loaded "+lang);
138            myfilter();
139            self.document.myfilter.arr=headlines;
140            element_id('lang').disabled = false;
141            element_id('textfilter').disabled = false;
142            do_filter(element_id('textfilter').value);
143            return false;
144  }  }
145    
146    function select_option(value,text,selected) {
147            document.write('<option value="'+value+'"');
148            if (value == selected) document.write(' selected');
149            document.write('>'+text+'</option>');
150    }
151    // -->
152  </script>  </script>
153  <script type="text/javascript" src="js/hide.js"></script>  <script type="text/javascript" src="js/hide.js"></script>
   
154  </head>  </head>
155    
156  <body onload="myfilter(); ">  <body onload="load_lang(lang);">
157  <table width="100%" border="0" cellspacing="0" cellpadding="0">  <table width="100%" border="0" cellspacing="0" cellpadding="0">
158    <tr>    <tr>
159          <td colspan="3" class="hdr" height="10">          <td colspan="3" class="hdr" height="10">
# Line 198  function myfilter() { Line 292  function myfilter() {
292            </tr>            </tr>
293            <tr>            <tr>
294                  <td colspan="3" class="menuItem">                  <td colspan="3" class="menuItem">
295                  Klik na znak &raquo; otvara novi prozor u kojem                  Klik na znak <img src="img/listic.png" border="0"> otvara novi prozor u kojem
296                  se pojavljuje detaljan prikaz traženog pojma.                  se pojavljuje detaljan prikaz traženog pojma.
297                  </td>                  </td>
298            </tr>            </tr>
# Line 218  function myfilter() { Line 312  function myfilter() {
312    
313    
314  <div style="float: right; width: 10em; text-align: center; margin: 0.5m">  <div style="float: right; width: 10em; text-align: center; margin: 0.5m">
315  <a href="#" onClick="toggle_display('debug');">debug</a>   <a href="#" onclick="toggle_display('debug');">debug</a>
316     <div style="text-align: left; border: 1px dashed #c0c0c0; display: none;" id="debug">
317  <div style="text-align: left; border: 1px dashed #c0c0c0; display: none;" id="debug">   </div>
 </div>  
   
318  </div>  </div>
319    
320    <form method="get" onsubmit="return false;" action="?">
 <form method="get" onSubmit="return false;">  
321  <div class="filters">  <div class="filters">
322          <select name="headlines_name" onChange="load_js(this.options[this.selectedIndex].value); self.document.myfilter.arr=headlines;">    <script type="text/javascript">
323          <option value="DescriptorHR.js">Hrvatski</option>          // <!--
324          <option value="DescriptorEN.js">Engleski</option>          document.write('<select id="lang" name="lang" onchange="load_lang(this.options[this.selectedIndex].value);">');
325          <option value="DescriptorFR.js">Francuski</option>          select_option("hr","Hrvatski",lang);
326          <option value="DescriptorGE.js">Njemački</option>          select_option("en","Engleski",lang);
327          </select>          select_option("fr","Francuski",lang);
328          <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);
329            document.write('</select>');
330            // -->
331      </script>
332    
333            <input autocomplete="off" class="filters" id="textfilter" title="enter a regular expression to filter by" onkeyup="do_filter(this.value);" />
334          <!-- this button is strictly for looks -->          <!-- this button is strictly for looks -->
335          <input class="filters" value="filter" type="button">          <input class="filters" value="filter" type="button" disabled="true"/>
336  </div>  </div>
337  </form>  </form>
338    
# Line 246  Enter few letters to filter by them Line 342  Enter few letters to filter by them
342  -->  -->
343  </div>  </div>
344    
345  <div id="results">  <ul id="results">
346  </div>  </ul>
347    
348          </td>          </td>
349  </tr>  </tr>
350  </table>          </table>        
351    
352  </body>  </body>
   
   
   
353  </html>    </html>  
   
   

Legend:
Removed from v.484  
changed lines
  Added in v.546

  ViewVC Help
Powered by ViewVC 1.1.26