Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js |
— | — | @@ -85,12 +85,15 @@ |
86 | 86 | |
87 | 87 | var reqData = { |
88 | 88 | 'action': 'watch', |
| 89 | + 'format': 'json', |
89 | 90 | 'title': $link.data( 'target' ) |
90 | 91 | }; |
91 | 92 | if ( $link.data( 'action' ) == 'unwatch' ) { |
92 | 93 | reqData['unwatch'] = ''; |
93 | 94 | } |
94 | | - mw.api(reqData, |
| 95 | + $.getJSON( mw.config.get( 'wgScriptPath' ) |
| 96 | + + '/api' + mw.config.get( 'wgScriptExtension' ), |
| 97 | + reqData, |
95 | 98 | function( data, textStatus, xhr ) { |
96 | 99 | wgAjaxWatch.processResult( data, $link ); |
97 | 100 | } |
Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -473,17 +473,6 @@ |
474 | 474 | }; |
475 | 475 | |
476 | 476 | /** |
477 | | - * Performs an API call |
478 | | - * |
479 | | - * @param data object Call parameters |
480 | | - * @param callback function Function to be called on success, see jQuery.getJSON() for details |
481 | | - */ |
482 | | - this.api = function( data, callback ) { |
483 | | - var url = this.config.get( 'wgScriptPath' ) + '/api' + this.config.get( 'wgScriptExtension' ); |
484 | | - data.format = 'json'; |
485 | | - return jQuery.getJSON( url, data, callback ); |
486 | | - } |
487 | | - /** |
488 | 477 | * Client-side module loader which integrates with the MediaWiki ResourceLoader |
489 | 478 | */ |
490 | 479 | this.loader = new ( function() { |
Index: trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js |
— | — | @@ -15,6 +15,7 @@ |
16 | 16 | } |
17 | 17 | $el.data( 'codeTooltipLoading', true ); |
18 | 18 | var reqData = { |
| 19 | + format: 'json', |
19 | 20 | action: 'query', |
20 | 21 | list: 'coderevisions', |
21 | 22 | crprop: 'revid|message|status|author', |
— | — | @@ -23,7 +24,9 @@ |
24 | 25 | crlimit: '1' |
25 | 26 | }; |
26 | 27 | $el.tipsy( { fade: true, gravity: 'sw', html:true } ); |
27 | | - mw.api( reqData, |
| 28 | + $.getJSON( |
| 29 | + mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get( 'wgScriptExtension' ), |
| 30 | + reqData, |
28 | 31 | function( data ) { |
29 | 32 | if ( !data || !data.query || !data.query.coderevisions ) { |
30 | 33 | return; |