Merge "Made ReplicatedBagOStuff wrapping the SQL class the default stash"
[lhc/web/wiklou.git] / resources / src / mediawiki.api / mediawiki.api.edit.js
index 714c38c..dbe45bf 100644 (file)
@@ -3,7 +3,6 @@
  */
 ( function ( mw, $ ) {
 
-       var msg = 'Use of mediawiki.api callback params is deprecated. Use the Promise instead.';
        $.extend( mw.Api.prototype, {
 
                /**
                 * cached token and start over.
                 *
                 * @param {Object} params API parameters
-                * @param {Function} [ok] Success callback (deprecated)
-                * @param {Function} [err] Error callback (deprecated)
                 * @return {jQuery.Promise} See #post
                 */
-               postWithEditToken: function ( params, ok, err ) {
-                       if ( ok || err ) {
-                               mw.track( 'mw.deprecate', 'api.cbParam' );
-                               mw.log.warn( msg );
-                       }
-
-                       return this.postWithToken( 'edit', params ).done( ok ).fail( err );
+               postWithEditToken: function ( params ) {
+                       return this.postWithToken( 'edit', params );
                },
 
                /**
                 * API helper to grab an edit token.
                 *
-                * @param {Function} [ok] Success callback (deprecated)
-                * @param {Function} [err] Error callback (deprecated)
                 * @return {jQuery.Promise}
                 * @return {Function} return.done
                 * @return {string} return.done.token Received token.
                 */
-               getEditToken: function ( ok, err ) {
-                       if ( ok || err ) {
-                               mw.track( 'mw.deprecate', 'api.cbParam' );
-                               mw.log.warn( msg );
-                       }
-
-                       return this.getToken( 'edit' ).done( ok ).fail( err );
+               getEditToken: function () {
+                       return this.getToken( 'edit' );
                },
 
                /**
                 * @param {string} header
                 * @param {string} message wikitext message
                 * @param {Object} [additionalParams] Additional API parameters, e.g. `{ redirect: true }`
-                * @param {Function} [ok] Success handler (deprecated)
-                * @param {Function} [err] Error handler (deprecated)
                 * @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...
-                       if ( $.isFunction( additionalParams ) ) {
-                               err = ok;
-                               ok = additionalParams;
-                               additionalParams = undefined;
-                       }
-
-                       if ( ok || err ) {
-                               mw.track( 'mw.deprecate', 'api.cbParam' );
-                               mw.log.warn( msg );
-                       }
-
+               newSection: function ( title, header, message, additionalParams ) {
                        return this.postWithEditToken( $.extend( {
                                action: 'edit',
                                section: 'new',
                                title: String( title ),
                                summary: header,
                                text: message
-                       }, additionalParams ) ).done( ok ).fail( err );
+                       }, additionalParams ) );
                }
        } );