From 4e5af8d87bc3602fcdb263ad2e1595be91df95c9 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 10 Feb 2016 18:06:11 +0100 Subject: [mod] move plugin static files to static/plugins --- searx/static/plugins/js/search_on_category_select.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 searx/static/plugins/js/search_on_category_select.js (limited to 'searx/static/plugins') 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 000000000..5ecc2cdb9 --- /dev/null +++ b/searx/static/plugins/js/search_on_category_select.js @@ -0,0 +1,16 @@ +$(document).ready(function() { + if($('#q').length) { + $('#categories label').click(function(e) { + $('#categories input[type="checkbox"]').each(function(i, checkbox) { + $(checkbox).prop('checked', false); + }); + $('#categories label').removeClass('btn-primary').removeClass('active').addClass('btn-default'); + $(this).removeClass('btn-default').addClass('btn-primary').addClass('active'); + $($(this).children()[0]).prop('checked', 'checked'); + if($('#q').val()) { + $('#search_form').submit(); + } + return false; + }); + } +}); -- cgit v1.2.3