/[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 524 by dpavlin, Tue Oct 19 15:46:39 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  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;
# Line 18  function myfilter() { Line 18  function myfilter() {
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"));                          e.appendChild(self.document.createTextNode("\u00bb"));
45                          r.appendChild(e);                          li.appendChild(e);
46    
47                            li.appendChild(self.document.createElement("br"));
48    
49                          r.appendChild(self.document.createElement("br"));                          // append li
50                            r_div.appendChild(li);
51    
52                  } else {                  } else {
53                          alert("can't find results div!");                          alert("can't find results div!");
# Line 52  function myfilter() { Line 65  function myfilter() {
65                  return null;                  return null;
66  //              return '<ul>'+html+'</ul>';  //              return '<ul>'+html+'</ul>';
67          }          }
68    
69            self.document.myfilter.show_status = function (status) {
70                    var html;
71                    if (this.hits > 0) {
72                            html = "Pronađeno "+this.hits+" zapisa";
73                    } else {
74                            html = "Nije pronađen niti jedan zapis";
75                    }
76                    if (! status) {
77                            html = "Unesite "+this.min_len+" znakova za pretraživanje.";
78                            status = "";
79                    } else {
80                            status = " za <em>"+status+"</em>.";
81                    }
82    
83                    var el = this.element_id("status");
84                    el.innerHTML = html+status+"\n";
85            }
86    }
87    
88    var lang2thes = {
89            'hr' : 'DescriptorHR.js',
90            'en' : 'DescriptorEN.js',
91            'fr' : 'DescriptorFR.js',
92            'ge' : 'DescriptorGE.js'
93    };
94    
95    var lang = get_cookie('w2_lang');
96    if (! lang) lang = 'hr';
97    
98    var headlines = null;
99    self.document.myfilter = null;
100    
101    function load_lang(lang) {
102            // reset results
103            if (self.document.myfilter) element_id('results').innerHTML = "";
104    
105            set_cookie('w2_lang', lang);
106            element_id('lang').disabled = true;
107            element_id('textfilter').disabled = true;
108            element_id('status').innerHTML = "Učitavanje podataka za jezik. Molimo, pričekate";
109    
110            self.document.myfilter = null;
111    
112            load_js(lang2thes[lang], 'headlines', 'load_lang_finished();' );
113    }
114    
115    function load_lang_finished() {
116            //alert("loaded "+lang);
117            myfilter();
118            self.document.myfilter.arr=headlines;
119            element_id('lang').disabled = false;
120            element_id('textfilter').disabled = false;
121            if (self.document.myfilter) self.document.myfilter.filter(element_id('textfilter').value);
122            return false;
123  }  }
124    
125    function select_option(value,text,selected) {
126            document.write('<option value="'+value+'"');
127            if (value == selected) document.write(' selected');
128            document.write('>'+text+'</option>');
129    }
130    // -->
131  </script>  </script>
132  <script type="text/javascript" src="js/hide.js"></script>  <script type="text/javascript" src="js/hide.js"></script>
   
133  </head>  </head>
134    
135  <body onload="myfilter(); ">  <body onload="load_lang(lang);">
136  <table width="100%" border="0" cellspacing="0" cellpadding="0">  <table width="100%" border="0" cellspacing="0" cellpadding="0">
137    <tr>    <tr>
138          <td colspan="3" class="hdr" height="10">          <td colspan="3" class="hdr" height="10">
# Line 218  function myfilter() { Line 291  function myfilter() {
291    
292    
293  <div style="float: right; width: 10em; text-align: center; margin: 0.5m">  <div style="float: right; width: 10em; text-align: center; margin: 0.5m">
294  <a href="#" onClick="toggle_display('debug');">debug</a>   <a href="#" onclick="toggle_display('debug');">debug</a>
295     <div style="text-align: left; border: 1px dashed #c0c0c0; display: none;" id="debug">
296  <div style="text-align: left; border: 1px dashed #c0c0c0; display: none;" id="debug">   </div>
297  </div>  </div>
298    
299  </div>  <form method="get" onsubmit="return false;" action="?">
   
   
 <form method="get" onSubmit="return false;">  
300  <div class="filters">  <div class="filters">
301          <select name="headlines_name" onChange="load_js(this.options[this.selectedIndex].value); self.document.myfilter.arr=headlines;">    <script type="text/javascript">
302          <option value="DescriptorHR.js">Hrvatski</option>          // <!--
303          <option value="DescriptorEN.js">Engleski</option>          document.write('<select id="lang" name="lang" onchange="load_lang(this.options[this.selectedIndex].value);">');
304          <option value="DescriptorFR.js">Francuski</option>          select_option("hr","Hrvatski",lang);
305          <option value="DescriptorGE.js">Njemački</option>          select_option("en","Engleski",lang);
306          </select>          select_option("fr","Francuski",lang);
307          <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);
308            document.write('</select>');
309            // -->
310      </script>
311    
312            <input autocomplete="off" class="filters" id="textfilter" title="enter a regular expression to filter by" onkeyup="self.document.myfilter.filter(this.value);" />
313          <!-- this button is strictly for looks -->          <!-- this button is strictly for looks -->
314          <input class="filters" value="filter" type="button">          <input class="filters" value="filter" type="button" disabled="true"/>
315  </div>  </div>
316  </form>  </form>
317    
# Line 246  Enter few letters to filter by them Line 321  Enter few letters to filter by them
321  -->  -->
322  </div>  </div>
323    
324  <div id="results">  <ul id="results">
325  </div>  </ul>
326    
327          </td>          </td>
328  </tr>  </tr>
329  </table>          </table>        
330    
331  </body>  </body>
   
   
   
332  </html>    </html>  
   
   

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

  ViewVC Help
Powered by ViewVC 1.1.26