Index: trunk/phase3/includes/SpecialSearch.php |
— | — | @@ -125,10 +125,11 @@ |
126 | 126 | global $wgOut; |
127 | 127 | $wgOut->addWikiText( wfMsg( 'searchresulttext' ) ); |
128 | 128 | |
129 | | - #if ( !$this->parseQuery() ) { |
130 | 129 | if( '' === trim( $term ) ) { |
| 130 | + // Empty query -- straight view of search form |
131 | 131 | $wgOut->setSubtitle( '' ); |
132 | 132 | $wgOut->addHTML( $this->powerSearchBox( $term ) ); |
| 133 | + $wgOut->addHTML( $this->powerSearchFocus() ); |
133 | 134 | wfProfileOut( $fname ); |
134 | 135 | return; |
135 | 136 | } |
— | — | @@ -400,7 +401,7 @@ |
401 | 402 | : ''; |
402 | 403 | $redirect = "<input type='checkbox' value='1' name=\"redirs\"{$checked} />\n"; |
403 | 404 | |
404 | | - $searchField = '<input type="text" name="search" value="' . |
| 405 | + $searchField = '<input type="text" id="powerSearchText" name="search" value="' . |
405 | 406 | htmlspecialchars( $term ) ."\" size=\"16\" />\n"; |
406 | 407 | |
407 | 408 | $searchButton = '<input type="submit" name="searchx" value="' . |
— | — | @@ -416,6 +417,12 @@ |
417 | 418 | return "<br /><br />\n<form id=\"powersearch\" method=\"get\" " . |
418 | 419 | "action=\"$action\">\n{$ret}\n</form>\n"; |
419 | 420 | } |
| 421 | + |
| 422 | + function powerSearchFocus() { |
| 423 | + return "<script type='text/javascript'>" . |
| 424 | + "document.getElementById('powerSearchText').focus();" . |
| 425 | + "</script>"; |
| 426 | + } |
420 | 427 | } |
421 | 428 | |
422 | 429 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -115,6 +115,8 @@ |
116 | 116 | * When a user is prohibited from creating a page, a title of "View source" |
117 | 117 | makes no sense, and there should be no "Return to [[Page]]" link. |
118 | 118 | * (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 |
119 | 121 | |
120 | 122 | |
121 | 123 | === Bug fixes in 1.12 === |