mediawiki-extensions-Echo/modules/viewmodel/handlers/mw.echo.dm.ForeignAPIHandler.js
Moriel Schottlender 24a8bc23ef Add a NetworkHandler as a central API authority to Echo
This is in preparation for dealing with cross-wiki notifications
where we may need several types of operations to extract bundled
notifications from local and external APIs.

Also, renamed files:
* mw.echo.dm.AbstractAPIHandler -> mw.echo.dm.APIHandler
* mw.echo.dm.APIHandler -> mw.echo.dm.LocalAPIHandler
* All API-related handler files moved to their own folder
  for better organization.

Change-Id: Ib730c780ea52c93a6026c5d0b22012b6f39bb50d
2015-11-19 15:25:03 -08:00

26 lines
627 B
JavaScript

( function ( mw ) {
/**
* Foreign notification API handler
*
* @class
* @extends mw.echo.dm.LocalAPIHandler
*
* @constructor
* @param {string} apiUrl A url for the access point of the
* foreign API.
* @param {Object} [config] Configuration object
*/
mw.echo.dm.ForeignAPIHandler = function MwEchoDmForeignAPIHandler( apiUrl, config ) {
config = config || {};
// Parent constructor
mw.echo.dm.ForeignAPIHandler.parent.call( this, config );
this.api = new mw.ForeignApi( apiUrl );
};
/* Setup */
OO.inheritClass( mw.echo.dm.ForeignAPIHandler, mw.echo.dm.LocalAPIHandler );
} )( mediaWiki );