logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: a11230819ff76312b4528b2bfb6e03d0560075b1
parent c677aee58a4eca1015262eb24530620a333ddcef
Author: marc <a01200356@itesm.mx>
Date:   Tue, 20 Sep 2016 15:19:02 -0500

automatic search when language is selected

Diffstat:

Msearx/static/plugins/js/search_on_category_select.js5+++++
Msearx/templates/oscar/languages.html2+-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/searx/static/plugins/js/search_on_category_select.js b/searx/static/plugins/js/search_on_category_select.js @@ -15,5 +15,10 @@ $(document).ready(function() { $('#search_form').submit(); } }); + $('#language').change(function(e) { + if($('#q').val()) { + $('#search_form').submit(); + } + }); } }); diff --git a/searx/templates/oscar/languages.html b/searx/templates/oscar/languages.html @@ -1,7 +1,7 @@ {% if preferences %} <select class="form-control" name='language'> {% else %} -<select class="time_range" name='language'> +<select class="time_range" id='language' name='language'> {% endif %} <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option> {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %}