projects
/
consearch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f4556a4
)
add option/ keyword to not use the default search engine
author
Felix Kästner
<git@fpunktk.de>
Tue, 2 Jun 2015 19:27:04 +0000
(21:27 +0200)
committer
Felix Kästner
<git@fpunktk.de>
Tue, 2 Jun 2015 19:27:04 +0000
(21:27 +0200)
index.php
patch
|
blob
|
history
diff --git
a/index.php
b/index.php
index cda4e5d394b17fc67d08eb1849597b5ccf80358f..3f1966dc993291449dcfece9a5dbc18444627075 100644
(file)
--- a/
index.php
+++ b/
index.php
@@
-159,17
+159,22
@@
function parse_fragmentstring() {
document.getElementById("querystring").focus();
} else {
fragmentarr = fragmentstring.replace("%20", "+").split("+");
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 {
fragmentarr.shift();
location.href = se[kw][1] + fragmentarr.join(" ");
} else {
- // there is no keyword
<?php
if ( $dse ) {
// use a default searchengine
<?php
if ( $dse ) {
// use a default searchengine
- echo ' location.href = se["' . $dse . '"][1] + fragmentarr.join(" ");
+ echo ' if ( kw != "nd" ) {
+ location.href = se["' . $dse . '"][1] + fragmentarr.join(" ");
+ } else {
+ fragmentarr.shift();
+ document.getElementById("querystring").value = fragmentarr.join(" ");
+ display_searchbuttons();
+ }
';
} else {
// display all buttons and write the fragmentstring into the querystring input
';
} else {
// display all buttons and write the fragmentstring into the querystring input