mediawiki-extensions-Echo/modules/special/ext.echo.special.js
Stephane Bisson f8a8d392d6 Expandable bundle
Support bundles being expandable
to show their sub-notifications.

Bug: T114356
Change-Id: I1507cae360f45cc87f2d60e966b4d047abfa202d
2016-06-28 15:37:54 -04:00

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 );