123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- {{/* Copyright Materialize, Inc. All rights reserved. Use of this software is
- governed by the Business Source License included in the LICENSE file at the root
- of this repository. As of the Change Date specified in that file, in accordance
- with the Business Source License, use of this software will be governed by the
- Apache License, Version 2.0. */}}
- <!DOCTYPE html>
- <html>
- <head>
- {{ partial "head.html" . }}
- </head>
- <body>
- <script>
- const theme = localStorage.getItem("theme");
- const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
- if (theme === null) {
- localStorage.setItem("theme", "system");
- if (darkMediaQuery.matches) {
- document.body.classList.add("dark");
- } else {
- document.body.classList.add("light");
- }
- } else if (theme === "dark") {
- document.body.classList.add("dark");
- } else if (theme === "light") {
- document.body.classList.add("light");
- } else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
- document.body.classList.add("dark");
- } else {
- document.body.classList.add("light");
- }
- </script>
- <!-- If a page uses supportlevel svg icons, embed them inline
- so they can be referenced via <use> tags. -->
- {{ if in .Page.RawContent "supportLevel" }} {{ partial "inline-svgs.html"}}
- {{ end }} {{ partial "header.html" . }} {{ block "body" .}}
- <div class="content-wrapper">
- {{ partial "sidebar.html" . }}
- <main
- class="content {{ if .Params.make_table_row_headers_searchable }} docsearch_index_table_headers {{ end }}"
- >
- <button class="show-topics" aria-label="Open the topics sidebar">
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="ionicon"
- viewBox="0 0 512 512"
- >
- <title>Arrow Pointing to the left</title>
- <path
- fill="none"
- stroke="currentColor"
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="48"
- d="M328 112L184 256l144 144"
- />
- </svg>
- All Topics
- </button>
- <div>
- {{ partial "breadcrumbs.html" . }} {{ block "main" . }}{{ end }}
- </div>
- <a href="#top" class="back-to-top">Back to top ↑</a>
- <!-- Footer goes in main so the border-right of
- sidebar.html can extend to the bottom of the page. -->
- {{ partial "footer.html" . }}
- </main>
- {{ partial "toc.html" . }}
- </div>
- {{ end }}
- <div class="backdrop"></div>
- <script>
- /* Add anchor links to headings */
- anchors.add(
- ".content h2, .content h3, .content h4, .content h5, .content h6, .heading"
- );
- /* Copy anchor links to clipboard on click */
- document.addEventListener("click", function (e) {
- const target = e.target;
- if (target.classList.contains("anchorjs-link")) {
- const initialIcon = e.target.getAttribute("data-anchorjs-icon");
- e.target.setAttribute("data-anchorjs-icon", "\u2713");
- setTimeout(() => {
- e.target.setAttribute("data-anchorjs-icon", initialIcon);
- }, 1000);
- e.preventDefault();
- const copyText = target.href;
- window.location.assign(target.href);
- navigator.clipboard
- .writeText(copyText)
- .then(() => {
- // Successful copy
- console.log("Text copied to clipboard: " + copyText);
- })
- .catch((error) => {
- // Error occurred
- console.error("Failed to copy text: " + error);
- });
- }
- });
- $(".content ol:has(p)").addClass("has-p");
- /* Make external links open in new tabs */
- $('a[href*="//"]:not([href*="materialize.com"])').attr({
- target: "_blank",
- title: "External Link",
- });
- /* Add "Click to Copy" button to code blocks */
- $(document).ready(function () {
- $("pre.chroma").append(
- '<button class="default_button copy_button" title="Copy code to clipboard">Copy</button>'
- );
- $("pre.chroma button.copy_button").click(function (e) {
- var _this = $(this),
- copyHex = document.createElement("textarea");
- copyHex.value = _this.parent().find("code").text().trim();
- document.body.appendChild(copyHex);
- copyHex.select();
- document.execCommand("copy");
- document.body.removeChild(copyHex);
- _this.addClass("success").text("Copied");
- setTimeout(function () {
- _this.removeClass("success").text("Copy");
- }, 1000);
- window.analytics && window.analytics.track('Button Clicked');
- });
- });
- // Add click handlers for all top-level items with children.
- const menus = $("nav[role=navigation] li.has-children");
- menus.find("a:not([href])").click((e) => {
- $(e.target).parents("li").first().toggleClass("open");
- e.preventDefault();
- return false;
- });
- // When an item is already active, and it's clicked, just collapse it
- menus.find("a.active").click((e) => {
- $(e.target).parents("li").first().toggleClass("open");
- e.preventDefault();
- return false;
- });
- // Open the submenu containing the current page by default.
- menus.has(".active").addClass("open");
- //Scroll the sidebar to the active element
- $(".sidebar").scrollTop(
- $(".sidebar .active").offset().top - $(window).height() / 2
- );
- </script>
- <script>
- const menuToggle = document.querySelector("nav .toggle");
- const mobileLinks = document.querySelector(".mobile");
- const sidebarOpenButton = document.querySelector("button.show-topics");
- const sidebarCloseButton = document.querySelector("button.close-topics");
- const sidebarWrapper = document.querySelector(".sidebar-wrapper");
- const backdrop = document.querySelector(".backdrop");
- const allTables = document.querySelectorAll("table");
- allTables.forEach((table) => {
- table.outerHTML = `<div class="table-container">${table.outerHTML}</div>`;
- });
- const toggleBodyOverflow = (boolean) => {
- if (boolean) {
- document.documentElement.style.overflowY = "scroll";
- } else {
- document.documentElement.style.overflowY = "hidden";
- }
- };
- sidebarOpenButton.addEventListener("click", () => {
- sidebarWrapper.classList.add("shown");
- backdrop.style.display = "block";
- toggleBodyOverflow(false);
- });
- const closeSidebar = () => {
- sidebarWrapper.classList.remove("shown");
- backdrop.style.display = "none";
- toggleBodyOverflow(true);
- };
- sidebarCloseButton.addEventListener("click", () => {
- closeSidebar();
- });
- backdrop.addEventListener("click", () => {
- closeSidebar();
- });
- menuToggle.addEventListener("click", () => {
- menuToggle.classList.toggle("open");
- if (menuToggle.classList.contains("open")) {
- mobileLinks.style.display = "block";
- toggleBodyOverflow(false);
- } else {
- mobileLinks.style.display = "none";
- toggleBodyOverflow(true);
- }
- });
- const query = window.matchMedia("(max-width: 850px)");
- query.addEventListener("change", (e) => {
- if (!e.matches) {
- mobileLinks.style.display = "none";
- menuToggle.classList.remove("open");
- toggleBodyOverflow(true);
- backdrop.style.display = "none";
- }
- });
- const systemButton = document.querySelector("button.system");
- const lightButton = document.querySelector("button.light");
- const darkButton = document.querySelector("button.dark");
- const highlightButton = (theme) => {
- [systemButton, lightButton, darkButton].forEach((button) => {
- if ([...button.classList].includes(theme)) {
- button.classList.add("active");
- } else {
- button.classList.remove("active");
- }
- });
- };
- highlightButton(theme);
- darkMediaQuery.addEventListener("change", () => {
- const storedTheme = localStorage.getItem("theme");
- if (storedTheme === "system") {
- highlightButton(storedTheme);
- if (darkMediaQuery.matches) {
- document.body.classList.replace("light", "dark");
- } else {
- document.body.classList.replace("dark", "light");
- }
- }
- });
- systemButton.addEventListener("click", () => {
- if (darkMediaQuery.matches) {
- document.body.classList.replace("light", "dark");
- } else {
- document.body.classList.replace("dark", "light");
- }
- localStorage.setItem("theme", "system");
- highlightButton("system");
- });
- lightButton.addEventListener("click", () => {
- document.body.classList.replace("dark", "light");
- localStorage.setItem("theme", "light");
- highlightButton("light");
- });
- darkButton.addEventListener("click", () => {
- document.body.classList.replace("light", "dark");
- localStorage.setItem("theme", "dark");
- highlightButton("dark");
- });
- const allLinks = document.querySelectorAll("a");
- console.log(allLinks.length);
- allLinks.forEach((link) => {
- const firstChild = link.children[0];
- if (firstChild) {
- if (firstChild.nodeName === "CODE") {
- link.classList.add("link-with-code");
- }
- }
- });
- const preferenceButton = document.querySelector("#cookie-preference");
- preferenceButton.addEventListener("click", () => {
- window.Osano.cm.showDrawer('osano-cm-dom-info-dialog-open');
- })
- </script>
- </body>
- </html>
|