From c82cd6dee0109cf67128a9963ec5398d32d2c884 Mon Sep 17 00:00:00 2001 From: Abijeet Date: Wed, 3 Jul 2024 18:32:19 +0530 Subject: [PATCH] Drop support for MW 1.40 Bug: T369064 Change-Id: Id3dde7df0fe963a35c68ff5b6bdf56a268eacc6e --- extension.json | 2 +- includes/Hooks.php | 12 +++--------- resources/js/ext.uls.interface.js | 4 +--- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/extension.json b/extension.json index 23023abe..0f595f7d 100644 --- a/extension.json +++ b/extension.json @@ -18,7 +18,7 @@ "descriptionmsg": "uls-desc", "license-name": "GPL-2.0-or-later OR MIT", "requires": { - "MediaWiki": ">= 1.40.0" + "MediaWiki": ">= 1.41.0" }, "Hooks": { "BeforePageDisplay": "main", diff --git a/includes/Hooks.php b/includes/Hooks.php index 6b69265a..6ca033e3 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -153,15 +153,9 @@ class Hooks implements * @param OutputPage $out */ private function loadCodexStyles( OutputPage $out ) { - if ( version_compare( MW_VERSION, '1.41', '<' ) ) { - // codex-search-styles was added in 1.41 so in older versions for MLEB support - // we load the full module. - $out->addModuleStyles( '@wikimedia/codex' ); - } else { - // Only needed for skins that do not load Codex. - if ( !in_array( $out->getSkin()->getSkinName(), [ 'minerva', 'vector-2022' ] ) ) { - $out->addModuleStyles( 'codex-search-styles' ); - } + // Only needed for skins that do not load Codex. + if ( !in_array( $out->getSkin()->getSkinName(), [ 'minerva', 'vector-2022' ] ) ) { + $out->addModuleStyles( 'codex-search-styles' ); } } diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index feb9217c..d702d566 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -196,9 +196,7 @@ } function userCanChangeLanguage() { - return mw.config.get( 'wgULSAnonCanChangeLanguage' ) || - // mw.user.isNamed() added in MW 1.40. Remove after MLEB drop support for MW < 1.40 - ( typeof mw.user.isNamed === 'function' ? mw.user.isNamed() : !mw.user.isAnon() ); + return mw.config.get( 'wgULSAnonCanChangeLanguage' ) || mw.user.isNamed(); } /**