only focus the input if it is empty
[consearch.git] / index.php
index e8a3756420937ae649e20b43a3ad77d14643a2b9..1f3311e3e98f49adf0e51e45bfc605f88a8af756 100644 (file)
--- a/index.php
+++ b/index.php
@@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with thi
 
 <title>consearch</title>
 <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAACMuuz63rNKAAAAK0lEQVQI12P4/58BiM4cZ9gdDUVnboNE/n8Hoc6JDLvLGLrLGF4DyWlAcQBYKBgvsgbJOAAAAABJRU5ErkJggg==" type="image/png">
-<link rel="search" type="application/opensearchdescription+xml" href="opensearchdescription-consearch.xml" title="consearch">
+<link rel="search" type="application/opensearchdescription+xml" href="opensearchdescription-consearch.xml.php" title="consearch">
 
 <style type="text/css">
 * {
@@ -119,13 +119,13 @@ function display_searchbuttons() {
     for ( kw in se ) {
         document.getElementById("searchbuttons").innerHTML += '<button type="button" value="' + se[kw][0] + '" onclick=\'location.href="' + se[kw][1] + '" + document.getElementById("querystring").value\'><img src="data:image/png;base64,' + b64images[se[kw][2]] + '" alt="">&nbsp;' + se[kw][0] + "</button> \n";
     }
-    document.getElementById("querystring").focus();
 }
 
 function parse_fragmentstring() {
     var fragmentstring = document.URL.substr( document.URL.split("#")[0].length + 1 );
     if ( fragmentstring == "" ) {
         display_searchbuttons();
+        document.getElementById("querystring").focus();
     } else {
         fragmentarr = fragmentstring.replace("%20", "+").split("+");
         if ( se[fragmentarr[0]] ) {