Mooeypoo has uploaded a new change for review.
https://gerrit.wikimedia.org/r/297933
Change subject: Load notification badges with the new 'notice' instead of
'message'
......................................................................
Load notification badges with the new 'notice' instead of 'message'
Make sure that all interface instances (css and javascript hooks) are
using the new 'notice' name rather than 'message', so the new
i18n messages work consistently.
Bug: T139520
Change-Id: Ie0fa87babebc05b15bf4bacf94685183bcb6d087
---
M Hooks.php
M modules/ext.echo.init.js
M modules/nojs/mw.echo.badge.less
M modules/nojs/mw.echo.badge.monobook.less
M modules/nojs/mw.echo.badge.vector.less
M modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
M modules/styles/mw.echo.ui.NotificationBadgeWidget.vector.less
M modules/ui/mw.echo.ui.NotificationBadgeWidget.js
M tests/browser/features/support/pages/article_page.rb
9 files changed, 21 insertions(+), 23 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/33/297933/1
diff --git a/Hooks.php b/Hooks.php
index 5c55be5..d50cc38 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -927,7 +927,7 @@
'class' => $msgLinkClasses,
);
- $insertUrls['notifications-message'] = $msgLink;
+ $insertUrls['notifications-notice'] = $msgLink;
$personal_urls = wfArrayInsertAfter( $personal_urls,
$insertUrls, 'userpage' );
diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js
index 67422be..d2bb610 100644
--- a/modules/ext.echo.init.js
+++ b/modules/ext.echo.init.js
@@ -14,7 +14,7 @@
$( document ).ready( function () {
var myWidget, echoApi,
$existingAlertLink = $( '#pt-notifications-alert a' ),
- $existingMessageLink = $( '#pt-notifications-message a'
),
+ $existingMessageLink = $( '#pt-notifications-notice a'
),
numAlerts = $existingAlertLink.text(),
numMessages = $existingMessageLink.text(),
hasUnseenAlerts = $existingAlertLink.hasClass(
'mw-echo-unseen-notifications' ),
diff --git a/modules/nojs/mw.echo.badge.less b/modules/nojs/mw.echo.badge.less
index 6886642..d29f55a 100644
--- a/modules/nojs/mw.echo.badge.less
+++ b/modules/nojs/mw.echo.badge.less
@@ -3,7 +3,7 @@
/* We have to include the #pt-notifications selector due to monobook */
.mw-echo-notifications-badge {
#pt-notifications-alert &,
- #pt-notifications-message & {
+ #pt-notifications-notice & {
font-weight: bold;
cursor: pointer;
text-decoration: none;
@@ -41,7 +41,7 @@
}
}
- #pt-notifications-message & {
+ #pt-notifications-notice & {
margin-left: @badge-distance-adjustment;
body.ltr & + .oo-ui-popupWidget {
diff --git a/modules/nojs/mw.echo.badge.monobook.less
b/modules/nojs/mw.echo.badge.monobook.less
index d4bcd46..f1f2a00 100644
--- a/modules/nojs/mw.echo.badge.monobook.less
+++ b/modules/nojs/mw.echo.badge.monobook.less
@@ -4,7 +4,7 @@
/* We have to include the #pt-notifications selector due to monobook */
.mw-echo-notifications-badge {
#pt-notifications-alert &,
- #pt-notifications-message & {
+ #pt-notifications-notice & {
color: @badge-text-color-idle;
opacity: 0.6;
@@ -23,7 +23,7 @@
#pt-notifications-alert & {
background-color: @badge-background-unseen-alert;
}
- #pt-notifications-message & {
+ #pt-notifications-notice & {
background-color: @badge-background-unseen-message;
}
}
diff --git a/modules/nojs/mw.echo.badge.vector.less
b/modules/nojs/mw.echo.badge.vector.less
index 4452c0f..688aa1c 100644
--- a/modules/nojs/mw.echo.badge.vector.less
+++ b/modules/nojs/mw.echo.badge.vector.less
@@ -4,7 +4,7 @@
/* We have to include the #pt-notifications selector due to monobook */
.mw-echo-notifications-badge {
#pt-notifications-alert &,
- #pt-notifications-message & {
+ #pt-notifications-notice & {
border-radius: 0.2em;
background-color: #d2d2d2;
font-size: 1.125em;
@@ -21,7 +21,7 @@
#pt-notifications-alert & {
background-color: @badge-background-unseen-alert;
}
- #pt-notifications-message & {
+ #pt-notifications-notice & {
background-color: @badge-background-unseen-message;
}
}
diff --git a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
index 4e3a1c7..703991b 100644
--- a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
+++ b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less
@@ -31,6 +31,6 @@
background-color: @badge-background-unseen-alert;
}
-#pt-notifications-message
.mw-echo-notifications-badge.oo-ui-flaggedElement-unseen {
+#pt-notifications-notice
.mw-echo-notifications-badge.oo-ui-flaggedElement-unseen {
background-color: @badge-background-unseen-message;
}
diff --git a/modules/styles/mw.echo.ui.NotificationBadgeWidget.vector.less
b/modules/styles/mw.echo.ui.NotificationBadgeWidget.vector.less
index 6c79900..bd5ea33 100644
--- a/modules/styles/mw.echo.ui.NotificationBadgeWidget.vector.less
+++ b/modules/styles/mw.echo.ui.NotificationBadgeWidget.vector.less
@@ -7,6 +7,6 @@
background-color: @badge-background-unseen-alert;
}
-#pt-notifications-message
.mw-echo-notifications-badge.oo-ui-flaggedElement-unseen {
+#pt-notifications-notice
.mw-echo-notifications-badge.oo-ui-flaggedElement-unseen {
background-color: @badge-background-unseen-message;
}
diff --git a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
index c0619c7..833e094 100644
--- a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
+++ b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
@@ -29,7 +29,10 @@
*/
mw.echo.ui.NotificationBadgeWidget = function
MwEchoUiNotificationBadgeButtonPopupWidget( controller, manager, config ) {
var buttonFlags, allNotificationsButton, preferencesButton,
footerButtonGroupWidget, $footer,
- initialNotifCount, notice;
+ initialNotifCount, notice,
+ getNormalizedMessageNoticeName = function ( typeString
) {
+ return typeString === 'message' ? 'notice' :
typeString;
+ };
config = config || {};
config.links = config.links || {};
@@ -70,9 +73,7 @@
// The following messages can be used here:
// tooltip-pt-notifications-alert
// tooltip-pt-notifications-notice
- title: mw.msg( 'tooltip-pt-notifications-' +
- this.controller.getTypeString() === 'message' ?
'notice' : this.controller.getTypeString()
- ),
+ title: mw.msg( 'tooltip-pt-notifications-' +
getNormalizedMessageNoticeName( this.controller.getTypeString() ) ),
href: config.href
} );
@@ -143,12 +144,7 @@
// echo-notification-alert-text-only
// echo-notification-message-text-only
label: mw.msg(
- 'echo-notification-' +
- (
- this.controller.getTypeString() ===
'message' ?
- 'notice' :
- this.controller.getTypeString()
- ) +
+ 'echo-notification-' +
getNormalizedMessageNoticeName( this.controller.getTypeString() ) +
'-text-only'
),
classes: [
'mw-echo-ui-notificationBadgeButtonPopupWidget-popup' ]
@@ -186,13 +182,15 @@
} );
this.$element
- .prop( 'id', 'pt-notifications-' +
this.controller.getTypeString() )
+ .prop( 'id',
+ 'pt-notifications-' +
getNormalizedMessageNoticeName( this.controller.getTypeString() )
+ )
// The following classes can be used here:
// mw-echo-ui-notificationBadgeButtonPopupWidget-alert
// mw-echo-ui-notificationBadgeButtonPopupWidget-message
.addClass(
'mw-echo-ui-notificationBadgeButtonPopupWidget
' +
-
'mw-echo-ui-notificationBadgeButtonPopupWidget-' +
this.controller.getTypeString()
+
'mw-echo-ui-notificationBadgeButtonPopupWidget-' +
getNormalizedMessageNoticeName( this.controller.getTypeString() )
)
.append(
this.badgeButton.$element,
diff --git a/tests/browser/features/support/pages/article_page.rb
b/tests/browser/features/support/pages/article_page.rb
index 4126fd7..a42f1bf 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -2,5 +2,5 @@
include PageObject
page_section(:alerts, Notifications, css: '#pt-notifications-alert')
- page_section(:messages, Notifications, css: '#pt-notifications-message')
+ page_section(:messages, Notifications, css: '#pt-notifications-notice')
end
--
To view, visit https://gerrit.wikimedia.org/r/297933
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0fa87babebc05b15bf4bacf94685183bcb6d087
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits