mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
Merge "API: Use formatversion=2 by default"
This commit is contained in:
commit
cd70d287de
|
@ -303,7 +303,6 @@
|
|||
titles: titles,
|
||||
lang: mw.config.get( 'wgUserLanguage' ),
|
||||
format: 'json',
|
||||
formatversion: '2',
|
||||
doNotIgnoreMissingTitles: '1',
|
||||
redirects: '1'
|
||||
} ).done( this.fetchRequestDone.bind( this, titles, specs ) );
|
||||
|
|
|
@ -217,7 +217,8 @@
|
|||
uselang: mw.config.get( 'wgUserLanguage' ),
|
||||
editintro: uri.query.editintro,
|
||||
preload: options.preload,
|
||||
preloadparams: options.preloadparams
|
||||
preloadparams: options.preloadparams,
|
||||
formatversion: 2
|
||||
};
|
||||
|
||||
// Only request the API to explicitly load the currently visible revision if we're restoring
|
||||
|
@ -375,7 +376,8 @@
|
|||
uselang: mw.config.get( 'wgUserLanguage' ),
|
||||
editintro: uri.query.editintro,
|
||||
preload: options.preload,
|
||||
preloadparams: options.preloadparams
|
||||
preloadparams: options.preloadparams,
|
||||
formatversion: 2
|
||||
};
|
||||
|
||||
// section should never really be undefined, but check just in case
|
||||
|
|
|
@ -658,6 +658,8 @@ ve.init.mw.Target.prototype.getPageName = function () {
|
|||
* @return {mw.Api} API object
|
||||
*/
|
||||
ve.init.mw.Target.prototype.getContentApi = function ( doc, options ) {
|
||||
options = options || {};
|
||||
options.parameters = ve.extendObject( { formatversion: 2 }, options.parameters );
|
||||
return new mw.Api( options );
|
||||
};
|
||||
|
||||
|
@ -671,5 +673,7 @@ ve.init.mw.Target.prototype.getContentApi = function ( doc, options ) {
|
|||
* @return {mw.Api} API object
|
||||
*/
|
||||
ve.init.mw.Target.prototype.getLocalApi = function ( options ) {
|
||||
options = options || {};
|
||||
options.parameters = ve.extendObject( { formatversion: 2 }, options.parameters );
|
||||
return new mw.Api( options );
|
||||
};
|
||||
|
|
|
@ -169,7 +169,6 @@ ve.ui.MWLanguagesPage.prototype.getAllLanguageItems = function () {
|
|||
// TODO: Detect paging token if results exceed limit
|
||||
ve.init.target.getContentApi().get( {
|
||||
format: 'json',
|
||||
formatversion: 2,
|
||||
action: 'query',
|
||||
prop: 'langlinks',
|
||||
llprop: 'autonym',
|
||||
|
|
|
@ -106,14 +106,13 @@ ve.ui.MWEditSummaryWidget.prototype.getSummaries = function () {
|
|||
if ( mw.user.isAnon() ) {
|
||||
this.getSummariesPromise = $.Deferred().resolve( [] ).promise();
|
||||
} else {
|
||||
this.getSummariesPromise = new mw.Api().get( {
|
||||
this.getSummariesPromise = ve.init.target.getLocalApi().get( {
|
||||
action: 'query',
|
||||
list: 'usercontribs',
|
||||
ucuser: mw.user.getName(),
|
||||
ucprop: 'comment|title',
|
||||
uclimit: 500,
|
||||
format: 'json',
|
||||
formatversion: 2
|
||||
format: 'json'
|
||||
} ).then( function ( response ) {
|
||||
var usedComments = {},
|
||||
changes = ve.getProp( response, 'query', 'usercontribs' ) || [];
|
||||
|
|
|
@ -105,7 +105,7 @@ ve.ui.MWTemplateTitleInputWidget.prototype.getLookupRequest = function () {
|
|||
xhr = widget.getApi().get( {
|
||||
action: 'templatedata',
|
||||
format: 'json',
|
||||
formatversion: '2',
|
||||
formatversion: 2,
|
||||
titles: titles,
|
||||
redirects: !!widget.showRedirects,
|
||||
doNotIgnoreMissingTitles: '1',
|
||||
|
|
Loading…
Reference in a new issue