From: Felix Kästner Date: Tue, 2 Jun 2015 19:27:04 +0000 (+0200) Subject: add option/ keyword to not use the default search engine X-Git-Url: https://fpunktk.de/gitweb/?p=consearch.git;a=commitdiff_plain;h=4da2fde952254a7571c58fbf3085917f2846fe2c;hp=f4556a4da52227cf8def049e206e5705a673a74e add option/ keyword to not use the default search engine --- diff --git a/index.php b/index.php index cda4e5d..3f1966d 100644 --- a/index.php +++ b/index.php @@ -159,17 +159,22 @@ function parse_fragmentstring() { document.getElementById("querystring").focus(); } else { fragmentarr = fragmentstring.replace("%20", "+").split("+"); - if ( se[fragmentarr[0]] ) { - // first word in query is a keyword - kw = fragmentarr[0]; + kw = fragmentarr[0]; + if ( se[kw] ) { + // first word in query is a search engine keyword fragmentarr.shift(); location.href = se[kw][1] + fragmentarr.join(" "); } else { - // there is no keyword