Added server setting to force day/night mode, #3618

This commit is contained in:
Ylian Saint-Hilaire
2022-02-08 10:13:52 -08:00
parent fe7fe29831
commit f7b2406e8d
4 changed files with 14 additions and 1 deletions

View File

@@ -1645,6 +1645,9 @@
// Fix links
if (urlargs.key) { Q('p6backuplink').href += '?key=' + urlargs.key; }
// Hide night mode button if needed
QV('uiViewButton4', (features2 & 0x00300000) == 0);
// Fix HTML words that in english have two or more meanings
Q('DeskType').value = multiTranslate("[KeyboardTyping]|Type");
}
@@ -1923,6 +1926,8 @@
// Set night mode
var nNightMode = getstore('nightMode', '0')
nightMode = false;
if ((features2 & 0x00100000) != 0) { nNightMode = '1'; }
if ((features2 & 0x00200000) != 0) { nNightMode = '2'; }
if (nNightMode == '1') { nightMode = true; }
else if ((nNightMode == '0') && (window.matchMedia)) { nightMode = window.matchMedia('(prefers-color-scheme: dark)').matches }
if (nightMode) { QC('body').add('night'); QS('body')['background-color'] = '#000'; } else { QC('body').remove('night'); QS('body')['background-color'] = '#d3d9d6'; }