From 7b1b2985ad0342fdff7cccce08c8787a93310fa0 Mon Sep 17 00:00:00 2001 From: k Date: Wed, 1 Sep 2021 20:05:39 +0300 Subject: Variable for default search engine Added a variable for default search engine (leaving Google for compatibility reasons), and added a case for Google if something else is defined. --- assets/js/search.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'assets/js') diff --git a/assets/js/search.js b/assets/js/search.js index 7d3cc76..fc47a9d 100755 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -1,5 +1,6 @@ var sindex = 0; var cycle = false; +var sengine = "https://www.google.com/?q="; // Default search engine function start() { var query = getParameterByName('q'); @@ -92,6 +93,10 @@ function search(text) { case "y": window.location = "https://www.youtube.com/results?search_query=" + subtext; break; + case "g": + window.location = "https://www.google.com/?q=" + subtext; + break; + } } else { var option = text.substr(1); -- cgit v1.2.3 From 41c22ed218d6f97f176ec3ef52c89ed2d17ad965 Mon Sep 17 00:00:00 2001 From: k Date: Wed, 1 Sep 2021 20:06:09 +0300 Subject: Update search.js --- assets/js/search.js | 1 - 1 file changed, 1 deletion(-) (limited to 'assets/js') diff --git a/assets/js/search.js b/assets/js/search.js index fc47a9d..3217735 100755 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -96,7 +96,6 @@ function search(text) { case "g": window.location = "https://www.google.com/?q=" + subtext; break; - } } else { var option = text.substr(1); -- cgit v1.2.3 From 190954b55012a5a933a8c0a8d869d34406db385d Mon Sep 17 00:00:00 2001 From: k Date: Fri, 3 Sep 2021 15:48:02 +0300 Subject: $sengine was not actually used Had declared search engine in variable, but the variable wasn't actually used. --- assets/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'assets/js') diff --git a/assets/js/search.js b/assets/js/search.js index 3217735..12736b2 100755 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -120,7 +120,7 @@ function search(text) { else window.location = "https://" + text; } else { - window.location = "https://www.google.com/search?q=" + text; + window.location = sengine + text; } } -- cgit v1.2.3