summaryrefslogtreecommitdiff
path: root/searx/static
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-04-12 19:27:48 +0200
committerAdam Tauber <asciimoo@gmail.com>2015-04-12 19:27:48 +0200
commit973c97c85b493bf142bd1b903cf9bf8931fcfbad (patch)
tree95be510a211652b6b96472ccbd03c3b8949d29f3 /searx/static
parentdd84814b68369e36d6be20bae707848a051a025a (diff)
downloadsearxng-973c97c85b493bf142bd1b903cf9bf8931fcfbad.tar.gz
searxng-973c97c85b493bf142bd1b903cf9bf8931fcfbad.zip
[enh] new plugin: search on category select (currently only in oscar theme)
TODO purge mootools from default/courgette and integrate jquery ++ this theme
Diffstat (limited to 'searx/static')
-rw-r--r--searx/static/js/search_on_category_select.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/searx/static/js/search_on_category_select.js b/searx/static/js/search_on_category_select.js
new file mode 100644
index 000000000..6156ca4e8
--- /dev/null
+++ b/searx/static/js/search_on_category_select.js
@@ -0,0 +1,14 @@
+$(document).ready(function() {
+ if($('#q')) {
+ $('#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');
+ $('#search_form').submit();
+ return false;
+ });
+ }
+});