summaryrefslogtreecommitdiff
path: root/searx/static/plugins
diff options
context:
space:
mode:
authorNoémi Ványi <kvch@users.noreply.github.com>2020-06-28 20:28:12 +0200
committerGitHub <noreply@github.com>2020-06-28 20:28:12 +0200
commit93cbd85b8a5becdf69e6d70dd7c60f7122531262 (patch)
tree90d202af89e02fc3e83d5bdf4a924b05ff197261 /searx/static/plugins
parent385e9b5c9e2d1caa73f99dac0bf1be1c46505121 (diff)
parentf9f5974968ce767c24eea8c8a651d0e3945fc01b (diff)
Merge branch 'master' into duckduckgo_correction
Diffstat (limited to 'searx/static/plugins')
-rw-r--r--searx/static/plugins/js/search_on_category_select.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/searx/static/plugins/js/search_on_category_select.js b/searx/static/plugins/js/search_on_category_select.js
index 1c42d9e9e..d590ed127 100644
--- a/searx/static/plugins/js/search_on_category_select.js
+++ b/searx/static/plugins/js/search_on_category_select.js
@@ -6,19 +6,37 @@ $(document).ready(function() {
});
$(document.getElementById($(this).attr("for"))).prop('checked', true);
if($('#q').val()) {
+ if (getHttpRequest() == "GET") {
+ $('#search_form').attr('action', $('#search_form').serialize());
+ }
$('#search_form').submit();
}
return false;
});
$('#time-range').change(function(e) {
if($('#q').val()) {
+ if (getHttpRequest() == "GET") {
+ $('#search_form').attr('action', $('#search_form').serialize());
+ }
$('#search_form').submit();
}
});
$('#language').change(function(e) {
if($('#q').val()) {
+ if (getHttpRequest() == "GET") {
+ $('#search_form').attr('action', $('#search_form').serialize());
+ }
$('#search_form').submit();
}
});
}
});
+
+function getHttpRequest() {
+ httpRequest = "POST";
+ urlParams = new URLSearchParams(window.location.search);
+ if (urlParams.has('method')) {
+ httpRequest = urlParams.get('method');
+ }
+ return httpRequest;
+}