PageSourceSearch

https://www.weerplaza.nl/js/SnippetMenuLocation.min.js?v=IvjzSx3OG8_C_Kwt6ZLPh4HIjVjTTZFe5J12BpIcHO0

js weerplaza.nl collected 2026-10-01 11:26:05 UTC 6,741 bytes, 1 lines download raw bytes

1!function(){"use strict";window.wpSubMenu={gps:null,gpsLocation:null,elInput:null,elInputClear:null,elInputSearch:null,elResults:null,elList:null,lastData:null,init(){if(null===this.gps&&(this.gps=wpGeo.available(),this.gps&&wpGeo.permission((e=>{!0===e?this.geoSearch():!1===e&&(this.gps=!1)}))),this.elInput=document.querySelector(".search input"),this.elInputClear=document.querySelector(".search .fa-times"),this.elInputSearch=document.querySelector(".search .fa-search"),this.elResults=document.querySelector(".search .results"),this.elList=document.querySelector(".favorite-list"),this.elInput.addEventListener("focus",this.results.show),this.elInput.addEventListener("blur",(()=>{setTimeout((()=>{document.activeElement!=this.elInput&&this.results.hide()}),300)})),this.elResults.addEventListener("click",(()=>this.elInput.focus())),this.elInput.addEventListener("keyup",wpUtil.debounce((e=>{40===e.keyCode?this.results.selectNext():38===e.keyCode?this.results.selectPrev():13===e.keyCode?this.results.selectItem():this.search()}),200)),this.elInputClear.addEventListener("click",(()=>this.clear())),wpLocation.list("search").length||""===wpCookie.get("MyWeatherGeoId"))this.list();else{const e=wpCookie.get("MyWeatherGeoId");wpLocation.get(e,(e=>this.results.select(e,null,!0)))}},clear(){this.elInput.value="",this.elInput.focus(),this.search()},list(){const e=wpLocation.list("favs"),t=wpLocation.getActiveCityId();if(e.length&&this.elList){const s=document.createDocumentFragment();let l=!1;const i=wpUtil.getScreenSize();e.forEach(((e,n)=>{if("mobile"===i&&n>=1)return;if(n>=3)return;const a=e.meteoGeoId||e.geoId,c=wpLocation.url(e,null,null),o=document.createElement("div");o.classList.add("favorite"),l||e.geoId!=t||(o.classList.add("active"),l=!0);const r=document.createElement("a");if(r.setAttribute("href",c),r.addEventListener("click",(t=>{this.results.select(e,t,!0)})),r.insertAdjacentHTML("beforeend",`<div class="geo-${a} wx wx-w30"></div>\n                    <span class="geo-${a} temp"></span>\n                    <span class="city">${e.displayName||e.name}</span>`),o.insertAdjacentElement("beforeend",r),n>0){const t=document.createElement("button");t.classList.add("favorite-button"),t.innerHTML="<div>&times;<div>",t.addEventListener("click",(()=>{wpLocation.remove(e,"favs"),this.list()})),o.appendChild(t)}s.appendChild(o)})),this.elList.innerHTML="",this.elList.appendChild(s),wpWeather.check()}},geoSearch(){wpGeo.getLocation((e=>{this.gpsLocation=e,wpGeo.permission((e=>{!1===e&&(this.gps=!1),this.results.update(this.lastData)}))}))},search(){const e=this.elInput.value;e.length?(wpLocation.search(e,"nl",(e=>this.results.update(e))),this.elInputSearch.classList.add("hidden"),this.elInputClear.classList.remove("hidden")):(this.results.update(null),this.elInputSearch.classList.remove("hidden"),this.elInputClear.classList.add("hidden"))},results:{show(){wpSubMenu.elResults.classList.remove("hidden"),wpSubMenu.search()},hide(){wpSubMenu.elResults.classList.add("hidden")},update(e,t){wpSubMenu.lastData=e;let s=[],l=!1;if(e){let t=0;t+=e.places.length,t+=e.skiPlaces.length,t+=e.countries.length,t+=e.pointsOfInterest.length,e.places??=[];for(let s of e.regions)s.locations=[],s.locations=e.places.filter((e=>e.regionIdentifier==s.identifier)),e.places=e.places?.filter((e=>e.regionIdentifier!=s.identifier)),t+=s.locations.length;l=t>0}if(null!==wpSubMenu.gpsLocation)s=s.concat(wpSubMenu.results.list("Huidige locatie:",[wpSubMenu.gpsLocation],!0));else if(wpSubMenu.gps){const e=document.createElement("li");e.innerHTML="<div>Huidige locatie:</div>";const t=document.createElement("a");t.insertAdjacentHTML("beforeend",'<i class="fa fa-crosshairs icon"><i>'),t.insertAdjacentHTML("beforeend","<span>Bepaal met GPS</span>"),t.addEventListener("click",(e=>{e.preventDefault(),wpSubMenu.geoSearch()})),isTouchDevice()||t.addEventListener("mouseover",(e=>{wpSubMenu.elResults.querySelectorAll("ul li a").forEach((e=>e.removeClass("selected"))),e.target.classList.add("selected")}));const l=document.createElement("li");l.appendChild(t),s.push(e),s.push(l)}l?(s=s.concat(this.list("Locaties:",e.places.slice(0,10),!0)),s=s.concat(this.list("Berg/skilocaties:",e.skiPlaces.slice(0,10),!1)),s=s.concat(this.list("Landen:",e.countries.slice(0,10),!1,!0)),s=s.concat(this.list("Bezienswaardigheden:",e.pointsOfInterest.slice(0,10),!1)),e.regi
1ons.filter((e=>e.locations&&e.locations.length>0)).forEach((e=>{let t=e.displayName;e.url&&(t=`<a href="${e.url}">${e.displayName}</a>`),s=s.concat(this.list('Locaties regio "'+t+'":',e.locations.slice(0,10),!0))}))):s=t&&t.length>0?s.concat('<li><div class="text-center">Geen resultaten gevonden.</div></li>'):s.concat(wpSubMenu.results.list("Laatst gezocht:",wpLocation.list("search").slice(0,10),!0));const i=wpSubMenu.elResults.querySelector("ul");i.innerHTML="",s.forEach((e=>i.appendChild(e))),wpSubMenu.elResults.querySelector("ul li a:first-child")?.classList.add("selected")},list(e,t,s){const l=[];if(t.length>0){if(e.length>0){const t=document.createElement("li");t.innerHTML=`<div>${e}</div>`,l.push(t)}t.forEach(((e,t)=>{e.name=e.name||e.displayName;const i=s&&e.url&&!e.url.includes("wintersport"),n=i?wpLocation.url(e,null,null):e.url,a=document.createElement("a");a.href=sanitize(n),a.dataset.index=(t+1).toString(),a.dataset.id=e.geoId.toString(),a.insertAdjacentHTML("beforeend",`<img src="https://assets.infoplaza.io/internationalsite/assets/flags/${sanitize(e.countryCode.toLocaleLowerCase())}.png" />`),a.insertAdjacentHTML("beforeend",`<span>${sanitize(e.name)}</span>`),a.addEventListener("click",(t=>this.select(e,t,i))),isTouchDevice()||a.addEventListener("mouseover",(e=>{[...wpSubMenu.elResults.querySelectorAll("ul li a")].forEach((e=>e.classList.remove("selected"))),e.target.classList.add("selected")}));const c=document.createElement("li");c.appendChild(a),l.push(c)}))}return l},select(e,t,s){s&&wpLocation.add(e,"favs"),wpLocation.add(e,"search")},selectItem(){const e=wpSubMenu.elResults.querySelector("ul li a.selected");if(!e)return;e.click();const t=e.getAttribute("href");t&&(window.location=t)},selectPrev(){const e=[...wpSubMenu.elResults.querySelectorAll("ul li a")],t=wpSubMenu.elResults.querySelectorAll("ul li a.selected");let s=e.indexOf(t)-1;s<0&&(s=e.length-1),e.forEach((e=>e.classList.remove("selected"))),e[s]?.classList.add("selected")},selectNext(){const e=[...wpSubMenu.elResults.querySelectorAll("ul li a")],t=wpSubMenu.elResults.querySelector("ul li a.selected");let s=e.indexOf(t)+1;s>=e.length&&(s=0),e.forEach((e=>e.classList.remove("selected"))),e[s]?.classList.add("selected")}}},document.addEventListener("DOMContentLoaded",(()=>wpSubMenu.init()))}();//# sourceMappingURL=SnippetMenuLocation.min.js.map

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.