2013-06-18 15:23:35 +00:00
|
|
|
( function ( $, mw ) {
|
2012-12-07 01:08:33 +00:00
|
|
|
'use strict';
|
2016-03-16 22:47:20 +00:00
|
|
|
/*!
|
|
|
|
* Echo Special:Notifications page initialization
|
2016-05-11 20:33:17 +00:00
|
|
|
*/
|
2016-03-16 22:47:20 +00:00
|
|
|
$( 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' ]
|
2012-12-07 01:08:33 +00:00
|
|
|
}
|
2016-03-16 22:47:20 +00:00
|
|
|
),
|
|
|
|
specialPageContainer = new mw.echo.ui.NotificationsInboxWidget(
|
|
|
|
controller,
|
|
|
|
modelManager,
|
|
|
|
{
|
|
|
|
limit: limitNotifications,
|
|
|
|
$overlay: mw.echo.ui.$overlay
|
2012-12-07 01:08:33 +00:00
|
|
|
}
|
2016-03-16 22:47:20 +00:00
|
|
|
);
|
2012-12-07 01:08:33 +00:00
|
|
|
|
2016-03-16 22:47:20 +00:00
|
|
|
// Overlay
|
|
|
|
$( 'body' ).append( mw.echo.ui.$overlay );
|
2012-12-07 01:08:33 +00:00
|
|
|
|
2016-03-16 22:47:20 +00:00
|
|
|
$content.empty().append( specialPageContainer.$element );
|
|
|
|
} );
|
2012-12-07 01:08:33 +00:00
|
|
|
} )( jQuery, mediaWiki );
|