This repository has been archived on 2022-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
frontend-styles/public/app.js

2 lines
8.5 KiB
JavaScript
Raw Normal View History

2022-01-23 20:11:30 +01:00
/*! For license information please see app.js.LICENSE.txt */
(()=>{var e={594:e=>{!function(t,n,i){"use strict";var o=function(e,o){n.getComputedStyle||(n.getComputedStyle=function(e){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return"float"===t&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,(function(){return arguments[2].toUpperCase()}))),e.currentStyle[t]?e.currentStyle[t]:null},this});var s,r,a,c,l,u,h=function(e,t,n,i){if("addEventListener"in e)try{e.addEventListener(t,n,i)}catch(o){if("object"!=typeof n||!n.handleEvent)throw o;e.addEventListener(t,(function(e){n.handleEvent.call(n,e)}),i)}else"attachEvent"in e&&("object"==typeof n&&n.handleEvent?e.attachEvent("on"+t,(function(){n.handleEvent.call(n)})):e.attachEvent("on"+t,n))},p=function(e,t,n,i){if("removeEventListener"in e)try{e.removeEventListener(t,n,i)}catch(o){if("object"!=typeof n||!n.handleEvent)throw o;e.removeEventListener(t,(function(e){n.handleEvent.call(n,e)}),i)}else"detachEvent"in e&&("object"==typeof n&&n.handleEvent?e.detachEvent("on"+t,(function(){n.handleEvent.call(n)})):e.detachEvent("on"+t,n))},f=function(e,t){for(var n in t)e.setAttribute(n,t[n])},v=function(e,t){0!==e.className.indexOf(t)&&(e.className+=" "+t,e.className=e.className.replace(/(^\s*)|(\s*$)/g,""))},d=function(e,t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ").replace(/(^\s*)|(\s*$)/g,"")},g=t.createElement("style"),y=t.documentElement,m=function(e,n){var i;for(i in this.options={animate:!0,transition:284,label:"Menu",insert:"before",customToggle:"",closeOnNavClick:!1,openPos:"relative",navClass:"nav-collapse",navActiveClass:"js-nav-active",jsClass:"js",init:function(){},open:function(){},close:function(){}},n)this.options[i]=n[i];if(v(y,this.options.jsClass),this.wrapperEl=e.replace("#",""),t.getElementById(this.wrapperEl))this.wrapper=t.getElementById(this.wrapperEl);else{if(!t.querySelector(this.wrapperEl))throw new Error("The nav element you are trying to select doesn't exist");this.wrapper=t.querySelector(this.wrapperEl)}this.wrapper.inner=function(e){if(e.children.length<1)throw new Error("The Nav container has no containing elements");for(var t=[],n=0;n<e.children.length;n++)1===e.children[n].nodeType&&t.push(e.children[n]);return t}(this.wrapper),r=this.options,s=this.wrapper,this._init(this)};return m.prototype={destroy:function(){this._removeStyles(),d(s,"closed"),d(s,"opened"),d(s,r.navClass),d(s,r.navClass+"-"+this.index),d(y,r.navActiveClass),s.removeAttribute("style"),s.removeAttribute("aria-hidden"),p(n,"resize",this,!1),p(n,"focus",this,!1),p(t.body,"touchmove",this,!1),p(a,"touchstart",this,!1),p(a,"touchend",this,!1),p(a,"mouseup",this,!1),p(a,"keyup",this,!1),p(a,"click",this,!1),r.customToggle?a.removeAttribute("aria-hidden"):a.parentNode.removeChild(a)},toggle:function(){!0===c&&(u?this.close():this.open())},open:function(){u||(d(s,"closed"),v(s,"opened"),v(y,r.navActiveClass),v(a,"active"),s.style.position=r.openPos,f(s,{"aria-hidden":"false"}),u=!0,r.open())},close:function(){u&&(v(s,"closed"),d(s,"opened"),d(y,r.navActiveClass),d(a,"active"),f(s,{"aria-hidden":"true"}),r.animate?(c=!1,setTimeout((function(){s.style.position="absolute",c=!0}),r.transition+10)):s.style.position="absolute",u=!1,r.close())},resize:function(){"none"!==n.getComputedStyle(a,null).getPropertyValue("display")?(l=!0,f(a,{"aria-hidden":"false"}),s.className.match(/(^|\s)closed(\s|$)/)&&(f(s,{"aria-hidden":"true"}),s.style.position="absolute"),this._createStyles(),this._calcHeight()):(l=!1,f(a,{"aria-hidden":"true"}),f(s,{"aria-hidden":"false"}),s.style.position=r.openPos,this._removeStyles())},handleEvent:function(e){var t=e||n.event;switch(t.type){case"touchstart":this._onTouchStart(t);break;case"touchmove":this._onTouchMove(t);break;case"touchend":case"mouseup":this._onTouchEnd(t);break;case"click":this._preventDefault(t);break;case"keyup":this._onKeyUp(t);break;case"focus":case"resize":this.resize(t)}},_init:function(){this.index=i++,v(s,r.navClass),v(s,r.navClass+"-"+this.index),v(s,"closed"),c=!0,u=!1,this._closeOnNavClick(),this._createToggle(),this._transitions(),this.resiz