Merge "Add a tooltip to the notification badges"

This commit is contained in:
jenkins-bot 2015-09-08 21:11:43 +00:00 committed by Gerrit Code Review
commit 582017e82f
7 changed files with 15 additions and 11 deletions

View file

@ -681,7 +681,7 @@ class EchoHooks {
);
$insertUrls = array(
'notifications_alert' => $alertLink,
'notifications-alert' => $alertLink,
);
if ( $notifUser->hasMessages() ) {
@ -692,7 +692,7 @@ class EchoHooks {
'class' => $msgLinkClasses,
);
$insertUrls['notifications_message'] = $msgLink;
$insertUrls['notifications-message'] = $msgLink;
}
$personal_urls = wfArrayInsertAfter( $personal_urls, $insertUrls, 'userpage' );

View file

@ -69,6 +69,8 @@ $wgResourceModules += array(
'echo-notification-alert-text-only',
'echo-notification-message-text-only',
'echo-email-batch-bullet',
'tooltip-pt-notifications-alert',
'tooltip-pt-notifications-message',
'mypreferences'
),
'targets' => array( 'desktop', 'mobile' ),

View file

@ -40,7 +40,8 @@
"echo-no-title": "[No page]",
"echo-error-no-formatter": "No formatting defined for notification.",
"notifications": "Notifications",
"tooltip-pt-notifications": "Your notifications",
"tooltip-pt-notifications-alert": "{{GENDER:|Your}} alerts",
"tooltip-pt-notifications-message": "{{GENDER:|Your}} messages",
"echo-specialpage": "Notifications",
"echo-anon": "To receive notifications, [$1 create an account] or [$2 log in].",
"echo-none": "You have no notifications.",

View file

@ -61,7 +61,8 @@
"echo-no-title": "Shown in place of a page title in a notification if the notification has no specified page title.",
"echo-error-no-formatter": "Error message displayed when no formatting has been defined for a notification. In other words, the extension doesn't know how to properly display the notification.",
"notifications": "{{doc-special|Notifications}}\n{{Identical|Notification}}",
"tooltip-pt-notifications": "This is used for the title (mouseover text) of the notifications user tool.",
"tooltip-pt-notifications-alert": "This is used for the title (mouseover text) of the alert notifications user tool.",
"tooltip-pt-notifications-message": "This is used for the title (mouseover text) of the message notifications user tool.",
"echo-specialpage": "Special page title for Special:Notifications.\n{{Identical|Notification}}",
"echo-anon": "Error message shown to users who try to visit [[Special:Notifications]] as an anon.\n\nParameters:\n* $1 - URL of signup page, with returnto pointing to Special:Notifications\n* $2 - URL of login page, with returnto pointing to Special:Notifications",
"echo-none": "Message shown to users who have no notifications. Also shown in the overlay.",

View file

@ -13,8 +13,8 @@
// Activate ooui
$( document ).ready( function () {
var $existingAlertLink = $( '#pt-notifications_alert a' ),
$existingMessageLink = $( '#pt-notifications_message a' ),
var $existingAlertLink = $( '#pt-notifications-alert a' ),
$existingMessageLink = $( '#pt-notifications-message a' ),
numAlerts = $existingAlertLink.text(),
numMessages = $existingMessageLink.text(),
hasUnseenAlerts = $existingAlertLink.hasClass( 'mw-echo-unseen-notifications' ),

View file

@ -3,8 +3,8 @@
/* We have to include the #pt-notifications selector due to monobook */
.mw-echo-notifications-badge {
#pt-notifications_alert &,
#pt-notifications_message & {
#pt-notifications-alert &,
#pt-notifications-message & {
.mixin-notifications-badge();
display: inline-block;
@ -31,10 +31,10 @@
}
&.mw-echo-unseen-notifications {
#pt-notifications_alert & {
#pt-notifications-alert & {
background-color: @badge-background-unseen-alert;
}
#pt-notifications_message & {
#pt-notifications-message & {
background-color: @badge-background-unseen-message;
}
}

View file

@ -82,12 +82,12 @@
allNotificationsButton.$element,
preferencesButton.$element
);
// Parent constructor
mw.echo.ui.NotificationBadgeWidget.parent.call( this, $.extend( {
framed: false,
flags: buttonFlags,
label: this.numItems,
title: mw.msg( 'tooltip-pt-notifications-' + this.type ),
popup: {
$content: this.notificationsWidget.$element,
$footer: $footer,