From 4da2fde952254a7571c58fbf3085917f2846fe2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20K=C3=A4stner?= Date: Tue, 2 Jun 2015 21:27:04 +0200 Subject: [PATCH] add option/ keyword to not use the default search engine --- index.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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