mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 16:04:35 +00:00
f8a8d392d6
Support bundles being expandable to show their sub-notifications. Bug: T114356 Change-Id: I1507cae360f45cc87f2d60e966b4d047abfa202d
34 lines
957 B
JavaScript
34 lines
957 B
JavaScript
( function ( $, mw ) {
|
|
'use strict';
|
|
/*!
|
|
* Echo Special:Notifications page initialization
|
|
*/
|
|
$( document ).ready( function () {
|
|
var limitNotifications = 50,
|
|
$content = $( '#mw-content-text' ),
|
|
echoApi = new mw.echo.api.EchoApi( { limit: limitNotifications, bundle: false } ),
|
|
unreadCounter = new mw.echo.dm.UnreadNotificationCounter( echoApi, [ 'message', 'alert' ], limitNotifications ),
|
|
modelManager = new mw.echo.dm.ModelManager( unreadCounter, { type: [ 'message', 'alert' ] } ),
|
|
controller = new mw.echo.Controller(
|
|
echoApi,
|
|
modelManager,
|
|
{
|
|
type: [ 'message' ]
|
|
}
|
|
),
|
|
specialPageContainer = new mw.echo.ui.NotificationsInboxWidget(
|
|
controller,
|
|
modelManager,
|
|
{
|
|
limit: limitNotifications,
|
|
$overlay: mw.echo.ui.$overlay
|
|
}
|
|
);
|
|
|
|
// Overlay
|
|
$( 'body' ).append( mw.echo.ui.$overlay );
|
|
|
|
$content.empty().append( specialPageContainer.$element );
|
|
} );
|
|
} )( jQuery, mediaWiki );
|