diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2020-06-19 04:50:36 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-19 04:50:36 +0000 |
| commit | 6337d515dd11d2014a775b67103eda51c7fc38e2 (patch) | |
| tree | fdd3f1e67a8e08d28b137348834aa6c72e4513ab /searx/static/plugins/js | |
| parent | 5dd235463a11bec2e3546e89f2b31d2a5aa40326 (diff) | |
| parent | c83007a6bcd2a7f765e7655b91cc6714fbc4ab01 (diff) | |
Merge branch 'master' into new-readme
Diffstat (limited to 'searx/static/plugins/js')
| -rw-r--r-- | searx/static/plugins/js/search_on_category_select.js | 18 |
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; +} |