Revision: 51251
Author:   rainman
Date:     2009-05-31 17:35:08 +0000 (Sun, 31 May 2009)

Log Message:
-----------
Don't use submit buttons in r51228 for select all/none since that confuses the 
browser as to which submit button 
is the main one. Instead use normal html buttons. Also actually work for 
localized values. 

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialSearch.php
    trunk/phase3/skins/common/search.js

Modified: trunk/phase3/includes/specials/SpecialSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialSearch.php    2009-05-31 17:33:25 UTC 
(rev 51250)
+++ trunk/phase3/includes/specials/SpecialSearch.php    2009-05-31 17:35:08 UTC 
(rev 51251)
@@ -632,8 +632,12 @@
 
                // toggle for turning on and off all checkboxes
                $selectOptionsLabel = Xml::label( wfMsg( 
'powersearch-togglelabel' ), 'mw-search-togglelabel' );
-               $selectAllButton = Xml::submitButton( wfMsg( 
'powersearch-toggleall' ), array( 'id' => 'mw-search-toggleall', 'onclick' => 
'mwToggleSearchCheckboxes(this);return false;' ) );
-               $selectNoneButton = Xml::submitButton( wfMsg( 
'powersearch-togglenone' ), array( 'id' => 'mw-search-togglenone', 'onclick' => 
'mwToggleSearchCheckboxes(this);return false;' ) );
+               $selectAllButton = Xml::openElement('button', 
array('type'=>'button', 'id' => 'mw-search-toggleall', 'onclick' => 
'mwToggleSearchCheckboxes("all");' ))
+                       . wfMsg( 'powersearch-toggleall' ) . 
Xml::closeElement('button');
+                       
+               $selectNoneButton = Xml::openElement('button', 
array('type'=>'button', 'id' => 'mw-search-togglenone', 'onclick' => 
'mwToggleSearchCheckboxes("none");' ))
+                       . wfMsg( 'powersearch-togglenone' ) . 
Xml::closeElement('button');
+                       
                $selectOptionsText = "<td id='mw-search-togglebox'>" . 
$selectOptionsLabel . $selectAllButton . $selectNoneButton . "</td>";
 
                $searchButton = Xml::submitButton( wfMsg( 'powersearch' ) ) . 
"\n";
@@ -657,10 +661,6 @@
                        $searchButton .
                        "</div>".
                        "</form>";
-               $t = Title::newFromText( $term );
-               /* if( $t != null && count($this->namespaces) === 1 ) {
-                       $out .= wfMsgExt( 'searchmenu-prefix', 
array('parseinline'), $term );
-               } */
                return Xml::openElement( 'fieldset', array('id' => 
'mw-searchoptions','style' => 'margin:0em;') ) .
                        Xml::element( 'legend', null, 
wfMsg('powersearch-legend') ) .
                        $out . $this->didYouMeanHtml .

Modified: trunk/phase3/skins/common/search.js
===================================================================
--- trunk/phase3/skins/common/search.js 2009-05-31 17:33:25 UTC (rev 51250)
+++ trunk/phase3/skins/common/search.js 2009-05-31 17:35:08 UTC (rev 51251)
@@ -28,13 +28,13 @@
        for ( var i = 0; i < nsInputs.length; i++ ) {
                var pattern = /^ns/;
                if ( ( nsInputs[i].type == 'checkbox' ) && ( pattern.test( 
nsInputs[i].name ) ) ) {
-                       switch ( btn.value ) {
-                               case "None":
+                       switch ( btn ) {
+                               case "none":
                                        if ( nsInputs[i].checked ) {
                                                nsInputs[i].checked = false;
                                        }
                                        break;
-                               case "All": 
+                               case "all": 
                                        if ( !nsInputs[i].checked ) {
                                                nsInputs[i].checked = true;
                                        }



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

Reply via email to