add keyword as title to buttons
[consearch.git] / index.php
index 0eff2c189714a3319ddabe8bf4ad78511faf4eb7..a4e8442df299f0ef6c7905e60a58fe44893f2127 100644 (file)
--- a/index.php
+++ b/index.php
@@ -43,7 +43,20 @@ if ( isset($_GET['get']) and $_GET['get'] === "opensearchdescription" ) {
 <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
 <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="index.php?get=opensearchdescription<?php if ( $dse ) { echo "&amp;dse=$dse"; } ?>" title="consearch<?php if ( $dse ) { echo " ($dse)"; } ?>">
+<?php
+if ( isset($_GET['include']) and $_GET['include'] == "opensearchdescriptionlink" ) {
+    echo '<link rel="search" type="application/opensearchdescription+xml" href="index.php?get=opensearchdescription';
+    if ( $dse ) {
+        echo "&amp;dse=$dse";
+    }
+    echo '" title="consearch';
+    if ( $dse ) {
+        echo " ($dse)";
+    }
+    echo '">';
+    echo "\n";
+}
+?>
 
 <style type="text/css">
 * {
@@ -148,13 +161,13 @@ se["gh"] = ["github", "https://github.com/search?utf8=✓&q=", ""];
 se["bb"] = ["bing", "https://www.bing.com/search?q=", ""];
 se["mdn"] = ["mdn", "https://developer.mozilla.org/search?q=", ""];
 se["ctan"] = ["ctan", "http://ctan.org/search/?phrase=", ""];
-se["gpg"] = ["gpg_key", "https://pgp.mit.edu/pks/lookup?op=index&fingerprint=on&search=", ""];
+se["gpg"] = ["gpg_mit", "https://pgp.mit.edu/pks/lookup?op=index&fingerprint=on&search=", ""];
 se["gsm"] = ["gsm", "http://www.gsmarena.com/results.php3?sQuickSearch=yes&sName=", ""];
 
 function display_searchbuttons() {
     document.getElementById("searchbuttons").innerHTML = "";
     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("searchbuttons").innerHTML += '<button type="button" title="' + kw + '" 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";
     }
 }
 
@@ -198,7 +211,7 @@ if ( $dse ) {
 
 <body onload="parse_fragmentstring();">
 
-<h1><a href="">fpunktk.de/consearch</a></h1>
+<h1><a href="./">fpunktk.de/consearch</a></h1>
 
 <noscript>
 <p style="color: red; font-size: 200%; font-weight: bold;">
@@ -213,6 +226,10 @@ please enable javascript
 <div id="searchbuttons">
 </div>
 
+<p>
+<a href="?include=opensearchdescriptionlink">add to browser</a>
+</p>
+
 <p>
 <a href="https://github.com/fpunktk/consearch">about</a>
 </p>