Follow-up per r65570 CR, also check wgEnableWriteAPI.
authorHappy-melon <happy-melon@users.mediawiki.org>
Wed, 28 Apr 2010 12:27:57 +0000 (12:27 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Wed, 28 Apr 2010 12:27:57 +0000 (12:27 +0000)
skins/common/ajaxwatch.js

index d2d24fa..b5bae1d 100644 (file)
@@ -83,7 +83,7 @@ $j(document).ready( function(){
        $links.click( function(event){
                var $link = $j(this);
 
-               if( wgAjaxWatch.supported === false || !wfSupportsAjax() ) {
+               if( wgAjaxWatch.supported === false || !wgEnableWriteAPI || !wfSupportsAjax() ) {
                        // Lazy initialization so we don't toss up
                        // ActiveX warnings on initial page load
                        // for IE 6 users with security settings.
@@ -93,8 +93,8 @@ $j(document).ready( function(){
                
                wgAjaxWatch.setLinkText( $link, $link.data('action')+'ing' );
                $j.get( wgScriptPath 
-                               + '/api.php?action=watch&format=json&title='
-                               + $link.data('target')
+                               + '/api' + wgScriptExtension + '?action=watch&format=json&title='
+                               + encodeURIComponent( $link.data('target') )
                                + ( $link.data('action')=='unwatch' ? '&unwatch' : '' ),
                        {},
                        wgAjaxWatch.processResult,