r86250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86249‎ | r86250 | r86251 >
Date:05:46, 17 April 2011
Author:maxsem
Status:ok
Tags:
Comment:
Back out r86054 and part of r86059 for now, I'd like to evaluate the possibility of integrating NeilK's work into the core now
Modified paths:
  • /trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js
@@ -85,12 +85,15 @@
8686
8787 var reqData = {
8888 'action': 'watch',
 89+ 'format': 'json',
8990 'title': $link.data( 'target' )
9091 };
9192 if ( $link.data( 'action' ) == 'unwatch' ) {
9293 reqData['unwatch'] = '';
9394 }
94 - mw.api(reqData,
 95+ $.getJSON( mw.config.get( 'wgScriptPath' )
 96+ + '/api' + mw.config.get( 'wgScriptExtension' ),
 97+ reqData,
9598 function( data, textStatus, xhr ) {
9699 wgAjaxWatch.processResult( data, $link );
97100 }
Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -473,17 +473,6 @@
474474 };
475475
476476 /**
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 - /**
488477 * Client-side module loader which integrates with the MediaWiki ResourceLoader
489478 */
490479 this.loader = new ( function() {
Index: trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js
@@ -15,6 +15,7 @@
1616 }
1717 $el.data( 'codeTooltipLoading', true );
1818 var reqData = {
 19+ format: 'json',
1920 action: 'query',
2021 list: 'coderevisions',
2122 crprop: 'revid|message|status|author',
@@ -23,7 +24,9 @@
2425 crlimit: '1'
2526 };
2627 $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,
2831 function( data ) {
2932 if ( !data || !data.query || !data.query.coderevisions ) {
3033 return;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86054Added wrapper mw.api() for API callsmaxsem15:56, 14 April 2011
r86059CodeReview.tooltips: use built-in functionsmaxsem16:41, 14 April 2011

Status & tagging log