PageSourceSearch

https://www.historiskmuseum.no/vrtx/dist/resources/js/toc.js

js historiskmuseum.no collected 2026-10-02 06:57:28 UTC 1,631 bytes, 2 lines download raw bytes

1class Toc{constructor(){this.num=1,this.opened=0,this.writeOut="",this.previous=0,this.parentOb=null}setup(e){var t;this.parentOb=document.getElementById("toc"),this.parentOb&&("undefined"==typeof tocGen?(void 0===e&&(t=document.getElementById("vrtx-main-content"),e=t?"vrtx-main-content":"main"),document.addEventListener("DOMContentLoaded",t=>{this.tocGen(e),this.forceScrollToTocIdIfNotScrolled()})):void 0===e?(t=document.getElementById("vrtx-main-content"),window.tocTargetId=t?"vrtx-main-content":"main"):window.tocTargetId=e)}tocGen(t){var e=null;if(null!==(e=(""!==t&&null!=(t=document.getElementById(t))?t:document).querySelectorAll("h2,h3"))&&0<e.length){for(var i,n=0;n<e.length;n++)if("vrtx-toc-header"!=e[n].className){if((i=e[n].nodeName.substring(1))>this.previous)this.writeOut+="<ul>",this.opened++;else if(i<this.previous)for(var o=this.previous-i;o--;)this.writeOut+="</li></ul>",this.opened--;else this.writeout+="</li>";this.addLink(e[n]),this.previous=i}for(;this.opened--;)this.writeOut+="</li></ul>";this.parentOb.innerHTML=this.writeOut}}addLink(t){var e=t,i=t.firstChild,i=(i&&"A"===i.nodeName&&(t=i),this.getId(t)),t=t.innerHTML,i='<li><a href="#'+i+'">'+(t=""===t.trim()?e.innerText:t)+"</a>";this.writeOut+=i}getId(t){return t.id||(t.id="toc"+this.num,this.num++),t.id}forceScrollToTocIdIfNotScrolled(){try{var t=document.documentElement;0==(window.pageYOffset||t.scrollTop)-(t.clientTop||0)&&window.location.hash&&/#toc[\d]{1}/.test(window.location.hash)&&document.getElementById(window.location.hash.split("#")[1]).scrollIntoView()}catch(t){}}}export default new Toc;
2//# sourceMappingURL=toc.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.