1 line
8.2 KiB
Plaintext
1 line
8.2 KiB
Plaintext
{"version":3,"file":"daux.min.js.map","sources":["../../../src/js/theme_daux/code_toggle.js","../../../src/js/theme_daux/hamburger.js","../../../src/js/theme_daux/highlight.js","../../../src/js/theme_daux/menu.js"],"sourcesContent":["const codeBlocks = document.querySelectorAll(\".s-content pre\");\nconst toggleCodeSection = document.querySelector(\".CodeToggler\");\n\nconst LOCAL_STORAGE_KEY = \"daux_code_blocks_hidden\";\n\nfunction setCodeBlockStyle(hidden) {\n for (let a = 0; a < codeBlocks.length; a++) {\n codeBlocks[a].classList.toggle(\"Hidden\", hidden);\n }\n try {\n localStorage.setItem(LOCAL_STORAGE_KEY, hidden);\n } catch (e) {\n // local storage operations can fail with the file:// protocol\n }\n}\n\nfunction enableToggler() {\n const toggleCodeBlockBtnSet = toggleCodeSection.querySelector(\n \".CodeToggler__button--main\"\n ); // available when floating is disabled\n\n toggleCodeBlockBtnSet.addEventListener(\n \"change\",\n ev => {\n setCodeBlockStyle(!ev.target.checked);\n },\n false\n );\n\n let hidden = false;\n try {\n hidden = localStorage.getItem(LOCAL_STORAGE_KEY);\n\n if (hidden === \"false\") {\n hidden = false;\n } else if (hidden === \"true\") {\n hidden = true;\n }\n\n if (hidden) {\n setCodeBlockStyle(!!hidden);\n toggleCodeBlockBtnSet.checked = !hidden;\n }\n } catch (e) {\n // local storage operations can fail with the file:// protocol\n }\n}\n\nif (toggleCodeSection) {\n if (codeBlocks.length) {\n enableToggler();\n } else {\n toggleCodeSection.classList.add(\"Hidden\");\n }\n}\n","const trigger = document.querySelector(\".Collapsible__trigger\");\n\nif (trigger) {\n const content = document.querySelector(\".Collapsible__content\");\n\n trigger.addEventListener(\"click\", ev => {\n if (content.classList.contains(\"Collapsible__content--open\")) {\n content.style.height = 0;\n content.classList.remove(\"Collapsible__content--open\");\n trigger.setAttribute(\"aria-expanded\", \"false\");\n } else {\n trigger.setAttribute(\"aria-expanded\", \"true\");\n content.style.transitionDuration = \"150ms\";\n content.style.height = `${content.scrollHeight}px`;\n content.classList.add(\"Collapsible__content--open\");\n }\n });\n}\n","const codeBlocks = document.querySelectorAll(\"pre > code:not(.hljs)\");\nif (codeBlocks.length) {\n const head = document.getElementsByTagName(\"head\")[0],\n script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.async = true;\n script.src = `${window.base_url}daux_libraries/highlight.pack.js`;\n script.onload = function(src) {\n [].forEach.call(codeBlocks, window.hljs.highlightBlock);\n };\n head.appendChild(script);\n}\n","/**\n * After the transition finishes set the height to auto so child\n * menus can expand properly.\n * @param {Element} item\n */\nfunction resetHeightAfterAnimation(item) {\n const setHeightToAuto = ev => {\n if (ev.target.style.height !== \"0px\") {\n ev.target.style.height = \"auto\";\n }\n\n ev.target.removeEventListener(\"transitionend\", setHeightToAuto);\n };\n\n item.addEventListener(\"transitionend\", setHeightToAuto);\n}\n\nfunction findNavItem(start) {\n let elem = start;\n while ((elem = elem.parentNode) && elem.nodeType !== 9) {\n if (elem.nodeType === 1 && elem.classList.contains(\"Nav__item\")) {\n return elem;\n }\n }\n\n throw new Error(\"Could not find a NavItem...\");\n}\n\nfunction toggleSubMenu(ev) {\n const isEvent = ev.preventDefault !== undefined;\n\n if (isEvent) {\n ev.preventDefault();\n }\n\n const parent = findNavItem(ev.target);\n const subNav = parent.querySelector(\"ul.Nav\");\n\n if (isEvent && parent.classList.contains(\"Nav__item--open\")) {\n // Temporarily set the height so the transition can work.\n subNav.style.height = `${subNav.scrollHeight}px`;\n subNav.style.transitionDuration = \"150ms\";\n subNav.style.height = \"0px\";\n parent.classList.remove(\"Nav__item--open\");\n } else {\n if (isEvent) {\n subNav.style.transitionDuration = \"150ms\";\n resetHeightAfterAnimation(subNav);\n subNav.style.height = `${subNav.scrollHeight}px`;\n parent.classList.add(\"Nav__item--open\");\n } else {\n // When running at page load the transitions don't need to fire and\n // the classList doesn't need to be altered.\n subNav.style.height = \"auto\";\n }\n }\n}\n\nconst navItems = document.querySelectorAll(\n \".Nav__item.has-children i.Nav__arrow\"\n);\n\n// Go in reverse here because on page load the child nav items need to be\n// opened first before their parents so the height on the parents can be\n// calculated properly.\nfor (let i = navItems.length - 1, target; i >= 0; i--) {\n target = navItems[i];\n target.addEventListener(\"click\", toggleSubMenu);\n\n if (target.parentNode.parentNode.classList.contains(\"Nav__item--open\")) {\n toggleSubMenu({ target });\n }\n}\n\n// Some navigations just have sub-pages without having a page by themselves\nconst ajNav = document.querySelectorAll(\".Nav__item__link--nopage\");\nfor (const navItem of ajNav) {\n navItem.addEventListener(\"click\", toggleSubMenu);\n}\n"],"names":["codeBlocks","document","querySelectorAll","toggleCodeSection","querySelector","LOCAL_STORAGE_KEY","setCodeBlockStyle","hidden","a","length","classList","toggle","localStorage","setItem","e","toggleCodeBlockBtnSet","addEventListener","ev","target","checked","getItem","enableToggler","add","trigger","content","contains","style","height","remove","setAttribute","transitionDuration","scrollHeight","head","getElementsByTagName","script","createElement","type","async","src","window","base_url","onload","forEach","call","hljs","highlightBlock","appendChild","toggleSubMenu","isEvent","undefined","preventDefault","parent","start","elem","parentNode","nodeType","Error","findNavItem","subNav","setHeightToAuto","removeEventListener","navItems","i","ajNav"],"mappings":"AAAA,IAAMA,EAAaC,SAASC,iBAAiB,kBACvCC,EAAoBF,SAASG,cAAc,gBAE3CC,EAAoB,0BAE1B,SAASC,EAAkBC,OAClB,IAAIC,EAAI,EAAGA,EAAIR,EAAWS,OAAQD,IACnCR,EAAWQ,GAAGE,UAAUC,OAAO,SAAUJ,OAGzCK,aAAaC,QAAQR,EAAmBE,GAC1C,MAAOO,KAqCTX,IACIH,EAAWS,OAjCnB,eACUM,EAAwBZ,EAAkBC,cAC5C,8BAGJW,EAAsBC,iBAClB,UACA,SAAAC,GACIX,GAAmBW,EAAGC,OAAOC,YAEjC,OAGAZ,GAAS,MAIM,WAFfA,EAASK,aAAaQ,QAAQf,IAG1BE,GAAS,EACS,SAAXA,IACPA,GAAS,GAGTA,IACAD,IAAoBC,GACpBQ,EAAsBI,SA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