Spaces:
Paused
Paused
Download js/dark_theme.js from bicheichane/testing123: direct link, hf CLI and curl.
- Browser
- Download file 797 Bytes
-
https://huggingface.co/spaces/bicheichane/testing123/resolve/main/js/dark_theme.js
- Command line
-
hf download hf://spaces/bicheichane/testing123/js/dark_theme.js
-
curl -L -o dark_theme.js https://huggingface.co/spaces/bicheichane/testing123/resolve/main/js/dark_theme.js
797 Bytes
| function toggleDarkMode() { | |
| document.body.classList.toggle("dark"); | |
| var currentCSS = document.getElementById("highlight-css"); | |
| if (currentCSS.getAttribute("href") === "file/css/highlightjs/github-dark.min.css") { | |
| currentCSS.setAttribute("href", "file/css/highlightjs/github.min.css"); | |
| } else { | |
| currentCSS.setAttribute("href", "file/css/highlightjs/github-dark.min.css"); | |
| } | |
| // Re-highlight all code blocks once stylesheet loads | |
| currentCSS.onload = function() { | |
| const messageBodies = document.getElementById("chat").querySelectorAll(".message-body"); | |
| messageBodies.forEach((messageBody) => { | |
| const codeBlocks = messageBody.querySelectorAll("pre code"); | |
| codeBlocks.forEach((codeBlock) => { | |
| hljs.highlightElement(codeBlock); | |
| }); | |
| }); | |
| }; | |
| } | |