diff options
author | flywind <xzsflywind@gmail.com> | 2022-04-09 23:50:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-09 17:50:57 +0200 |
commit | ded8b0e5410518ffed24b46565eb6e42f18a63f1 (patch) | |
tree | b58e13d7f60168d518a248cb08f1397ce8997478 /nimdoc/rst2html | |
parent | 00775f6880733695d187d84bb742e8c9d6c65d6d (diff) | |
download | Nim-ded8b0e5410518ffed24b46565eb6e42f18a63f1.tar.gz |
rewrite docs JS in Nim (#19701)
* rewrite docs JS in Nim * fixup * fix nimdoc/rsttester
Diffstat (limited to 'nimdoc/rst2html')
-rw-r--r-- | nimdoc/rst2html/expected/rst_examples.html | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/nimdoc/rst2html/expected/rst_examples.html b/nimdoc/rst2html/expected/rst_examples.html index 1df91ff1f..2b5218d9f 100644 --- a/nimdoc/rst2html/expected/rst_examples.html +++ b/nimdoc/rst2html/expected/rst_examples.html @@ -22,49 +22,6 @@ <script type="text/javascript" src="dochack.js"></script> -<script type="text/javascript"> -function main() { - var pragmaDots = document.getElementsByClassName("pragmadots"); - for (var i = 0; i < pragmaDots.length; i++) { - pragmaDots[i].onclick = function(event) { - // Hide tease - event.target.parentNode.style.display = "none"; - // Show actual - event.target.parentNode.nextElementSibling.style.display = "inline"; - } - } - - function switchTheme(e) { - if (e.target.checked) { - document.documentElement.setAttribute('data-theme', 'dark'); - localStorage.setItem('theme', 'dark'); - } else { - document.documentElement.setAttribute('data-theme', 'light'); - localStorage.setItem('theme', 'light'); - } - } - - const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]'); - if (toggleSwitch !== null) { - toggleSwitch.addEventListener('change', switchTheme, false); - } - - var currentTheme = localStorage.getItem('theme'); - if (!currentTheme && window.matchMedia('(prefers-color-scheme: dark)').matches) { - currentTheme = 'dark'; - } - if (currentTheme) { - document.documentElement.setAttribute('data-theme', currentTheme); - - if (currentTheme === 'dark' && toggleSwitch !== null) { - toggleSwitch.checked = true; - } - } -} - -window.addEventListener('DOMContentLoaded', main); -</script> - </head> <body> <div class="document" id="documentId"> |