From f674a8733c8b7fade8ee09c980ae951e2a20f372 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 3 Jan 2008 01:02:09 +0000 Subject: [PATCH] * (bug 9939) Special:Search now sets focus to search input box when no existing search is active --- RELEASE-NOTES | 2 ++ includes/SpecialSearch.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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 ""; + } } -- 2.20.1