mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
bed038b509
Updates: * grunt-contrib-csslint 0.3.1 -> 0.4.0 * grunt-contrib-jslint 0.10.0 -> 0.11.0 * grunt-jscs 0.8.1 -> 1.2.0 For jscs, leaving requireSpacesInsideArrayBrackets to avoid headaches for now. Change-Id: I62d34444edbba65c8bd22d2fa5e50e16cabb0042
43 lines
988 B
JavaScript
43 lines
988 B
JavaScript
/*!
|
|
* VisualEditor MediaWiki Initialization ImageInfoCache class.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
( function () {
|
|
/**
|
|
* Get information about images.
|
|
* @class
|
|
* @extends ve.init.mw.ApiResponseCache
|
|
* @constructor
|
|
*/
|
|
ve.init.mw.ImageInfoCache = function VeInitMwImageInfoCache() {
|
|
ve.init.mw.ImageInfoCache.super.call( this );
|
|
};
|
|
|
|
OO.inheritClass( ve.init.mw.ImageInfoCache, ve.init.mw.ApiResponseCache );
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
ve.init.mw.ImageInfoCache.prototype.getRequestPromise = function ( subqueue ) {
|
|
return ve.init.target.constructor.static.apiRequest(
|
|
{
|
|
action: 'query',
|
|
prop: 'imageinfo',
|
|
indexpageids: '1',
|
|
iiprop: 'size|mediatype',
|
|
titles: subqueue.join( '|' )
|
|
},
|
|
{ type: 'POST' }
|
|
);
|
|
};
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
ve.init.mw.ImageInfoCache.prototype.processPage = function ( page ) {
|
|
return page.imageinfo[0];
|
|
};
|
|
}() );
|