mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-02 19:36:48 +00:00
1bef12c3e7
Bug: T129176 Change-Id: If0d05cb1df0b2e0f93c7367c0848fbcbb04fea8d
34 lines
942 B
JavaScript
34 lines
942 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 } ),
|
|
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 );
|