diff options
| author | Martin Fischer <martin@push-f.com> | 2025-08-16 21:28:57 +0200 | 
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2025-08-16 22:32:40 +0200 | 
| commit | 38871393ba1658bd0b8aac4f88c4159271502d63 (patch) | |
| tree | 731e87e5b3421d58e1e4a62076eba4e928c64922 /static | |
| parent | 4428200fa4181e5c26253bf8c67cda86951ec754 (diff) | |
fix: remove copy buttons
Diffstat (limited to 'static')
| -rw-r--r-- | static/js/copy-code.js | 34 | 
1 files changed, 0 insertions, 34 deletions
| diff --git a/static/js/copy-code.js b/static/js/copy-code.js deleted file mode 100644 index 2de3cda..0000000 --- a/static/js/copy-code.js +++ /dev/null @@ -1,34 +0,0 @@ -document.addEventListener("DOMContentLoaded", function () { -  const codeBlocks = document.querySelectorAll("pre"); - -  codeBlocks.forEach((codeBlock) => { -    if (codeBlock.className == "mermaid") return; -    const copyButton = document.createElement("button"); -    copyButton.className = "copy-code-button"; -    copyButton.textContent = "copy"; - -    // Insert the button inside the <pre> block -    codeBlock.appendChild(copyButton); - -    copyButton.addEventListener("click", function () { -      const code = codeBlock.querySelector("code"); -      // Get the code content -      const textToCopy = code.textContent || code.innerText; - -      // Use the Clipboard API to copy the text -      navigator.clipboard -        .writeText(textToCopy) -        .then(() => { -          // Change button text to "Copied" -          copyButton.textContent = "copied"; - -          setTimeout(() => { -            copyButton.textContent = "copy"; -          }, 2000); // Reset the button text after 2 seconds -        }) -        .catch((err) => { -          console.error("Unable to copy text:", err); -        }); -    }); -  }); -}); | 
