View source for MediaWiki:Gadget-dark-mode-toggle.js
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
/**
* Enables or disables the dark-mode gadget.
*
* Authors: [[User:SD0001]], [[User:Nardog]]
*/
// 'Dark mode' and 'Light mode' messages must match the ::before content in
// [[MediaWiki:Gadget-dark-mode-toggle-pagestyles.css]] and [[MediaWiki:Gadget-dark-mode.css]], respectively.
// Don't overwrite existing messages, if already set on a foreign wiki prior to loading this file
if (!mw.messages.get('darkmode-turn-on-label')) {
mw.messages.set({
'darkmode-turn-on-label': 'Dark mode',
'darkmode-turn-on-tooltip': 'Turn dark mode on',
'darkmode-turn-off-label': 'Light mode',
'darkmode-turn-off-tooltip': 'Turn dark mode off',
});
}
var isOn = mw.loader.getState('ext.gadget.dark-mode') === 'ready';
var broadcastChannel = new BroadcastChannel('gadget-dark-mode');
000
1:0
Return to MediaWiki:Gadget-dark-mode-toggle.js.