1 line
12 KiB
Plaintext
1 line
12 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\nfunction setCodeBlockStyle(\n codeBlockState,\n toggleCodeBlockBtnList,\n toggleCodeBlockBtnFloat,\n toggleCodeBlockBtnBelow,\n toggleCodeBlockBtnHide,\n codeBlockView\n) {\n for (let a = 0; a < toggleCodeBlockBtnList.length; a++) {\n toggleCodeBlockBtnList[a].classList.remove(\"Button--active\");\n }\n let hidden;\n switch (codeBlockState) {\n case true: // Show code blocks below (flowed); checkbox\n hidden = false;\n break;\n case false: // Hidden code blocks; checkbox\n hidden = true;\n break;\n case 2: // Show code blocks inline (floated)\n toggleCodeBlockBtnFloat.classList.add(\"Button--active\");\n codeBlockView.classList.add(\"Columns__right--float\");\n codeBlockView.classList.remove(\"Columns__right--full\");\n hidden = false;\n break;\n case 1: // Show code blocks below (flowed)\n case \"checked\":\n toggleCodeBlockBtnBelow.classList.add(\"Button--active\");\n codeBlockView.classList.remove(\"Columns__right--float\");\n codeBlockView.classList.add(\"Columns__right--full\");\n hidden = false;\n break;\n case 0: // Hidden code blocks\n default:\n toggleCodeBlockBtnHide.classList.add(\"Button--active\");\n codeBlockView.classList.remove(\"Columns__right--float\");\n codeBlockView.classList.add(\"Columns__right--full\");\n hidden = true;\n break;\n }\n for (let a = 0; a < codeBlocks.length; a++) {\n if (hidden) {\n codeBlocks[a].classList.add(\"Hidden\");\n } else {\n codeBlocks[a].classList.remove(\"Hidden\");\n }\n }\n try {\n localStorage.setItem(\"codeBlockState\", +codeBlockState);\n } catch (e) {\n // local storage operations can fail with the file:// protocol\n }\n}\n\nfunction enableToggler() {\n const toggleCodeBlockBtnList = toggleCodeSection.querySelectorAll(\n \".CodeToggler__button\"\n );\n const toggleCodeBlockBtnSet = toggleCodeSection.querySelector(\n \".CodeToggler__button--main\"\n ); // available when floating is disabled\n const toggleCodeBlockBtnHide = toggleCodeSection.querySelector(\n \".CodeToggler__button--hide\"\n );\n const toggleCodeBlockBtnBelow = toggleCodeSection.querySelector(\n \".CodeToggler__button--below\"\n );\n const toggleCodeBlockBtnFloat = toggleCodeSection.querySelector(\n \".CodeToggler__button--float\"\n );\n const codeBlockView = document.querySelector(\".Columns__right\");\n const floating = document.body.classList.contains(\"with-float\");\n\n const setStyle = style => {\n setCodeBlockStyle(\n style,\n toggleCodeBlockBtnList,\n toggleCodeBlockBtnFloat,\n toggleCodeBlockBtnBelow,\n toggleCodeBlockBtnHide,\n codeBlockView\n );\n };\n\n if (floating) {\n toggleCodeBlockBtnHide.addEventListener(\n \"click\",\n () => {\n setStyle(0);\n },\n false\n );\n toggleCodeBlockBtnBelow.addEventListener(\n \"click\",\n () => {\n setStyle(1);\n },\n false\n );\n toggleCodeBlockBtnFloat.addEventListener(\n \"click\",\n () => {\n setStyle(2);\n },\n false\n );\n } else {\n toggleCodeBlockBtnSet.addEventListener(\n \"change\",\n ev => {\n setStyle(ev.target.checked);\n },\n false\n );\n }\n\n let codeBlockState = null;\n try {\n codeBlockState = localStorage.getItem(\"codeBlockState\");\n } catch (e) {\n // local storage operations can fail with the file:// protocol\n }\n\n if (codeBlockState) {\n codeBlockState = parseInt(codeBlockState, 10);\n } else {\n codeBlockState = floating ? 2 : 1;\n }\n\n if (!floating) {\n codeBlockState = !!codeBlockState;\n }\n\n setCodeBlockStyle(\n codeBlockState,\n toggleCodeBlockBtnList,\n toggleCodeBlockBtnFloat,\n toggleCodeBlockBtnBelow,\n toggleCodeBlockBtnHide,\n codeBlockView\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 } else {\n content.style.transitionDuration = `${Math.max(\n content.scrollHeight,\n 150\n )}ms`;\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}_libraries/highlight.pack.js`;\n script.onload = function(src) {\n [].forEach.call(codeBlocks, window.hljs.highlightBlock);\n };\n head.appendChild(script);\n}\n","function 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\nfunction toggleSubMenu(ev) {\n if (ev.preventDefault !== undefined) {\n ev.preventDefault();\n }\n\n const parent = ev.target.parentNode.parentNode;\n const subNav = parent.querySelector(\"ul.Nav\");\n\n if (\n ev.preventDefault !== undefined &&\n parent.classList.contains(\"Nav__item--open\")\n ) {\n // Temporarily set the height so the transition can work.\n subNav.style.height = `${subNav.scrollHeight}px`;\n subNav.style.transitionDuration = `${Math.max(\n subNav.scrollHeight,\n 150\n )}ms`;\n subNav.style.height = \"0px\";\n parent.classList.remove(\"Nav__item--open\");\n } else {\n if (ev.preventDefault === undefined) {\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 } else {\n subNav.style.transitionDuration = `${Math.max(\n subNav.scrollHeight,\n 150\n )}ms`;\n // After the transition finishes set the height to auto so child\n // menus can expand properly.\n subNav.addEventListener(\"transitionend\", setHeightToAuto);\n subNav.style.height = `${subNav.scrollHeight}px`;\n parent.classList.add(\"Nav__item--open\");\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, cur; i >= 0; i--) {\n cur = navItems[i];\n cur.addEventListener(\"click\", toggleSubMenu);\n\n if (cur.parentNode.parentNode.classList.contains(\"Nav__item--open\")) {\n toggleSubMenu({ target: cur });\n }\n}\n"],"names":["codeBlocks","document","querySelectorAll","toggleCodeSection","querySelector","setCodeBlockStyle","codeBlockState","toggleCodeBlockBtnList","toggleCodeBlockBtnFloat","toggleCodeBlockBtnBelow","toggleCodeBlockBtnHide","codeBlockView","a","length","classList","remove","hidden","add","localStorage","setItem","e","toggleCodeBlockBtnSet","floating","body","contains","setStyle","style","addEventListener","ev","target","checked","getItem","parseInt","enableToggler","trigger","content","height","transitionDuration","Math","max","scrollHeight","head","getElementsByTagName","script","createElement","type","async","src","window","base_url","onload","forEach","call","hljs","highlightBlock","appendChild","setHeightToAuto","removeEventListener","toggleSubMenu","undefined","preventDefault","parent","parentNode","subNav","cur","navItems","i"],"mappings":"AAAA,IAAMA,EAAaC,SAASC,iBAAiB,kBACvCC,EAAoBF,SAASG,cAAc,gBAEjD,SAASC,EACLC,EACAC,EACAC,EACAC,EACAC,EACAC,OAEK,IAAIC,EAAI,EAAGA,EAAIL,EAAuBM,OAAQD,IAC/CL,EAAuBK,GAAGE,UAAUC,OAAO,sBAE3CC,SACIV,QACC,EACDU,GAAS,aAER,EACDA,GAAS,aAER,EACDR,EAAwBM,UAAUG,IAAI,kBACtCN,EAAcG,UAAUG,IAAI,yBAC5BN,EAAcG,UAAUC,OAAO,wBAC/BC,GAAS,aAER,MACA,UACDP,EAAwBK,UAAUG,IAAI,kBACtCN,EAAcG,UAAUC,OAAO,yBAC/BJ,EAAcG,UAAUG,IAAI,wBAC5BD,GAAS,aAER,UAEDN,EAAuBI,UAAUG,IAAI,kBACrCN,EAAcG,UAAUC,OAAO,y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