Back out r86054 and part of r86059 for now, I'd like to evaluate the possibility...
authorMax Semenik <maxsem@users.mediawiki.org>
Sun, 17 Apr 2011 05:46:41 +0000 (05:46 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sun, 17 Apr 2011 05:46:41 +0000 (05:46 +0000)
resources/mediawiki.action/mediawiki.action.watch.ajax.js
resources/mediawiki/mediawiki.js

index f92f004..c0fc405 100644 (file)
@@ -85,12 +85,15 @@ $( document ).ready( function() {
                
                var reqData = {
                        'action': 'watch',
+                       'format': 'json',
                        'title': $link.data( 'target' )
                };
                if ( $link.data( 'action' ) == 'unwatch' ) {
                        reqData['unwatch'] = '';
                }
-               mw.api(reqData,
+               $.getJSON( mw.config.get( 'wgScriptPath' )
+                               + '/api' + mw.config.get( 'wgScriptExtension' ),
+                       reqData,
                        function( data, textStatus, xhr ) {
                                wgAjaxWatch.processResult( data, $link );
                        }
index 8cf2c68..bf81dd7 100644 (file)
@@ -472,17 +472,6 @@ window.mediaWiki = new ( function( $ ) {
                return mediaWiki.message.apply( mediaWiki.message, arguments ).toString();
        };
 
-       /**
-        * Performs an API call
-        *
-        * @param data object Call parameters
-        * @param callback function Function to be called on success, see jQuery.getJSON() for details
-        */
-       this.api = function( data, callback ) {
-               var url = this.config.get( 'wgScriptPath' ) + '/api' + this.config.get( 'wgScriptExtension' );
-               data.format = 'json';
-               return jQuery.getJSON( url, data, callback );
-       }
        /**
         * Client-side module loader which integrates with the MediaWiki ResourceLoader
         */