MediaWiki:Gadget-dark-mode-toggle.js explained

/** * Enables or disables the dark-mode gadget. * * Authors:, */

// 'Dark mode' and 'Light mode' messages must match the ::before content in// and, respectively.// Don't overwrite existing messages, if already set on a foreign wiki prior to loading this fileif (!mw.messages.get('darkmode-turn-on-label'))

var isOn = mw.loader.getState('ext.gadget.dark-mode')

'ready';

var broadcastChannel = new BroadcastChannel('gadget-dark-mode');

function setThemeColor

function setHtmlClass

function vectorStickyCallback

function addPortlets

function getMsg(suffix)

function makePortletLink(portletId, portletLinkId, nextnode)

function togglePortlets

function actuallyToggleDarkMode

function savePreference

function savePreferenceLocally

function notifyOtherTabs

function toggleMode(offline)

function toggleBasedOnSystemColourScheme

$.when($.ready, mw.loader.using(['mediawiki.util', 'mediawiki.api', 'mediawiki.Uri', 'mediawiki.storage'])).then(function);