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
This commit is contained in:
bwang 2021-10-26 16:19:58 -05:00 committed by Jdlrobson
parent ce6802b4b6
commit a2d065c062
4 changed files with 9 additions and 4 deletions

View file

@ -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
) {

View file

@ -50,10 +50,12 @@
<div class="banner-container">
{{>banners}}
</div>
{{#html-user-message}}
<div class="minerva-anon-talk-message warningbox">
<span class="mw-ui-icon mw-ui-icon-wikimedia-userTalk-warning"> </span>
{{{html-user-message}}}
</div>
{{/html-user-message}}
<div class="pre-content heading-holder">
<div class="page-heading">
{{{headinghtml}}}

View file

@ -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;
}

View file

@ -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",