2016-01-15 22:11:33 +00:00
|
|
|
( function ( mw, $ ) {
|
|
|
|
/**
|
|
|
|
* Foreign notification API handler
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends mw.echo.api.LocalAPIHandler
|
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {string} apiUrl A url for the access point of the
|
|
|
|
* foreign API.
|
|
|
|
* @param {Object} [config] Configuration object
|
|
|
|
*/
|
|
|
|
mw.echo.api.ForeignAPIHandler = function MwEchoApiForeignAPIHandler( apiUrl, config ) {
|
|
|
|
config = config || {};
|
|
|
|
|
|
|
|
// Parent constructor
|
|
|
|
mw.echo.api.ForeignAPIHandler.parent.call( this, config );
|
|
|
|
|
|
|
|
this.api = new mw.ForeignApi( apiUrl );
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Setup */
|
|
|
|
|
|
|
|
OO.inheritClass( mw.echo.api.ForeignAPIHandler, mw.echo.api.LocalAPIHandler );
|
2016-04-21 10:28:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
mw.echo.api.ForeignAPIHandler.prototype.getTypeParams = function ( type ) {
|
|
|
|
return $.extend( {}, this.typeParams[ type ], {
|
2016-04-26 22:55:07 +00:00
|
|
|
notfilter: '!read',
|
|
|
|
// Backwards compatibility
|
|
|
|
notnoforn: 1
|
2016-04-21 10:28:32 +00:00
|
|
|
} );
|
|
|
|
};
|
2016-01-15 22:11:33 +00:00
|
|
|
} )( mediaWiki, jQuery );
|