summaryrefslogtreecommitdiff
path: root/searx/static/plugins/js/search_on_category_select.js
diff options
context:
space:
mode:
Diffstat (limited to 'searx/static/plugins/js/search_on_category_select.js')
-rw-r--r--searx/static/plugins/js/search_on_category_select.js24
1 files changed, 24 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
new file mode 100644
index 0000000..a76fd12
--- /dev/null
+++ b/searx/static/plugins/js/search_on_category_select.js
@@ -0,0 +1,24 @@
+$(document).ready(function() {
+ if($('#q').length) {
+ $('#categories label').click(function(e) {
+ $('#categories input[type="checkbox"]').each(function(i, checkbox) {
+ $(checkbox).prop('checked', false);
+ });
+ $(document.getElementById($(this).attr("for"))).prop('checked', true);
+ if($('#q').val()) {
+ $('#search_form').submit();
+ }
+ return false;
+ });
+ $('#time-range > option').click(function(e) {
+ if($('#q').val()) {
+ $('#search_form').submit();
+ }
+ });
+ $('#language').change(function(e) {
+ if($('#q').val()) {
+ $('#search_form').submit();
+ }
+ });
+ }
+});