Revision: 51245
Author:   rainman
Date:     2009-05-31 16:58:01 +0000 (Sun, 31 May 2009)

Log Message:
-----------
Another follow-up for 50207: show form header for empty searches as well

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialSearch.php
    trunk/phase3/skins/common/search.js

Modified: trunk/phase3/includes/specials/SpecialSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialSearch.php    2009-05-31 16:55:30 UTC 
(rev 51244)
+++ trunk/phase3/includes/specials/SpecialSearch.php    2009-05-31 16:58:01 UTC 
(rev 51245)
@@ -201,6 +201,7 @@
                $filePrefix = $wgContLang->getFormattedNsText(NS_FILE).':';
                if( '' === trim( $term ) || $filePrefix === trim( $term ) ) {
                        $wgOut->addHTML( $this->searchAdvanced ? 
$this->powerSearchFocus() : $this->searchFocus() );
+                       $wgOut->addHTML( $this->formHeader($term, 0, 0));
                        // Empty query -- straight view of search form
                        wfProfileOut( __METHOD__ );
                        return;

Modified: trunk/phase3/skins/common/search.js
===================================================================
--- trunk/phase3/skins/common/search.js 2009-05-31 16:55:30 UTC (rev 51244)
+++ trunk/phase3/skins/common/search.js 2009-05-31 16:58:01 UTC (rev 51245)
@@ -11,9 +11,12 @@
        var searchterm = searchbox.value;
        var parts = obj.href.split("search=");
        var lastpart = '';
-       if( parts[1].indexOf('&') >= 0 )
+       var prefix = "search=";
+       if( parts.length > 1 && parts[1].indexOf('&') >= 0 )
                lastpart = parts[1].substring( parts[1].indexOf('&') )
-       obj.href = parts[0] + "search=" + encodeURIComponent(searchterm) + 
lastpart;
+       else 
+               prefix = "&search=";
+       obj.href = parts[0] + prefix + encodeURIComponent(searchterm) + 
lastpart;
 }
 
 function mwToggleSearchCheckboxes( btn ) {



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to