Merge "SpecialMovepage: Convert form to use OOUI controls"
[lhc/web/wiklou.git] / resources / src / mediawiki.api / mediawiki.api.parse.js
index b1f1d2b..bc3d44f 100644 (file)
@@ -8,31 +8,21 @@
                 * Convenience method for 'action=parse'.
                 *
                 * @param {string} wikitext
-                * @param {Function} [ok] Success callback (deprecated)
-                * @param {Function} [err] Error callback (deprecated)
                 * @return {jQuery.Promise}
                 * @return {Function} return.done
                 * @return {string} return.done.data Parsed HTML of `wikitext`.
                 */
-               parse: function ( wikitext, ok, err ) {
+               parse: function ( wikitext ) {
                        var apiPromise = this.get( {
                                action: 'parse',
                                contentmodel: 'wikitext',
                                text: wikitext
                        } );
 
-                       // Backwards compatibility (< MW 1.20)
-                       if ( ok || err ) {
-                               mw.track( 'mw.deprecate', 'api.cbParam' );
-                               mw.log.warn( 'Use of mediawiki.api callback params is deprecated. Use the Promise instead.' );
-                       }
-
                        return apiPromise
                                .then( function ( data ) {
-                                       return data.parse.text['*'];
+                                       return data.parse.text[ '*' ];
                                } )
-                               .done( ok )
-                               .fail( err )
                                .promise( { abort: apiPromise.abort } );
                }
        } );