diff options
Diffstat (limited to 'searx/static/plugins')
| -rw-r--r-- | searx/static/plugins/external_plugins/.gitignore | 3 | ||||
| -rw-r--r-- | searx/static/plugins/js/open_results_on_new_tab.js | 3 | ||||
| -rw-r--r-- | searx/static/plugins/js/search_on_category_select.js | 18 |
3 files changed, 21 insertions, 3 deletions
diff --git a/searx/static/plugins/external_plugins/.gitignore b/searx/static/plugins/external_plugins/.gitignore new file mode 100644 index 000000000..94548af5b --- /dev/null +++ b/searx/static/plugins/external_plugins/.gitignore @@ -0,0 +1,3 @@ +* +*/ +!.gitignore diff --git a/searx/static/plugins/js/open_results_on_new_tab.js b/searx/static/plugins/js/open_results_on_new_tab.js deleted file mode 100644 index 99ef382a0..000000000 --- a/searx/static/plugins/js/open_results_on_new_tab.js +++ /dev/null @@ -1,3 +0,0 @@ -$(document).ready(function() { - $('.result_header > a').attr('target', '_blank'); -}); 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; +} |