mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
Merge branch 'master' into duckduckgo_correction
This commit is contained in:
commit
93cbd85b8a
100 changed files with 7507 additions and 641 deletions
|
|
@ -1,4 +1,5 @@
|
|||
GIT_URL = 'https://github.com/asciimoo/searx'
|
||||
GIT_BRANCH = 'master'
|
||||
ISSUE_URL = 'https://github.com/asciimoo/searx/issues'
|
||||
SEARX_URL = 'https://searx.me'
|
||||
DOCS_URL = 'https://asciimoo.github.io/searx'
|
||||
|
|
|
|||
|
|
@ -117,14 +117,10 @@ def response(resp):
|
|||
'img_format': img_format,
|
||||
'template': 'images.html'
|
||||
}
|
||||
try:
|
||||
result['author'] = author
|
||||
result['title'] = title
|
||||
result['content'] = content
|
||||
except:
|
||||
result['author'] = ''
|
||||
result['title'] = ''
|
||||
result['content'] = ''
|
||||
result['author'] = author.encode('utf-8', 'ignore').decode('utf-8')
|
||||
result['source'] = source.encode('utf-8', 'ignore').decode('utf-8')
|
||||
result['title'] = title.encode('utf-8', 'ignore').decode('utf-8')
|
||||
result['content'] = content.encode('utf-8', 'ignore').decode('utf-8')
|
||||
results.append(result)
|
||||
|
||||
return results
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ supported_languages_url = 'https://search.yahoo.com/web/advanced'
|
|||
results_xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' Sr ')]"
|
||||
url_xpath = './/h3/a/@href'
|
||||
title_xpath = './/h3/a'
|
||||
content_xpath = './/div[@class="compText aAbs"]'
|
||||
content_xpath = './/div[contains(@class, "compText")]'
|
||||
suggestion_xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' AlsoTry ')]//a"
|
||||
|
||||
time_range_dict = {'day': ['1d', 'd'],
|
||||
|
|
|
|||
|
|
@ -6,19 +6,37 @@ $(document).ready(function() {
|
|||
});
|
||||
$(document.getElementById($(this).attr("for"))).prop('checked', true);
|
||||
if($('#q').val()) {
|
||||
if (getHttpRequest() == "GET") {
|
||||
$('#search_form').attr('action', $('#search_form').serialize());
|
||||
}
|
||||
$('#search_form').submit();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('#time-range').change(function(e) {
|
||||
if($('#q').val()) {
|
||||
if (getHttpRequest() == "GET") {
|
||||
$('#search_form').attr('action', $('#search_form').serialize());
|
||||
}
|
||||
$('#search_form').submit();
|
||||
}
|
||||
});
|
||||
$('#language').change(function(e) {
|
||||
if($('#q').val()) {
|
||||
if (getHttpRequest() == "GET") {
|
||||
$('#search_form').attr('action', $('#search_form').serialize());
|
||||
}
|
||||
$('#search_form').submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function getHttpRequest() {
|
||||
httpRequest = "POST";
|
||||
urlParams = new URLSearchParams(window.location.search);
|
||||
if (urlParams.has('method')) {
|
||||
httpRequest = urlParams.get('method');
|
||||
}
|
||||
return httpRequest;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,21 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not
|
|||
-ms-user-select: none;
|
||||
}
|
||||
.onoffswitch-checkbox {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
.onoffswitch-checkbox:before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 10px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 1px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 0px;
|
||||
}
|
||||
.onoffswitch-label {
|
||||
display: block;
|
||||
|
|
@ -104,7 +118,7 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not
|
|||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0px;
|
||||
border: 2px solid #FFFFFF !important;
|
||||
border: 2px solid #FFFFFF;
|
||||
border-radius: 50px !important;
|
||||
transition: all 0.3s ease-in 0s;
|
||||
}
|
||||
|
|
@ -115,6 +129,9 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not
|
|||
right: 71px;
|
||||
background-color: #A1A1A1;
|
||||
}
|
||||
.onoffswitch-checkbox:focus + .onoffswitch-label .onoffswitch-switch {
|
||||
border: 3px solid #444444;
|
||||
}
|
||||
.result_header {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 2px;
|
||||
|
|
@ -377,6 +394,17 @@ Ny0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb
|
|||
.search-margin {
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
.visually-hidden {
|
||||
position: absolute !important;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
/* IE6, IE7 */
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
white-space: nowrap;
|
||||
/* added line */
|
||||
}
|
||||
#advanced-search-container {
|
||||
display: none;
|
||||
text-align: left;
|
||||
|
|
@ -407,8 +435,8 @@ Ny0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb
|
|||
font-weight: bold;
|
||||
border-bottom: #01d7d4 5px solid;
|
||||
}
|
||||
#check-advanced {
|
||||
display: none;
|
||||
#check-advanced:focus + label {
|
||||
text-decoration: underline;
|
||||
}
|
||||
#check-advanced:checked ~ #advanced-search-container {
|
||||
display: block;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -43,7 +43,21 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not
|
|||
-ms-user-select: none;
|
||||
}
|
||||
.onoffswitch-checkbox {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
.onoffswitch-checkbox:before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 10px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 1px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 0px;
|
||||
}
|
||||
.onoffswitch-label {
|
||||
display: block;
|
||||
|
|
@ -77,7 +91,7 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not
|
|||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0px;
|
||||
border: 2px solid #FFFFFF !important;
|
||||
border: 2px solid #FFFFFF;
|
||||
border-radius: 50px !important;
|
||||
transition: all 0.3s ease-in 0s;
|
||||
}
|
||||
|
|
@ -88,6 +102,9 @@ input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not
|
|||
right: 71px;
|
||||
background-color: #A1A1A1;
|
||||
}
|
||||
.onoffswitch-checkbox:focus + .onoffswitch-label .onoffswitch-switch {
|
||||
border: 3px solid #444444;
|
||||
}
|
||||
.result_header {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 2px;
|
||||
|
|
@ -350,6 +367,17 @@ Ny0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb
|
|||
.search-margin {
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
.visually-hidden {
|
||||
position: absolute !important;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(1px 1px 1px 1px);
|
||||
/* IE6, IE7 */
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
white-space: nowrap;
|
||||
/* added line */
|
||||
}
|
||||
#advanced-search-container {
|
||||
display: none;
|
||||
text-align: left;
|
||||
|
|
@ -380,8 +408,8 @@ Ny0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb
|
|||
font-weight: bold;
|
||||
border-bottom: #01d7d4 5px solid;
|
||||
}
|
||||
#check-advanced {
|
||||
display: none;
|
||||
#check-advanced:focus + label {
|
||||
text-decoration: underline;
|
||||
}
|
||||
#check-advanced:checked ~ #advanced-search-container {
|
||||
display: block;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -291,7 +291,7 @@ $(document).ready(function(){
|
|||
}
|
||||
})
|
||||
.fail(function() {
|
||||
$(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">could not load data!</p>");
|
||||
$(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">"+could_not_load+"</p>");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
searx/static/themes/oscar/js/searx.min.js
vendored
4
searx/static/themes/oscar/js/searx.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -90,7 +90,7 @@ $(document).ready(function(){
|
|||
}
|
||||
})
|
||||
.fail(function() {
|
||||
$(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">could not load data!</p>");
|
||||
$(result_table_loadicon).html($(result_table_loadicon).html() + "<p class=\"text-muted\">"+could_not_load+"</p>");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
#check-advanced {
|
||||
display: none;
|
||||
#check-advanced:focus + label {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#check-advanced:checked ~ #advanced-search-container {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,21 @@
|
|||
-ms-user-select: none;
|
||||
}
|
||||
.onoffswitch-checkbox {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
.onoffswitch-checkbox:before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 10px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 1px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 0px;
|
||||
}
|
||||
.onoffswitch-label {
|
||||
display: block;
|
||||
|
|
@ -44,7 +58,7 @@
|
|||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0px;
|
||||
border: 2px solid #FFFFFF !important;
|
||||
border: 2px solid #FFFFFF;
|
||||
border-radius: 50px !important;
|
||||
transition: all 0.3s ease-in 0s;
|
||||
}
|
||||
|
|
@ -55,3 +69,6 @@
|
|||
right: 71px;
|
||||
background-color: #A1A1A1;
|
||||
}
|
||||
.onoffswitch-checkbox:focus + .onoffswitch-label .onoffswitch-switch {
|
||||
border: 3px solid #444444;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,4 +77,14 @@ Ny0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb
|
|||
|
||||
.search-margin {
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
}
|
||||
|
||||
.visually-hidden {
|
||||
position: absolute !important;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
white-space: nowrap; /* added line */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/*! simple/searx.min.js | 06-08-2019 | https://github.com/asciimoo/searx */
|
||||
/*! simple/searx.min.js | 15-06-2020 | */
|
||||
|
||||
(function(t,e){"use strict";var a=e.currentScript||function(){var t=e.getElementsByTagName("script");return t[t.length-1]}();t.searx={touch:"ontouchstart"in t||t.DocumentTouch&&document instanceof DocumentTouch||false,method:a.getAttribute("data-method"),autocompleter:a.getAttribute("data-autocompleter")==="true",search_on_category_select:a.getAttribute("data-search-on-category-select")==="true",infinite_scroll:a.getAttribute("data-infinite-scroll")==="true",static_path:a.getAttribute("data-static-path"),no_item_found:a.getAttribute("data-no-item-found")};e.getElementsByTagName("html")[0].className=t.searx.touch?"js touch":"js"})(window,document);
|
||||
//# sourceMappingURL=searx.head.min.js.map
|
||||
|
|
@ -1314,7 +1314,7 @@ module.exports = AutoComplete;
|
|||
})
|
||||
.catch(function() {
|
||||
result_table_loadicon.classList.remove('invisible');
|
||||
result_table_loadicon.innerHTML = "could not load data!";
|
||||
result_table_loadicon.innerHTML = could_not_load;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
searx/static/themes/simple/js/searx.min.js
vendored
4
searx/static/themes/simple/js/searx.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -97,7 +97,7 @@
|
|||
})
|
||||
.catch(function() {
|
||||
result_table_loadicon.classList.remove('invisible');
|
||||
result_table_loadicon.innerHTML = "could not load data!";
|
||||
result_table_loadicon.innerHTML = could_not_load;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,12 +59,16 @@
|
|||
|
||||
<h2 id='add to browser'>How to set as the default search engine?</h2>
|
||||
|
||||
<dt>Firefox</dt>
|
||||
<p>
|
||||
Searx supports <a href="https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md">OpenSearch</a>.
|
||||
For more information on changing your default search engine, see your browser's documentation:
|
||||
</p>
|
||||
|
||||
<dd>
|
||||
<a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a>
|
||||
searx as a search engine on any version of Firefox! (javascript required)
|
||||
</dd>
|
||||
<ul>
|
||||
<li><a href="https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox">Firefox</a></li>
|
||||
<li><a href="https://support.microsoft.com/en-us/help/4028574/microsoft-edge-change-the-default-search-engine" >Microsoft Egde</a></li>
|
||||
<li>Chrome based browsers <a href="https://www.chromium.org/tab-to-search">only add websites that the user navigates to without a path.</a>
|
||||
</ul>
|
||||
|
||||
<h2>Where to find anonymous usage statistics of this instance ?</h2>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,23 +6,13 @@
|
|||
<Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
|
||||
<LongName>searx metasearch</LongName>
|
||||
{% if opensearch_method == 'get' %}
|
||||
<Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
|
||||
{% if autocomplete %}
|
||||
<Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
|
||||
<Param name="format" value="x-suggestions" />
|
||||
<Param name="q" value="{searchTerms}" />
|
||||
</Url>
|
||||
{% endif %}
|
||||
<Url rel="results" type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
|
||||
{% else %}
|
||||
<Url type="text/html" method="post" template="{{ host }}">
|
||||
<Url rel="results" type="text/html" method="post" template="{{ host }}">
|
||||
<Param name="q" value="{searchTerms}" />
|
||||
</Url>
|
||||
{% if autocomplete %}
|
||||
<!-- TODO, POST REQUEST doesn't work -->
|
||||
<Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
|
||||
<Param name="format" value="x-suggestions" />
|
||||
<Param name="q" value="{searchTerms}" />
|
||||
</Url>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if autocomplete %}
|
||||
<Url rel="suggestions" type="application/json" template="{{ host }}autocompleter"/>
|
||||
{% endif %}
|
||||
</OpenSearchDescription>
|
||||
|
|
|
|||
1
searx/templates/__common__/translations.js.tpl
Normal file
1
searx/templates/__common__/translations.js.tpl
Normal file
|
|
@ -0,0 +1 @@
|
|||
var could_not_load = '{{ _('could not load data') }}!';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<input type="checkbox" name="advanced_search" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}>
|
||||
<input type="checkbox" name="advanced_search" class="visually-hidden" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}>
|
||||
<label for="check-advanced">{{- "" -}}
|
||||
<span class="glyphicon glyphicon-cog"></span>
|
||||
{{- _('Advanced settings') -}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{% from 'oscar/macros.html' import icon %}
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ preferences.get_value('locale') }}" xml:lang="{{ preferences.get_value('locale') }}"{% if rtl %} dir="rtl"{% endif %}>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="description" content="searx - a privacy-respecting, hackable metasearch engine" />
|
||||
|
|
@ -8,9 +8,9 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="searx/{{ searx_version }}">
|
||||
<meta name="referrer" content="no-referrer">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=2.0, user-scalable=1" />
|
||||
{% block meta %}{% endblock %}
|
||||
|
||||
<script src="{{ url_for('js_translations') }}"></script>
|
||||
<title>{% block title %}{% endblock %}{{ instance_name }}</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" />
|
||||
{% if preferences.get_value('oscar-style') -%}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
{% if cookies['oscar-style'] == 'pointhi' %}
|
||||
<h1 class="text-hide center-block"><img class="center-block img-responsive" src="{{ url_for('static', filename='img/searx_logo.png') }}" alt="searx logo"/>searx</h1>
|
||||
{% else %}
|
||||
<h1 class="text-hide center-block" id="main-logo">
|
||||
<div class="text-hide center-block" id="main-logo">
|
||||
<img class="center-block img-responsive" src="{{ url_for('static', filename='img/logo_searx_a.png') }}" alt="searx logo" />
|
||||
searx
|
||||
</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
{% for u in infobox.urls %}{% if u.official %} <a href="{{ u.url }}">{{ u.domain }}</a>{% endif %}{% endfor %}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" alt="{{ infobox.infobox }}" />{% endif %}
|
||||
{% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ image_proxify(infobox.img_src) }}" />{% endif %}
|
||||
|
||||
{% if infobox.content %}<bdi><p class="infobox_part">{{ infobox.content | safe }}</p></bdi>{% endif %}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<label class="visually-hidden" for="language">{{ _('Language') }}</label>
|
||||
<select class="language custom-select form-control" id="language" name="language" accesskey="l">
|
||||
<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) -%}
|
||||
|
|
|
|||
|
|
@ -60,15 +60,15 @@
|
|||
{%- endif %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro preferences_item_header(info, label, rtl) -%}
|
||||
{% macro preferences_item_header(info, label, rtl, id) -%}
|
||||
{% if rtl %}
|
||||
<div class="row form-group">
|
||||
<label class="col-sm-3 col-md-2 pull-right">{{ label }}</label>
|
||||
<label class="col-sm-3 col-md-2 pull-right"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>
|
||||
<span class="col-sm-5 col-md-6 help-block pull-left">{{ info }}</span>
|
||||
<div class="col-sm-4 col-md-4">
|
||||
{% else %}
|
||||
<div class="row form-group">
|
||||
<label class="col-sm-3 col-md-2">{{ label }}</label>
|
||||
<label class="col-sm-3 col-md-2"{% if id %} for="{{id}}"{% endif %}>{{ label }}</label>
|
||||
<div class="col-sm-4 col-md-4">
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
|
@ -91,6 +91,7 @@
|
|||
<span class="onoffswitch-inner"></span>
|
||||
<span class="onoffswitch-switch"></span>
|
||||
</label>
|
||||
<label class="visually-hidden" for="{{ id }}">{{ _('Allow') }}</label>
|
||||
</div>
|
||||
{%- endmacro %}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@
|
|||
<div class="col-sm-11 col-md-10">
|
||||
{% include 'oscar/categories.html' %}
|
||||
</div>
|
||||
<label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
|
||||
<label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label>
|
||||
{% else %}
|
||||
<label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
|
||||
<label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label>
|
||||
<div class="col-sm-11 col-md-10 search-categories">
|
||||
{% include 'oscar/categories.html' %}
|
||||
</div>
|
||||
|
|
@ -40,14 +40,14 @@
|
|||
</div>
|
||||
{% set language_label = _('Search language') %}
|
||||
{% set language_info = _('What language do you prefer for search?') %}
|
||||
{{ preferences_item_header(language_info, language_label, rtl) }}
|
||||
{{ preferences_item_header(language_info, language_label, rtl, 'language') }}
|
||||
{% include 'oscar/languages.html' %}
|
||||
{{ preferences_item_footer(language_info, language_label, rtl) }}
|
||||
|
||||
{% set locale_label = _('Interface language') %}
|
||||
{% set locale_info = _('Change the language of the layout') %}
|
||||
{{ preferences_item_header(locale_info, locale_label, rtl) }}
|
||||
<select class="form-control" name='locale'>
|
||||
{{ preferences_item_header(locale_info, locale_label, rtl, 'locale') }}
|
||||
<select class="form-control" name="locale" id="locale">
|
||||
{% for locale_id,locale_name in locales.items() | sort %}
|
||||
<option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
|
||||
{% endfor %}
|
||||
|
|
@ -56,8 +56,8 @@
|
|||
|
||||
{% set autocomplete_label = _('Autocomplete') %}
|
||||
{% set autocomplete_info = _('Find stuff as you type') %}
|
||||
{{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }}
|
||||
<select class="form-control" name="autocomplete">
|
||||
{{ preferences_item_header(autocomplete_info, autocomplete_label, rtl, 'autocomplete') }}
|
||||
<select class="form-control" name="autocomplete" id="autocomplete">
|
||||
<option value=""> - </option>
|
||||
{% for backend in autocomplete_backends %}
|
||||
<option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
|
||||
|
|
@ -67,8 +67,8 @@
|
|||
|
||||
{% set image_proxy_label = _('Image proxy') %}
|
||||
{% set image_proxy_info = _('Proxying image results through searx') %}
|
||||
{{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }}
|
||||
<select class="form-control" name='image_proxy'>
|
||||
{{ preferences_item_header(image_proxy_info, image_proxy_label, rtl, 'image_proxy') }}
|
||||
<select class="form-control" name="image_proxy" id="image_proxy">
|
||||
<option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
|
||||
<option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
|
||||
</select>
|
||||
|
|
@ -76,8 +76,8 @@
|
|||
|
||||
{% set method_label = _('Method') %}
|
||||
{% set method_info = _('Change how forms are submited, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') %}
|
||||
{{ preferences_item_header(method_info, method_label, rtl) }}
|
||||
<select class="form-control" name='method'>
|
||||
{{ preferences_item_header(method_info, method_label, rtl, 'method') }}
|
||||
<select class="form-control" name="method" id="method">
|
||||
<option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
|
||||
<option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
|
||||
</select>
|
||||
|
|
@ -85,8 +85,8 @@
|
|||
|
||||
{% set safesearch_label = _('SafeSearch') %}
|
||||
{% set safesearch_info = _('Filter content') %}
|
||||
{{ preferences_item_header(safesearch_info, safesearch_label, rtl) }}
|
||||
<select class="form-control" name='safesearch'>
|
||||
{{ preferences_item_header(safesearch_info, safesearch_label, rtl, 'safesearch') }}
|
||||
<select class="form-control" name="safesearch" id="safesearch">
|
||||
<option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
|
||||
<option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
|
||||
<option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
|
||||
|
|
@ -95,16 +95,16 @@
|
|||
|
||||
{% set theme_label = _('Themes') %}
|
||||
{% set theme_info = _('Change searx layout') %}
|
||||
{{ preferences_item_header(theme_info, theme_label, rtl) }}
|
||||
<select class="form-control" name="theme">
|
||||
{{ preferences_item_header(theme_info, theme_label, rtl, 'theme') }}
|
||||
<select class="form-control" name="theme" id="theme">
|
||||
{% for name in themes %}
|
||||
<option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{{ preferences_item_footer(theme_info, theme_label, rtl) }}
|
||||
|
||||
{{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl) }}
|
||||
<select class="form-control" name='oscar-style'>
|
||||
{{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl, 'oscar_style') }}
|
||||
<select class="form-control" name="oscar-style" id="oscar_style">
|
||||
<option value="logicodev" >Logicodev</option>
|
||||
<option value="pointhi" {% if preferences.get_value('oscar-style') == 'pointhi' %}selected="selected"{% endif %}>Pointhi</option>
|
||||
<option value="logicodev-dark" {% if preferences.get_value('oscar-style') == 'logicodev-dark' %}selected="selected"{% endif %}>Logicodev dark</option>
|
||||
|
|
@ -113,8 +113,8 @@
|
|||
|
||||
{% set label = _('Results on new tabs') %}
|
||||
{% set info = _('Open result links on new browser tabs') %}
|
||||
{{ preferences_item_header(info, label, rtl) }}
|
||||
<select class="form-control" name='results_on_new_tab'>
|
||||
{{ preferences_item_header(info, label, rtl, 'results_on_new_tab') }}
|
||||
<select class="form-control" name="results_on_new_tab" id="results_on_new_tab">
|
||||
<option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option>
|
||||
<option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option>
|
||||
</select>
|
||||
|
|
@ -122,8 +122,8 @@
|
|||
|
||||
{% set label = _('Open Access DOI resolver') %}
|
||||
{% set info = _('Redirect to open-access versions of publications when available (plugin required)') %}
|
||||
{{ preferences_item_header(info, label, rtl) }}
|
||||
<select class="form-control" id='doi_resolver' name='doi_resolver'>
|
||||
{{ preferences_item_header(info, label, rtl, 'doi_resolver') }}
|
||||
<select class="form-control" name="doi_resolver" id="doi_resolver">
|
||||
{% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %}
|
||||
<option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}>
|
||||
{{ doi_resolver_name }} - {{ doi_resolver_url }}
|
||||
|
|
@ -134,8 +134,8 @@
|
|||
|
||||
{% set label = _('Engine tokens') %}
|
||||
{% set info = _('Access tokens for private engines') %}
|
||||
{{ preferences_item_header(info, label, rtl) }}
|
||||
<input class="form-control" id='tokens' name='tokens' value='{{ preferences.tokens.get_value() }}'/>
|
||||
{{ preferences_item_header(info, label, rtl, 'tokens') }}
|
||||
<input class="form-control" id="tokens" name="tokens" value='{{ preferences.tokens.get_value() }}'/>
|
||||
{{ preferences_item_footer(info, label, rtl) }}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
|
@ -173,23 +173,23 @@
|
|||
<table class="table table-hover table-condensed table-striped">
|
||||
<tr>
|
||||
{% if not rtl %}
|
||||
<th>{{ _("Allow") }}</th>
|
||||
<th>{{ _("Engine name") }}</th>
|
||||
<th>{{ _("Shortcut") }}</th>
|
||||
<th>{{ _("Selected language") }}</th>
|
||||
<th>{{ _("SafeSearch") }}</th>
|
||||
<th>{{ _("Time range") }}</th>
|
||||
<th>{{ _("Avg. time") }}</th>
|
||||
<th>{{ _("Max time") }}</th>
|
||||
<th scope="col">{{ _("Allow") }}</th>
|
||||
<th scope="col">{{ _("Engine name") }}</th>
|
||||
<th scope="col">{{ _("Shortcut") }}</th>
|
||||
<th scope="col">{{ _("Selected language") }}</th>
|
||||
<th scope="col">{{ _("SafeSearch") }}</th>
|
||||
<th scope="col">{{ _("Time range") }}</th>
|
||||
<th scope="col">{{ _("Avg. time") }}</th>
|
||||
<th scope="col">{{ _("Max time") }}</th>
|
||||
{% else %}
|
||||
<th class="text-right">{{ _("Max time") }}</th>
|
||||
<th class="text-right">{{ _("Avg. time") }}</th>
|
||||
<th class="text-right">{{ _("Time range") }}</th>
|
||||
<th class="text-right">{{ _("SafeSearch") }}</th>
|
||||
<th class="text-right">{{ _("Selected language") }}</th>
|
||||
<th class="text-right">{{ _("Shortcut") }}</th>
|
||||
<th class="text-right">{{ _("Engine name") }}</th>
|
||||
<th class="text-right">{{ _("Allow") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("Max time") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("Avg. time") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("Time range") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("SafeSearch") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("Selected language") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("Shortcut") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("Engine name") }}</th>
|
||||
<th scope="col" class="text-right">{{ _("Allow") }}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for search_engine in engines_by_category[categ] %}
|
||||
|
|
@ -199,21 +199,21 @@
|
|||
<td class="onoff-checkbox">
|
||||
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
|
||||
</td>
|
||||
<th>{{ search_engine.name }}</th>
|
||||
<th scope="row">{{ search_engine.name }}</th>
|
||||
<td class="name">{{ shortcuts[search_engine.name] }}</td>
|
||||
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
|
||||
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
|
||||
<td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
|
||||
{% else %}
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{% if stats[search_engine.name]['warn_time'] %}{{ icon('exclamation-sign')}} {% endif %}{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{% if stats[search_engine.name]['warn_timeout'] %}{{ icon('exclamation-sign') }} {% endif %}{{ search_engine.timeout }}</td>
|
||||
{% else %}
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}</td>
|
||||
<td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}</td>
|
||||
<td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
|
||||
<td>{{ support_toggle(search_engine.safesearch==True) }}</td>
|
||||
<td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
|
||||
<td>{{ shortcuts[search_engine.name] }}</td>
|
||||
<th>{{ search_engine.name }}</th>
|
||||
<th scope="row">{{ search_engine.name }}</th>
|
||||
<td class="onoff-checkbox">
|
||||
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
|
||||
</td>
|
||||
|
|
@ -241,7 +241,7 @@
|
|||
<h3 class="panel-title">{{ _(plugin.name) }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-xs-6 col-sm-4 col-md-6">{{ _(plugin.description) }}</div>
|
||||
<div class="col-xs-6 col-sm-4 col-md-6"><label for="{{'plugin_' + plugin.id}}">{{ _(plugin.description) }}</label></div>
|
||||
<div class="col-xs-6 col-sm-4 col-md-6">
|
||||
<div class="onoff-checkbox">
|
||||
{{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
{%- if result.img_src -%}
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<img src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
|
||||
<img src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content">
|
||||
{% if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif -%}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
|
||||
<a href="{{ result.url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" /></a>
|
||||
{% if result.author %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Author') }}</b>: {{ result.author }}</p>{% endif %}
|
||||
{% if result.length %}<p class="col-xs-12 col-sm-8 col-md-8 result-content"><b>{{ _('Length') }}</b>: {{ result.length }}</p>{% endif %}
|
||||
{% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<label class="visually-hidden" for="time-range">{{ _('Time range') }}</label>
|
||||
<select name="time_range" id="time-range" class="custom-select form-control" accesskey="t">{{- "" -}}
|
||||
<option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}>
|
||||
{{- _('Anytime') -}}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<title>{% block title %}{% endblock %}{{ instance_name }}</title>
|
||||
{% block meta %}{% endblock %}
|
||||
<script src="{{ url_for('js_translations') }}"></script>
|
||||
{% if rtl %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/searx-rtl.min.css') }}" type="text/css" media="screen" />
|
||||
{% else %}
|
||||
|
|
|
|||
|
|
@ -335,8 +335,15 @@ def image_proxify(url):
|
|||
if not request.preferences.get_value('image_proxy'):
|
||||
return url
|
||||
|
||||
if url.startswith('data:image/jpeg;base64,'):
|
||||
return url
|
||||
if url.startswith('data:image/'):
|
||||
# 50 is an arbitrary number to get only the beginning of the image.
|
||||
partial_base64 = url[len('data:image/'):50].split(';')
|
||||
if len(partial_base64) == 2 \
|
||||
and partial_base64[0] in ['gif', 'png', 'jpeg', 'pjpeg', 'webp', 'tiff', 'bmp']\
|
||||
and partial_base64[1].startswith('base64,'):
|
||||
return url
|
||||
else:
|
||||
return None
|
||||
|
||||
if settings.get('result_proxy'):
|
||||
return proxify(url)
|
||||
|
|
@ -949,7 +956,7 @@ def opensearch():
|
|||
|
||||
resp = Response(response=ret,
|
||||
status=200,
|
||||
mimetype="text/xml")
|
||||
mimetype="application/opensearchdescription+xml")
|
||||
return resp
|
||||
|
||||
|
||||
|
|
@ -1021,6 +1028,14 @@ def config():
|
|||
})
|
||||
|
||||
|
||||
@app.route('/translations.js')
|
||||
def js_translations():
|
||||
return render(
|
||||
'translations.js.tpl',
|
||||
override_theme='__common__',
|
||||
), {'Content-Type': 'text/javascript; charset=UTF-8'}
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def page_not_found(e):
|
||||
return render('404.html'), 404
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue