PageSourceSearch

https://www.filipstadstidning.se/assets/rev/js/theme-toggler-module-VHAXCD5I.js

js filipstadstidning.se collected 2026-10-02 20:24:25 UTC 1,590 bytes, 2 lines download raw bytes

1import{a,b as h,c as r}from"./chunk-ZOYOJ6FT.js";import"./chunk-6KHOHYTW.js";var o=class{constructor(e){this.element=e,this.toggleButton=e.querySelector(".theme-toggler"),this.wrapper=e.querySelector(".theme-toggler-wrapper"),this.colorSelect=e.querySelector("#theme-toggler-color"),this.jalla2Select=e.querySelector("#theme-toggler-jalla2-theme"),this.resetButton=this.element.querySelector(".theme-toggler-reset"),this.jalla2ThemeCookie="theme-toggler-jalla2-theme",this.htmlEl=document.documentElement,this._init()}_init(){this.htmlEl&&(this._applyInitialTheme("data-jalla2-theme",this.jalla2ThemeCookie,this.jalla2Select),this._applyInitialTheme("data-theme",null,this.colorSelect),this._addSelectListener(this.colorSelect,"data-theme"),this._addSelectListener(this.jalla2Select,"data-jalla2-theme",this.jalla2ThemeCookie),this.toggleButton&&this.toggleButton.addEventListener("click",()=>this._toggleState()),this.resetButton&&this.resetButton.addEventListener("click",()=>this._reset()))}_toggleState(){let e=this.element.dataset.state==="open";this.element.dataset.state=e?"closed":"open"}_applyInitialTheme(e,t,l){let i=t?a(t):this.htmlEl.getAttribute(e);i&&(this.htmlEl.setAttribute(e,i),l&&(l.value=i))}_addSelectListener(e,t,l=null){e&&e.addEventListener("change",i=>{let s=i.target.value;l&&this._setCookie(l,s),t==="data-jalla2-theme"?window.location.reload():this.htmlEl.setAttribute(t,s)})}_reset(){r(this.jalla2ThemeCookie),window.location.reload()}_setCookie(e,t){h(e,t,{expires:86400*365})}};export{o as default};
2//# sourceMappingURL=theme-toggler-module-VHAXCD5I.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.