Merge "i18n: Drop img-auth-nologinnWL, unused AFAICT"
[lhc/web/wiklou.git] / resources / src / mediawiki.api / parse.js
index f38e88b..447b936 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * @class mw.Api.plugin.parse
  */
-( function ( mw, $ ) {
+( function () {
 
        $.extend( mw.Api.prototype, {
                /**
                        if ( mw.Title && content instanceof mw.Title ) {
                                // Parse existing page
                                config.page = content.getPrefixedDb();
+                               apiPromise = this.get( config );
                        } else {
                                // Parse wikitext from input
                                config.text = String( content );
+                               apiPromise = this.post( config );
                        }
 
-                       apiPromise = this.get( config );
-
                        return apiPromise
                                .then( function ( data ) {
                                        return data.parse.text;
@@ -46,4 +46,4 @@
         * @mixins mw.Api.plugin.parse
         */
 
-}( mediaWiki, jQuery ) );
+}() );