-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlocal.min.js
More file actions
2 lines (2 loc) · 5.6 KB
/
Copy pathlocal.min.js
File metadata and controls
2 lines (2 loc) · 5.6 KB
1
2
var tabdropdown={disappeardelay:200,disablemenuclick:false,enableiframeshim:0,dropmenuobj:null,ie:document.all,firefox:document.getElementById&&!document.all,previousmenuitem:null,currentpageurl:window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,""),getposOffset:function(e,t){var n=t=="left"?e.offsetLeft:e.offsetTop;var r=e.offsetParent;while(r!=null){n=t=="left"?n+r.offsetLeft:n+r.offsetTop;r=r.offsetParent}return n},showhide:function(e,t,n){if(this.ie||this.firefox)this.dropmenuobj.style.left=this.dropmenuobj.style.top="-400px";if(t.type=="click"&&e.visibility==hidden||t.type=="mouseover"){if(n.parentNode.className.indexOf("default")==-1)n.parentNode.className="selected";e.visibility="visible"}else if(t.type=="click")e.visibility="hidden"},iecompattest:function(){return document.compatMode&&document.compatMode!="BackCompat"?document.documentElement:document.body},clearbrowseredge:function(e,t){var n=0;if(t=="rightedge"){var r=this.ie&&!window.opera?this.standardbody.scrollLeft+this.standardbody.clientWidth-15:window.pageXOffset+window.innerWidth-15;this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth;if(r-this.dropmenuobj.x<this.dropmenuobj.contentmeasure)n=this.dropmenuobj.contentmeasure-e.offsetWidth}else{var i=this.ie&&!window.opera?this.standardbody.scrollTop:window.pageYOffset;var r=this.ie&&!window.opera?this.standardbody.scrollTop+this.standardbody.clientHeight-15:window.pageYOffset+window.innerHeight-18;this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight;if(r-this.dropmenuobj.y<this.dropmenuobj.contentmeasure){n=this.dropmenuobj.contentmeasure+e.offsetHeight;if(this.dropmenuobj.y-i<this.dropmenuobj.contentmeasure)n=this.dropmenuobj.y+e.offsetHeight-i}this.dropmenuobj.firstlink.style.borderTopWidth=n==0?0:"1px"}return n},dropit:function(e,t,n){if(this.dropmenuobj!=null){this.dropmenuobj.style.visibility="hidden";if(this.previousmenuitem!=null&&this.previousmenuitem!=e){if(this.previousmenuitem.parentNode.className.indexOf("default")==-1)this.previousmenuitem.parentNode.className=""}}this.clearhidemenu();if(this.ie||this.firefox){e.onmouseout=function(){tabdropdown.delayhidemenu(e)};e.onclick=function(){return!tabdropdown.disablemenuclick};this.dropmenuobj=document.getElementById(n);this.dropmenuobj.onmouseover=function(){tabdropdown.clearhidemenu()};this.dropmenuobj.onmouseout=function(t){tabdropdown.dynamichide(t,e)};this.dropmenuobj.onclick=function(){tabdropdown.delayhidemenu(e)};this.showhide(this.dropmenuobj.style,t,e);this.dropmenuobj.x=this.getposOffset(e,"left");this.dropmenuobj.y=this.getposOffset(e,"top");this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(e,"rightedge")+"px";this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(e,"bottomedge")+e.offsetHeight+1+"px";this.previousmenuitem=e;this.positionshim()}},contains_firefox:function(e,t){while(t.parentNode)if((t=t.parentNode)==e)return true;return false},dynamichide:function(e,t){var n=window.event?window.event:e;if(this.ie&&!this.dropmenuobj.contains(n.toElement))this.delayhidemenu(t);else if(this.firefox&&e.currentTarget!=n.relatedTarget&&!this.contains_firefox(n.currentTarget,n.relatedTarget))this.delayhidemenu(t)},delayhidemenu:function(e){this.delayhide=setTimeout(function(){tabdropdown.dropmenuobj.style.visibility="hidden";if(e.parentNode.className.indexOf("default")==-1)e.parentNode.className=""},this.disappeardelay)},clearhidemenu:function(){if(this.delayhide!="undefined")clearTimeout(this.delayhide)},positionshim:function(){if(this.enableiframeshim&&typeof this.shimobject!="undefined"){if(this.dropmenuobj.style.visibility=="visible"){this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px";this.shimobject.style.left=this.dropmenuobj.style.left;this.shimobject.style.top=this.dropmenuobj.style.top}this.shimobject.style.display=this.dropmenuobj.style.visibility=="visible"?"block":"none"}},hideshim:function(){if(this.enableiframeshim&&typeof this.shimobject!="undefined")this.shimobject.style.display="none"},isSelected:function(e){var e=e.replace("http://"+e.hostname,"").replace(/^\//,"");return tabdropdown.currentpageurl==e},init:function(e,t){this.standardbody=document.compatMode=="CSS1Compat"?document.documentElement:document.body;var n=document.getElementById(e).getElementsByTagName("a");for(var r=0;r<n.length;r++){if(n[r].getAttribute("rel")){var i=n[r].getAttribute("rel");document.getElementById(i).firstlink=document.getElementById(i).getElementsByTagName("a")[0];n[r].onmouseover=function(e){var t=typeof e!="undefined"?e:window.event;tabdropdown.dropit(this,t,this.getAttribute("rel"))}}if(t=="auto"&&typeof s=="undefined"&&this.isSelected(n[r].href)){n[r].parentNode.className+=" selected default";var s=true}else if(parseInt(t)==r)n[r].parentNode.className+=" selected default"}}}
window.load_leaflet_map=function(e,t,n){var r="http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";var i='© editorii <a href="http://openstreetma'+'p.org">OSM</a>, <a hr'+'ef="http://creativecommons.org/licenses/by-s'+'a/2.0/">CCBYSA</a>';var s=L.map(e);var o=L.tileLayer(r,{attribution:i,maxZoom:18});o.addTo(s);if(typeof n!="undefined"){var u=new Array;var a=new L.Icon.Default({iconSize:[15,25],iconAnchor:[12,25],popupAnchor:[-2,-25],shadowSize:[38,25],shadowAnchor:[12,25]});$.each(n,function(e){var t=L.marker([n[e].y,n[e].x],{riseOnHover:true,icon:a});t.bindPopup(n[e].denloc,{closeButton:false}).on("mouseover",function(){t.openPopup()}).on("mouseout",function(){t.closePopup()});u.push(t)});if(u.length>0){L.featureGroup(u).addTo(s)}}var f=L.geoJson(t);f.addTo(s);s.fitBounds([[t.bbox[1],t.bbox[0]],[t.bbox[3],t.bbox[2]]])}