/[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 509 by dpavlin, Sun Oct 10 19:16:07 2004 UTC revision 524 by dpavlin, Tue Oct 19 15:46:39 2004 UTC
# 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                          r.appendChild(self.document.createElement("br"));                          li.appendChild(self.document.createElement("br"));
48    
49                            // 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 = {  var lang2thes = {
# Line 64  var lang2thes = { Line 95  var lang2thes = {
95  var lang = get_cookie('w2_lang');  var lang = get_cookie('w2_lang');
96  if (! lang) lang = 'hr';  if (! lang) lang = 'hr';
97    
98  load_js(lang2thes[lang]);  var headlines = null;
99    self.document.myfilter = null;
100    
101  function change_lang(lang) {  function load_lang(lang) {
102          // reset results          // reset results
103          self.document.myfilter.filter('');          if (self.document.myfilter) element_id('results').innerHTML = "";
104    
105          set_cookie('w2_lang', lang);          set_cookie('w2_lang', lang);
106          load_js(lang2thes[lang]);          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;          self.document.myfilter.arr=headlines;
119          return true;          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) {  function select_option(value,text,selected) {
# Line 86  function select_option(value,text,select Line 132  function select_option(value,text,select
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 254  function select_option(value,text,select Line 300  function select_option(value,text,select
300  <div class="filters">  <div class="filters">
301    <script type="text/javascript">    <script type="text/javascript">
302          // <!--          // <!--
303          document.write('<select name="lang" onchange="change_lang(this.options[this.selectedIndex].value);">');          document.write('<select id="lang" name="lang" onchange="load_lang(this.options[this.selectedIndex].value);">');
304          select_option("hr","Hrvatski",lang);          select_option("hr","Hrvatski",lang);
305          select_option("en","Engleski",lang);          select_option("en","Engleski",lang);
306          select_option("fr","Francuski",lang);          select_option("fr","Francuski",lang);
# Line 265  function select_option(value,text,select Line 311  function select_option(value,text,select
311    
312          <input autocomplete="off" class="filters" id="textfilter" title="enter a regular expression to filter by" onkeyup="self.document.myfilter.filter(this.value);" />          <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 275  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>

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

  ViewVC Help
Powered by ViewVC 1.1.26