http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90990

Revision: 90990
Author:   hashar
Date:     2011-06-28 19:32:25 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
Find 'all' special ns regardless of its rank in the select

This is done by looking for an <option> element with an empty string value
which denote the special case 'all'.
Also removed a comment in Xml.php asking to keep 'all' as a first element
since it is no longer needed.

Follow up r90943 (comment 18872 by Brion)

Modified Paths:
--------------
    trunk/phase3/includes/Xml.php
    trunk/phase3/resources/mediawiki.special/mediawiki.special.recentchanges.js

Modified: trunk/phase3/includes/Xml.php
===================================================================
--- trunk/phase3/includes/Xml.php       2011-06-28 18:35:37 UTC (rev 90989)
+++ trunk/phase3/includes/Xml.php       2011-06-28 19:32:25 UTC (rev 90990)
@@ -132,8 +132,6 @@
                }
 
                if( !is_null( $all ) )
-                       # Please make sure the 'namespacesall' is the first or 
you will break
-                       # such an assumption (ex js: 
mw.special.recentchanges.updateCheckboxes)
                        $namespaces = array( $all => wfMsg( 'namespacesall' ) ) 
+ $namespaces;
                foreach( $namespaces as $index => $name ) {
                        if( $index < NS_MAIN ) {

Modified: 
trunk/phase3/resources/mediawiki.special/mediawiki.special.recentchanges.js
===================================================================
--- trunk/phase3/resources/mediawiki.special/mediawiki.special.recentchanges.js 
2011-06-28 18:35:37 UTC (rev 90989)
+++ trunk/phase3/resources/mediawiki.special/mediawiki.special.recentchanges.js 
2011-06-28 19:32:25 UTC (rev 90990)
@@ -15,8 +15,8 @@
                 * special 'all' namespace is selected/unselected respectively.
                 */
                updateCheckboxes: function() {
-                       // The 'all' namespace is the FIRST in the list.
-                       var isAllNS = $select.find( 'option' ).first().is( 
':selected' );
+                       // The option element for the 'all' namespace has an 
empty value
+                       var isAllNS = ('' === 
$select.find('option:selected').val() );
 
                        // Iterates over checkboxes and propagate the selected 
option
                        $.each( checkboxes, function( i, id ) {


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to