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

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

  ViewVC Help
Powered by ViewVC 1.1.26