PageSourceSearch

https://www.himolde.no/vrtx/dist/resources/js/consent.js

js himolde.no collected 2026-10-02 04:19:50 UTC 18,797 bytes, 50 lines download raw bytes

1var vrtxConsents={};function readCookie(e){for(var n=e+"=",t=document.cookie.split(";"),o=0,s=t.length;o<s;o++){for(var i=t[o],a=i.length;" "==i.charAt(0);)i=i.substring(1,a);if(0==i.indexOf(n))return i.substring(n.length,a)}return null}function createCookie(e,n,t,o,s){var i,a="",a=t?((i=new Date).setTime(i.getTime()+24*t*60*60*1e3),"; expires="+i.toGMTString()):"";o&&(a=a+";domain="+o),document.cookie=e+"="+n+a+"; path=/"+("boolean"==typeof forceSecure&&forceSecure||"https:"===location.protocol?";secure":"")}function eraseCookie(e,n){createCookie(e,"",-1,n)}function appendScript(e){var n=document.createElement("script");n.src="/vrtx/decorating/resources/script/consent/"+e.replace(/(?:^|\.?)([A-Z])/g,function(e,n){return"-"+n.toLowerCase()}).replace(/^-/,"")+".js",document.getElementsByTagName("head")[0].appendChild(n)}function checkIfGaScriptHasBeenAddedThenAdd(o){new MutationObserver(function(e){for(var n=0;n<e.length;n++){var t=e[n];t.addedNodes&&0<t.addedNodes.length&&t.addedNodes[0].outerHTML&&/customTracker.js"><\/script>$/.test(t.addedNodes[0].outerHTML.trim())&&appendScript(o)}}).observe(document.head,{childList:!0})}function essentialCookiesAppendScript(e){checkIfGaScriptHasBeenAddedThenAdd(e)}function setConsentFlagsAndAppendScript(e,n){readCookie(e)&&(vrtxConsents[e]=!0,("boolean"==typeof n&&n?appendScript:checkIfGaScriptHasBeenAddedThenAdd)(e))}/(www.inn.no|inn-test.uio.no)/.test(location.hostname)&&(essentialCookiesAppendScript("essential"),setConsentFlagsAndAppendScript("UsageAnalysisConsent"),setConsentFlagsAndAppendScript("MarketingConsent")),/(www.nih.no|nih-test.uio.no)/.test(location.hostname)&&setConsentFlagsAndAppendScript("UsageAnalysisConsent"),/(www.himolde.no|himolde-test.uio.no)/.test(location.hostname)&&(setConsentFlagsAndAppendScript("UsageAnalysisConsent"),setConsentFlagsAndAppendScript("MarketingConsent")),/(www.politihogskolen.no|phs-test.uio.no)/.test(location.hostname)&&setConsentFlagsAndAppendScript("UsageAnalysisConsent",!0),/(www.samordnaopptak.no)/.test(location.hostname)&&setConsentFlagsAndAppendScript("UsageAnalysisConsent",!0);var consentHostNames=["www.nora.ai","www.uio.no","www.mn.uio.no","www.med.uio.no","www.hf.uio.no","www.tf.uio.no","www.sv.uio.no","www.jus.uio.no","www.odont.uio.no","www.uv.uio.no","www.ub.uio.no","www.usit.uio.no","www.stk.uio.no","www.nhm.uio.no","www.khm.uio.no","www.muv.uio.no","vortex-test.uio.no","vortex-test-int.uio.no","nyweb1.uio.no","www.seas.uio.no","www.smart.uio.no","www.unirand.uio.no","www.apollon.uio.no","www.uniforum.uio.no","www.studentparlamentet.uio.no","www.titan.uio.no","titan-test.uio.no","nyweb2.uio.no","www.forbio.uio.no","www.comorment.uio.no","www.frisch.uio.no","www.lifebrain.uio.no","www.plato.uio.no","www.atlast.uio.no","www.cosmoglobe.uio.no","www.dice.uio.no","www.eu3d.uio.no","www.finse.uio.no","www.globus.uio.no","www.sequencing.uio.no","www.sustainabilitylab.uio.no","www.nnrc.uio.no","www.norcc.uio.no","www.nalokson.uio.no","www.trust-aicentre.no","www.napi.uio.no","www.realment.uio.no","www.rescuer.uio.no","www.cresco.uio.no","www.prima.uio.no","www.openscreen.uio.no","www.opera.uio.no","www.winprog.uio.no","www.macprog.uio.no","www.vortexkurs.uio.no","www.vortex-demo.uio.no","www.accessafrica.uio.no","www.arche.uio.no","aho-test.uio.no","www.aho.no","inn-test.uio.no","www.inn.no","nih-test.uio.no","www.nih.no","hiof-test.uio.no","www.hiof.no","himolde-test.uio.no","www.himolde.no","tp-info.educloud.no","www.nutriome.uio.no","www.lcbc.uio.no","www.corehgs.uio.no","www.samtalesenter.uio.no","www.rercto.uio.no","www.synergy-plague.org","www.historiskmuseum.no","www.vikingtidsmuseet.no","www.integreat.no","uio-test.uio.no","uio-test-int.uio.no","www.globaluniversityacademy.org","www.integreat.no","www.globaluniversityacademy.org","www.oslopeacedays.no","www.politihogskolen.no","phs-test.uio.no","www.samfunnsforskning.no","www.stortleringspotensial.uio.no","www.globe.uio.no","www.supa.uio.no","www.the-guild.eu","www.norgeshistorie.no","www.preciseprevent.uio.no","www.n-rihs.uio.no","www.ecoarch-project.org","www.boomerang.uio.no","www.samordnaopptak.no"],consentHostNamesWithoutUsageAnalysisSection=[],consentHostNamesWithMarketingSection=["inn-test.uio.no","www.inn.no","himolde-test.uio.no","www.himolde.no"];function consentInit(){var e,n,t=null,t=/(www.inn.no|inn-test.uio.no)
1/.test(location.hostname)||/(www.himolde.no|himolde-test.uio.no)/.test(location.hostname)||/(www.aho.no|aho-test.uio.no)/.test(location.hostname)||/(www.nih.no|nih-test.uio.no)/.test(location.hostname)||/(www.politihogskolen.no|phs-test.uio.no)/.test(location.hostname)?location.hostname:/\.uio\.no$/.test(location.hostname)?"uio.no":/(www.samordnaopptak.no)/.test(location.hostname)?"samordnaopptak.no":location.hostname,o=document.getElementsByTagName("html")[0].getAttribute("lang"),s={no:{btnAccept:"Godta",btnAcceptAll:"Godta alle",btnDeny:"Avslå",langLink:"English",btnCustomizeOk:"Lagre samtykke",btnCustomizeOkNoneOptionalSelected:"Kun nødvendige",title:"Dette nettstedet bruker informasjons&shy;kapsler",settingsTitle:"Innstillinger for informasjons&shy;kapsler",linkSettings:"Detaljer for informasjons&shy;kapsler"},en:{btnAccept:"Accept",btnAcceptAll:"Accept all",btnDeny:"Deny",langLink:"Norwegian",btnCustomizeOk:"Save consent",btnCustomizeOkNoneOptionalSelected:"Only essential",title:"This webpage uses cookies",settingsTitle:"Cookie settings",linkSettings:"Read more about cookies"}},i=s[o],a=new URLSearchParams(document.location.search),c=a.get("consent-settings");window.cookieNameConsentEssentials=/(www.inn.no|inn-test.uio.no)/.test(location.hostname)?"PrivacyPolicyOptOutInn":"PrivacyPolicyOptOut",window.navigator.cookieEnabled&&window==top&&"/english/about/management-documents/privacy-policy/"!==location.pathname&&"/om/dokumenter/personvern/"!==location.pathname&&"/english/about/management-documents/privacy-policy/index.html"!==location.pathname&&"/om/dokumenter/personvern/index.html"!==location.pathname&&"/om/regelverk/personvern/personvernerklering-nett.html"!==location.pathname&&"/english/about/regulations/privacy-declarations/privacy-policy-web.html"!==location.pathname&&"https://www.khm.uio.no/english/research/collections/gjoahaven/?exhibition=true"!==location.href?"true"===c?consentCustomize("consentA","a",o,i,s,t):"yes"!==readCookie(cookieNameConsentEssentials)&&(a=a.get("consent"),e=null,(n=document.getElementById("consent-script"))&&n.dataset&&n.dataset.variant&&(e=n.dataset.variant),(n=null!=a||null!=e?-1:0)<.5&&0<=n||"A"===a||"A"===e?consentMain("consentA","a",o,i,s,t):(.5<=n||"B"===a||"B"===e)&&consentMain("consentB","b",o,i,s,t)):"true"===c&&consentCustomize("consentA","a",o,i,s,t)}function consentMain(l,r,u,w,d,g){window.addEventListener("resize",e=>{fixMobileHeight(document.querySelector(".consent")),fixMobileHeight(document.querySelector(".consent-settings"))}),getHtml(l).then(function(e){var a=document.createElement("html");a.innerHTML=e;let c=a.querySelector(".consent-intro-"+u);var e=document.querySelector("body"),n=(e.classList.add("consent-settings-opened-mobile"),dialogHtml="a"===r?`
2        <div class="consent-overlay"></div>
3        <div class="consent consent-${r}" role="dialog" aria-labelledby="consent-dialog-title" tabindex="0" lang="${u}">
4          <div class="consent-inner">
5            <a class="consent-lang" href="/">${w.langLink}</a>
6            <h1 class="consent-title" id="consent-dialog-title">${w.title}</h1>
7            <p class="consent-main-intro-text">${c.innerHTML}</p>
8            <p class="consent-main-buttons">
9              <button class="consent-accept-all button-large">${w.btnAccept}</button>
10              <button class="consent-decline-all button-large">${w.btnDeny}</button>
11            </p>
12            <p><a class="consent-customize" href="/">${w.linkSettings}</a></p>
13          </div>
14        </div>
15      `:`
16        <div class="consent consent-${r}" role="dialog" aria-labelledby="consent-dialog-title" tabindex="0" lang="${u}">
17          <div class="consent-inner">
18            <div>
19              <a class="consent-lang" href="/">${w.langLink}</a>
20              <h1 class="consent-title" id="consent-dialog-title">${w.title}</h1>
21              <p class="consent-main-intro-text">${c.innerHTML}</p>
22            </div>
23            <div>
24              <p class="consent-main-buttons">
25                <button class="consent-accept-all button-large">${w.btnAccept}</button>
26                <button class="consent-decline-all button-large">${w.btnDeny}</button>
27              </p>
28              <p><a class="consent-customize" href="/">${w.linkSettings}</a></p>
29            </div>
30          </div>
31        </div>
32      `,document.getElementById("hidnav-wrapper")),n=(n?n.insertAdjacentHTML("afterend",dialogHtml):e.insertAdjacentHTML("afterbegin",dialogHtml),document.querySelector(".consent"));fixMobileHeight(n),"a"===r&&trapFocusInsideDialog(n,".consent-lang",".consent-customize","button.hidden"),n.addEventListener("click",e=>{var n=e.target&&e.target.classList.contains("consent-accept-all"),t=e.target&&e.target.classList.contains("consent-decline-all"),o=e.target&&e.target.classList.contains("consent-customize"),s=e.target&&e.target.classList.contains("consent-lang"),i={};n&&(createCookie(cookieNameConsentEssentials,"yes",90,g),i[cookieNameConsentEssentials]=!0,-1===consentHostNamesWithoutUsageAnalysisSection.indexOf(location.hostname.replace("www-int","www"))&&(createCookie("UsageAnalysisConsent","yes",90,g),i.UsageAnalysisConsent=!0),-1!==consentHostNamesWithMarketingSection.indexOf(location.hostname.replace("www-int","www"))&&(createCookie("MarketingConsent","yes",90,g),i.MarketingConsent=!0),i["consent-"+r.toUpperCase()]=!0,postConsent(i,function(){closeAll(),location.href=location.href.replace("?consent-settings=true","")}),e.stopPropagation(),e.preventDefault()),t&&(createCookie(cookieNameConsentEssentials,"yes",90,g),closeAll(),location.href=location.href.replace("?consent-settings=true",""),e.stopPropagation(),e.preventDefault()),o&&(consentCustomize(l,r,u,w,d,g),e.stopPropagation(),e.preventDefault()),s&&(w=d[u="en"===u?"no":"en"],c=a.querySelector(".consent-intro-"+u),document.querySelector(".consent-lang").textContent=w.langLink,document.querySelector(".consent-title").innerHTML=w.title,document.querySelector(".consent-main-intro-text").innerHTML=c.innerHTML,document.querySelector(".consent-accept-all").textContent=w.btnAccept,document.querySelector(".consent-decline-all").textContent=w.btnDeny,document.querySelector(".consent-customize").innerHTML=w.linkSettings,document.querySelector(".consent").setAttribute("lang",u),e.stopPropagation(),e.preventDefault())})})}function consentCustomize(e,r,u,w,d,g){let m={};getHtml(e+"-settings").then(function(e){var n=document.querySelector(".consent"),c=(n&&n.remove(),document.createElement("html"));c.innerHTML=e;let l=consentCustomizeFellestekst(c,u),t="";document.querySelector(".consent-overlay")||(t+='<div class="consent-overlay"></div>'),t+=`
33      <div class="consent-settings consent-${r}-settings" role="dialog" aria-labelledby="consent-dialog-title" tabindex="0" lang="${u}">
34        <div class="consent-settings-inner">
35          <a class="consent-settings-lang" href="/">${w.langLink}</a>
36          <div>
37            <h1 class="consent-settings-title" id="consent-dialog-title">${w.settingsTitle}</h1>
38            <div class="consent-settings-intro">${l.intro}</div>
39          </div>
40          <div class="consent-settings-type consent-settings-essential">${l.essential}</div>
41          ${l.usageAnalysisHtml}
42          ${l.marketingHtml}
43          <p class="consent-settings-main-buttons">
44            <button class="consent-settings-save button-large">${w.btnCustomizeOk}</button>
45            <button class="consent-settings-accept-all button-large">${w.btnAcceptAll}</button>
46          </p>
47        </div>
48      </div>
49    `;n=document.querySelector("body"),n.classList.add("consent-settings-opened"),e=document.getElementById("hidnav-wrapper"),e?e.insertAdjacentHTML("afterend",t):n.insertAdjacentHTML("afterbegin",t),e=document.querySelector(".consent-settings");fixMobileHeight(e),trapFocusInsideDialog(e,".consent-settings-lang",".consent-settings-accept-all","button.hidden"),consentCustomizeSetupAfter(m,l,w),consentCustomizeSetupOtherCookiesRadios(m,l,w),e.addEventListener("click",e=>{var n,t,o,s=e.target&&e.target.classList.contains("consent-settings-save"),i=e.target&&e.target.classList.contains("consent-settings-accept-all"),a=e.target&&e.target.classList.contains("consent-settings-lang");(s||i)&&(createCookie(cookieNameConsentEssentials,"yes",90,g),i={cookieNameConsentEssentials:!0},n=readCookie("UsageAnalysisConsent"),t=readCookie("MarketingConsent"),o=!1,s?(""!=l.usageAnalysisHtml&&(document.querySelector(".consent-settings-usage-analysis li a.checked")?(null==n&&(o=!0),i.UsageAnalysisConsent=!0,createCookie("UsageAnalysisConsent","yes",90,g)):(null!=n&&(o=!0),eraseCookie("UsageAnalysisConsent",g))),""!=l.marketingHtml&&(document.querySelector(".consent-settings-marketing li a.checked")?(null==t&&(o=!0),i.MarketingConsent=!0,createCookie("MarketingConsent","yes",90,g)):(null!=t&&(o=!0),eraseCookie("MarketingConsent",g)))):(""!=l.usageAnalysisHtml&&(i.UsageAnalysisConsent=!0,null==n&&(o=!0),createCookie("UsageAnalysisConsent","yes",90,g)),""!=l.marketingHtml&&(i.MarketingConsent=!0,null==t&&(o=!0),createCookie("MarketingConsent","yes",90,g))),i["consent-"+r.toUpperCase()]=!0,s=function(){closeAll();var e=document.querySelector("body");e.classList.remove("consent-settings-opened"),e.classList.remove("consent-settings-opened-mobile"),location.href=location.href.replace("?consent-settings=true","")},o?postConsent(i,s):s(),e.stopPropagation(),e.preventDefault()),a&&(w=d[u="en"===u?"no":"en"],l=consentCustomizeFellestekst(c,u),document.querySelector(".consent-settings-lang").textContent=w.langLink,document.querySelector(".consent-settings-title").innerHTML=w.settingsTitle,document.querySelector(".consent-settings-intro").innerHTML=l.intro,document.querySelector(".consent-settings-essential").innerHTML=l.essential,""!=l.usageAnalysisHtml&&(document.querySelector(".consent-settings-usage-analysis").outerHTML=l.usageAnalysisHtml),""!=l.marketingHtml&&(document.querySelector(".consent-settings-marketing").outerHTML=l.marketingHtml),document.querySelector(".consent-settings-save").textContent=w.btnCustomizeOk,document.querySelector(".consent-settings-accept-all").textContent=w.btnAcceptAll,document.querySelector(".consent-settings").setAttribute("lang",u),consentCustomizeSetupAfter(m,l,w),consentCustomizeSetupOtherCookiesRadios(m,l,w),e.stopPropagation(),e.preventDefault())})})}
49function fixMobileHeight(e){var n;e&&(e.removeAttribute("style"),window.innerWidth<768)&&(n=window.innerHeight-e.offsetHeight)<0&&(e.style.height=e.offsetHeight-(-1*n+65)+"px")}function trapFocusInsideDialog(n,e,t,o){var s=n.querySelector(e),i=n.querySelector(t);n.focus(),n.addEventListener("keydown",function(e){"Tab"===e.key&&(e.shiftKey?document.activeElement!==s&&document.activeElement!==n||(i.focus(),e.preventDefault()):document.activeElement===i&&(s.focus(),e.preventDefault()))})}function postConsent(e,n){fetch("/vrtx/__vrtx/app-services/consent",{method:"POST",body:JSON.stringify(e),headers:{"Content-type":"application/json; charset=UTF-8"}}).then(function(e){console.log(e)}).then(function(e){n()}).catch(e=>console.error("Error:",e))}function consentCustomizeFellestekst(e,n){var t=e.querySelector(".consent-intro-"+n),o=e.querySelector(".consent-essential-"+n),s=e.querySelector(".consent-usage-analysis-"+n),e=e.querySelector(".consent-marketing-"+n),n=o.querySelector(":scope > h3:first-child");n&&n.remove();let i="",a=(s&&((n=s.querySelector(":scope > h3:first-child"))&&n.remove(),i=`<div class="consent-settings-type consent-settings-usage-analysis">${s.innerHTML}</div>`),"");return e&&((n=e.querySelector(":scope > h3:first-child"))&&n.remove(),a=`<div class="consent-settings-type consent-settings-marketing">${e.innerHTML}</div>`),{intro:t.innerHTML,essential:o.innerHTML,usageAnalysisHtml:i,marketingHtml:a}}function consentCustomizeSetupAfter(e,n,t){"function"==typeof add2Accordions?add2Accordions(".consent-settings-inner",!0,"h3"):"function"==typeof addAccordions&&addAccordions(".consent-settings-inner",!0,"h3");setTimeout(()=>{window.UiO2&&"function"==typeof UiO2.scrollableTablesIframes?UiO2.scrollableTablesIframes():window.UiO&&"function"==typeof UiO.mobileReponsiveTable&&UiO.mobileReponsiveTable(".consent-settings table")},10);document.querySelector(".consent-settings-essential li a").classList.add("checked","disabled"),""!=n.usageAnalysisHtml&&(readCookie("UsageAnalysisConsent")||e.UsageAnalysisConsent?(document.querySelector(".consent-settings-usage-analysis li a").classList.add("checked"),e.UsageAnalysisConsent=!0):e.UsageAnalysisConsent=!1),""!=n.consentMarketingHtml&&(readCookie("MarketingConsent")||e.MarketingConsent?(document.querySelector(".consent-settings-marketing li a").classList.add("checked"),e.MarketingConsent=!0):e.MarketingConsent=!1),changeSettingsSaveBtnText(e,t)}function consentCustomizeSetupOtherCookiesRadios(n,e,t){document.querySelector(".consent-settings-essential li a").addEventListener("click",e=>{e.stopPropagation(),e.preventDefault()}),""!=e.usageAnalysisHtml&&document.querySelector(".consent-settings-usage-analysis li a").addEventListener("click",function(e){this.classList.toggle("checked"),this.classList.contains("checked")?n.UsageAnalysisConsent=!0:n.UsageAnalysisConsent=!1,changeSettingsSaveBtnText(n,t),e.stopPropagation(),e.preventDefault()}),""!=e.marketingHtml&&document.querySelector(".consent-settings-marketing li a").addEventListener("click",function(e){this.classList.toggle("checked"),this.classList.contains("checked")?n.MarketingConsent=!0:n.MarketingConsent=!1,changeSettingsSaveBtnText(n,t),e.stopPropagation(),e.preventDefault()})}function changeSettingsSaveBtnText(e,n){let t=!1;for(var o in e)if(e[o]){t=!0;break}t?document.querySelector(".consent-settings-save").textContent=n.btnCustomizeOk:document.querySelector(".consent-settings-save").textContent=n.btnCustomizeOkNoneOptionalSelected}function closeAll(){var e=document.querySelector(".consent-overlay"),n=document.querySelector(".consent"),t=document.querySelector(".consent-settings");e&&e.remove(),n&&n.remove(),t&&t.remove()}async function getHtml(e){return fetch("/vrtx/dist/resources/html/"+e+".html").then(function(e){return e.text()}).catch(function(e){console.log(e)})}window.runCookieBanner=!0,-1!==consentHostNames.indexOf(location.hostname.replace("www-int","www"))?(document.addEventListener("DOMContentLoaded",e=>{consentInit()}),window.runCookieBanner=!1):window.runCookieBanner=!0;
50//# sourceMappingURL=consent.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.