diff --git a/modules/CommentController.js b/modules/CommentController.js index 62d6b590a..a8eaa40b6 100644 --- a/modules/CommentController.js +++ b/modules/CommentController.js @@ -1,5 +1,5 @@ var - api = new mw.Api( { formatversion: 2 } ), + api = new mw.Api( { parameters: { formatversion: 2 } } ), controller = require( './controller.js' ), modifier = require( './modifier.js' ), parser = require( './parser.js' ), @@ -374,7 +374,7 @@ CommentController.prototype.save = function ( parsoidData ) { { // No timeout. Huge talk pages take a long time to save, and falsely reporting an error can // result in duplicate messages when the user retries. (T249071) - api: new mw.Api( { ajax: { timeout: 0 }, formatversion: 2 } ) + api: new mw.Api( { ajax: { timeout: 0 }, parameters: { formatversion: 2 } } ) } ).catch( function ( code, data ) { // Handle edit conflicts. Load the latest revision of the page, then try again. If the parent diff --git a/modules/controller.js b/modules/controller.js index 7a247b4b0..c194cf93b 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -1,7 +1,7 @@ 'use strict'; var - api = new mw.Api( { formatversion: 2 } ), + api = new mw.Api( { parameters: { formatversion: 2 } } ), $pageContainer, parser = require( './parser.js' ), utils = require( './utils.js' ), diff --git a/modules/dt.ui.ReplyWidget.js b/modules/dt.ui.ReplyWidget.js index 083746b67..55c6ea43f 100644 --- a/modules/dt.ui.ReplyWidget.js +++ b/modules/dt.ui.ReplyWidget.js @@ -94,7 +94,7 @@ function ReplyWidget( commentController, parsoidData, config ) { this.beforeUnloadHandler = this.onBeforeUnload.bind( this ); this.unloadHandler = this.onUnload.bind( this ); - this.api = new mw.Api( { formatversion: 2 } ); + this.api = new mw.Api( { parameters: { formatversion: 2 } } ); this.onInputChangeThrottled = OO.ui.throttle( this.onInputChange.bind( this ), 1000 ); // Initialization @@ -525,7 +525,6 @@ ReplyWidget.prototype.onReplyClick = function () { titles: mw.config.get( 'wgRelevantPageName' ) } ).then( function () { return widget.api.get( { - formatversion: 2, action: 'parse', prop: [ 'text', 'modules', 'jsconfigvars' ], page: mw.config.get( 'wgRelevantPageName' ) diff --git a/modules/dt.ui.UsernameCompletion.js b/modules/dt.ui.UsernameCompletion.js index ef55eb804..787a56cad 100644 --- a/modules/dt.ui.UsernameCompletion.js +++ b/modules/dt.ui.UsernameCompletion.js @@ -20,7 +20,7 @@ function MWUsernameCompletionAction( surface ) { // Parent constructor MWUsernameCompletionAction.super.call( this, surface ); - this.api = new mw.Api( { formatversion: 2 } ); + this.api = new mw.Api( { parameters: { formatversion: 2 } } ); this.searchedPrefixes = {}; this.localUsers = []; this.ipUsers = [];