mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Merge "Fixing dismiss functionality for new checkmatrix system and categories"
This commit is contained in:
commit
18f9b513d2
|
@ -102,6 +102,7 @@ class ApiEchoNotifications extends ApiQueryBase {
|
|||
$thisEvent = array(
|
||||
'id' => $event->getId(),
|
||||
'type' => $event->getType(),
|
||||
'category' => EchoNotificationController::getNotificationCategory( $event->getType() ),
|
||||
'timestamp' => array(
|
||||
'unix' => $timestampUnix,
|
||||
'mw' => $timestampMw,
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
'dismiss': function( notification ) {
|
||||
var _this = this,
|
||||
$notification = $( notification ),
|
||||
eventType = $notification.attr( 'data-notification-type' ),
|
||||
eventCategory = $notification.attr( 'data-notification-category' ),
|
||||
prefName = '',
|
||||
prefs = [],
|
||||
prefRequest = {};
|
||||
$.each( mw.echo.dismissOutputFormats, function( index, format ) {
|
||||
// Make sure output format pref exists for this event type
|
||||
prefName = 'echo-' + format + '-notifications' + eventType;
|
||||
prefName = 'echo-subscriptions-' + format + '-' + eventCategory;
|
||||
if ( mw.user.options.exists( prefName ) ) {
|
||||
prefs.push( prefName + '=0' );
|
||||
}
|
||||
|
@ -43,8 +43,8 @@
|
|||
{
|
||||
window.location.reload();
|
||||
} else {
|
||||
eventType = $notification.attr( 'data-notification-type' );
|
||||
$( '.mw-echo-overlay li[data-notification-type="' + eventType + '"]' ).hide();
|
||||
eventCategory = $notification.attr( 'data-notification-category' );
|
||||
$( '.mw-echo-overlay li[data-notification-category="' + eventCategory + '"]' ).hide();
|
||||
$notification.data( 'dismiss', false );
|
||||
}
|
||||
},
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
var $li = $( '<li></li>' )
|
||||
.data( 'details', data )
|
||||
.data( 'id', id )
|
||||
.attr( 'data-notification-type', data.type )
|
||||
.attr( 'data-notification-category', data.category )
|
||||
.addClass( 'mw-echo-notification' )
|
||||
.append( data['*'] )
|
||||
.appendTo( $ul );
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
.data( 'details', data )
|
||||
.data( 'id', id )
|
||||
.addClass( 'mw-echo-notification' )
|
||||
.attr( 'data-notification-type', data.type )
|
||||
.attr( 'data-notification-category', data.category )
|
||||
.append( data['*'] )
|
||||
.appendTo( container );
|
||||
|
||||
|
|
|
@ -79,7 +79,8 @@ class SpecialNotifications extends SpecialPage {
|
|||
}
|
||||
$nextTimestamp = $row['timestamp']['unix'];
|
||||
$nextOffset = $row['id'];
|
||||
$notices .= Html::rawElement( 'li', array( 'class' => $class, 'data-notification-type' => $row['type'] ), $row['*'] );
|
||||
$dataNotificationCategory = EchoNotificationController::getNotificationCategory( $row['type'] );
|
||||
$notices .= Html::rawElement( 'li', array( 'class' => $class, 'data-notification-category' => $dataNotificationCategory ), $row['*'] );
|
||||
}
|
||||
$html .= Html::rawElement( 'ul', array( 'id' => 'mw-echo-special-container' ), $notices );
|
||||
|
||||
|
|
Loading…
Reference in a new issue