()
| 50 | // The button is rendered asynchronously by Mustache templates loaded via AJAX, |
| 51 | // so we use a MutationObserver to catch it. |
| 52 | function updateThemeButtonLabel() { |
| 53 | var current = document.documentElement.getAttribute('data-bs-theme') || 'light'; |
| 54 | var btn = document.getElementById('theme-toggle-btn'); |
| 55 | if (btn) { |
| 56 | btn.value = (current === 'dark') ? 'Light Mode' : 'Dark Mode'; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | (function() { |
| 61 | var observer = new MutationObserver(function() { updateThemeButtonLabel(); }); |