Zulma-Theme/static/js/zulma_switchcss.js
2019-05-10 08:56:47 +01:00

2 lines
No EOL
2.6 KiB
JavaScript

!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}({2:function(e,t){!function(e){var t="ZULMA_THEME",n="stop-blink",o="stylesheet",r=null,c=localStorage.getItem(t),l=function e(t){var n=t.currentTarget;n.removeEventListener("load",e),n.removeEventListener("error",i),a(),n.className+=o,r=null,d()},i=function e(n){var c=n.currentTarget;c.removeEventListener("load",l),c.removeEventListener("error",e),localStorage.removeItem(t),s(c.id,!1),c.remove(),r&&document.getElementsByTagName("head")[0].appendChild(r),s(document.querySelectorAll(".".concat(o))[0].id,!0),d()};function u(e,n){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href="/".concat(e,".css"),c.id=e;var u=document.getElementsByTagName("head")[0].appendChild(c);u.addEventListener("load",l),u.addEventListener("error",i),n&&(r=document.querySelectorAll(".".concat(o))[0],a()),function(e){localStorage.setItem(t,e)}(e)}function a(){document.querySelectorAll(".".concat(o)).forEach(function(e){e.remove()})}function d(){var e=document.getElementById(n);e&&e.remove()}function s(e,t){var n=document.querySelectorAll("#theme-select>option");n.length?n.forEach(function(n){n.value===e&&(t?n.selected="selected":n.remove())}):window.addEventListener("DOMContentLoaded",function(){s(e,t)})}e.init=function(){var e,t,o;c&&!document.getElementById(c)&&(e=document.getElementsByTagName("head")[0],t=document.createElement("style"),o="body{visibility:hidden;}",t.id=n,t.setAttribute("type","text/css"),t.styleSheet?t.styleSheet.cssText=o:t.appendChild(document.createTextNode(o)),e.appendChild(t),u(c,!0),s(c,!0)),window.addEventListener("DOMContentLoaded",function(){document.getElementById("theme-select").onchange=function(){u(this.value)}})}}(switch_css=window.switch_css||{}),switch_css.init()}});
//# sourceMappingURL=zulma_switchcss.js.map