From b142e883910be4d66259fdb1a70e4d8ca21705cb Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Mon, 31 Jul 2017 04:41:53 +0430 Subject: [PATCH 1/9] Update results.less More gap between search results increase the readability. Currently, the result page is just filled with text. --- searx/static/themes/oscar/less/logicodev/results.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/static/themes/oscar/less/logicodev/results.less b/searx/static/themes/oscar/less/logicodev/results.less index b16b3c2e2..702ece426 100644 --- a/searx/static/themes/oscar/less/logicodev/results.less +++ b/searx/static/themes/oscar/less/logicodev/results.less @@ -53,7 +53,7 @@ // default formating of results .result-default, .result-code, .result-torrent, .result-videos, .result-map { clear: both; - padding: 2px 4px; + padding: 1em 4px; &:hover{ background-color: @dim-gray; } From f47e6fc0f8f2c3115a126f37e319b0e3515f49e1 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 3 Jun 2020 13:44:40 +0200 Subject: [PATCH 2/9] [enh] build css after less file changes --- .../themes/oscar/css/logicodev-dark.css | 2 +- .../themes/oscar/css/logicodev-dark.min.css | Bin 13348 -> 13348 bytes searx/static/themes/oscar/css/logicodev.css | 2 +- .../static/themes/oscar/css/logicodev.min.css | Bin 9908 -> 9908 bytes 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/static/themes/oscar/css/logicodev-dark.css b/searx/static/themes/oscar/css/logicodev-dark.css index 07f422f8e..e646d24fc 100644 --- a/searx/static/themes/oscar/css/logicodev-dark.css +++ b/searx/static/themes/oscar/css/logicodev-dark.css @@ -172,7 +172,7 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not .result-videos, .result-map { clear: both; - padding: 2px 4px; + padding: 1em 4px; } .result-default:hover, .result-code:hover, diff --git a/searx/static/themes/oscar/css/logicodev-dark.min.css b/searx/static/themes/oscar/css/logicodev-dark.min.css index 06e7fb0a9afb0981e2ba370f1af0ec333099186a..33a11439874d8e4c03b251f94bcaad7fd374c9f2 100644 GIT binary patch delta 16 XcmZ3Iu_R-|KMrQY)ZERCoXXk&JtYO; delta 16 XcmZ3Iu_R-|KMrQ2f{M+IoXXk&J-h|? diff --git a/searx/static/themes/oscar/css/logicodev.css b/searx/static/themes/oscar/css/logicodev.css index 5e78ac749..5a329d61a 100644 --- a/searx/static/themes/oscar/css/logicodev.css +++ b/searx/static/themes/oscar/css/logicodev.css @@ -145,7 +145,7 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not .result-videos, .result-map { clear: both; - padding: 2px 4px; + padding: 1em 4px; } .result-default:hover, .result-code:hover, diff --git a/searx/static/themes/oscar/css/logicodev.min.css b/searx/static/themes/oscar/css/logicodev.min.css index 7f093e71741a29977c7cdf726622f84d0afbf1af..e3a3cfbd6de0e8d4b1cb37d3234c76489af6cc6a 100644 GIT binary patch delta 16 XcmdnuyTx}yHW#yDYVPJdE;ktfH^K$G delta 16 XcmdnuyTx}yHW#x|LB-}gE;ktfI9UbK From bab5efeac9591f1ffe87a0ab5c8ca10ed2d2eafc Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 3 Jun 2020 13:44:55 +0200 Subject: [PATCH 3/9] [enh] update npm dependency versions --- searx/static/themes/oscar/package.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/searx/static/themes/oscar/package.json b/searx/static/themes/oscar/package.json index 5b10fcf9f..5c01ef904 100644 --- a/searx/static/themes/oscar/package.json +++ b/searx/static/themes/oscar/package.json @@ -1,15 +1,18 @@ { "devDependencies": { - "grunt": "~0.4.5", - "grunt-contrib-uglify": "~0.6.0", - "grunt-contrib-watch": "~0.6.1", + "grunt": "^0.4.5", "grunt-contrib-concat": "~0.5.0", "grunt-contrib-jshint": "~0.10.0", - "grunt-contrib-less": "~0.11.0" + "grunt-contrib-less": "~0.11.0", + "grunt-contrib-uglify": "~0.6.0", + "grunt-contrib-watch": "~0.6.1" }, "scripts": { "build": "npm install && grunt", "start": "grunt watch", "test": "grunt" + }, + "dependencies": { + "grunt-cli": "^1.3.2" } } From c54a0e81ff3c44c79d0d4cab3d4022efa0cbdcd5 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 3 Jun 2020 13:49:20 +0200 Subject: [PATCH 4/9] [enh] add shortcut column to search engines table in preferences - fixes #230 --- searx/templates/courgette/preferences.html | 4 +++- searx/templates/legacy/preferences.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/searx/templates/courgette/preferences.html b/searx/templates/courgette/preferences.html index 56a6e0202..c67f7662b 100644 --- a/searx/templates/courgette/preferences.html +++ b/searx/templates/courgette/preferences.html @@ -98,6 +98,7 @@ + @@ -106,7 +107,8 @@ {% if not search_engine.private %} - + +
{{ _('Engine name') }}{{ _('Shortcut') }} {{ _('Category') }} {{ _('Allow') }} / {{ _('Block') }}
{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})‎{{ search_engine.name }}{{ shortcuts[search_engine.name] }} {{ _(categ) }} diff --git a/searx/templates/legacy/preferences.html b/searx/templates/legacy/preferences.html index f418dcd5b..414b3f6c0 100644 --- a/searx/templates/legacy/preferences.html +++ b/searx/templates/legacy/preferences.html @@ -95,6 +95,7 @@ + @@ -103,7 +104,8 @@ {% if not search_engine.private %} - + +
{{ _('Engine name') }}{{ _('Shortcut') }} {{ _('Category') }} {{ _('Allow') }} / {{ _('Block') }}
{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})‎{{ search_engine.name }}{{ shortcuts[search_engine.name] }} {{ _(categ) }} From 47cddcab8b86742480e4c12cf47853843e83e55f Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 3 Jun 2020 15:04:01 +0200 Subject: [PATCH 5/9] [mod] reduce the gap between results --- .../themes/oscar/css/logicodev-dark.css | 2 +- .../themes/oscar/css/logicodev-dark.min.css | Bin 13348 -> 13349 bytes searx/static/themes/oscar/css/logicodev.css | 2 +- .../static/themes/oscar/css/logicodev.min.css | Bin 9908 -> 9909 bytes .../themes/oscar/less/logicodev/results.less | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/searx/static/themes/oscar/css/logicodev-dark.css b/searx/static/themes/oscar/css/logicodev-dark.css index e646d24fc..b904c6701 100644 --- a/searx/static/themes/oscar/css/logicodev-dark.css +++ b/searx/static/themes/oscar/css/logicodev-dark.css @@ -172,7 +172,7 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not .result-videos, .result-map { clear: both; - padding: 1em 4px; + padding: 0.5em 4px; } .result-default:hover, .result-code:hover, diff --git a/searx/static/themes/oscar/css/logicodev-dark.min.css b/searx/static/themes/oscar/css/logicodev-dark.min.css index 33a11439874d8e4c03b251f94bcaad7fd374c9f2..f03e6336ba8ddbf541ac51ab7785af9e7f76570b 100644 GIT binary patch delta 15 WcmZ3Iu{2}DKMp26)6M@mRJ8#(_y#`! delta 13 UcmZ3Qu_R-|KMqF2O`NLQ04o&*4FCWD diff --git a/searx/static/themes/oscar/css/logicodev.css b/searx/static/themes/oscar/css/logicodev.css index 5a329d61a..b6c4af950 100644 --- a/searx/static/themes/oscar/css/logicodev.css +++ b/searx/static/themes/oscar/css/logicodev.css @@ -145,7 +145,7 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not .result-videos, .result-map { clear: both; - padding: 1em 4px; + padding: 0.5em 4px; } .result-default:hover, .result-code:hover, diff --git a/searx/static/themes/oscar/css/logicodev.min.css b/searx/static/themes/oscar/css/logicodev.min.css index e3a3cfbd6de0e8d4b1cb37d3234c76489af6cc6a..a7d750d193a0fcaf1556ad6950cb2bac9e17c316 100644 GIT binary patch delta 15 WcmdnuyVZ9?HW!ng>E;|R4;cV3KLr~A delta 14 Vcmdn$yTx}yHW#De=3Fih82~G}1nB?( diff --git a/searx/static/themes/oscar/less/logicodev/results.less b/searx/static/themes/oscar/less/logicodev/results.less index cd0dfca2a..a33ca7673 100644 --- a/searx/static/themes/oscar/less/logicodev/results.less +++ b/searx/static/themes/oscar/less/logicodev/results.less @@ -64,7 +64,7 @@ // default formating of results .result-default, .result-code, .result-torrent, .result-videos, .result-map { clear: both; - padding: 1em 4px; + padding: 0.5em 4px; &:hover{ background-color: @dim-gray; } From 08fdfc73fbbbe47811252ba89d8aeff8c1d07fcb Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 3 Jun 2020 15:36:22 +0200 Subject: [PATCH 6/9] [fix] do not autocomplete for pressing enter when mouse is on the completion list - fixes #340 --- searx/static/themes/oscar/js/searx.js | 9 +++++++++ searx/static/themes/oscar/js/searx.min.js | Bin 5124 -> 5217 bytes .../oscar/js/searx_src/autocompleter.js | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js index c6feda50c..c93f597fe 100644 --- a/searx/static/themes/oscar/js/searx.js +++ b/searx/static/themes/oscar/js/searx.js @@ -78,7 +78,13 @@ if(searx.autocompleter) { } $(document).ready(function(){ + var original_search_value = ''; if(searx.autocompleter) { + $("#q").on('keydown', function(e) { + if(e.which == 13) { + original_search_value = $('#q').val(); + } + }); $('#q').typeahead(null, { name: 'search-results', displayKey: function(result) { @@ -87,6 +93,9 @@ $(document).ready(function(){ source: searx.searchResults.ttAdapter() }); $('#q').bind('typeahead:selected', function(ev, suggestion) { + if(original_search_value) { + $('#q').val(original_search_value); + } $("#search_form").submit(); }); } diff --git a/searx/static/themes/oscar/js/searx.min.js b/searx/static/themes/oscar/js/searx.min.js index 9c3e13b59b85fdda39ac75c6eecc41b9a295dc6a..08aba2b4be8b580419795dfec39f60f0dd9f736e 100644 GIT binary patch delta 188 zcmZqCc&IT!lGVUi*T8I}TpSZ;Sz?hwqOFpW_2e2RIjj6U4W;bV%9Q-_JSCm9(!Au7 zOrTJbX0@TQt!~ V#Ps6mlvuc|l9iI?W>entYyf1ZH*o*} delta 102 zcmaE;(V{UylGWHy*T8h6TpW{FacW{wg Date: Mon, 30 Mar 2020 23:24:30 +0200 Subject: [PATCH 7/9] make category order configurable using ui.categories_order --- searx/settings.yml | 6 ++++++ searx/webapp.py | 24 +++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/searx/settings.yml b/searx/settings.yml index 2497a764b..8df151b14 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -24,6 +24,12 @@ ui: default_locale : "" # Default interface locale - leave blank to detect from browser information or use codes from the 'locales' config section theme_args : oscar_style : logicodev # default style of oscar +# categories_order : +# - general +# - files +# - map +# - it +# - science # searx supports result proxification using an external service: https://github.com/asciimoo/morty # uncomment below section if you have running morty proxy diff --git a/searx/webapp.py b/searx/webapp.py index f3f5f21b8..46d4e949c 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -355,17 +355,12 @@ def render(template_name, override_theme=None, **kwargs): if (engine_name, category) not in disabled_engines) if 'categories' not in kwargs: - kwargs['categories'] = ['general'] - kwargs['categories'].extend(x for x in - sorted(categories.keys()) - if x != 'general' - and x in enabled_categories) + kwargs['categories'] = [x for x in + _get_ordered_categories() + if x in enabled_categories] if 'all_categories' not in kwargs: - kwargs['all_categories'] = ['general'] - kwargs['all_categories'].extend(x for x in - sorted(categories.keys()) - if x != 'general') + kwargs['all_categories'] = _get_ordered_categories() if 'selected_categories' not in kwargs: kwargs['selected_categories'] = [] @@ -443,6 +438,17 @@ def render(template_name, override_theme=None, **kwargs): '{}/{}'.format(kwargs['theme'], template_name), **kwargs) +def _get_ordered_categories(): + ordered_categories = [] + if 'categories_order' not in settings['ui']: + ordered_categories = ['general'] + ordered_categories.extend(x for x in sorted(categories.keys()) if x != 'general') + return ordered_categories + ordered_categories = settings['ui']['categories_order'] + ordered_categories.extend(x for x in sorted(categories.keys()) if x not in ordered_categories) + return ordered_categories + + @app.before_request def pre_request(): request.start_time = time() From de1b08a941a6834a39159b9a2aa3ff3552df029f Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Thu, 4 Jun 2020 19:20:44 +0200 Subject: [PATCH 8/9] [enh] add unique class for each endpoint - closes #1133 --- searx/templates/courgette/base.html | 2 +- searx/templates/legacy/base.html | 2 +- searx/templates/oscar/base.html | 2 +- searx/templates/simple/base.html | 2 +- searx/webapp.py | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/searx/templates/courgette/base.html b/searx/templates/courgette/base.html index 8e272585c..f4c61dac2 100644 --- a/searx/templates/courgette/base.html +++ b/searx/templates/courgette/base.html @@ -29,7 +29,7 @@ searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %}; - +
{% block content %} {% endblock %} diff --git a/searx/templates/legacy/base.html b/searx/templates/legacy/base.html index da19741cb..21fe42e16 100644 --- a/searx/templates/legacy/base.html +++ b/searx/templates/legacy/base.html @@ -20,7 +20,7 @@ {% endblock %} - +
{% block content %} {% endblock %} diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index 5eb4462e4..cd3d23df5 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -47,7 +47,7 @@ - + {% include 'oscar/navbar.html' %}
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 71df123ea..650ef771c 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -32,7 +32,7 @@ {% endblock %} - +
{% if errors %}