Index: trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js |
— | — | @@ -15,7 +15,6 @@ |
16 | 16 | } |
17 | 17 | $el.data( 'codeTooltipLoading', true ); |
18 | 18 | var reqData = { |
19 | | - format: 'json', |
20 | 19 | action: 'query', |
21 | 20 | list: 'coderevisions', |
22 | 21 | crprop: 'revid|message|status|author', |
— | — | @@ -24,16 +23,14 @@ |
25 | 24 | crlimit: '1' |
26 | 25 | }; |
27 | 26 | $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, |
31 | 28 | function( data ) { |
32 | 29 | if ( !data || !data.query || !data.query.coderevisions ) { |
33 | 30 | return; |
34 | 31 | } |
35 | 32 | var rev = data.query.coderevisions[0]; |
36 | 33 | var text = rev['*'].length > 82 ? rev['*'].substr(0,80) + '...' : rev['*']; |
37 | | - text = text.replace( /</g, '<' ).replace( />/g, '>' ); |
| 34 | + text = mw.html.escape( text ); |
38 | 35 | text = text.replace( /\n/g, '<br/>' ); |
39 | 36 | |
40 | 37 | var tip = '<div class="mw-codereview-status-' + rev.status + '" style="padding:5px 8px 4px; margin:-5px -8px -4px;">' |