| 1 |
( function () { |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
mw.echo.api.ForeignAPIHandler = function MwEchoApiForeignAPIHandler( apiUrl, config ) { |
| 16 |
config = config || {}; |
| 17 |
|
| 18 |
|
| 19 |
mw.echo.api.ForeignAPIHandler.super.call( this, config ); |
| 20 |
|
| 21 |
this.api = new mw.ForeignApi( apiUrl ); |
| 22 |
this.unreadOnly = config.unreadOnly !== undefined ? !!config.unreadOnly : false; |
| 23 |
}; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
OO.inheritClass( mw.echo.api.ForeignAPIHandler, mw.echo.api.LocalAPIHandler ); |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
mw.echo.api.ForeignAPIHandler.prototype.getTypeParams = function ( type ) { |
| 33 |
let params = { |
| 34 |
|
| 35 |
notforn: 1 |
| 36 |
}; |
| 37 |
|
| 38 |
if ( this.unreadOnly ) { |
| 39 |
params = Object.assign( {}, params, { notfilter: '!read' } ); |
| 40 |
} |
| 41 |
|
| 42 |
return Object.assign( {}, this.typeParams[ type ], params ); |
| 43 |
}; |
| 44 |
}() ); |