PageSourceSearch

http://sa-airports.co.za/wp-content/cache/speedycache/sa-airports.co.za/assets/4ac691a8750166ef-selectnav.js

js sa-airports.co.za collected 2026-09-25 11:53:30 UTC 2,206 bytes, 91 lines download raw bytes

1window.selectnav=(function(){
2"use strict";
3var selectnav=function(element,options){
4element=document.getElementById(element);
5if(! element){
6return;
7}
8if(! islist(element)){
9return;
10}
11document.documentElement.className +=" js";
12var o=options||{},
13activeclass=o.activeclass||'active',
14autoselect=typeof(o.autoselect)==="boolean" ? o.autoselect:true,
15nested=typeof(o.nested)==="boolean" ? o.nested:true,
16indent=o.indent||"→",
17label=o.label||"- MENU -",
18level=0,
19selected=" selected ";
20element.insertAdjacentHTML('afterend', parselist(element));
21var nav=document.getElementById(id());
22if(nav.addEventListener){
23nav.addEventListener('change',goTo);
24}
25if(nav.attachEvent){
26nav.attachEvent('onchange', goTo);
27}
28return nav;
29function goTo(e){
30var targ;
31if(!e) e=window.event;
32if(e.target) targ=e.target;
33else if(e.srcElement) targ=e.srcElement;
34if(targ.nodeType===3)
35targ=targ.parentNode;
36if(targ.value) window.location.href=targ.value;
37}
38function islist(list){
39var n=list.nodeName.toLowerCase();
40return (n==='ul'||n==='ol');
41}
42function id(nextId){
43for(var j=1; document.getElementById('selectnav'+j);j++);
44return (nextId) ? 'selectnav'+j:'selectnav'+(j-1);
45}
46function parselist(list){
47level++;
48var length=list.children.length,
49html='',
50prefix='',
51k=level-1
52;
53if(!length){
54return;
55}
56if(k){
57while(k--){
58prefix +=indent;
59}
60prefix +=" ";
61}
62for(var i=0; i < length; i++){
63var link=list.children[i].children[0];
64if(typeof(link)!=='undefined'){
65var text=link.innerText||link.textContent;
66var isselected='';
67if(activeclass){
68isselected=link.className.search(activeclass)!==-1||link.parentElement.className.search(activeclass)!==-1 ? selected:'';
69}
70if(autoselect&&!isselected){
71isselected=link.href===document.URL ? selected:'';
72}
73html +='<option value="' + link.href + '" ' + isselected + '>' + prefix + text +'</option>';
74if(nested){
75var subElement=list.children[i].children[1];
76if(subElement&&islist(subElement)){
77html +=parselist(subElement);
78}}
79}}
80if(level===1&&label){
81html='<option value="">' + label + '</option>' + html;
82}
83if(level===1){
84html='<select class="selectnav" id="'+id(true)+'">' + html + '</select>';
85}
86level--;
87return html;
88}};
89return function (element,options){
90selectnav(element,options);
91};})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.