daux.io/themes/daux/js/daux.min.js

3 lignes
3.7 KiB
JavaScript
Brut Vue normale Historique

!function(){"use strict";function e(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function t(e,t){for(var n=0;n<e.length;n++)e[n].classList.toggle("CodeToggler--hidden",t);try{localStorage.setItem("daux_code_blocks_hidden",t)}catch(e){}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e))){var t=0,r=function(){};return{s:r,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,i=!0,l=!1;return{s:function(){o=e[Symbol.iterator]()},n:function(){var e=o.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==o.return||o.return()}finally{if(l)throw a}}}}function o(e){var t=void 0!==e.preventDefault;t&&e.preventDefault();var n=function(e){for(var t=e;(t=t.parentNode)&&9!==t.nodeType;)if(1===t.nodeType&&t.classList.contains("Nav__item"))return t;throw new Error("Could not find a NavItem...")}(e.target),r=n.querySelector("ul.Nav");t&&n.classList.contains("Nav__item--open")?(r.style.height="".concat(r.scrollHeight,"px"),r.style.transitionDuration="150ms",r.style.height="0px",n.classList.remove("Nav__item--open")):t?(r.style.transitionDuration="150ms",r.addEventListener("transitionend",(function e(t){"0px"!==t.target.style.height&&(t.target.style.height="auto"),t.target.removeEventListener("transitionend",e)})),r.style.height="".concat(r.scrollHeight,"px"),n.classList.add("Nav__item--open")):r.style.height="auto"}e((function(){var e=document.querySelectorAll(".s-content pre"),n=document.querySelector(".CodeToggler");n&&(e.length?function(e,n){var r=e.querySelector(".CodeToggler__button--main");r.addEventListener("change",(function(e){t(n,!e.target.checked)}),!1);var o=!1;try{"false"===(o=localStorage.getItem("daux_code_blocks_hidden"))?o=!1:"true"===o&&(o=!0),o&&(t(n,!!o),r.checked=!o)}catch(e){}}(n,e):n.classList.add("CodeToggler--hidden"))})),e((function(){var e=document.querySelector(".Collapsible__trigger");if(e){var t=document.querySelector(".Collapsible__content");e.addEventListener("click",(function(n){t.classList.contains("Collapsible__content--open")?(t.style.height=0,t.classList.remove("Collapsible__content--open"),e.setAttribute("aria-expanded","false")):(e.setAttribute("aria-expanded","true"),t.style.transitionDuration="150ms",t.style.height="".concat(t.scrollHeight,"px"),t.classList.add("Collapsible__content--open"))}))}})),e((function(){var e=document.querySelectorAll("pre > code:not(.hljs)");if(e.length){var t=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src="".concat(window.base_url,"daux_libraries/highlight.pack.js"),n.onload=function(t){[].forEach.call(e,window.hljs.highlightBlock)},t.appendChild(n)}})),e((function(){for(var e,t=document.querySelectorAll(".Nav__item.has-children i.Nav__arrow"),n=t.length-1;n>=0;n--)(e=t[n]).addEventListener("click",o),e.parentNode.parentNode.classList.contains("Nav__item--open")&&o({target:e});var a,i=r(document.querySelectorAll(".Nav__item__link--nopage"));try{for(i.s();!(a=i.n()).done;){a.value.addEventListener("click",o)}}catch(e){i.e(e)}finally{i.f()}}))}();
//# sourceMappingURL=daux.min.js.map