RELEASE-NOTES for last commit, and don't load the AJAX framework if we don't need it
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 27 Dec 2006 00:22:34 +0000 (00:22 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 27 Dec 2006 00:22:34 +0000 (00:22 +0000)
RELEASE-NOTES
includes/OutputPage.php

index f7a8570..e5c2178 100644 (file)
@@ -415,6 +415,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Enable selflinks and categories to be written in some of the language variants
 * Prevent conversion of JavaScript code in language variants
 * Output software version number in maintenance/parserTests.php
+* (bug 7169) Use Ajax to watch/unwatch articles if enabled
 
 == Languages updated ==
 
index d83e1e1..74c041f 100644 (file)
@@ -535,7 +535,10 @@ class OutputPage {
                $sk = $wgUser->getSkin();
 
                if ( $wgUseAjax ) {
-                       $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajax.js?$wgStyleVersion\"></script>\n" );
+                       // No point in enabling it if watching is the only enabled thing and the user isn't logged in
+                       if( $wgAjaxSearch || ( $wgAjaxWatch && $wgUser->isLoggedIn() )) {
+                               $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajax.js?$wgStyleVersion\"></script>\n" );
+                       }
                        if( $wgAjaxSearch ) {
                                $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajaxsearch.js\"></script>\n" );
                                $this->addScript( "<script type=\"{$wgJsMimeType}\">hookEvent(\"load\", sajax_onload);</script>\n" );