From a2d065c062ff047bed63afddd44cf5f76fae19ad Mon Sep 17 00:00:00 2001 From: bwang Date: Tue, 26 Oct 2021 16:19:58 -0500 Subject: [PATCH] Update anon talk messages to show on non-main namespaces - Loads messageBox styles on non-main namespaces - Add messageBox styles to 'skins.minerva.scripts' module for MobileFrontend's edit overlay page - Prevent warning box from showing with empty message Bug: T284642 Change-Id: I70d0d86671384210cc3ab43cb1d350ff2a862fd9 --- includes/MinervaHooks.php | 4 +++- includes/Skins/skin.mustache | 2 ++ resources/skins.minerva.base.styles/anonTalkMessage.less | 6 +++--- skin.json | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/MinervaHooks.php b/includes/MinervaHooks.php index 4ab924544..e00496f56 100644 --- a/includes/MinervaHooks.php +++ b/includes/MinervaHooks.php @@ -366,18 +366,20 @@ class MinervaHooks { * - special pages * - edit workflow (action=edit and action=submit) * - when viewing old revisions + * - non-main namespaces for anon talk page messages * * @param OutputPage $out */ private static function addMessageBoxStylesToPage( OutputPage $out ) { $request = $out->getRequest(); + $title = $out->getTitle(); // Warning box styles are needed when reviewing old revisions // and inside the fallback editor styles to action=edit page. $requestAction = $request->getVal( 'action' ); $viewAction = $requestAction === null || $requestAction === 'view'; if ( - $out->getTitle()->isSpecialPage() || + $title->getNamespace() !== NS_MAIN || $request->getText( 'oldid' ) || !$viewAction ) { diff --git a/includes/Skins/skin.mustache b/includes/Skins/skin.mustache index 010d71e66..d15221156 100644 --- a/includes/Skins/skin.mustache +++ b/includes/Skins/skin.mustache @@ -50,10 +50,12 @@ + {{#html-user-message}}
{{{html-user-message}}}
+ {{/html-user-message}}
{{{headinghtml}}} diff --git a/resources/skins.minerva.base.styles/anonTalkMessage.less b/resources/skins.minerva.base.styles/anonTalkMessage.less index 2abfb7a67..d47ef369c 100644 --- a/resources/skins.minerva.base.styles/anonTalkMessage.less +++ b/resources/skins.minerva.base.styles/anonTalkMessage.less @@ -1,5 +1,4 @@ .minerva-anon-talk-message.warningbox { - display: none; margin-top: 16px; margin-bottom: 0; @@ -13,6 +12,7 @@ } } -.ns-special .minerva-anon-talk-message { - display: block; +// Hide on all non-main namespaces +.ns-0 .minerva-anon-talk-message { + display: none; } diff --git a/skin.json b/skin.json index dee19f137..7316908f8 100644 --- a/skin.json +++ b/skin.json @@ -517,6 +517,7 @@ "skins.minerva.icons.page.issues.uncolored", "skins.minerva.icons.page.issues.default.color", "skins.minerva.icons.page.issues.medium.color", + "skins.minerva.messageBox.styles", "mediawiki.util", "mediawiki.router", "mediawiki.Title",