r29201 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29200‎ | r29201 | r29202 >
Date:01:02, 3 January 2008
Author:brion
Status:old
Tags:
Comment:
* (bug 9939) Special:Search now sets focus to search input box when no existing
search is active
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialSearch.php
@@ -125,10 +125,11 @@
126126 global $wgOut;
127127 $wgOut->addWikiText( wfMsg( 'searchresulttext' ) );
128128
129 - #if ( !$this->parseQuery() ) {
130129 if( '' === trim( $term ) ) {
 130+ // Empty query -- straight view of search form
131131 $wgOut->setSubtitle( '' );
132132 $wgOut->addHTML( $this->powerSearchBox( $term ) );
 133+ $wgOut->addHTML( $this->powerSearchFocus() );
133134 wfProfileOut( $fname );
134135 return;
135136 }
@@ -400,7 +401,7 @@
401402 : '';
402403 $redirect = "<input type='checkbox' value='1' name=\"redirs\"{$checked} />\n";
403404
404 - $searchField = '<input type="text" name="search" value="' .
 405+ $searchField = '<input type="text" id="powerSearchText" name="search" value="' .
405406 htmlspecialchars( $term ) ."\" size=\"16\" />\n";
406407
407408 $searchButton = '<input type="submit" name="searchx" value="' .
@@ -416,6 +417,12 @@
417418 return "<br /><br />\n<form id=\"powersearch\" method=\"get\" " .
418419 "action=\"$action\">\n{$ret}\n</form>\n";
419420 }
 421+
 422+ function powerSearchFocus() {
 423+ return "<script type='text/javascript'>" .
 424+ "document.getElementById('powerSearchText').focus();" .
 425+ "</script>";
 426+ }
420427 }
421428
422429
Index: trunk/phase3/RELEASE-NOTES
@@ -115,6 +115,8 @@
116116 * When a user is prohibited from creating a page, a title of "View source"
117117 makes no sense, and there should be no "Return to [[Page]]" link.
118118 * (bug 12486) Protected titles now give a warning for privileged editors.
 119+* (bug 9939) Special:Search now sets focus to search input box when no existing
 120+ search is active
119121
120122
121123 === Bug fixes in 1.12 ===

Follow-up revisions

RevisionCommit summaryAuthorDate
r29202* (bug 9939) Put focus in the search box when going to Special:Search with no...brion01:12, 3 January 2008

Status & tagging log