mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Use apiRequest() function in MWMediaEditDialog
Change-Id: I4fbc3f2080660b217beb502c6cf3007197627a14
This commit is contained in:
parent
b26716156c
commit
2598fe8088
|
@ -5,8 +5,6 @@
|
||||||
* @license The MIT License (MIT); see LICENSE.txt
|
* @license The MIT License (MIT); see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global mw */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DataModel generated content node.
|
* DataModel generated content node.
|
||||||
*
|
*
|
||||||
|
@ -44,22 +42,13 @@ ve.dm.MWImageNode.prototype.getImageInfo = function () {
|
||||||
deferred.resolve( store.value( index ) );
|
deferred.resolve( store.value( index ) );
|
||||||
} else {
|
} else {
|
||||||
// Look for the media size through the API
|
// Look for the media size through the API
|
||||||
$.ajax( {
|
ve.init.mw.Target.static.apiRequest( {
|
||||||
'url': mw.util.wikiScript( 'api' ),
|
|
||||||
'data': {
|
|
||||||
'action': 'query',
|
'action': 'query',
|
||||||
'prop': 'imageinfo',
|
'prop': 'imageinfo',
|
||||||
'indexpageids': '1',
|
'indexpageids': '1',
|
||||||
'iiprop': 'size|mediatype',
|
'iiprop': 'size|mediatype',
|
||||||
'format': 'json',
|
|
||||||
'titles': this.getFilename()
|
'titles': this.getFilename()
|
||||||
},
|
}, { 'type': 'POST' } )
|
||||||
'dataType': 'json',
|
|
||||||
'type': 'POST',
|
|
||||||
// Wait up to 100 seconds before giving up
|
|
||||||
'timeout': 100000,
|
|
||||||
'cache': false
|
|
||||||
} )
|
|
||||||
.done( function ( resp ) {
|
.done( function ( resp ) {
|
||||||
var originalSize,
|
var originalSize,
|
||||||
page = resp.query && resp.query.pages[resp.query.pageids[0]],
|
page = resp.query && resp.query.pages[resp.query.pageids[0]],
|
||||||
|
|
Loading…
Reference in a new issue