diff options
Diffstat (limited to 'development/git.html')
-rw-r--r-- | development/git.html | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/development/git.html b/development/git.html index 89a9d30..2d4295d 100644 --- a/development/git.html +++ b/development/git.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> @@ -404,7 +407,7 @@ history: A - B <nav class="nav-wrapper" aria-label="Page navigation"> <!-- Mobile navigation buttons --> - <a rel="prev" href="../development/gas.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> + <a rel="prev" href="../development/ld.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> <i class="fa fa-angle-left"></i> </a> @@ -418,7 +421,7 @@ history: A - B </div> <nav class="nav-wide-wrapper" aria-label="Page navigation"> - <a rel="prev" href="../development/gas.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> + <a rel="prev" href="../development/ld.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> <i class="fa fa-angle-left"></i> </a> |