diff options
Diffstat (limited to 'development/c++filt.html')
-rw-r--r-- | development/c++filt.html | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/development/c++filt.html b/development/c++filt.html index 4a69661..b35da72 100644 --- a/development/c++filt.html +++ b/development/c++filt.html @@ -31,10 +31,11 @@ <!-- Custom theme stylesheets --> - <!-- Provide site root to javascript --> + <!-- Provide site root and default themes to javascript --> <script> - var path_to_root = "../"; - var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light"; + const path_to_root = "../"; + const default_light_theme = "light"; + const default_dark_theme = "navy"; </script> <!-- Start loading toc.js asap --> <script src="../toc.js"></script> @@ -44,8 +45,8 @@ <!-- Work around some values being stored in localStorage wrapped in quotes --> <script> try { - var theme = localStorage.getItem('mdbook-theme'); - var sidebar = localStorage.getItem('mdbook-sidebar'); + let theme = localStorage.getItem('mdbook-theme'); + let sidebar = localStorage.getItem('mdbook-sidebar'); if (theme.startsWith('"') && theme.endsWith('"')) { localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1)); @@ -59,7 +60,8 @@ <!-- Set the theme before any content is loaded, prevents flash --> <script> - var theme; + const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme; + let theme; try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { } if (theme === null || theme === undefined) { theme = default_theme; } const html = document.documentElement; @@ -72,8 +74,8 @@ <!-- Hide / unhide sidebar before it is displayed --> <script> - var sidebar = null; - var sidebar_toggle = document.getElementById("sidebar-toggle-anchor"); + let sidebar = null; + const sidebar_toggle = document.getElementById("sidebar-toggle-anchor"); if (document.body.clientWidth >= 1080) { try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { } sidebar = sidebar || 'visible'; @@ -109,6 +111,7 @@ <i class="fa fa-paint-brush"></i> </button> <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu"> + <li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li> <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li> <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li> |