From: Amir E. Aharoni Date: Sun, 13 Jul 2014 12:22:22 +0000 (+0300) Subject: Cleanup whtespace and comments in mediawiki.api.edit.js X-Git-Tag: 1.31.0-rc.0~14961^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=f0dfc3e6b7388355c903dfe2165f4cb4efddc013;p=lhc%2Fweb%2Fwiklou.git Cleanup whtespace and comments in mediawiki.api.edit.js Change-Id: I61419bae4286317dbd6ca3c2e0596184e7953392 --- diff --git a/resources/src/mediawiki.api/mediawiki.api.edit.js b/resources/src/mediawiki.api/mediawiki.api.edit.js index 403d37216d..e88ae5e203 100644 --- a/resources/src/mediawiki.api/mediawiki.api.edit.js +++ b/resources/src/mediawiki.api/mediawiki.api.edit.js @@ -21,11 +21,12 @@ mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); } + return this.postWithToken( 'edit', params ).done( ok ).fail( err ); }, /** - * Api helper to grab an edit token. + * API helper to grab an edit token. * * @param {Function} [ok] Success callback (deprecated) * @param {Function} [err] Error callback (deprecated) @@ -38,11 +39,12 @@ mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); } + return this.getToken( 'edit' ).done( ok ).fail( err ); }, /** - * Create a new section of the page. + * Post a new section to the page. * @see #postWithEditToken * @param {mw.Title|String} title Target page * @param {string} header @@ -53,17 +55,19 @@ * @return {jQuery.Promise} */ newSection: function ( title, header, message, additionalParams, ok, err ) { - // Until we remove 'ok' and 'err' parameters, we have to support code that passes them but not - // additionalParams... + // Until we remove 'ok' and 'err' parameters, we have to support code that passes them, + // but not additionalParams... if ( $.isFunction( additionalParams ) ) { err = ok; ok = additionalParams; additionalParams = undefined; } + if ( ok || err ) { mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); } + return this.postWithEditToken( $.extend( { action: 'edit', section: 'new',