logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git

search_on_category_select.js (771B)


  1. $(document).ready(function() {
  2. if($('#q').length) {
  3. $('#categories label').click(function(e) {
  4. $('#categories input[type="checkbox"]').each(function(i, checkbox) {
  5. $(checkbox).prop('checked', false);
  6. });
  7. $(document.getElementById($(this).attr("for"))).prop('checked', true);
  8. if($('#q').val()) {
  9. $('#search_form').submit();
  10. }
  11. return false;
  12. });
  13. $('#time-range').change(function(e) {
  14. if($('#q').val()) {
  15. $('#search_form').submit();
  16. }
  17. });
  18. $('#language').change(function(e) {
  19. if($('#q').val()) {
  20. $('#search_form').submit();
  21. }
  22. });
  23. }
  24. });