Skip to content

Latest commit

 

History

History
60 lines (51 loc) · 1.46 KB

settings.md

File metadata and controls

60 lines (51 loc) · 1.46 KB
layout title permalink
default
Settings
/settings
<script> var td = { DEBUG: false, log(what) { if (this.DEBUG) { console.log(what); } } }; </script>

Theme: (default) Light Dark

<script> var updateDesc = function (theme) { var desc = { system: 'Dark or light theme is chosen based on browser or system preferences.', dark: 'Dark theme is enabled for all pages.', light: 'Light theme is enabled for all pages.' }; document.getElementById('theme-description').textContent = desc[theme]; } var updateTheme = function (elem) { var v = elem.value; td.log('update: ' + v); DARKMODE.override(v === 'system' ? null : v); updateDesc(v); }; var updateSelect = function () { var cur = DARKMODE.getOverride() || 'system'; document.getElementById('theme-select').value = cur; updateDesc(cur); }; window.addEventListener('DOMContentLoaded', function() { if (!DARKMODE.lsOk()) { document.getElementById('theme-select').disabled = true; document.getElementById('theme-description').textContent = 'Can\'t set theme because localStorage is not working'; } else { updateSelect(); } }); </script>