Merge "Revert "The new class should be present alongside the old class for all page views""

This commit is contained in:
jenkins-bot 2024-03-20 16:15:18 +00:00 committed by Gerrit Code Review
commit 978702f3be
3 changed files with 0 additions and 23 deletions

View file

@ -1,20 +0,0 @@
const LEGACY_NIGHT = 'skin-night-mode-clientpref-1';
const LEGACY_AUTO = 'skin-night-mode-clientpref-2';
const THEME_NIGHT = 'skin-theme-clientpref-night';
const THEME_AUTO = 'skin-theme-clientpref-os';
/**
* Prepares for rename in T359983. Ensures that the new classes are present in the DOM on page load.
* Since the controls for mobile are only on Special:MobileOptions we only worry about page load and
* assume they won't change later on.
*/
module.exports = function nightModeClasses() {
const node = document.documentElement;
if ( node.classList.contains( LEGACY_AUTO ) ) {
node.classList.add( THEME_AUTO );
}
if ( node.classList.contains( LEGACY_NIGHT ) ) {
node.classList.add( THEME_NIGHT );
}
};

View file

@ -3,7 +3,6 @@
* It should run without errors even if MobileFrontend is not installed. * It should run without errors even if MobileFrontend is not installed.
*/ */
var ms = require( 'mobile.startup' ), var ms = require( 'mobile.startup' ),
nightModeClasses = require( './nightModeClasses.js' ),
reportIfNightModeWasDisabledOnPage = require( './reportIfNightModeWasDisabledOnPage.js' ), reportIfNightModeWasDisabledOnPage = require( './reportIfNightModeWasDisabledOnPage.js' ),
addPortletLink = require( './addPortletLink.js' ), addPortletLink = require( './addPortletLink.js' ),
teleportTarget = require( 'mediawiki.page.ready' ).teleportTarget; teleportTarget = require( 'mediawiki.page.ready' ).teleportTarget;
@ -43,7 +42,6 @@ function init() {
reportIfNightModeWasDisabledOnPage( reportIfNightModeWasDisabledOnPage(
document.documentElement, mw.user.options, mw.user.isNamed() document.documentElement, mw.user.options, mw.user.isNamed()
); );
nightModeClasses();
} }
init(); init();

View file

@ -519,7 +519,6 @@
}, },
"packageFiles": [ "packageFiles": [
"resources/skins.minerva.scripts/setup.js", "resources/skins.minerva.scripts/setup.js",
"resources/skins.minerva.scripts/nightModeClasses.js",
"resources/skins.minerva.scripts/reportIfNightModeWasDisabledOnPage.js", "resources/skins.minerva.scripts/reportIfNightModeWasDisabledOnPage.js",
"resources/skins.minerva.scripts/addPortletLink.js", "resources/skins.minerva.scripts/addPortletLink.js",
"resources/skins.minerva.scripts/initMobile.js", "resources/skins.minerva.scripts/initMobile.js",