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' ),
|
2016-06-07 20:08:16 +00:00
|
|
|
echoApi = new mw.echo.api.EchoApi( { limit: limitNotifications, bundle: false } ),
|
2016-03-16 22:47:20 +00:00
|
|
|
unreadCounter = new mw.echo.dm.UnreadNotificationCounter( echoApi, [ 'message', 'alert' ], limitNotifications ),
|
2016-07-14 00:03:57 +00:00
|
|
|
modelManager = new mw.echo.dm.ModelManager( unreadCounter, {
|
|
|
|
type: [ 'message', 'alert' ],
|
|
|
|
itemsPerPage: limitNotifications
|
|
|
|
} ),
|
2016-03-16 22:47:20 +00:00
|
|
|
controller = new mw.echo.Controller(
|
|
|
|
echoApi,
|
2016-07-14 00:03:57 +00:00
|
|
|
modelManager
|
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 );
|