r51251 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51250‎ | r51251 | r51252 >
Date:17:35, 31 May 2009
Author:rainman
Status:ok
Tags:
Comment:
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 (modified) (history)
  • /trunk/phase3/skins/common/search.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/search.js
@@ -28,13 +28,13 @@
2929 for ( var i = 0; i < nsInputs.length; i++ ) {
3030 var pattern = /^ns/;
3131 if ( ( nsInputs[i].type == 'checkbox' ) && ( pattern.test( nsInputs[i].name ) ) ) {
32 - switch ( btn.value ) {
33 - case "None":
 32+ switch ( btn ) {
 33+ case "none":
3434 if ( nsInputs[i].checked ) {
3535 nsInputs[i].checked = false;
3636 }
3737 break;
38 - case "All":
 38+ case "all":
3939 if ( !nsInputs[i].checked ) {
4040 nsInputs[i].checked = true;
4141 }
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -632,8 +632,12 @@
633633
634634 // toggle for turning on and off all checkboxes
635635 $selectOptionsLabel = Xml::label( wfMsg( 'powersearch-togglelabel' ), 'mw-search-togglelabel' );
636 - $selectAllButton = Xml::submitButton( wfMsg( 'powersearch-toggleall' ), array( 'id' => 'mw-search-toggleall', 'onclick' => 'mwToggleSearchCheckboxes(this);return false;' ) );
637 - $selectNoneButton = Xml::submitButton( wfMsg( 'powersearch-togglenone' ), array( 'id' => 'mw-search-togglenone', 'onclick' => 'mwToggleSearchCheckboxes(this);return false;' ) );
 636+ $selectAllButton = Xml::openElement('button', array('type'=>'button', 'id' => 'mw-search-toggleall', 'onclick' => 'mwToggleSearchCheckboxes("all");' ))
 637+ . wfMsg( 'powersearch-toggleall' ) . Xml::closeElement('button');
 638+
 639+ $selectNoneButton = Xml::openElement('button', array('type'=>'button', 'id' => 'mw-search-togglenone', 'onclick' => 'mwToggleSearchCheckboxes("none");' ))
 640+ . wfMsg( 'powersearch-togglenone' ) . Xml::closeElement('button');
 641+
638642 $selectOptionsText = "<td id='mw-search-togglebox'>" . $selectOptionsLabel . $selectAllButton . $selectNoneButton . "</td>";
639643
640644 $searchButton = Xml::submitButton( wfMsg( 'powersearch' ) ) . "\n";
@@ -657,10 +661,6 @@
658662 $searchButton .
659663 "</div>".
660664 "</form>";
661 - $t = Title::newFromText( $term );
662 - /* if( $t != null && count($this->namespaces) === 1 ) {
663 - $out .= wfMsgExt( 'searchmenu-prefix', array('parseinline'), $term );
664 - } */
665665 return Xml::openElement( 'fieldset', array('id' => 'mw-searchoptions','style' => 'margin:0em;') ) .
666666 Xml::element( 'legend', null, wfMsg('powersearch-legend') ) .
667667 $out . $this->didYouMeanHtml .

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r51228More work on new search UI (follow-up to r50207):...rainman13:22, 31 May 2009

Status & tagging log