r65614 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65613‎ | r65614 | r65615 >
Date:12:27, 28 April 2010
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
Follow-up per r65570 CR, also check wgEnableWriteAPI.
Modified paths:
  • /trunk/phase3/skins/common/ajaxwatch.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/ajaxwatch.js
@@ -83,7 +83,7 @@
8484 $links.click( function(event){
8585 var $link = $j(this);
8686
87 - if( wgAjaxWatch.supported === false || !wfSupportsAjax() ) {
 87+ if( wgAjaxWatch.supported === false || !wgEnableWriteAPI || !wfSupportsAjax() ) {
8888 // Lazy initialization so we don't toss up
8989 // ActiveX warnings on initial page load
9090 // for IE 6 users with security settings.
@@ -93,8 +93,8 @@
9494
9595 wgAjaxWatch.setLinkText( $link, $link.data('action')+'ing' );
9696 $j.get( wgScriptPath
97 - + '/api.php?action=watch&format=json&title='
98 - + $link.data('target')
 97+ + '/api' + wgScriptExtension + '?action=watch&format=json&title='
 98+ + encodeURIComponent( $link.data('target') )
9999 + ( $link.data('action')=='unwatch' ? '&unwatch' : '' ),
100100 {},
101101 wgAjaxWatch.processResult,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65570Rewrite ajaxwatch.js to use the API watch action, and JQuery. Allows it to b...happy-melon15:09, 27 April 2010

Comments

#Comment by Catrope (talk | contribs)   21:38, 1 May 2010

Why not use $j.get()'s second parameter instead and let jQuery handle the escaping and query string building for you?

Status & tagging log