From 9b4186d8630c1dec89639bfa23ba094871c9d733 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Thu, 1 Jul 2021 09:31:23 -0700 Subject: [PATCH] Drop MonoBook responsive preference This was moved to a core preference as part of T285402 The migration was handled by a #user-notice Bug: T285402 Change-Id: I25fe3d32ad929924034db06b5a95bab6a3a3a727 --- i18n/en.json | 3 +-- i18n/qqq.json | 3 +-- includes/Hooks.php | 16 ---------------- includes/SkinMonoBook.php | 7 ------- skin.json | 7 ++----- 5 files changed, 4 insertions(+), 32 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index 23e18a0..be3fde8 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -13,6 +13,5 @@ "monobook-more-actions": "More", "monobook-cactions-label": "Page actions", "monobook-notifications-link": "Notifications ($1)", - "monobook-notifications-link-none": "Notifications", - "monobook-responsive-label": "Enable responsive MonoBook design" + "monobook-notifications-link-none": "Notifications" } diff --git a/i18n/qqq.json b/i18n/qqq.json index ebfbc00..7c51220 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -23,6 +23,5 @@ "monobook-more-actions": "Label for the less-important or rarer actions that are hidden from the usual tabs on mobile interfaces (like moving the page, or for sysops deleting or protecting the page). {{Identical|More}}", "monobook-cactions-label": "Header for the content actions menu (tabs on the top of the page)", "monobook-notifications-link": "Label for Extension:Notifications link in mobile personal toolbar\n\nParameters:\n* $1 - number of current alerts/notifications", - "monobook-notifications-link-none": "Label for Extension:Notifications link in mobile personal toolbar when no notifications present\n{{Identical|Notification}}", - "monobook-responsive-label": "Label for preference checkbox" + "monobook-notifications-link-none": "Label for Extension:Notifications link in mobile personal toolbar when no notifications present\n{{Identical|Notification}}" } diff --git a/includes/Hooks.php b/includes/Hooks.php index 9e53108..9e4c5f6 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -24,7 +24,6 @@ namespace MonoBook; use OutputPage; use Skin; -use User; class Hooks { /** @@ -49,19 +48,4 @@ class Hooks { $bodyAttrs['class'] .= ' monobook-capitalize-all-nouns'; } } - - /** - * @param User $user - * @param array &$preferences - */ - public static function onGetPreferences( User $user, array &$preferences ) { - $preferences['monobook-responsive'] = [ - 'type' => 'toggle', - 'label-message' => 'monobook-responsive-label', - 'section' => 'rendering/skin/skin-prefs', - // Only show this section when the Monobook skin is checked. The JavaScript client also uses - // this state to determine whether to show or hide the whole section. - 'hide-if' => [ '!==', 'wpskin', 'monobook' ], - ]; - } } diff --git a/includes/SkinMonoBook.php b/includes/SkinMonoBook.php index 635121c..14def92 100644 --- a/includes/SkinMonoBook.php +++ b/includes/SkinMonoBook.php @@ -34,13 +34,6 @@ use SkinTemplate; * @ingroup Skins */ class SkinMonoBook extends SkinTemplate { - /** - * @inheritDoc - * @return bool - */ - public function isResponsive() { - return parent::isResponsive() || $this->getUser()->getOption( 'monobook-responsive' ); - } /** * @inheritDoc diff --git a/skin.json b/skin.json index 5ba6704..0c9cc26 100644 --- a/skin.json +++ b/skin.json @@ -19,6 +19,7 @@ "args": [ { "name": "monobook", + "responsive": true, "template": "MonoBook\\MonoBookTemplate" } ] @@ -27,15 +28,11 @@ "SkinOOUIThemes": { "monobook": "Apex" }, - "DefaultUserOptions": { - "monobook-responsive": true - }, "SkinLessImportPaths": { "monobook": "resources/mediawiki.less" }, "Hooks": { - "OutputPageBodyAttributes": "MonoBook\\Hooks::onOutputPageBodyAttributes", - "GetPreferences": "MonoBook\\Hooks::onGetPreferences" + "OutputPageBodyAttributes": "MonoBook\\Hooks::onOutputPageBodyAttributes" }, "MessagesDirs": { "MonoBook": [