Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geonorge-shared-partials

Package Overview
Dependencies
Maintainers
4
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geonorge-shared-partials - npm Package Compare versions

Comparing version 0.0.70 to 0.0.72

2

dist/main.js

@@ -1,1 +0,1 @@

"use strict";var kartKatalogenUrl={local:"//kartkatalog.dev.geonorge.no",test:"https://kartkatalog.test.geonorge.no",prod:"https://kartkatalog.geonorge.no"},geonorgeBaseUrl={local:"//localhost:61381",test:"www.test.geonorge.no",prod:"www.geonorge.no"},searchOptions={local:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.local+"/search",api:kartKatalogenUrl.local+"/api/search",shoppingCartUrl:kartKatalogenUrl.local+"/nedlasting",loginUrl:kartKatalogenUrl.local+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.test.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",logoutUrl:kartKatalogenUrl.local+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",hosts:"localhost,geonorge.epidemo.no,geonorge.local,kartkatalog.dev.geonorge.no",epiBaseUrl:geonorgeBaseUrl.local,imageLogoPath:"/dist/images/geonorge_logo_350px_dev.svg"},dev:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.local+"/search",api:kartKatalogenUrl.local+"/api/search",shoppingCartUrl:kartKatalogenUrl.local+"/nedlasting",loginUrl:kartKatalogenUrl.local+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.test.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",logoutUrl:kartKatalogenUrl.local+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",hosts:"localhost,geonorge.epidemo.no,geonorge.local,kartkatalog.dev.geonorge.no",epiBaseUrl:geonorgeBaseUrl.local,imageLogoPath:"/dist/images/geonorge_logo_350px_dev.svg"},test:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.test+"/search",api:kartKatalogenUrl.test+"/api/search",shoppingCartUrl:kartKatalogenUrl.test+"/nedlasting",loginUrl:kartKatalogenUrl.test+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.test.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.test+"%2F",logoutUrl:kartKatalogenUrl.test+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.test+"%2F",hosts:"test.geonorge.no,kartkatalog.test.geonorge.no,register.test.geonorge.no,objektkatalog.test.geonorge.no,editor.test.geonorge.no,produktark.test.geonorge.no,validering.test.geonorge.no,159.162.102.155,kartkatalog.dev.geonorge.no,register.dev.geonorge.no,objektkatalog.dev.geonorge.no,editor.dev.geonorge.no,produktark.dev.geonorge.no,validering.dev.geonorge.no,159.162.102.155,kartkatalog.dev.geonorge.no,register.dev.geonorge.no,objektkatalog.dev.geonorge.no,editor.dev.geonorge.no,produktark.dev.geonorge.no,validering.dev.geonorge.no,159.162.102.155",epiBaseUrl:"//"+geonorgeBaseUrl.test,imageLogoPath:"/dist/images/geonorge_logo_350px_test.svg"},prod:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.prod+"/search",api:kartKatalogenUrl.prod+"/api/search",shoppingCartUrl:kartKatalogenUrl.prod+"/nedlasting",loginUrl:kartKatalogenUrl.prod+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.prod+"%2F",logoutUrl:kartKatalogenUrl.prod+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.prod+"%2F",hosts:"geonorge.no,kartkatalog.geonorge.no,register.geonorge.no,objektkatalog.geonorge.no,editor.geonorge.no,produktark.geonorge.no,validering.geonorge.no,159.162.102.155",epiBaseUrl:"//"+geonorgeBaseUrl.prod,imageLogoPath:"/dist/images/geonorge_logo_350px.svg"}},searchOption=searchOptions.prod,applicationEnvironment=applicationEnvironment||"";if(""!==applicationEnvironment)searchOption=searchOptions[applicationEnvironment];searchOption.supportsLogin=void 0===searchOption.supportsLogin||searchOption.supportsLogin,searchOption.supportsCulture=void 0===searchOption.supportsCulture||searchOption.supportsCulture,angular.module("geonorge-header",["ui.bootstrap"]),angular.module("geonorge-header").controller("baseController",["$scope","$http",function(e,t){switch("undefined"!=typeof Cookies?e.langCode=Cookies.get("_culture"):e.langCode="no",e.localizedText={search:{en:"Search",no:"Søk"},menu:{en:"Menu",no:"Meny"},login:{en:"Login",no:"Logg inn"},logout:{en:"Log out",no:"Logg ut"}},e.langCode){case"en":e.cultureSwitchName="Norsk",e.cultureSwitchCode="no",cultureData&&(e.cultureSwitchUrl=cultureData.friendlyUrlNO);break;default:e.cultureSwitchName="English",e.cultureSwitchCode="en",cultureData&&(e.cultureSwitchUrl=cultureData.friendlyUrlEN)}e.switchCulture=function(e){document.cookie="_culture="+e+"; path=/;domain=.geonorge.no"},"undefined"!=typeof Cookies&&(e.loggedIn=Cookies.get("_loggedIn")),void 0!==searchOption.loggedIn&&(e.loggedIn=searchOption.loggedIn),e.imageLogoPath="/dist/images/geonorge_logo_350px.svg",void 0!==searchOption.imageLogoPath&&(e.imageLogoPath=searchOption.imageLogoPath),e.epiBaseUrl="//www.geonorge.no",void 0!==searchOption.epiBaseUrl&&(e.epiBaseUrl=searchOption.epiBaseUrl),e.shoppingCartUrl="//kartkatalog.geonorge.no/nedlasting",void 0!==searchOption.shoppingCartUrl&&(e.shoppingCartUrl=searchOption.shoppingCartUrl)}]),angular.module("geonorge-header").controller("menuTopController",["$scope","$http",function(o,t){function r(e){var t=e.data;o.menuItems=t}function a(e){o.getMenuError=!0,console.debug("Error while getting menuItems",e)}o.trustSrc=function(e){return $sce.trustAsResourceUrl(e)},o.getMenuData=function(){var e="";return void 0!==searchOption.epiBaseUrl&&(e=searchOption.epiBaseUrl),t({method:"GET",url:e+"/api/menu?omitLinks=1",headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{},crossDomain:!0}).then(r,a)},o.loginUrl="//kartkatalog.geonorge.no/AuthServices/SignIn?ReturnUrl=http%3A%2F%2Fwww.geonorge.no%2F",void 0!==searchOption.loginUrl&&(o.loginUrl=searchOption.loginUrl),o.logoutUrl="//kartkatalog.geonorge.no/AuthServices/SignOut?ReturnUrl=http%3A%2F%2Fwww.geonorge.no%2F",void 0!==searchOption.logoutUrl&&(o.logoutUrl=searchOption.logoutUrl)}]),angular.module("geonorge-header").service("aggregatedService",["$http","$q",function(d,h){var e=document.getElementById("txtLang");e&&e.value;var o=void 0;return{triggerSearch:function(t){return h(function(e){null==o?e():o(t)})},executeMethod:function(e){o=e},performSearch:function(e,t,o,r){function a(e,t){var o="facets[1]name=type&facets[1]value="+e,r="text="+t,a="en";return void 0!==cultureData.currentCulture&&""!==cultureData.currentCulture&&"no"!=cultureData.currentCulture||(a="no"),"?limit=5&"+o+"&"+r+"&lang="+a}var n=encodeURI(searchOption.api+a("dataset",e)),l=d({method:"GET",url:n,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}}),s=encodeURI(searchOption.api+a("service",e)),u=d({method:"GET",url:s,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}}),g=encodeURI(searchOption.api.replace("search","articles")+"?limit=5&text="+e),i=d({method:"GET",url:g,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}}),c=encodeURI(searchOption.api+a("software",e)),p=d({method:"GET",url:c,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}});return h.all([l,u,i,p])}}}]).controller("searchTopController",["$rootScope","$scope","$location","$window","$timeout","aggregatedService","$sce",function(g,i,e,r,t,o,a){function n(e,t){e.preventDefault(),e.stopPropagation(),g.selectedSearch=t,i.dropdownOpen=!1,document.getElementById("txtSearch").focus()}function l(){var e=i.selectedSearch,t="";""!==g.searchQuery&&(t=e.queryParameter,t+=g.searchQuery);var o=e.url+t;r.location.href=o}i.trustSrc=function(e){return a.trustAsResourceUrl(e)},g.trustHtml=function(e){return a.trustAsHtml(e)},i.dropdownOpen=!1,i.extendedSearchOpen=!1,i.showFakeResults=!1,i.searchString="",g.selectedSearch=searchOption,g.searchQuery=parseLocation(window.location.search).text,g.activePageUrl="//"+window.location.host+window.location.pathname+window.location.search,void 0===cultureData.currentCulture||""===cultureData.currentCulture||"no"==cultureData.currentCulture?(g.showAllText="Vis alle treff...",g.noResultsText="Søket gir ingen treff",g.loadingContentText="Henter innhold",g.loadingSearchResultsText="Henter søkeresultater"):"en"==cultureData.currentCulture&&(g.showAllText="Show all results...",g.noResultsText="Your search did not return any data",g.loadingContentText="Loading content",g.loadingSearchResultsText="Loading search results"),i.autoCompleteResult=[],i.autoCompletePartial="/dist/partials/_autoCompleteRow.html",i.focused=!1,i.autocompleteActive=!1,i.ajaxCallActive=!1,i.allowBlur=!0,i.viewport={width:window.innerWidth,height:window.innerHeight},i.breakpoints={xSmall:480,small:768,medium:992,large:1200},i.select=n,i.dropdownKeyDown=function(e,t){var o;switch(e.keyCode){case 13:return void n(e,dropdownOptions[t]);case 38:var r=angular.element(document.getElementById("search-dropdown"));o=0===t?r.children()[dropdownOptions.length-1]:r.children()[t-1];break;case 40:o=t>=dropdownOptions.length-1?angular.element(document.getElementById("search-dropdown")).children()[0]:angular.element(e.target).next()[0];break;default:return}e.target.blur(),o.focus(),e.preventDefault(),e.stopPropagation()},i.buttonDropdownKeyDown=function(e){switch(e.keyCode){case 38:e.target.blur(),angular.element(e.target).next().children()[dropdownOptions.length-1].focus();break;case 40:e.target.blur(),angular.element(e.target).next().children()[0].focus();break;default:return}e.preventDefault(),e.stopPropagation()},i.onSearch=function(e){e&&e.preventDefault(),!g.searchQuery||g.searchQuery.length<3||o.triggerSearch(g.searchQuery).then(l)},i.preventDefault=function(e){switch(e.keyCode){case 13:e.preventDefault();break;case 16:h=!0;break;case 9:0<i.autoCompleteResult.length&&e.preventDefault();break;case 38:case 40:e.preventDefault()}};var s=null;function c(e){if(void 0===cultureData.currentCulture||""==cultureData.currentCulture||"no"==cultureData.currentCulture)switch(e){case"dataset":return"Datasett";case"servicelayer":return"Tjenestelag";case"service":return"Tjenester";case"dimensionGroup":return"Datapakker";case"software":return"Applikasjon";case"StandardPage":case"NewsPage":return"Artikler"}else if("en"==cultureData.currentCulture)switch(e){case"dataset":return"Dataset";case"servicelayer":return"Service layer";case"service":return"Service";case"dimensionGroup":return"Data package";case"software":return"Application";case"StandardPage":case"NewsPage":return"Articles"}}function p(e){var t=searchOption.url;switch(e){case"dataset":return t+"?Facets%5B0%5D.name=type&Facets%5B0%5D.value=dataset";case"servicelayer":case"service":return t+"?Facets%5B0%5D.name=type&Facets%5B0%5D.value=service&Facets%5B1%5D.name=type&Facets%5B1%5D.value=servicelayer";case"dimensionGroup":return t;case"StandardPage":case"NewsPage":return t+"?facet=articles";case"software":return t+"?Facets%5B0%5D.name=type&Facets%5B0%5D.value=software"}}i.autocomplete=function(e){if(!1!==i.focused){if(!g.searchQuery||g.searchQuery.length<3)return i.autoCompleteResult=[],i.autocompleteActive=!1,i.ajaxCallActive=!1,void(u=null);switch(e.keyCode){case 13:null===u?(i.resetAutocomplete(),i.allowBlur=!0,i.onSearch(e)):(i.allowBlur=!1,window.location=i.autoCompleteResult[u-1].list[d-1].url);break;case 16:h=!1;break;case 37:break;case 38:return v(),!1;case 39:break;case 9:h?v():m();break;case 40:return m(),!1;default:return u=null,s&&(t.cancel(s),s=null,console.debug("cancel timeout")),void(s=t(function(){i.autocompleteActive=!0,console.debug("calling WS"),0<g.searchQuery.length&&(i.ajaxCallActive=!0,o.performSearch(g.searchQuery,[],5,0).then(function(e){console.debug(e),function(e){if(i.ajaxCallActive=!1,i.autoCompleteResult=[],e.d){var t;if(0===e.d.NumberOfHitsTotal)return i.autoCompleteResult=[];t=e.d.Results;for(var o=0;o<t.length;o++){var r={},a=t[o];if(null!=a.data&&0!==a.data.Results.length){var n=p(a.data.Results[0].Type),l=n.length&&-1<n.indexOf("?")?"&text="+g.searchQuery:"?text="+g.searchQuery;r.showAllUrl=n+l,r.list=[];for(var s=0;s<a.data.Results.length;s++){var u=a.data.Results[s];r.title=c(u.Type),r.list.push({externalId:a.SectionName+"_"+a.Section+"_"+s,id:s,typeId:a.Section,title:u.Title,url:u.ShowDetailsUrl})}i.autoCompleteResult.push(r),console.debug(r)}}}}({d:{Results:e}})}))},300))}}};var u=null,d=null,h=!1;function v(){0<d&&1==u&&0==--d&&(u=null),1==d&&1<u&&(u--,d=i.autoCompleteResult[u-1].list.length),1<u&1<d&&d--,k()}function m(){null===u?d=u=1:(u==i.autoCompleteResult.length&&i.autoCompleteResult[u-1].list.length>d&&d++,u<i.autoCompleteResult.length&&(i.autoCompleteResult[u-1].list.length>d?d++:(u++,d=1))),k()}function k(){for(var e=0;e<i.autoCompleteResult.length;e++){var t=i.autoCompleteResult[e];if(e==u-1)for(var o=0;o<t.list.length;o++){var r=t.list[o];r.highlight=o==d-1}else for(var a=0;a<t.list.length;a++)t.list[a].highlight=!1}console.debug("categoryCount "+u),console.debug("resultCount "+d)}i.mouseOver=function(e,t,o){console.debug(t),console.debug(o),i.allowBlur=e,d=o+1,u=t+1,k()},i.mouseOut=function(e){i.allowBlur=e},i.resetAutocomplete=function(){i.focused=!1,i.autocompleteActive=!1,i.ajaxCallActive=!1,i.autoCompleteResult=[]},i.setFocus=function(e){i.focused=!0,angular.element(e.target).on("blur",function(){t(function(){i.allowBlur&&(i.resetAutocomplete(),console.debug(i.focused),angular.element(e.target).on("blur",null))},!0)})},angular.element(document).ready(function(){o.triggerSearch(g.searchQuery)})}]);var parseLocation=function(e){var t,o,r=e.substring(1).split("&"),a={};for(o in r)""!==r[o]&&(t=r[o].split("="),a[decodeURIComponent(t[0])]=decodeURIComponent(t[1]));return a};
"use strict";var kartKatalogenUrl={local:"//kartkatalog.dev.geonorge.no",test:"https://kartkatalog.test.geonorge.no",prod:"https://kartkatalog.geonorge.no"},geonorgeBaseUrl={local:"//localhost:61381",test:"www.test.geonorge.no",prod:"www.geonorge.no"},searchOptions={local:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.local+"/search",api:kartKatalogenUrl.local+"/api/search",shoppingCartUrl:kartKatalogenUrl.local+"/nedlasting",loginUrl:kartKatalogenUrl.local+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.test.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",logoutUrl:kartKatalogenUrl.local+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",hosts:"localhost,geonorge.epidemo.no,geonorge.local,kartkatalog.dev.geonorge.no",epiBaseUrl:geonorgeBaseUrl.local,imageLogoPath:"/dist/images/geonorge_logo_350px_dev.svg"},dev:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.local+"/search",api:kartKatalogenUrl.local+"/api/search",shoppingCartUrl:kartKatalogenUrl.local+"/nedlasting",loginUrl:kartKatalogenUrl.local+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.test.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",logoutUrl:kartKatalogenUrl.local+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.local+"%2F",hosts:"localhost,geonorge.epidemo.no,geonorge.local,kartkatalog.dev.geonorge.no",epiBaseUrl:geonorgeBaseUrl.local,imageLogoPath:"/dist/images/geonorge_logo_350px_dev.svg"},test:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.test+"/search",api:kartKatalogenUrl.test+"/api/search",shoppingCartUrl:kartKatalogenUrl.test+"/nedlasting",loginUrl:kartKatalogenUrl.test+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.test.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.test+"%2F",logoutUrl:kartKatalogenUrl.test+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.test+"%2F",hosts:"test.geonorge.no,kartkatalog.test.geonorge.no,register.test.geonorge.no,objektkatalog.test.geonorge.no,editor.test.geonorge.no,produktark.test.geonorge.no,validering.test.geonorge.no,159.162.102.155,kartkatalog.dev.geonorge.no,register.dev.geonorge.no,objektkatalog.dev.geonorge.no,editor.dev.geonorge.no,produktark.dev.geonorge.no,validering.dev.geonorge.no,159.162.102.155,kartkatalog.dev.geonorge.no,register.dev.geonorge.no,objektkatalog.dev.geonorge.no,editor.dev.geonorge.no,produktark.dev.geonorge.no,validering.dev.geonorge.no,159.162.102.155",epiBaseUrl:"//"+geonorgeBaseUrl.test,imageLogoPath:"/dist/images/geonorge_logo_350px_test.svg"},prod:{text:"Kartkatalogen",searchTitle:"Kartkatalogen",buttonCss:"edgesKartkatalogen",listCss:"left-edge-kartkatalogen",queryParameter:"?text=",localUrl:!1,autoComplete:!0,url:kartKatalogenUrl.prod+"/search",api:kartKatalogenUrl.prod+"/api/search",shoppingCartUrl:kartKatalogenUrl.prod+"/nedlasting",loginUrl:kartKatalogenUrl.prod+"/AuthServices/SignIn?ReturnUrl=https%3A%2F%2Fnedlasting.geonorge.no%2FAuthServices%2FSignIn%3FReturnUrl%3Dhttps%3A%2F%2F"+geonorgeBaseUrl.prod+"%2F",logoutUrl:kartKatalogenUrl.prod+"/AuthServices/SignOut?ReturnUrl=http%3A%2F%2F"+geonorgeBaseUrl.prod+"%2F",hosts:"geonorge.no,kartkatalog.geonorge.no,register.geonorge.no,objektkatalog.geonorge.no,editor.geonorge.no,produktark.geonorge.no,validering.geonorge.no,159.162.102.155",epiBaseUrl:"//"+geonorgeBaseUrl.prod,imageLogoPath:"/dist/images/geonorge_logo_350px.svg"}},searchOption=searchOptions.prod,applicationEnvironment=applicationEnvironment||"";(searchOption=""!==applicationEnvironment?searchOptions[applicationEnvironment]:searchOption).supportsLogin=void 0===searchOption.supportsLogin||searchOption.supportsLogin,searchOption.supportsCulture=void 0===searchOption.supportsCulture||searchOption.supportsCulture,angular.module("geonorge-header",["ui.bootstrap"]),angular.module("geonorge-header").controller("baseController",["$scope","$http",function(e,t){"undefined"!=typeof Cookies?e.langCode=Cookies.get("_culture"):e.langCode="no",e.localizedText={search:{en:"Search",no:"Søk"},menu:{en:"Menu",no:"Meny"},login:{en:"Login",no:"Logg inn"},logout:{en:"Log out",no:"Logg ut"}},"en"===e.langCode?(e.cultureSwitchName="Norsk",e.cultureSwitchCode="no",cultureData&&(e.cultureSwitchUrl=cultureData.friendlyUrlNO)):(e.cultureSwitchName="English",e.cultureSwitchCode="en",cultureData&&(e.cultureSwitchUrl=cultureData.friendlyUrlEN)),e.switchCulture=function(e){document.cookie="_culture="+e+"; path=/;domain=.geonorge.no"},"undefined"!=typeof Cookies&&(e.loggedIn=Cookies.get("_loggedIn")),void 0!==searchOption.loggedIn&&(e.loggedIn=searchOption.loggedIn),e.imageLogoPath="/dist/images/geonorge_logo_350px.svg",void 0!==searchOption.imageLogoPath&&(e.imageLogoPath=searchOption.imageLogoPath),e.epiBaseUrl="//www.geonorge.no",void 0!==searchOption.epiBaseUrl&&(e.epiBaseUrl=searchOption.epiBaseUrl),e.shoppingCartUrl="//kartkatalog.geonorge.no/nedlasting",void 0!==searchOption.shoppingCartUrl&&(e.shoppingCartUrl=searchOption.shoppingCartUrl)}]),angular.module("geonorge-header").controller("menuTopController",["$scope","$http",function(t,o){function r(e){e=e.data;t.menuItems=e}function a(e){t.getMenuError=!0,console.debug("Error while getting menuItems",e)}t.trustSrc=function(e){return $sce.trustAsResourceUrl(e)},t.getMenuData=function(){var e="";return void 0!==searchOption.epiBaseUrl&&(e=searchOption.epiBaseUrl),o({method:"GET",url:e+"/api/menu?omitLinks=1",headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{},crossDomain:!0}).then(r,a)},t.loginUrl="//kartkatalog.geonorge.no/AuthServices/SignIn?ReturnUrl=http%3A%2F%2Fwww.geonorge.no%2F",void 0!==searchOption.loginUrl&&(t.loginUrl=searchOption.loginUrl),t.logoutUrl="//kartkatalog.geonorge.no/AuthServices/SignOut?ReturnUrl=http%3A%2F%2Fwww.geonorge.no%2F",void 0!==searchOption.logoutUrl&&(t.logoutUrl=searchOption.logoutUrl)}]),angular.module("geonorge-header").service("aggregatedService",["$http","$q",function(u,g){var e=document.getElementById("txtLang");e&&e.value;var o=void 0;return{triggerSearch:function(t){return g(function(e){null==o?e():o(t)})},executeMethod:function(e){o=e},performSearch:function(e,t,o,r){function a(e,t){var o="en";return"?limit=5&"+("facets[1]name=type&facets[1]value="+e)+"&"+("text="+t)+"&lang="+(o=void 0===cultureData.currentCulture||""===cultureData.currentCulture||"no"==cultureData.currentCulture?"no":o)}var n=encodeURI(searchOption.api+a("dataset",e)),l=u({method:"GET",url:n,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}}),s=encodeURI(searchOption.api+a("service",e)),n=u({method:"GET",url:s,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}}),s=encodeURI(searchOption.api.replace("search","articles")+"?limit=5&text="+e),s=u({method:"GET",url:s,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}}),e=encodeURI(searchOption.api+a("software",e)),e=u({method:"GET",url:e,headers:{"Content-Type":"application/json; charset=utf-8",accept:"*/*"},data:{}});return g.all([l,n,s,e])}}}]).controller("searchTopController",["$rootScope","$scope","$location","$window","$timeout","aggregatedService","$sce",function(g,i,e,o,t,r,a){i.trustSrc=function(e){return a.trustAsResourceUrl(e)},g.trustHtml=function(e){return a.trustAsHtml(e)},i.dropdownOpen=!1,i.extendedSearchOpen=!1,i.showFakeResults=!1,i.searchString="",g.selectedSearch=searchOption,g.searchQuery=parseLocation(window.location.search).text,g.activePageUrl="//"+window.location.host+window.location.pathname+window.location.search,void 0===cultureData.currentCulture||""===cultureData.currentCulture||"no"==cultureData.currentCulture?(g.showAllText="Vis alle treff...",g.noResultsText="Søket gir ingen treff",g.loadingContentText="Henter innhold",g.loadingSearchResultsText="Henter søkeresultater"):"en"==cultureData.currentCulture&&(g.showAllText="Show all results...",g.noResultsText="Your search did not return any data",g.loadingContentText="Loading content",g.loadingSearchResultsText="Loading search results"),i.autoCompleteResult=[],i.autoCompletePartial="/dist/partials/_autoCompleteRow.html",i.focused=!1,i.autocompleteActive=!1,i.ajaxCallActive=!1,i.allowBlur=!0,i.viewport={width:window.innerWidth,height:window.innerHeight},i.breakpoints={xSmall:480,small:768,medium:992,large:1200};function n(e,t){e.preventDefault(),e.stopPropagation(),g.selectedSearch=t,i.dropdownOpen=!1,document.getElementById("txtSearch").focus()}i.select=n;function l(){var e=i.selectedSearch,t="";""!==g.searchQuery&&(t=e.queryParameter,t+=g.searchQuery);t=e.url+t;o.location.href=t}i.dropdownKeyDown=function(e,t){switch(e.keyCode){case 13:return void n(e,dropdownOptions[t]);case 38:var o=angular.element(document.getElementById("search-dropdown")),r=0===t?o.children()[dropdownOptions.length-1]:o.children()[t-1];break;case 40:r=(t>=dropdownOptions.length-1?angular.element(document.getElementById("search-dropdown")).children():angular.element(e.target).next())[0];break;default:return}e.target.blur(),r.focus(),e.preventDefault(),e.stopPropagation()},i.buttonDropdownKeyDown=function(e){switch(e.keyCode){case 38:e.target.blur(),angular.element(e.target).next().children()[dropdownOptions.length-1].focus();break;case 40:e.target.blur(),angular.element(e.target).next().children()[0].focus();break;default:return}e.preventDefault(),e.stopPropagation()},i.onSearch=function(e){e&&e.preventDefault(),!g.searchQuery||g.searchQuery.length<3||r.triggerSearch(g.searchQuery).then(l)},i.preventDefault=function(e){switch(e.keyCode){case 13:e.preventDefault();break;case 16:p=!0;break;case 9:0<i.autoCompleteResult.length&&e.preventDefault();break;case 38:case 40:e.preventDefault()}};var s=null;i.autocomplete=function(e){if(!1!==i.focused){if(!g.searchQuery||g.searchQuery.length<3)return i.autoCompleteResult=[],i.autocompleteActive=!1,i.ajaxCallActive=!1,void(u=null);switch(e.keyCode){case 13:null===u?(i.resetAutocomplete(),i.allowBlur=!0,i.onSearch(e)):(i.allowBlur=!1,window.location=i.autoCompleteResult[u-1].list[c-1].url);break;case 16:p=!1;break;case 37:break;case 38:return d(),!1;case 39:break;case 9:(p?d:h)();break;case 40:return h(),!1;default:return u=null,s&&(t.cancel(s),s=null,console.debug("cancel timeout")),void(s=t(function(){i.autocompleteActive=!0,console.debug("calling WS"),0<g.searchQuery.length&&(i.ajaxCallActive=!0,r.performSearch(g.searchQuery,[],5,0).then(function(e){console.debug(e),function(e){if(i.ajaxCallActive=!1,i.autoCompleteResult=[],e.d){var t=[];if(0!==e.d.NumberOfHitsTotal){t=e.d.Results;for(var o=0;o<t.length;o++){var r={},a=t[o];if(null!=a.data&&0!==a.data.Results.length){var n=function(e){var t=searchOption.url;switch(e){case"dataset":return t+"?Facets%5B0%5D.name=type&Facets%5B0%5D.value=dataset";case"servicelayer":case"service":return t+"?Facets%5B0%5D.name=type&Facets%5B0%5D.value=service&Facets%5B1%5D.name=type&Facets%5B1%5D.value=servicelayer";case"dimensionGroup":return t;case"StandardPage":case"NewsPage":return t+"?facet=articles";case"software":return t+"?Facets%5B0%5D.name=type&Facets%5B0%5D.value=software"}}(a.data.Results[0].Type),l=n.length&&-1<n.indexOf("?")?"&text="+g.searchQuery:"?text="+g.searchQuery;r.showAllUrl=n+l,r.list=[];for(var s=0;s<a.data.Results.length;s++){var u=a.data.Results[s];r.title=function(e){if(void 0===cultureData.currentCulture||""==cultureData.currentCulture||"no"==cultureData.currentCulture)switch(e){case"dataset":return"Datasett";case"servicelayer":return"Tjenestelag";case"service":return"Tjenester";case"dimensionGroup":return"Datapakker";case"software":return"Applikasjon";case"StandardPage":case"NewsPage":return"Artikler"}else if("en"==cultureData.currentCulture)switch(e){case"dataset":return"Dataset";case"servicelayer":return"Service layer";case"service":return"Service";case"dimensionGroup":return"Data package";case"software":return"Application";case"StandardPage":case"NewsPage":return"Articles"}}(u.Type),r.list.push({externalId:a.SectionName+"_"+a.Section+"_"+s,id:s,typeId:a.Section,title:u.Title,url:u.ShowDetailsUrl})}i.autoCompleteResult.push(r),console.debug(r)}}}else i.autoCompleteResult=[]}}({d:{Results:e}})}))},300))}}};var u=null,c=null,p=!1;function d(){0<c&&1==u&&0===--c&&(u=null),1==c&&1<u&&(u--,c=i.autoCompleteResult[u-1].list.length),1<u&1<c&&c--,v()}function h(){null===u?c=u=1:(u==i.autoCompleteResult.length&&i.autoCompleteResult[u-1].list.length>c&&c++,u<i.autoCompleteResult.length&&(i.autoCompleteResult[u-1].list.length>c?c++:(u++,c=1))),v()}function v(){for(var e=0;e<i.autoCompleteResult.length;e++){var t=i.autoCompleteResult[e];if(e==u-1)for(var o=0;o<t.list.length;o++){var r=t.list[o];r.highlight=o==c-1}else for(var a=0;a<t.list.length;a++)t.list[a].highlight=!1}console.debug("categoryCount "+u),console.debug("resultCount "+c)}i.mouseOver=function(e,t,o){console.debug(t),console.debug(o),i.allowBlur=e,c=o+1,u=t+1,v()},i.mouseOut=function(e){i.allowBlur=e},i.resetAutocomplete=function(){i.focused=!1,i.autocompleteActive=!1,i.ajaxCallActive=!1,i.autoCompleteResult=[]},i.setFocus=function(e){i.focused=!0,angular.element(e.target).on("blur",function(){t(function(){i.allowBlur&&(i.resetAutocomplete(),console.debug(i.focused),angular.element(e.target).on("blur",null))},!0)})},angular.element(document).ready(function(){r.triggerSearch(g.searchQuery)})}]);var parseLocation=function(e){var t,o,r=e.substring(1).split("&"),a={};for(o in r)""!==r[o]&&(t=r[o].split("="),a[decodeURIComponent(t[0])]=decodeURIComponent(t[1]));return a};

@@ -112,3 +112,3 @@ {

},
"version": "0.0.70"
"version": "0.0.72"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc