r86059 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86058‎ | r86059 | r86060 >
Date:16:41, 14 April 2011
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
CodeReview.tooltips: use built-in functions
Modified paths:
  • /trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js
@@ -15,7 +15,6 @@
1616 }
1717 $el.data( 'codeTooltipLoading', true );
1818 var reqData = {
19 - format: 'json',
2019 action: 'query',
2120 list: 'coderevisions',
2221 crprop: 'revid|message|status|author',
@@ -24,16 +23,14 @@
2524 crlimit: '1'
2625 };
2726 $el.tipsy( { fade: true, gravity: 'sw', html:true } );
28 - $.getJSON(
29 - mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get( 'wgScriptExtension' ),
30 - reqData,
 27+ mw.api( reqData,
3128 function( data ) {
3229 if ( !data || !data.query || !data.query.coderevisions ) {
3330 return;
3431 }
3532 var rev = data.query.coderevisions[0];
3633 var text = rev['*'].length > 82 ? rev['*'].substr(0,80) + '...' : rev['*'];
37 - text = text.replace( /</g, '&lt;' ).replace( />/g, '&gt;' );
 34+ text = mw.html.escape( text );
3835 text = text.replace( /\n/g, '<br/>' );
3936
4037 var tip = '<div class="mw-codereview-status-' + rev.status + '" style="padding:5px 8px 4px; margin:-5px -8px -4px;">'

Follow-up revisions

RevisionCommit summaryAuthorDate
r86250Back out r86054 and part of r86059 for now, I'd like to evaluate the possibil...maxsem05:46, 17 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86054Added wrapper mw.api() for API callsmaxsem15:56, 14 April 2011

Comments

#Comment by Reedy (talk | contribs)   16:43, 14 April 2011

Marking scaptrap, as it needs r86054 in core to work correctly

Status & tagging log