From: Brion Vibber Date: Thu, 3 Jan 2008 01:02:09 +0000 (+0000) Subject: * (bug 9939) Special:Search now sets focus to search input box when no existing X-Git-Tag: 1.31.0-rc.0~50170 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=f674a8733c8b7fade8ee09c980ae951e2a20f372;p=lhc%2Fweb%2Fwiklou.git * (bug 9939) Special:Search now sets focus to search input box when no existing search is active --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2f33b5a4ae..4572c980f7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -115,6 +115,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * When a user is prohibited from creating a page, a title of "View source" makes no sense, and there should be no "Return to [[Page]]" link. * (bug 12486) Protected titles now give a warning for privileged editors. +* (bug 9939) Special:Search now sets focus to search input box when no existing + search is active === Bug fixes in 1.12 === diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index 3530ff1a5b..e30ad08b06 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -125,10 +125,11 @@ class SpecialSearch { global $wgOut; $wgOut->addWikiText( wfMsg( 'searchresulttext' ) ); - #if ( !$this->parseQuery() ) { if( '' === trim( $term ) ) { + // Empty query -- straight view of search form $wgOut->setSubtitle( '' ); $wgOut->addHTML( $this->powerSearchBox( $term ) ); + $wgOut->addHTML( $this->powerSearchFocus() ); wfProfileOut( $fname ); return; } @@ -400,7 +401,7 @@ class SpecialSearch { : ''; $redirect = "\n"; - $searchField = '\n"; $searchButton = '
\n
\n{$ret}\n
\n"; } + + function powerSearchFocus() { + return ""; + } }