diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..0a75fa6d8
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,10 @@
+searx/static/css/bootstrap.min.css -diff
+searx/static/js/bootstrap.min.js -diff
+searx/static/themes/oscar/css/logicodev.min.css -diff
+searx/static/themes/oscar/css/leaflet.min.css -diff
+searx/static/themes/oscar/css/pointhi.min.css -diff
+searx/static/themes/oscar/js/searx.min.js -diff
+searx/static/themes/simple/css/searx.min.css -diff
+searx/static/themes/simple/css/searx-rtl.min.css -diff
+searx/static/themes/simple/js/searx.min.js -diff
+searx/static/themes/simple/js/searx.min.js.map -diff
diff --git a/.travis.yml b/.travis.yml
index b6017cd93..1eb6573f2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,10 +13,11 @@ python:
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- - npm install less grunt-cli
+ - npm install less less-plugin-clean-css grunt-cli
- ( cd searx/static/themes/oscar;npm install; cd - )
+ - ( cd searx/static/themes/simple;npm install; cd - )
- mkdir -p ~/drivers; export PATH=~/drivers:$PATH;
- - GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz";
+ - GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/v0.14.0/geckodriver-v0.14.0-linux64.tar.gz";
- FILE=`mktemp`; wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C ~/drivers -f $FILE geckodriver; rm $FILE; chmod 777 ~/drivers/geckodriver;
install:
- ./manage.sh update_dev_packages
diff --git a/manage.sh b/manage.sh
index 2466f25ca..681f3a975 100755
--- a/manage.sh
+++ b/manage.sh
@@ -22,7 +22,7 @@ check_geckodriver() {
if [ -z $NOTFOUND ]; then
return
fi
- GECKODRIVER_VERSION="v0.11.1"
+ GECKODRIVER_VERSION="v0.14.0"
PLATFORM=`python -c "import platform; print platform.system().lower(), platform.architecture()[0]"`
case $PLATFORM in
"linux 32bit" | "linux2 32bit") ARCH="linux32";;
@@ -49,7 +49,7 @@ pep8_check() {
# ignored rules:
# E402 module level import not at top of file
# W503 line break before binary operator
- pep8 --max-line-length=120 --ignore "E402,W503" "$SEARX_DIR" "$BASE_DIR/tests"
+ pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" "$SEARX_DIR" "$BASE_DIR/tests"
}
unit_tests() {
@@ -79,7 +79,8 @@ tests() {
}
build_style() {
- lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
+ # lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
+ lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
}
styles() {
@@ -92,10 +93,13 @@ styles() {
build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
+ build_style themes/simple/less/style.less themes/simple/css/searx.min.css
+ build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
}
grunt_build() {
grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
+ grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
}
locales() {
diff --git a/searx/plugins/doai_rewrite.py b/searx/plugins/doai_rewrite.py
index 95efa8f9b..b7b814fac 100644
--- a/searx/plugins/doai_rewrite.py
+++ b/searx/plugins/doai_rewrite.py
@@ -7,6 +7,7 @@ regex = re.compile(r'10\.\d{4,9}/[^\s]+')
name = gettext('DOAI rewrite')
description = gettext('Avoid paywalls by redirecting to open-access versions of publications when available')
default_on = False
+preference_section = 'privacy'
def extract_doi(url):
diff --git a/searx/plugins/https_rewrite.py b/searx/plugins/https_rewrite.py
index 4462c86bc..3d986770e 100644
--- a/searx/plugins/https_rewrite.py
+++ b/searx/plugins/https_rewrite.py
@@ -31,6 +31,7 @@ if sys.version_info[0] == 3:
name = "HTTPS rewrite"
description = gettext('Rewrite HTTP links to HTTPS if possible')
default_on = True
+preference_section = 'privacy'
if 'SEARX_HTTPS_REWRITE_PATH' in environ:
rules_path = environ['SEARX_rules_path']
diff --git a/searx/plugins/infinite_scroll.py b/searx/plugins/infinite_scroll.py
index 422a4befb..e3726671a 100644
--- a/searx/plugins/infinite_scroll.py
+++ b/searx/plugins/infinite_scroll.py
@@ -3,6 +3,7 @@ from flask_babel import gettext
name = gettext('Infinite scroll')
description = gettext('Automatically load next page when scrolling to bottom of current page')
default_on = False
+preference_section = 'ui'
js_dependencies = ('plugins/js/infinite_scroll.js',)
css_dependencies = ('plugins/css/infinite_scroll.css',)
diff --git a/searx/plugins/search_on_category_select.py b/searx/plugins/search_on_category_select.py
index f72c63d76..2a38cac78 100644
--- a/searx/plugins/search_on_category_select.py
+++ b/searx/plugins/search_on_category_select.py
@@ -19,5 +19,6 @@ name = gettext('Search on category select')
description = gettext('Perform search immediately if a category selected. '
'Disable to select multiple categories. (JavaScript required)')
default_on = True
+preference_section = 'ui'
js_dependencies = ('plugins/js/search_on_category_select.js',)
diff --git a/searx/plugins/tracker_url_remover.py b/searx/plugins/tracker_url_remover.py
index a84012828..630c8a638 100644
--- a/searx/plugins/tracker_url_remover.py
+++ b/searx/plugins/tracker_url_remover.py
@@ -26,6 +26,7 @@ regexes = {re.compile(r'utm_[^&]+&?'),
name = gettext('Tracker URL remover')
description = gettext('Remove trackers arguments from the returned URL')
default_on = True
+preference_section = 'privacy'
def on_result(request, search, result):
diff --git a/searx/static/themes/simple/.jshintignore b/searx/static/themes/simple/.jshintignore
new file mode 100644
index 000000000..3b2b7148f
--- /dev/null
+++ b/searx/static/themes/simple/.jshintignore
@@ -0,0 +1 @@
+js/searx_src/autocomplete.js
diff --git a/searx/static/themes/simple/css/searx-rtl.css b/searx/static/themes/simple/css/searx-rtl.css
new file mode 100644
index 000000000..e43f02d50
--- /dev/null
+++ b/searx/static/themes/simple/css/searx-rtl.css
@@ -0,0 +1,2049 @@
+/*! searx | 06-08-2017 | https://github.com/asciimoo/searx */
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*
+* To convert "style.less" to "style.css" run: $make styles
+*/
+/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
+/* Document
+ ========================================================================== */
+/**
+ * 1. Correct the line height in all browsers.
+ * 2. Prevent adjustments of font size after orientation changes in
+ * IE on Windows Phone and in iOS.
+ */
+html {
+ line-height: 1.15;
+ /* 1 */
+ -ms-text-size-adjust: 100%;
+ /* 2 */
+ -webkit-text-size-adjust: 100%;
+ /* 2 */
+}
+/* Sections
+ ========================================================================== */
+/**
+ * Remove the margin in all browsers (opinionated).
+ */
+body {
+ margin: 0;
+}
+/**
+ * Add the correct display in IE 9-.
+ */
+article,
+aside,
+footer,
+header,
+nav,
+section {
+ display: block;
+}
+/**
+ * Correct the font size and margin on `h1` elements within `section` and
+ * `article` contexts in Chrome, Firefox, and Safari.
+ */
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+/* Grouping content
+ ========================================================================== */
+/**
+ * Add the correct display in IE 9-.
+ * 1. Add the correct display in IE.
+ */
+figcaption,
+figure,
+main {
+ /* 1 */
+ display: block;
+}
+/**
+ * Add the correct margin in IE 8.
+ */
+figure {
+ margin: 1em 40px;
+}
+/**
+ * 1. Add the correct box sizing in Firefox.
+ * 2. Show the overflow in Edge and IE.
+ */
+hr {
+ box-sizing: content-box;
+ /* 1 */
+ height: 0;
+ /* 1 */
+ overflow: visible;
+ /* 2 */
+}
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+pre {
+ font-family: monospace, monospace;
+ /* 1 */
+ font-size: 1em;
+ /* 2 */
+}
+/* Text-level semantics
+ ========================================================================== */
+/**
+ * 1. Remove the gray background on active links in IE 10.
+ * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
+ */
+a {
+ background-color: transparent;
+ /* 1 */
+ -webkit-text-decoration-skip: objects;
+ /* 2 */
+}
+/**
+ * 1. Remove the bottom border in Chrome 57- and Firefox 39-.
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
+ */
+abbr[title] {
+ border-bottom: none;
+ /* 1 */
+ text-decoration: underline;
+ /* 2 */
+ text-decoration: underline dotted;
+ /* 2 */
+}
+/**
+ * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
+ */
+b,
+strong {
+ font-weight: inherit;
+}
+/**
+ * Add the correct font weight in Chrome, Edge, and Safari.
+ */
+b,
+strong {
+ font-weight: bolder;
+}
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+code,
+kbd,
+samp {
+ font-family: monospace, monospace;
+ /* 1 */
+ font-size: 1em;
+ /* 2 */
+}
+/**
+ * Add the correct font style in Android 4.3-.
+ */
+dfn {
+ font-style: italic;
+}
+/**
+ * Add the correct background and color in IE 9-.
+ */
+mark {
+ background-color: #ff0;
+ color: #000;
+}
+/**
+ * Add the correct font size in all browsers.
+ */
+small {
+ font-size: 80%;
+}
+/**
+ * Prevent `sub` and `sup` elements from affecting the line height in
+ * all browsers.
+ */
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+sub {
+ bottom: -0.25em;
+}
+sup {
+ top: -0.5em;
+}
+/* Embedded content
+ ========================================================================== */
+/**
+ * Add the correct display in IE 9-.
+ */
+audio,
+video {
+ display: inline-block;
+}
+/**
+ * Add the correct display in iOS 4-7.
+ */
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+/**
+ * Remove the border on images inside links in IE 10-.
+ */
+img {
+ border-style: none;
+}
+/**
+ * Hide the overflow in IE.
+ */
+svg:not(:root) {
+ overflow: hidden;
+}
+/* Forms
+ ========================================================================== */
+/**
+ * 1. Change the font styles in all browsers (opinionated).
+ * 2. Remove the margin in Firefox and Safari.
+ */
+button,
+input,
+optgroup,
+select,
+textarea {
+ font-family: sans-serif;
+ /* 1 */
+ font-size: 100%;
+ /* 1 */
+ line-height: 1.15;
+ /* 1 */
+ margin: 0;
+ /* 2 */
+}
+/**
+ * Show the overflow in IE.
+ * 1. Show the overflow in Edge.
+ */
+button,
+input {
+ /* 1 */
+ overflow: visible;
+}
+/**
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
+ * 1. Remove the inheritance of text transform in Firefox.
+ */
+button,
+select {
+ /* 1 */
+ text-transform: none;
+}
+/**
+ * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
+ * controls in Android 4.
+ * 2. Correct the inability to style clickable types in iOS and Safari.
+ */
+button,
+html [type="button"],
+[type="reset"],
+[type="submit"] {
+ -webkit-appearance: button;
+ /* 2 */
+}
+/**
+ * Remove the inner border and padding in Firefox.
+ */
+button::-moz-focus-inner,
+[type="button"]::-moz-focus-inner,
+[type="reset"]::-moz-focus-inner,
+[type="submit"]::-moz-focus-inner {
+ border-style: none;
+ padding: 0;
+}
+/**
+ * Restore the focus styles unset by the previous rule.
+ */
+button:-moz-focusring,
+[type="button"]:-moz-focusring,
+[type="reset"]:-moz-focusring,
+[type="submit"]:-moz-focusring {
+ outline: 1px dotted ButtonText;
+}
+/**
+ * Correct the padding in Firefox.
+ */
+fieldset {
+ padding: 0.35em 0.75em 0.625em;
+}
+/**
+ * 1. Correct the text wrapping in Edge and IE.
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
+ * 3. Remove the padding so developers are not caught out when they zero out
+ * `fieldset` elements in all browsers.
+ */
+legend {
+ box-sizing: border-box;
+ /* 1 */
+ color: inherit;
+ /* 2 */
+ display: table;
+ /* 1 */
+ max-width: 100%;
+ /* 1 */
+ padding: 0;
+ /* 3 */
+ white-space: normal;
+ /* 1 */
+}
+/**
+ * 1. Add the correct display in IE 9-.
+ * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
+ */
+progress {
+ display: inline-block;
+ /* 1 */
+ vertical-align: baseline;
+ /* 2 */
+}
+/**
+ * Remove the default vertical scrollbar in IE.
+ */
+textarea {
+ overflow: auto;
+}
+/**
+ * 1. Add the correct box sizing in IE 10-.
+ * 2. Remove the padding in IE 10-.
+ */
+[type="checkbox"],
+[type="radio"] {
+ box-sizing: border-box;
+ /* 1 */
+ padding: 0;
+ /* 2 */
+}
+/**
+ * Correct the cursor style of increment and decrement buttons in Chrome.
+ */
+[type="number"]::-webkit-inner-spin-button,
+[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+/**
+ * 1. Correct the odd appearance in Chrome and Safari.
+ * 2. Correct the outline style in Safari.
+ */
+[type="search"] {
+ -webkit-appearance: textfield;
+ /* 1 */
+ outline-offset: -2px;
+ /* 2 */
+}
+/**
+ * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
+ */
+[type="search"]::-webkit-search-cancel-button,
+[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+/**
+ * 1. Correct the inability to style clickable types in iOS and Safari.
+ * 2. Change font properties to `inherit` in Safari.
+ */
+::-webkit-file-upload-button {
+ -webkit-appearance: button;
+ /* 1 */
+ font: inherit;
+ /* 2 */
+}
+/* Interactive
+ ========================================================================== */
+/*
+ * Add the correct display in IE 9-.
+ * 1. Add the correct display in Edge, IE, and Firefox.
+ */
+details,
+menu {
+ display: block;
+}
+/*
+ * Add the correct display in all browsers.
+ */
+summary {
+ display: list-item;
+}
+/* Scripting
+ ========================================================================== */
+/**
+ * Add the correct display in IE 9-.
+ */
+canvas {
+ display: inline-block;
+}
+/**
+ * Add the correct display in IE.
+ */
+template {
+ display: none;
+}
+/* Hidden
+ ========================================================================== */
+/**
+ * Add the correct display in IE 10-.
+ */
+[hidden] {
+ display: none;
+}
+/*
+ * searx, A privacy-respecting, hackable metasearch engine
+ *
+ * To change the colors of the site, simple edit this variables
+ */
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*/
+.highlight .hll {
+ background-color: #ffffcc;
+}
+.highlight {
+ background: #f8f8f8;
+}
+.highlight .c {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment */
+.highlight .err {
+ border: 1px solid #FF0000;
+}
+/* Error */
+.highlight .k {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword */
+.highlight .o {
+ color: #666666;
+}
+/* Operator */
+.highlight .cm {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment.Multiline */
+.highlight .cp {
+ color: #BC7A00;
+}
+/* Comment.Preproc */
+.highlight .c1 {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment.Single */
+.highlight .cs {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment.Special */
+.highlight .gd {
+ color: #A00000;
+}
+/* Generic.Deleted */
+.highlight .ge {
+ font-style: italic;
+}
+/* Generic.Emph */
+.highlight .gr {
+ color: #FF0000;
+}
+/* Generic.Error */
+.highlight .gh {
+ color: #000080;
+ font-weight: bold;
+}
+/* Generic.Heading */
+.highlight .gi {
+ color: #00A000;
+}
+/* Generic.Inserted */
+.highlight .go {
+ color: #888888;
+}
+/* Generic.Output */
+.highlight .gp {
+ color: #000080;
+ font-weight: bold;
+}
+/* Generic.Prompt */
+.highlight .gs {
+ font-weight: bold;
+}
+/* Generic.Strong */
+.highlight .gu {
+ color: #800080;
+ font-weight: bold;
+}
+/* Generic.Subheading */
+.highlight .gt {
+ color: #0044DD;
+}
+/* Generic.Traceback */
+.highlight .kc {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Constant */
+.highlight .kd {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Declaration */
+.highlight .kn {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Namespace */
+.highlight .kp {
+ color: #008000;
+}
+/* Keyword.Pseudo */
+.highlight .kr {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Reserved */
+.highlight .kt {
+ color: #B00040;
+}
+/* Keyword.Type */
+.highlight .m {
+ color: #666666;
+}
+/* Literal.Number */
+.highlight .s {
+ color: #BA2121;
+}
+/* Literal.String */
+.highlight .na {
+ color: #7D9029;
+}
+/* Name.Attribute */
+.highlight .nb {
+ color: #008000;
+}
+/* Name.Builtin */
+.highlight .nc {
+ color: #0000FF;
+ font-weight: bold;
+}
+/* Name.Class */
+.highlight .no {
+ color: #880000;
+}
+/* Name.Constant */
+.highlight .nd {
+ color: #AA22FF;
+}
+/* Name.Decorator */
+.highlight .ni {
+ color: #999999;
+ font-weight: bold;
+}
+/* Name.Entity */
+.highlight .ne {
+ color: #D2413A;
+ font-weight: bold;
+}
+/* Name.Exception */
+.highlight .nf {
+ color: #0000FF;
+}
+/* Name.Function */
+.highlight .nl {
+ color: #A0A000;
+}
+/* Name.Label */
+.highlight .nn {
+ color: #0000FF;
+ font-weight: bold;
+}
+/* Name.Namespace */
+.highlight .nt {
+ color: #008000;
+ font-weight: bold;
+}
+/* Name.Tag */
+.highlight .nv {
+ color: #19177C;
+}
+/* Name.Variable */
+.highlight .ow {
+ color: #AA22FF;
+ font-weight: bold;
+}
+/* Operator.Word */
+.highlight .w {
+ color: #bbbbbb;
+}
+/* Text.Whitespace */
+.highlight .mf {
+ color: #666666;
+}
+/* Literal.Number.Float */
+.highlight .mh {
+ color: #666666;
+}
+/* Literal.Number.Hex */
+.highlight .mi {
+ color: #666666;
+}
+/* Literal.Number.Integer */
+.highlight .mo {
+ color: #666666;
+}
+/* Literal.Number.Oct */
+.highlight .sb {
+ color: #BA2121;
+}
+/* Literal.String.Backtick */
+.highlight .sc {
+ color: #BA2121;
+}
+/* Literal.String.Char */
+.highlight .sd {
+ color: #BA2121;
+ font-style: italic;
+}
+/* Literal.String.Doc */
+.highlight .s2 {
+ color: #BA2121;
+}
+/* Literal.String.Double */
+.highlight .se {
+ color: #BB6622;
+ font-weight: bold;
+}
+/* Literal.String.Escape */
+.highlight .sh {
+ color: #BA2121;
+}
+/* Literal.String.Heredoc */
+.highlight .si {
+ color: #BB6688;
+ font-weight: bold;
+}
+/* Literal.String.Interpol */
+.highlight .sx {
+ color: #008000;
+}
+/* Literal.String.Other */
+.highlight .sr {
+ color: #BB6688;
+}
+/* Literal.String.Regex */
+.highlight .s1 {
+ color: #BA2121;
+}
+/* Literal.String.Single */
+.highlight .ss {
+ color: #19177C;
+}
+/* Literal.String.Symbol */
+.highlight .bp {
+ color: #008000;
+}
+/* Name.Builtin.Pseudo */
+.highlight .vc {
+ color: #19177C;
+}
+/* Name.Variable.Class */
+.highlight .vg {
+ color: #19177C;
+}
+/* Name.Variable.Global */
+.highlight .vi {
+ color: #19177C;
+}
+/* Name.Variable.Instance */
+.highlight .il {
+ color: #666666;
+}
+/* Literal.Number.Integer.Long */
+.highlight pre {
+ overflow: auto;
+}
+.highlight .lineno {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ cursor: default;
+}
+.highlight .lineno::selection {
+ background: transparent;
+ /* WebKit/Blink Browsers */
+}
+.highlight .lineno::-moz-selection {
+ background: transparent;
+ /* Gecko Browsers */
+}
+html.no-js .hide_if_nojs {
+ display: none;
+}
+html.js .show_if_nojs {
+ display: none;
+}
+.center {
+ text-align: center;
+}
+.right {
+ float: right ;
+}
+.left {
+ float: left;
+}
+.invisible {
+ display: none;
+}
+.danger {
+ background-color: #fae1e1;
+}
+.badge {
+ display: inline-block;
+ color: #fff;
+ background-color: #777;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ min-width: 10px;
+ padding: 1px 5px;
+ border-radius: 5px;
+}
+table {
+ width: 100%;
+}
+table.striped tr {
+ border-bottom: 1px solid #ececec;
+}
+th {
+ padding: 0.4em;
+}
+td {
+ padding: 0 4px;
+}
+tr:hover {
+ background: #ececec;
+}
+.dialog-error {
+ position: relative;
+ width: 70%;
+ padding: 1em 1em 1em 2.7em;
+ margin: 0em 8% 1em 8%;
+ border: 1px solid black;
+ border-radius: 4px;
+ text-align: left;
+ color: #db3434;
+ background: #fae1e1;
+ border-color: #db3434;
+}
+.dialog-error:before {
+ position: absolute;
+ top: 0.5em;
+ left: 0.5em;
+ font-family: "ion";
+ font-size: 1.5em;
+}
+.dialog-error .close {
+ float: right;
+ position: relative;
+ top: -3px;
+ color: inherit;
+ font-size: 1.5em;
+}
+.dialog-error ul,
+.dialog-error ol,
+.dialog-error p {
+ margin: 1px 0 0 0;
+}
+.dialog-error:before {
+ content: "\f110";
+}
+.dialog-warning {
+ position: relative;
+ width: 70%;
+ padding: 1em 1em 1em 2.7em;
+ margin: 0em 8% 1em 8%;
+ border: 1px solid black;
+ border-radius: 4px;
+ text-align: left;
+ color: #dbba34;
+ background: #faf5e1;
+ border-color: #dbba34;
+}
+.dialog-warning:before {
+ position: absolute;
+ top: 0.5em;
+ left: 0.5em;
+ font-family: "ion";
+ font-size: 1.5em;
+}
+.dialog-warning .close {
+ float: right;
+ position: relative;
+ top: -3px;
+ color: inherit;
+ font-size: 1.5em;
+}
+.dialog-warning ul,
+.dialog-warning ol,
+.dialog-warning p {
+ margin: 1px 0 0 0;
+}
+.dialog-warning:before {
+ content: "\f10f";
+}
+.btn-collapse {
+ cursor: pointer;
+}
+.scrollx {
+ overflow-x: auto;
+ overflow-y: hidden;
+ display: block;
+ padding: 0;
+ margin: 0;
+ border: none;
+}
+.tabs .tabs > label {
+ font-size: 90%;
+}
+.tabs {
+ display: -webkit-box;
+ display: -moz-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ flex-wrap: wrap;
+ width: 100%;
+ min-width: 100%;
+}
+.tabs > * {
+ order: 2;
+}
+.tabs > input[type=radio] {
+ display: none;
+}
+.tabs > label {
+ order: 1;
+ padding: 0.7em;
+ margin: 0 0.7em;
+ letter-spacing: 0.5px;
+ text-transform: uppercase;
+ border: solid white;
+ border-width: 0px 0px 2px 0;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ cursor: pointer;
+}
+.tabs > label:hover {
+ border-bottom: 2px solid #084999;
+}
+.tabs > section {
+ min-width: 100%;
+ padding: 0.7rem 0;
+ box-sizing: border-box;
+ border-top: 1px solid black;
+ display: none;
+}
+.tabs > label:last-of-type {
+ border-bottom: 2px solid #084999;
+ background: #3498DB;
+ color: #FFF;
+ font-weight: bold;
+ letter-spacing: -0.1px;
+}
+.tabs > section:last-of-type {
+ display: block;
+}
+html body .tabs > input:checked ~ section {
+ display: none;
+}
+html body .tabs > input:checked ~ label {
+ position: inherited;
+ background: inherit;
+ border-bottom: 2px solid transparent;
+ font-weight: normal;
+ color: inherit;
+}
+html body .tabs > input:checked ~ label:hover {
+ border-bottom: 2px solid #084999;
+}
+html body .tabs > input:checked + label {
+ border-bottom: 2px solid #084999;
+ background: #3498DB;
+ color: #FFF;
+ font-weight: bold;
+ letter-spacing: -0.1px;
+}
+html body .tabs > input:checked + label + section {
+ display: block;
+}
+select {
+ height: 28px;
+ margin: 0 1em 0 0;
+ padding: 2px 8px 2px 0 !important;
+ color: #222;
+ font-size: 12px;
+ z-index: 2;
+}
+select:hover,
+select:focus {
+ cursor: pointer;
+}
+@supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))) {
+ select {
+ appearance: none;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ border: none;
+ border-bottom: 1px solid #d7d7d7;
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat;
+ background-position-x: 105%;
+ background-size: 2em;
+ background-origin: content-box;
+ outline: medium none;
+ }
+ select:hover,
+ select:focus {
+ border-bottom: 1px solid #3498DB;
+ }
+}
+@supports (border-radius: 50px) {
+ .checkbox-onoff {
+ display: inline-block;
+ width: 40px;
+ height: 10px;
+ background: #dcdcdc;
+ margin: 8px auto;
+ position: relative;
+ border-radius: 50px;
+ }
+ .checkbox-onoff label {
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ top: -5px;
+ cursor: pointer;
+ border-radius: 50px;
+ box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.3);
+ transition: all 0.4s ease;
+ left: 27px;
+ background-color: #3498DB;
+ }
+ .checkbox-onoff input[type=checkbox] {
+ visibility: hidden;
+ }
+ .checkbox-onoff input[type=checkbox]:checked + label {
+ left: -5px;
+ background: #dcdcdc;
+ }
+}
+@supports (transform: rotate(-45deg)) {
+ .checkbox {
+ width: 20px;
+ position: relative;
+ margin: 20px auto;
+ }
+ .checkbox label {
+ width: 20px;
+ height: 20px;
+ cursor: pointer;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background: white;
+ border-radius: 4px;
+ box-shadow: inset 0px 1px 1px white, 0px 1px 4px rgba(0, 0, 0, 0.5);
+ }
+ .checkbox label:after {
+ content: '';
+ width: 9px;
+ height: 5px;
+ position: absolute;
+ top: 4px;
+ left: 4px;
+ border: 3px solid #333;
+ border-top: none;
+ border-right: none;
+ background: transparent;
+ opacity: 0;
+ transform: rotate(-45deg);
+ }
+ .checkbox input[type=checkbox] {
+ visibility: hidden;
+ }
+ .checkbox input[type=checkbox]:checked + label:after {
+ border-color: #3498DB;
+ opacity: 1;
+ }
+ .checkbox input[disabled] + label {
+ background-color: transparent !important;
+ box-shadow: none !important;
+ cursor: inherit;
+ }
+ .checkbox input:not(:checked):not([readonly]):not([disabled]) + label:hover::after {
+ opacity: 0.5;
+ }
+}
+@media screen and (max-width: 50em) {
+ .tabs > label {
+ width: 100%;
+ }
+}
+.autocomplete {
+ position: absolute;
+ max-height: 0;
+ overflow-y: hidden;
+ text-align: left;
+}
+.autocomplete:active,
+.autocomplete:focus,
+.autocomplete:hover {
+ background-color: white;
+}
+.autocomplete:empty {
+ display: none;
+}
+.autocomplete > ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+}
+.autocomplete > ul > li {
+ cursor: pointer;
+ padding: 5px 0 5px 10px;
+}
+.autocomplete > ul > li.active,
+.autocomplete > ul > li:active,
+.autocomplete > ul > li:focus {
+ background-color: #3498DB;
+}
+.autocomplete > ul > li.active a:active,
+.autocomplete > ul > li:active a:active,
+.autocomplete > ul > li:focus a:active,
+.autocomplete > ul > li.active a:focus,
+.autocomplete > ul > li:active a:focus,
+.autocomplete > ul > li:focus a:focus,
+.autocomplete > ul > li.active a:hover,
+.autocomplete > ul > li:active a:hover,
+.autocomplete > ul > li:focus a:hover {
+ text-decoration: none;
+}
+.autocomplete > ul > li.locked {
+ cursor: inherit;
+}
+.autocomplete.open {
+ display: block;
+ background-color: white;
+ border: 1px solid #3498DB;
+ max-height: 500px;
+ overflow-y: auto;
+ z-index: 100;
+}
+.autocomplete.open:empty {
+ display: none;
+}
+@media screen and (max-width: 50em) {
+ .autocomplete {
+ bottom: 0;
+ }
+ .autocomplete > ul > li {
+ padding: 7px 0 7px 10px;
+ border-bottom: 1px solid #E8E7E6;
+ text-align: left;
+ }
+}
+@font-face {
+ font-family: "ion";
+ src: url("../fonts/ion.eot?94af7082ea096aefe3a7b6642834716e");
+ src: url("../fonts/ion.eot?#iefix") format("embedded-opentype"), url("../fonts/ion.woff2?94af7082ea096aefe3a7b6642834716e") format("woff2"), url("../fonts/ion.woff?94af7082ea096aefe3a7b6642834716e") format("woff"), url("../fonts/ion.ttf?94af7082ea096aefe3a7b6642834716e") format("truetype"), url("../fonts/ion.svg?94af7082ea096aefe3a7b6642834716e#ion") format("svg");
+ font-weight: normal;
+ font-style: normal;
+}
+.ion-icon {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 1;
+ font-weight: normal;
+ font-style: normal;
+ speak: none;
+ text-decoration: inherit;
+ text-transform: none;
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+.ion-icon:before {
+ font-family: "ion";
+}
+.ion-navicon-round:before {
+ content: "\f101";
+}
+.ion-search:before {
+ content: "\f102";
+}
+.ion-play:before {
+ content: "\f103";
+}
+.ion-link:before {
+ content: "\f104";
+}
+.ion-chevron-up:before {
+ content: "\f105";
+}
+.ion-chevron-left:before {
+ content: "\f106";
+}
+.ion-chevron-right:before {
+ content: "\f107";
+}
+.ion-arrow-down-a:before {
+ content: "\f108";
+}
+.ion-arrow-up-a:before {
+ content: "\f109";
+}
+.ion-arrow-swap:before {
+ content: "\f10a";
+}
+.ion-arrow-dropdown:before {
+ content: "\f10b";
+}
+.ion-globe:before {
+ content: "\f10c";
+}
+.ion-time:before {
+ content: "\f10d";
+}
+.ion-location:before {
+ content: "\f10e";
+}
+.ion-warning:before {
+ content: "\f10f";
+}
+.ion-error:before {
+ content: "\f110";
+}
+.ion-film-outline:before {
+ content: "\f111";
+}
+.ion-music-note:before {
+ content: "\f112";
+}
+.ion-more-vertical:before {
+ content: "\f113";
+}
+.ion-magnet:before {
+ content: "\f114";
+}
+.ion-icon-big {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 1;
+ font-weight: normal;
+ font-style: normal;
+ speak: none;
+ text-decoration: inherit;
+ text-transform: none;
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 149%;
+}
+.ion-icon-big:before {
+ font-family: "ion";
+}
+.index {
+ text-align: center;
+}
+.index .title {
+ background: url('../img/searx.png') no-repeat;
+ width: 100%;
+ min-height: 80px;
+ background-position: center;
+}
+.index h1 {
+ font-size: 5em;
+ visibility: hidden;
+}
+.index #search {
+ margin: 0 auto;
+ background: inherit;
+ border: inherit;
+}
+.index .search_filters {
+ display: block;
+ margin: 1em 0;
+}
+.index .category label {
+ padding: 6px 10px;
+ border-bottom: initial !important;
+}
+@media screen and (max-width: 75em) {
+ div.title h1 {
+ font-size: 1em;
+ }
+}
+#main_preferences form {
+ width: 100%;
+}
+#main_preferences fieldset {
+ margin: 8px;
+ border: none;
+}
+#main_preferences legend {
+ margin: 0;
+ padding: 5px 0 0 0;
+ display: block;
+ float: left;
+ width: 300px;
+}
+#main_preferences .value {
+ margin: 0;
+ padding: 0;
+ float: left;
+ width: 15em;
+}
+#main_preferences .description {
+ margin: 0;
+ padding: 5px 0 0 0;
+ float: left;
+ width: 50%;
+ color: #909090;
+ font-size: 90%;
+}
+#main_preferences select {
+ width: 200px;
+ font-size: inherit !important;
+}
+#main_preferences table {
+ border-collapse: collapse;
+}
+#main_preferences table td {
+ text-align: center;
+}
+#main_preferences .name,
+#main_preferences .shortcut {
+ text-align: left;
+}
+#main_preferences .preferences_back {
+ background: none repeat scroll 0 0 #3498DB;
+ color: white;
+ border: 0 none;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ cursor: pointer;
+ display: inline-block;
+ margin: 2px 4px;
+ padding: 0.5em;
+}
+#main_preferences .preferences_back a {
+ display: block;
+ color: #FFF;
+}
+#main_preferences .preferences_back a::first-letter {
+ text-transform: uppercase;
+}
+@media screen and (max-width: 75em) {
+ .preferences_back {
+ clear: both;
+ }
+}
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*/
+#search {
+ padding: 0 2em;
+ margin: 0;
+ background: #f7f7f7;
+ border-bottom: 1px solid #d7d7d7;
+}
+#search_wrapper {
+ padding: 10px 0;
+}
+.search_box {
+ margin: 0 12px 0 0;
+ display: inline-flex;
+ flex-direction: row;
+ white-space: nowrap;
+ /*
+ &:has(q:focus) {
+ box-shadow: 0px 0px 5px #CCC;
+}
+*/
+}
+#q,
+#send_search {
+ display: block !important;
+ border-collapse: separate;
+ box-sizing: border-box;
+ position: relative;
+ margin: 0;
+ padding: 2px;
+ height: 2.2em;
+ background: none repeat scroll 0 0 #FFF;
+ border: 1px solid #3498DB;
+ border-radius: 0px;
+ outline: none;
+ color: #222;
+ font-size: 16px;
+ z-index: 2;
+}
+#q {
+ outline: medium none;
+ padding-left: 8px;
+ padding-right: 0px !important;
+ border-right: none;
+ width: 40em;
+}
+#send_search {
+ border-left: none;
+ width: 2.2em;
+}
+#send_search:hover {
+ cursor: pointer;
+ background-color: #3498DB;
+ color: #ECF0F1;
+}
+.no-js #send_search {
+ width: auto !important;
+}
+.search_filters {
+ display: inline-block;
+ vertical-align: middle;
+}
+@media screen and (max-width: 75em) {
+ #categories {
+ font-size: 90%;
+ clear: both;
+ }
+ #categories .checkbox_container {
+ margin-top: 2px;
+ margin: auto;
+ }
+ html.touch #main_index #categories_container,
+ html.touch #main_results #categories_container {
+ width: 1000px;
+ width: -moz-max-content;
+ width: -webkit-max-content;
+ width: max-content;
+ }
+ html.touch #main_index #categories_container .category,
+ html.touch #main_results #categories_container .category {
+ display: inline-block;
+ width: auto;
+ }
+ html.touch #main_index #categories,
+ html.touch #main_results #categories {
+ width: 100%;
+ margin: 0;
+ text-align: left;
+ overflow-x: scroll;
+ overflow-y: hidden;
+ -webkit-overflow-scrolling: touch;
+ }
+}
+@media screen and (max-width: 50em) {
+ #search {
+ width: 100%;
+ margin: 0;
+ padding: 0.1em 0 0 0;
+ }
+ #search_wrapper {
+ width: 100%;
+ margin: 0 0 0.7em 0;
+ padding: 0;
+ }
+ .search_box {
+ width: 99%;
+ margin: 0.1em;
+ padding: 0 0.1em 0 0;
+ display: flex;
+ flex-direction: row;
+ }
+ #q {
+ width: auto !important;
+ flex: 1;
+ }
+ .search_filters {
+ display: block;
+ margin: 0.5em;
+ }
+ .language,
+ .time_range {
+ width: 45%;
+ }
+ .category {
+ display: block;
+ width: 90%;
+ }
+ .category label {
+ border-bottom: 0;
+ }
+}
+#categories {
+ margin: 0 10px 0 0;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+#categories::-webkit-scrollbar {
+ width: 0;
+ height: 0;
+}
+.category {
+ display: inline-block;
+ position: relative;
+ margin: 0 3px;
+ padding: 0px;
+ /*label:hover {
+ border-bottom: 2px solid @color-categories-item-border-unselected-hover;
+ }*/
+}
+.category input {
+ display: none;
+}
+.category label {
+ cursor: pointer;
+ padding: 4px 10px;
+ margin: 0;
+ display: block;
+ text-transform: capitalize;
+ font-size: 0.9em;
+ border-bottom: 2px solid transparent;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.category input[type="checkbox"]:focus + label {
+ box-shadow: 0px 0px 8px #3498DB;
+}
+.category input[type="checkbox"]:checked + label {
+ background: #3498DB;
+ color: #FFF;
+ border-bottom: 2px solid #084999;
+}
+#categories_container {
+ position: relative;
+}
+#categories_container .help {
+ position: absolute;
+ width: 100%;
+ bottom: -20px;
+ overflow: hidden;
+ opacity: 0;
+ transition: opacity 1s ease;
+ font-size: 0.8em;
+ text-position: center;
+ background: white;
+}
+#categories_container:hover .help {
+ opacity: 0.8;
+ transition: opacity 1s ease;
+}
+html {
+ font-family: arial, sans-serif;
+ font-size: 0.9em;
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%;
+ -moz-text-size-adjust: 100%;
+ text-size-adjust: 100%;
+ color: #444;
+ padding: 0;
+ margin: 0;
+}
+body,
+main {
+ padding: 0;
+ margin: 0;
+}
+main {
+ width: 100%;
+}
+footer {
+ bottom: 0;
+ width: 100%;
+ height: 50px;
+}
+#main_preferences,
+#main_about,
+#main_stats {
+ margin: 3em;
+ width: auto;
+}
+footer {
+ bottom: 0;
+ height: 3em;
+ margin: 1em 0;
+ padding: 1em 0;
+ clear: both;
+ width: 100%;
+ text-align: center;
+}
+footer p {
+ font-size: 0.9em;
+}
+#main_preferences h1,
+#main_stats h1 {
+ background: url('../img/searx.png') no-repeat;
+ background-size: auto 75%;
+ min-height: 40px;
+ margin: 0 auto;
+}
+#main_preferences h1 span,
+#main_stats h1 span {
+ visibility: hidden;
+}
+input[type="submit"],
+#results button[type="submit"] {
+ padding: 0.5rem;
+ margin: 2px 4px;
+ display: inline-block;
+ background: #3498DB;
+ color: #FFF;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ border: 0;
+ cursor: pointer;
+}
+a {
+ text-decoration: none;
+ color: #29314d;
+}
+a:visited {
+ color: #684898;
+}
+a:visited .highlight {
+ color: #684898;
+}
+article[data-vim-selected] {
+ background: #f7f7f7;
+}
+article[data-vim-selected]::before {
+ position: absolute;
+ left: 1em;
+ padding: 2px;
+ content: ">";
+ font-weight: bold;
+ color: #3498DB;
+}
+article.result-images[data-vim-selected] {
+ background: #3498DB;
+}
+article.result-images[data-vim-selected]::before {
+ display: none;
+ content: "";
+}
+.result {
+ margin: 19px 0 18px 0;
+ padding: 0;
+}
+.result h3 {
+ font-size: 1.1em;
+ word-wrap: break-word;
+ margin: 5px 0 1px 0;
+ padding: 0;
+ margin-bottom: 0;
+}
+.result h3 a {
+ color: #084999;
+ font-weight: normal;
+ font-size: 1.1em;
+}
+.result h3 a:visited {
+ color: #684898;
+}
+.result h3 a:focus,
+.result h3 a:hover {
+ text-decoration: underline;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ outline: none;
+}
+.result .cache_link,
+.result .proxyfied_link {
+ font-size: 0.9em !important;
+}
+.result .content,
+.result .stat,
+.result .altlink {
+ font-size: 0.9em;
+ margin: 0;
+ padding: 0;
+ max-width: 54em;
+ word-wrap: break-word;
+ line-height: 1.24;
+}
+.result .content .highlight,
+.result .stat .highlight,
+.result .altlink .highlight {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+.result .codelines .highlight {
+ color: inherit;
+ background: inherit;
+ font-weight: normal;
+}
+.result .url {
+ font-size: 0.9em;
+ margin: 0 0 3px 0;
+ padding: 0;
+ max-width: 54em;
+ word-wrap: break-word;
+ color: #25a55b;
+}
+.result .published_date {
+ font-size: 0.8em;
+ color: #888;
+}
+.result img.thumbnail {
+ float: left;
+ padding: 0 5px 10px 0;
+ width: 20em;
+ min-width: 20em;
+ min-height: 8em;
+}
+.result img.image {
+ float: left;
+ padding: 0 5px 10px 0;
+ width: 100px;
+ max-height: 100px;
+ object-fit: scale-down;
+ object-position: right top;
+}
+.result .break {
+ clear: both;
+}
+.category-social .image {
+ width: auto !important;
+ min-width: 48px;
+ min-height: 48px;
+ padding: 0 5px 25px 0 !important;
+}
+.result-videos .content {
+ overflow: hidden;
+}
+.engines {
+ float: right;
+ color: #888;
+}
+.engines span {
+ font-size: smaller;
+ margin: 0 0.5em 0 0;
+}
+.small_font {
+ font-size: 0.8em;
+}
+.highlight {
+ color: #094089;
+ background: inherit;
+ font-weight: bold;
+}
+.result-images {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ max-height: 200px;
+}
+.result-images img {
+ float: inherit;
+ margin: 0;
+ padding: 0;
+ border: none;
+ max-height: 200px;
+ background: #084999;
+}
+.result-images span a {
+ display: none;
+ color: #FFF;
+}
+.result-images:hover span a {
+ display: block;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ padding: 4px;
+ margin: 0 0 4px 4px;
+ background-color: rgba(0, 0, 0, 0.6);
+ font-size: 0.7em;
+}
+.torrent_result {
+ border-left: 10px solid lightgray;
+ padding-left: 3px;
+}
+.torrent_result p {
+ margin: 3px;
+ font-size: 0.8em;
+}
+.torrent_result a {
+ color: #084999;
+}
+.torrent_result a:hover {
+ text-decoration: underline;
+}
+.torrent_result a:visited {
+ color: #684898;
+}
+#results {
+ margin: 2em 2em 20px 2em;
+ padding: 0;
+ width: 50em;
+}
+#suggestions .wrapper {
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: flex-end;
+}
+#suggestions .wrapper form {
+ display: inline-block;
+ flex: 1 1 50%;
+}
+#suggestions,
+#answers,
+#corrections {
+ max-width: 50em;
+}
+#suggestions input,
+#answers input,
+#infoboxes input,
+#corrections input {
+ padding: 0;
+ margin: 3px;
+ font-size: 0.9em;
+ display: inline-block;
+ background: transparent;
+ color: #444;
+ cursor: pointer;
+}
+#suggestions input[type="submit"],
+#answers input[type="submit"],
+#infoboxes input[type="submit"],
+#corrections input[type="submit"],
+#suggestions .infobox .url a,
+#answers .infobox .url a,
+#infoboxes .infobox .url a,
+#corrections .infobox .url a {
+ color: #084999;
+ text-decoration: none;
+ font-size: 0.9rem;
+}
+#suggestions input[type="submit"]:hover,
+#answers input[type="submit"]:hover,
+#infoboxes input[type="submit"]:hover,
+#corrections input[type="submit"]:hover,
+#suggestions .infobox .url a:hover,
+#answers .infobox .url a:hover,
+#infoboxes .infobox .url a:hover,
+#corrections .infobox .url a:hover {
+ text-decoration: underline;
+}
+#corrections {
+ display: flex;
+ flex-flow: row wrap;
+ margin: 1em 0;
+}
+#corrections h4,
+#corrections input[type="submit"] {
+ display: inline-block;
+ margin: 0 0.5em 0 0;
+}
+#corrections input[type="submit"]::after {
+ content: ", ";
+}
+#suggestions .title,
+#search_url .title,
+#apis .title {
+ margin: 2em 0 0.5em 0;
+ color: #444;
+}
+#answers {
+ margin: 10px 8px 10px 8px;
+ border: 1px solid #ddd;
+ padding: 0.9em;
+ box-shadow: 0px 0px 5px #CCC;
+}
+#answers h4 {
+ display: none;
+}
+#answers .answer {
+ display: block;
+ font-size: 1.2em;
+ font-weight: bold;
+}
+#answers form,
+#infoboxes form {
+ min-width: 210px;
+}
+#sidebar {
+ position: absolute;
+ top: 100px;
+ left: 57em;
+ margin: 0px 2px 5px 5px;
+ padding: 0px 2px 2px;
+ max-width: 25em;
+ word-wrap: break-word;
+}
+#sidebar .infobox {
+ margin: 10px 0 10px;
+ border: 1px solid #ddd;
+ padding: 0.9em;
+ font-size: 0.9em;
+ box-shadow: 0px 0px 5px #CCC;
+}
+#sidebar .infobox h2 {
+ margin: 0 0 .5em 0;
+}
+#sidebar .infobox img {
+ max-width: 100%;
+ max-height: 12em;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+#sidebar .infobox dl {
+ margin: 0.5em 0;
+}
+#sidebar .infobox dt {
+ display: inline;
+ margin: 0.5em 0.25em 0.5em 0;
+ padding: 0;
+ font-weight: bold;
+}
+#sidebar .infobox dd {
+ display: inline;
+ margin: 0.5em 0;
+ padding: 0;
+}
+#sidebar .infobox input {
+ font-size: 1em;
+}
+#sidebar .infobox br {
+ clear: both;
+}
+#sidebar .infobox .attributes,
+#sidebar .infobox .urls {
+ clear: both;
+}
+#search_url {
+ margin-top: 8px;
+}
+#search_url div {
+ border: 1px solid #888;
+ padding: 4px;
+ color: #444;
+ width: 100%;
+ display: block;
+ margin: 0.1em;
+ overflow: hidden;
+ height: 1.2em;
+ line-height: 1.2em;
+}
+#search_url div pre {
+ display: block;
+ width: 200em;
+ font-size: 0.8em;
+ word-break: break-all;
+ margin: 0.1em;
+ -webkit-user-select: all;
+ -moz-user-select: all;
+ -ms-user-select: all;
+ user-select: all;
+}
+#linkto_preferences {
+ position: absolute;
+ right: 10px;
+ top: 0.9em;
+ padding: 0;
+ border: 0;
+ display: block;
+ font-size: 1.2em;
+ color: #222;
+}
+#linkto_preferences a:link *,
+#linkto_preferences a:hover *,
+#linkto_preferences a:visited *,
+#linkto_preferences a:active * {
+ color: #222;
+}
+#pagination {
+ clear: both;
+}
+#pagination br {
+ clear: both;
+}
+#apis {
+ margin-top: 8px;
+ clear: both;
+}
+#backToTop {
+ border: 1px solid #ddd;
+ margin: 0 0 0 2em;
+ padding: 0;
+ font-size: 1em;
+ box-shadow: 0px 0px 5px #CCC;
+ background: white;
+ position: fixed;
+ bottom: 85px;
+ left: 50em;
+ transition: opacity 0.5s;
+ opacity: 0;
+}
+#backToTop a {
+ display: block;
+ margin: 0;
+ padding: 0.6em;
+}
+@media screen and (max-width: 75em) {
+ #main_preferences,
+ #main_about,
+ #main_stats {
+ margin: 0.5em;
+ width: auto;
+ }
+ #suggestions,
+ #answers {
+ margin-top: 1em;
+ }
+ #infoboxes {
+ position: inherit;
+ max-width: inherit;
+ }
+ #infoboxes .infobox {
+ clear: both;
+ }
+ #infoboxes .infobox img {
+ float: left;
+ max-width: 10em;
+ margin: 0.5em 0.5em 0.5em 0;
+ }
+ #sidebar {
+ position: static;
+ max-width: 50em;
+ margin: 0 0 2px 0;
+ padding: 0;
+ float: none;
+ border: none;
+ width: auto;
+ }
+ #sidebar input {
+ border: 0;
+ }
+ #apis {
+ display: none;
+ }
+ #search_url {
+ display: none;
+ }
+ .result {
+ border-bottom: 1px solid #E8E7E6;
+ margin: 0;
+ padding-top: 8px;
+ padding-bottom: 6px;
+ }
+ .result h3 {
+ margin: 0 0 1px 0;
+ }
+ .result .thumbnail {
+ max-width: 98%;
+ }
+ .result .url span.url {
+ display: block;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ width: 100%;
+ }
+ .result .url a {
+ float: right;
+ padding: 0 0.5em;
+ }
+ .result .engines {
+ float: right;
+ padding: 0 0 3px 0;
+ }
+ .result-images {
+ border-bottom: none !important;
+ }
+ .image_result {
+ max-width: 98%;
+ }
+ .image_result img {
+ max-width: 98%;
+ }
+}
+@media screen and (max-width: 50em) {
+ article[data-vim-selected]::before {
+ display: none;
+ content: "";
+ }
+ #linkto_preferences {
+ display: none;
+ postion: fixed !important;
+ top: 100px;
+ right: 0px;
+ }
+ #sidebar {
+ margin: 0 5px 2px 5px;
+ }
+ #corrections {
+ margin: 1em 5px 1em 5px;
+ }
+ #results {
+ margin: 0;
+ padding: 0;
+ width: initial;
+ }
+ #backToTop {
+ left: 40em;
+ bottom: 35px;
+ }
+ .result {
+ padding: 8px 10px 6px 10px;
+ }
+ .result-images {
+ margin: 0;
+ padding: 0;
+ border: none;
+ }
+}
+@media screen and (max-width: 35em) {
+ .result-videos img.thumbnail {
+ float: none !important;
+ }
+ .result-videos .content {
+ overflow: inherit;
+ }
+}
+#search_submit {
+ left: 1px;
+ right: auto;
+}
diff --git a/searx/static/themes/simple/css/searx-rtl.min.css b/searx/static/themes/simple/css/searx-rtl.min.css
new file mode 100644
index 000000000..16d03f1e3
--- /dev/null
+++ b/searx/static/themes/simple/css/searx-rtl.min.css
@@ -0,0 +1 @@
+/*! searx | 06-08-2017 | https://github.com/asciimoo/searx *//*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-block}[type=checkbox],[type=radio],legend{padding:0;box-sizing:border-box}.badge,.center{text-align:center}.badge,progress,sub,sup{vertical-align:baseline}#q,#send_search,.tabs>section,legend{box-sizing:border-box}#apis,#pagination,#pagination br,#sidebar .infobox .attributes,#sidebar .infobox .urls,#sidebar .infobox br,.result .break,footer{clear:both}html{line-height:1.15}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.highlight pre,textarea{overflow:auto}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{padding:.35em .75em .625em}legend{color:inherit;display:table;max-width:100%;white-space:normal}.badge,.search_box{white-space:nowrap}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.highlight .c,.highlight .cm,.highlight .ge,.highlight .sd{font-style:italic}.dialog-error:before,.dialog-warning:before,.ion-icon-big:before,.ion-icon:before{font-family:ion}summary{display:list-item}.invisible,[hidden],html.js .show_if_nojs,html.no-js .hide_if_nojs,template{display:none}.highlight .hll{background-color:#ffc}.highlight .c{color:#408080}.highlight .err{border:1px solid red}.highlight .k{color:green;font-weight:700}.highlight .o{color:#666}.highlight .cm{color:#408080}.highlight .cp{color:#BC7A00}.highlight .c1,.highlight .cs{color:#408080;font-style:italic}.highlight .gd{color:#A00000}.highlight .gr{color:red}.highlight .gh{color:navy;font-weight:700}.highlight .gi{color:#00A000}.highlight .go{color:#888}.highlight .gp{color:navy;font-weight:700}.highlight .gs{font-weight:700}.highlight .gu{color:purple;font-weight:700}.highlight .gt{color:#04D}.highlight .kc,.highlight .kd,.highlight .kn{color:green;font-weight:700}.highlight .kp{color:green}.highlight .kr{color:green;font-weight:700}.highlight .kt{color:#B00040}.highlight .m{color:#666}.highlight .s{color:#BA2121}.highlight .na{color:#7D9029}.highlight .nb{color:green}.highlight .nc{color:#00F;font-weight:700}.highlight .no{color:#800}.highlight .nd{color:#A2F}.highlight .ni{color:#999;font-weight:700}.highlight .ne{color:#D2413A;font-weight:700}.highlight .nf{color:#00F}.highlight .nl{color:#A0A000}.highlight .nn{color:#00F;font-weight:700}.highlight .nt{color:green;font-weight:700}.highlight .nv{color:#19177C}.highlight .ow{color:#A2F;font-weight:700}.highlight .w{color:#bbb}.highlight .mf,.highlight .mh,.highlight .mi,.highlight .mo{color:#666}.highlight .s2,.highlight .sb,.highlight .sc{color:#BA2121}.highlight .sd{color:#BA2121}.highlight .se{color:#B62;font-weight:700}.highlight .sh{color:#BA2121}.highlight .si{color:#B68;font-weight:700}.highlight .sx{color:green}.highlight .sr{color:#B68}.highlight .s1{color:#BA2121}.highlight .ss{color:#19177C}.highlight .bp{color:green}.highlight .vc,.highlight .vg,.highlight .vi{color:#19177C}.highlight .il{color:#666}.highlight .lineno{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}#categories,.tabs>label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-khtml-user-select:none}.btn-collapse,.tabs>label,select:focus,select:hover{cursor:pointer}.highlight .lineno::selection{background:0 0}.highlight .lineno::-moz-selection{background:0 0}.right{float:right}.left{float:left}.danger{background-color:#fae1e1}.badge{display:inline-block;color:#fff;background-color:#777;min-width:10px;padding:1px 5px;border-radius:5px}table{width:100%}table.striped tr{border-bottom:1px solid #ececec}th{padding:.4em}td{padding:0 4px}.dialog-error,.dialog-warning{width:70%;padding:1em 1em 1em 2.7em;text-align:left}tr:hover{background:#ececec}.dialog-error{position:relative;margin:0 8% 1em;border:1px solid #db3434;border-radius:4px;color:#db3434;background:#fae1e1}.dialog-error:before{position:absolute;top:.5em;left:.5em;font-size:1.5em;content:"\f110"}.dialog-error .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-error ol,.dialog-error p,.dialog-error ul{margin:1px 0 0}.dialog-warning{position:relative;margin:0 8% 1em;border:1px solid #dbba34;border-radius:4px;color:#dbba34;background:#faf5e1}.dialog-warning:before{position:absolute;top:.5em;left:.5em;font-size:1.5em;content:"\f10f"}.dialog-warning .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-warning ol,.dialog-warning p,.dialog-warning ul{margin:1px 0 0}.scrollx{overflow-x:auto;overflow-y:hidden;display:block;padding:0;margin:0;border:none}.tabs .tabs>label{font-size:90%}.tabs{display:-webkit-box;display:-moz-box;display:-webkit-flex;display:-ms-flexbox;display:flex;flex-wrap:wrap;width:100%;min-width:100%}.tabs>*{order:2}.tabs>input[type=radio]{display:none}.tabs>label{order:1;padding:.7em;margin:0 .7em;letter-spacing:.5px;text-transform:uppercase;border:solid #fff;border-width:0 0 2px;user-select:none}.tabs>label:hover{border-bottom:2px solid #084999}.tabs>section{min-width:100%;padding:.7rem 0;border-top:1px solid #000;display:none}.tabs>label:last-of-type{border-bottom:2px solid #084999;background:#3498DB;color:#FFF;font-weight:700;letter-spacing:-.1px}.tabs>section:last-of-type{display:block}html body .tabs>input:checked~section{display:none}html body .tabs>input:checked~label{position:inherited;background:inherit;border-bottom:2px solid transparent;font-weight:400;color:inherit}html body .tabs>input:checked~label:hover{border-bottom:2px solid #084999}html body .tabs>input:checked+label{border-bottom:2px solid #084999;background:#3498DB;color:#FFF;font-weight:700;letter-spacing:-.1px}html body .tabs>input:checked+label+section{display:block}select{height:28px;margin:0 1em 0 0;padding:2px 8px 2px 0!important;color:#222;font-size:12px;z-index:2}@supports ((background-position-x:100%) and ((appearance:none) or (-webkit-appearance:none) or (-moz-appearance:none))){select{appearance:none;-webkit-appearance:none;-moz-appearance:none;border:none;border-bottom:1px solid #d7d7d7;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat;background-position-x:105%;background-size:2em;background-origin:content-box;outline:0}select:focus,select:hover{border-bottom:1px solid #3498DB}}@supports (border-radius:50px){.checkbox-onoff{display:inline-block;width:40px;height:10px;background:#dcdcdc;margin:8px auto;position:relative;border-radius:50px}.checkbox-onoff label{display:block;width:20px;height:20px;position:absolute;top:-5px;cursor:pointer;border-radius:50px;box-shadow:0 3px 5px 0 rgba(0,0,0,.3);transition:all .4s ease;left:27px;background-color:#3498DB}.checkbox-onoff input[type=checkbox]{visibility:hidden}.checkbox-onoff input[type=checkbox]:checked+label{left:-5px;background:#dcdcdc}}@supports (transform:rotate(-45deg)){.checkbox{width:20px;position:relative;margin:20px auto}.checkbox label{width:20px;height:20px;cursor:pointer;position:absolute;top:0;left:0;background:#fff;border-radius:4px;box-shadow:inset 0 1px 1px #fff,0 1px 4px rgba(0,0,0,.5)}.checkbox label:after{content:'';width:9px;height:5px;position:absolute;top:4px;left:4px;border:3px solid #333;border-top:none;border-right:none;background:0 0;opacity:0;transform:rotate(-45deg)}.checkbox input[type=checkbox]{visibility:hidden}.checkbox input[type=checkbox]:checked+label:after{border-color:#3498DB;opacity:1}.checkbox input[disabled]+label{background-color:transparent!important;box-shadow:none!important;cursor:inherit}.checkbox input:not(:checked):not([readonly]):not([disabled])+label:hover::after{opacity:.5}}#main_preferences form,.index .title,footer,main{width:100%}.autocomplete{position:absolute;max-height:0;overflow-y:hidden;text-align:left}#categories_container,#q,#send_search,.category{position:relative}.autocomplete:active,.autocomplete:focus,.autocomplete:hover{background-color:#fff}.autocomplete:empty{display:none}.autocomplete>ul{list-style-type:none;margin:0;padding:0}.autocomplete>ul>li{cursor:pointer;padding:5px 0 5px 10px}.autocomplete>ul>li.active,.autocomplete>ul>li:active,.autocomplete>ul>li:focus{background-color:#3498DB}.autocomplete>ul>li.active a:active,.autocomplete>ul>li.active a:focus,.autocomplete>ul>li.active a:hover,.autocomplete>ul>li:active a:active,.autocomplete>ul>li:active a:focus,.autocomplete>ul>li:active a:hover,.autocomplete>ul>li:focus a:active,.autocomplete>ul>li:focus a:focus,.autocomplete>ul>li:focus a:hover{text-decoration:none}.autocomplete>ul>li.locked{cursor:inherit}.autocomplete.open{display:block;background-color:#fff;border:1px solid #3498DB;max-height:500px;overflow-y:auto;z-index:100}.autocomplete.open:empty{display:none}.ion-icon,.ion-icon-big{display:inline-block;line-height:1;font-weight:400;font-style:normal;speak:none;text-decoration:inherit;text-transform:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:middle}@media screen and (max-width:50em){.tabs>label{width:100%}.autocomplete{bottom:0}.autocomplete>ul>li{padding:7px 0 7px 10px;border-bottom:1px solid #E8E7E6;text-align:left}}#main_preferences table td,.index{text-align:center}@font-face{font-family:ion;src:url(../fonts/ion.eot?94af7082ea096aefe3a7b6642834716e);src:url(../fonts/ion.eot?#iefix) format("embedded-opentype"),url(../fonts/ion.woff2?94af7082ea096aefe3a7b6642834716e) format("woff2"),url(../fonts/ion.woff?94af7082ea096aefe3a7b6642834716e) format("woff"),url(../fonts/ion.ttf?94af7082ea096aefe3a7b6642834716e) format("truetype"),url(../fonts/ion.svg?94af7082ea096aefe3a7b6642834716e#ion) format("svg");font-weight:400;font-style:normal}.ion-navicon-round:before{content:"\f101"}.ion-search:before{content:"\f102"}.ion-play:before{content:"\f103"}.ion-link:before{content:"\f104"}.ion-chevron-up:before{content:"\f105"}.ion-chevron-left:before{content:"\f106"}.ion-chevron-right:before{content:"\f107"}.ion-arrow-down-a:before{content:"\f108"}.ion-arrow-up-a:before{content:"\f109"}.ion-arrow-swap:before{content:"\f10a"}.ion-arrow-dropdown:before{content:"\f10b"}.ion-globe:before{content:"\f10c"}.ion-time:before{content:"\f10d"}.ion-location:before{content:"\f10e"}.ion-warning:before{content:"\f10f"}.ion-error:before{content:"\f110"}.ion-film-outline:before{content:"\f111"}.ion-music-note:before{content:"\f112"}.ion-more-vertical:before{content:"\f113"}.ion-magnet:before{content:"\f114"}.ion-icon-big{font-size:149%}.index .title{background:url(../img/searx.png) center no-repeat;min-height:80px}.index h1{font-size:5em;visibility:hidden}.index #search{margin:0 auto;background:inherit;border:inherit}.index .search_filters{display:block;margin:1em 0}.index .category label{padding:6px 10px;border-bottom:initial!important}@media screen and (max-width:75em){div.title h1{font-size:1em}.preferences_back{clear:both}}#main_preferences fieldset{margin:8px;border:none}#main_preferences legend{margin:0;padding:5px 0 0;display:block;float:left;width:300px}#main_preferences .value{margin:0;padding:0;float:left;width:15em}#main_preferences .description{margin:0;padding:5px 0 0;float:left;width:50%;color:#909090;font-size:90%}#main_preferences select{width:200px;font-size:inherit!important}#main_preferences table{border-collapse:collapse}#main_preferences .name,#main_preferences .shortcut{text-align:left}#main_preferences .preferences_back{background:#3498DB;color:#fff;border:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:.5em}#main_preferences .preferences_back a{display:block;color:#FFF}#main_preferences .preferences_back a::first-letter{text-transform:uppercase}#search{padding:0 2em;margin:0;background:#f7f7f7;border-bottom:1px solid #d7d7d7}#search_wrapper{padding:10px 0}.search_box{margin:0 12px 0 0;display:inline-flex;flex-direction:row}#q,#send_search{display:block!important;border-collapse:separate;margin:0;padding:2px;height:2.2em;background:#FFF;border:1px solid #3498DB;border-radius:0;outline:0;color:#222;font-size:16px;z-index:2}#q{outline:0;padding-left:8px;padding-right:0!important;border-right:none;width:40em}#send_search{border-left:none;width:2.2em}#send_search:hover{cursor:pointer;background-color:#3498DB;color:#ECF0F1}.no-js #send_search{width:auto!important}.search_filters{display:inline-block;vertical-align:middle}@media screen and (max-width:75em){#categories{font-size:90%;clear:both}#categories .checkbox_container{margin:auto}html.touch #main_index #categories_container,html.touch #main_results #categories_container{width:1000px;width:-moz-max-content;width:-webkit-max-content;width:max-content}html.touch #main_index #categories_container .category,html.touch #main_results #categories_container .category{display:inline-block;width:auto}html.touch #main_index #categories,html.touch #main_results #categories{width:100%;margin:0;text-align:left;overflow-x:scroll;overflow-y:hidden;-webkit-overflow-scrolling:touch}}#search_url div,.result-videos .content{overflow:hidden}@media screen and (max-width:50em){#search{width:100%;margin:0;padding:.1em 0 0}#search_wrapper{width:100%;margin:0 0 .7em;padding:0}.search_box{width:99%;margin:.1em;padding:0 .1em 0 0;display:flex;flex-direction:row}#q{width:auto!important;flex:1}.search_filters{display:block;margin:.5em}.language,.time_range{width:45%}.category{display:block;width:90%}.category label{border-bottom:0}}#categories{margin:0 10px 0 0;user-select:none}#categories::-webkit-scrollbar{width:0;height:0}.category{display:inline-block;margin:0 3px;padding:0}.category input{display:none}.category label{cursor:pointer;padding:4px 10px;margin:0;display:block;text-transform:capitalize;font-size:.9em;border-bottom:2px solid transparent;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}body,html,main{padding:0;margin:0}.category input[type=checkbox]:focus+label{box-shadow:0 0 8px #3498DB}.category input[type=checkbox]:checked+label{background:#3498DB;color:#FFF;border-bottom:2px solid #084999}#categories_container .help{position:absolute;width:100%;bottom:-20px;overflow:hidden;opacity:0;transition:opacity 1s ease;font-size:.8em;text-position:center;background:#fff}footer p,html{font-size:.9em}#categories_container:hover .help{opacity:.8;transition:opacity 1s ease}html{font-family:arial,sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color:#444}#main_about,#main_preferences,#main_stats{margin:3em;width:auto}footer{bottom:0;height:3em;margin:1em 0;padding:1em 0;text-align:center}#main_preferences h1,#main_stats h1{background:url(../img/searx.png) no-repeat;background-size:auto 75%;min-height:40px;margin:0 auto}#main_preferences h1 span,#main_stats h1 span{visibility:hidden}#results button[type=submit],input[type=submit]{padding:.5rem;margin:2px 4px;display:inline-block;background:#3498DB;color:#FFF;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0;cursor:pointer}a{text-decoration:none;color:#29314d}a:visited,a:visited .highlight{color:#684898}article[data-vim-selected]{background:#f7f7f7}article[data-vim-selected]::before{position:absolute;left:1em;padding:2px;content:">";font-weight:700;color:#3498DB}article.result-images[data-vim-selected]{background:#3498DB}article.result-images[data-vim-selected]::before{display:none;content:""}.result{margin:19px 0 18px;padding:0}.result h3{font-size:1.1em;word-wrap:break-word;margin:5px 0 0;padding:0}.result h3 a{color:#084999;font-weight:400;font-size:1.1em}.result h3 a:visited{color:#684898}.result h3 a:focus,.result h3 a:hover{text-decoration:underline;border:none;-webkit-box-shadow:none;box-shadow:none;outline:0}.result .cache_link,.result .proxyfied_link{font-size:.9em!important}.result .altlink,.result .content,.result .stat,.result .url{font-size:.9em;padding:0;max-width:54em;word-wrap:break-word}.result .altlink,.result .content,.result .stat{margin:0;line-height:1.24}.result .altlink .highlight,.result .content .highlight,.result .stat .highlight{color:#000;background:inherit;font-weight:700}.result .codelines .highlight{color:inherit;background:inherit;font-weight:400}.result .url{margin:0 0 3px;color:#25a55b}.result .published_date{font-size:.8em;color:#888}.result img.thumbnail{float:left;padding:0 5px 10px 0;width:20em;min-width:20em;min-height:8em}.result img.image{float:left;padding:0 5px 10px 0;width:100px;max-height:100px;object-fit:scale-down;object-position:right top}.category-social .image{width:auto!important;min-width:48px;min-height:48px;padding:0 5px 25px 0!important}.engines{float:right;color:#888}.engines span{font-size:smaller;margin:0 .5em 0 0}.result-images,.result-images img{margin:0;padding:0;max-height:200px}.small_font{font-size:.8em}.highlight{color:#094089;background:inherit;font-weight:700}.result-images{display:inline-block;position:relative}.result-images img{float:inherit;border:none;background:#084999}.result-images span a{display:none;color:#FFF}.result-images:hover span a{display:block;position:absolute;bottom:0;right:0;padding:4px;margin:0 0 4px 4px;background-color:rgba(0,0,0,.6);font-size:.7em}.torrent_result{border-left:10px solid #d3d3d3;padding-left:3px}#answers,#backToTop,#sidebar .infobox{border:1px solid #ddd;box-shadow:0 0 5px #CCC}.torrent_result p{margin:3px;font-size:.8em}.torrent_result a{color:#084999}.torrent_result a:hover{text-decoration:underline}.torrent_result a:visited{color:#684898}#results{margin:2em 2em 20px;padding:0;width:50em}#suggestions .wrapper{display:flex;flex-flow:row wrap;justify-content:flex-end}#suggestions .wrapper form{display:inline-block;flex:1 1 50%}#answers,#corrections,#suggestions{max-width:50em}#answers input,#corrections input,#infoboxes input,#suggestions input{padding:0;margin:3px;font-size:.9em;display:inline-block;background:0 0;color:#444;cursor:pointer}#answers .infobox .url a,#answers input[type=submit],#corrections .infobox .url a,#corrections input[type=submit],#infoboxes .infobox .url a,#infoboxes input[type=submit],#suggestions .infobox .url a,#suggestions input[type=submit]{color:#084999;text-decoration:none;font-size:.9rem}#answers .infobox .url a:hover,#answers input[type=submit]:hover,#corrections .infobox .url a:hover,#corrections input[type=submit]:hover,#infoboxes .infobox .url a:hover,#infoboxes input[type=submit]:hover,#suggestions .infobox .url a:hover,#suggestions input[type=submit]:hover{text-decoration:underline}#corrections{display:flex;flex-flow:row wrap;margin:1em 0}#corrections h4,#corrections input[type=submit]{display:inline-block;margin:0 .5em 0 0}#corrections input[type=submit]::after{content:", "}#apis .title,#search_url .title,#suggestions .title{margin:2em 0 .5em;color:#444}#answers{margin:10px 8px;padding:.9em}#answers h4{display:none}#answers .answer{display:block;font-size:1.2em;font-weight:700}#answers form,#infoboxes form{min-width:210px}#sidebar{position:absolute;top:100px;left:57em;margin:0 2px 5px 5px;padding:0 2px 2px;max-width:25em;word-wrap:break-word}#sidebar .infobox{margin:10px 0;padding:.9em;font-size:.9em}#sidebar .infobox h2{margin:0 0 .5em}#sidebar .infobox img{max-width:100%;max-height:12em;display:block;margin:0;padding:0}#sidebar .infobox dl{margin:.5em 0}#sidebar .infobox dt{display:inline;margin:.5em .25em .5em 0;padding:0;font-weight:700}#sidebar .infobox dd{display:inline;margin:.5em 0;padding:0}#apis,#search_url{margin-top:8px}#sidebar .infobox input{font-size:1em}#search_url div{border:1px solid #888;padding:4px;color:#444;width:100%;display:block;margin:.1em;height:1.2em;line-height:1.2em}#search_url div pre{display:block;width:200em;font-size:.8em;word-break:break-all;margin:.1em;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}#linkto_preferences{position:absolute;right:10px;top:.9em;padding:0;border:0;display:block;font-size:1.2em;color:#222}#linkto_preferences a:active *,#linkto_preferences a:hover *,#linkto_preferences a:link *,#linkto_preferences a:visited *{color:#222}#backToTop{margin:0 0 0 2em;padding:0;font-size:1em;background:#fff;position:fixed;bottom:85px;left:50em;transition:opacity .5s;opacity:0}#backToTop a{display:block;margin:0;padding:.6em}@media screen and (max-width:75em){#main_about,#main_preferences,#main_stats{margin:.5em;width:auto}#answers,#suggestions{margin-top:1em}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em;margin:.5em .5em .5em 0}#sidebar{position:static;max-width:50em;margin:0 0 2px;padding:0;float:none;border:none;width:auto}.image_result,.image_result img,.result .thumbnail{max-width:98%}#sidebar input{border:0}#apis,#search_url{display:none}.result{border-bottom:1px solid #E8E7E6;margin:0;padding-top:8px;padding-bottom:6px}.result h3{margin:0 0 1px}.result .url span.url{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}.result .url a{float:right;padding:0 .5em}.result .engines{float:right;padding:0 0 3px}.result-images{border-bottom:none!important}}@media screen and (max-width:50em){article[data-vim-selected]::before{display:none;content:""}#linkto_preferences{display:none;postion:fixed!important;top:100px;right:0}#sidebar{margin:0 5px 2px}#corrections{margin:1em 5px}#results{margin:0;padding:0;width:initial}#backToTop{left:40em;bottom:35px}.result{padding:8px 10px 6px}.result-images{margin:0;padding:0;border:none}}@media screen and (max-width:35em){.result-videos img.thumbnail{float:none!important}.result-videos .content{overflow:inherit}}#search_submit{left:1px;right:auto}
\ No newline at end of file
diff --git a/searx/static/themes/simple/css/searx.css b/searx/static/themes/simple/css/searx.css
new file mode 100644
index 000000000..b276bc59a
--- /dev/null
+++ b/searx/static/themes/simple/css/searx.css
@@ -0,0 +1,2045 @@
+/*! searx | 06-08-2017 | https://github.com/asciimoo/searx */
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*
+* To convert "style.less" to "style.css" run: $make styles
+*/
+/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
+/* Document
+ ========================================================================== */
+/**
+ * 1. Correct the line height in all browsers.
+ * 2. Prevent adjustments of font size after orientation changes in
+ * IE on Windows Phone and in iOS.
+ */
+html {
+ line-height: 1.15;
+ /* 1 */
+ -ms-text-size-adjust: 100%;
+ /* 2 */
+ -webkit-text-size-adjust: 100%;
+ /* 2 */
+}
+/* Sections
+ ========================================================================== */
+/**
+ * Remove the margin in all browsers (opinionated).
+ */
+body {
+ margin: 0;
+}
+/**
+ * Add the correct display in IE 9-.
+ */
+article,
+aside,
+footer,
+header,
+nav,
+section {
+ display: block;
+}
+/**
+ * Correct the font size and margin on `h1` elements within `section` and
+ * `article` contexts in Chrome, Firefox, and Safari.
+ */
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+/* Grouping content
+ ========================================================================== */
+/**
+ * Add the correct display in IE 9-.
+ * 1. Add the correct display in IE.
+ */
+figcaption,
+figure,
+main {
+ /* 1 */
+ display: block;
+}
+/**
+ * Add the correct margin in IE 8.
+ */
+figure {
+ margin: 1em 40px;
+}
+/**
+ * 1. Add the correct box sizing in Firefox.
+ * 2. Show the overflow in Edge and IE.
+ */
+hr {
+ box-sizing: content-box;
+ /* 1 */
+ height: 0;
+ /* 1 */
+ overflow: visible;
+ /* 2 */
+}
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+pre {
+ font-family: monospace, monospace;
+ /* 1 */
+ font-size: 1em;
+ /* 2 */
+}
+/* Text-level semantics
+ ========================================================================== */
+/**
+ * 1. Remove the gray background on active links in IE 10.
+ * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
+ */
+a {
+ background-color: transparent;
+ /* 1 */
+ -webkit-text-decoration-skip: objects;
+ /* 2 */
+}
+/**
+ * 1. Remove the bottom border in Chrome 57- and Firefox 39-.
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
+ */
+abbr[title] {
+ border-bottom: none;
+ /* 1 */
+ text-decoration: underline;
+ /* 2 */
+ text-decoration: underline dotted;
+ /* 2 */
+}
+/**
+ * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
+ */
+b,
+strong {
+ font-weight: inherit;
+}
+/**
+ * Add the correct font weight in Chrome, Edge, and Safari.
+ */
+b,
+strong {
+ font-weight: bolder;
+}
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+code,
+kbd,
+samp {
+ font-family: monospace, monospace;
+ /* 1 */
+ font-size: 1em;
+ /* 2 */
+}
+/**
+ * Add the correct font style in Android 4.3-.
+ */
+dfn {
+ font-style: italic;
+}
+/**
+ * Add the correct background and color in IE 9-.
+ */
+mark {
+ background-color: #ff0;
+ color: #000;
+}
+/**
+ * Add the correct font size in all browsers.
+ */
+small {
+ font-size: 80%;
+}
+/**
+ * Prevent `sub` and `sup` elements from affecting the line height in
+ * all browsers.
+ */
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+sub {
+ bottom: -0.25em;
+}
+sup {
+ top: -0.5em;
+}
+/* Embedded content
+ ========================================================================== */
+/**
+ * Add the correct display in IE 9-.
+ */
+audio,
+video {
+ display: inline-block;
+}
+/**
+ * Add the correct display in iOS 4-7.
+ */
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+/**
+ * Remove the border on images inside links in IE 10-.
+ */
+img {
+ border-style: none;
+}
+/**
+ * Hide the overflow in IE.
+ */
+svg:not(:root) {
+ overflow: hidden;
+}
+/* Forms
+ ========================================================================== */
+/**
+ * 1. Change the font styles in all browsers (opinionated).
+ * 2. Remove the margin in Firefox and Safari.
+ */
+button,
+input,
+optgroup,
+select,
+textarea {
+ font-family: sans-serif;
+ /* 1 */
+ font-size: 100%;
+ /* 1 */
+ line-height: 1.15;
+ /* 1 */
+ margin: 0;
+ /* 2 */
+}
+/**
+ * Show the overflow in IE.
+ * 1. Show the overflow in Edge.
+ */
+button,
+input {
+ /* 1 */
+ overflow: visible;
+}
+/**
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
+ * 1. Remove the inheritance of text transform in Firefox.
+ */
+button,
+select {
+ /* 1 */
+ text-transform: none;
+}
+/**
+ * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
+ * controls in Android 4.
+ * 2. Correct the inability to style clickable types in iOS and Safari.
+ */
+button,
+html [type="button"],
+[type="reset"],
+[type="submit"] {
+ -webkit-appearance: button;
+ /* 2 */
+}
+/**
+ * Remove the inner border and padding in Firefox.
+ */
+button::-moz-focus-inner,
+[type="button"]::-moz-focus-inner,
+[type="reset"]::-moz-focus-inner,
+[type="submit"]::-moz-focus-inner {
+ border-style: none;
+ padding: 0;
+}
+/**
+ * Restore the focus styles unset by the previous rule.
+ */
+button:-moz-focusring,
+[type="button"]:-moz-focusring,
+[type="reset"]:-moz-focusring,
+[type="submit"]:-moz-focusring {
+ outline: 1px dotted ButtonText;
+}
+/**
+ * Correct the padding in Firefox.
+ */
+fieldset {
+ padding: 0.35em 0.75em 0.625em;
+}
+/**
+ * 1. Correct the text wrapping in Edge and IE.
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
+ * 3. Remove the padding so developers are not caught out when they zero out
+ * `fieldset` elements in all browsers.
+ */
+legend {
+ box-sizing: border-box;
+ /* 1 */
+ color: inherit;
+ /* 2 */
+ display: table;
+ /* 1 */
+ max-width: 100%;
+ /* 1 */
+ padding: 0;
+ /* 3 */
+ white-space: normal;
+ /* 1 */
+}
+/**
+ * 1. Add the correct display in IE 9-.
+ * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
+ */
+progress {
+ display: inline-block;
+ /* 1 */
+ vertical-align: baseline;
+ /* 2 */
+}
+/**
+ * Remove the default vertical scrollbar in IE.
+ */
+textarea {
+ overflow: auto;
+}
+/**
+ * 1. Add the correct box sizing in IE 10-.
+ * 2. Remove the padding in IE 10-.
+ */
+[type="checkbox"],
+[type="radio"] {
+ box-sizing: border-box;
+ /* 1 */
+ padding: 0;
+ /* 2 */
+}
+/**
+ * Correct the cursor style of increment and decrement buttons in Chrome.
+ */
+[type="number"]::-webkit-inner-spin-button,
+[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+/**
+ * 1. Correct the odd appearance in Chrome and Safari.
+ * 2. Correct the outline style in Safari.
+ */
+[type="search"] {
+ -webkit-appearance: textfield;
+ /* 1 */
+ outline-offset: -2px;
+ /* 2 */
+}
+/**
+ * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
+ */
+[type="search"]::-webkit-search-cancel-button,
+[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+/**
+ * 1. Correct the inability to style clickable types in iOS and Safari.
+ * 2. Change font properties to `inherit` in Safari.
+ */
+::-webkit-file-upload-button {
+ -webkit-appearance: button;
+ /* 1 */
+ font: inherit;
+ /* 2 */
+}
+/* Interactive
+ ========================================================================== */
+/*
+ * Add the correct display in IE 9-.
+ * 1. Add the correct display in Edge, IE, and Firefox.
+ */
+details,
+menu {
+ display: block;
+}
+/*
+ * Add the correct display in all browsers.
+ */
+summary {
+ display: list-item;
+}
+/* Scripting
+ ========================================================================== */
+/**
+ * Add the correct display in IE 9-.
+ */
+canvas {
+ display: inline-block;
+}
+/**
+ * Add the correct display in IE.
+ */
+template {
+ display: none;
+}
+/* Hidden
+ ========================================================================== */
+/**
+ * Add the correct display in IE 10-.
+ */
+[hidden] {
+ display: none;
+}
+/*
+ * searx, A privacy-respecting, hackable metasearch engine
+ *
+ * To change the colors of the site, simple edit this variables
+ */
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*/
+.highlight .hll {
+ background-color: #ffffcc;
+}
+.highlight {
+ background: #f8f8f8;
+}
+.highlight .c {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment */
+.highlight .err {
+ border: 1px solid #FF0000;
+}
+/* Error */
+.highlight .k {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword */
+.highlight .o {
+ color: #666666;
+}
+/* Operator */
+.highlight .cm {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment.Multiline */
+.highlight .cp {
+ color: #BC7A00;
+}
+/* Comment.Preproc */
+.highlight .c1 {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment.Single */
+.highlight .cs {
+ color: #408080;
+ font-style: italic;
+}
+/* Comment.Special */
+.highlight .gd {
+ color: #A00000;
+}
+/* Generic.Deleted */
+.highlight .ge {
+ font-style: italic;
+}
+/* Generic.Emph */
+.highlight .gr {
+ color: #FF0000;
+}
+/* Generic.Error */
+.highlight .gh {
+ color: #000080;
+ font-weight: bold;
+}
+/* Generic.Heading */
+.highlight .gi {
+ color: #00A000;
+}
+/* Generic.Inserted */
+.highlight .go {
+ color: #888888;
+}
+/* Generic.Output */
+.highlight .gp {
+ color: #000080;
+ font-weight: bold;
+}
+/* Generic.Prompt */
+.highlight .gs {
+ font-weight: bold;
+}
+/* Generic.Strong */
+.highlight .gu {
+ color: #800080;
+ font-weight: bold;
+}
+/* Generic.Subheading */
+.highlight .gt {
+ color: #0044DD;
+}
+/* Generic.Traceback */
+.highlight .kc {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Constant */
+.highlight .kd {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Declaration */
+.highlight .kn {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Namespace */
+.highlight .kp {
+ color: #008000;
+}
+/* Keyword.Pseudo */
+.highlight .kr {
+ color: #008000;
+ font-weight: bold;
+}
+/* Keyword.Reserved */
+.highlight .kt {
+ color: #B00040;
+}
+/* Keyword.Type */
+.highlight .m {
+ color: #666666;
+}
+/* Literal.Number */
+.highlight .s {
+ color: #BA2121;
+}
+/* Literal.String */
+.highlight .na {
+ color: #7D9029;
+}
+/* Name.Attribute */
+.highlight .nb {
+ color: #008000;
+}
+/* Name.Builtin */
+.highlight .nc {
+ color: #0000FF;
+ font-weight: bold;
+}
+/* Name.Class */
+.highlight .no {
+ color: #880000;
+}
+/* Name.Constant */
+.highlight .nd {
+ color: #AA22FF;
+}
+/* Name.Decorator */
+.highlight .ni {
+ color: #999999;
+ font-weight: bold;
+}
+/* Name.Entity */
+.highlight .ne {
+ color: #D2413A;
+ font-weight: bold;
+}
+/* Name.Exception */
+.highlight .nf {
+ color: #0000FF;
+}
+/* Name.Function */
+.highlight .nl {
+ color: #A0A000;
+}
+/* Name.Label */
+.highlight .nn {
+ color: #0000FF;
+ font-weight: bold;
+}
+/* Name.Namespace */
+.highlight .nt {
+ color: #008000;
+ font-weight: bold;
+}
+/* Name.Tag */
+.highlight .nv {
+ color: #19177C;
+}
+/* Name.Variable */
+.highlight .ow {
+ color: #AA22FF;
+ font-weight: bold;
+}
+/* Operator.Word */
+.highlight .w {
+ color: #bbbbbb;
+}
+/* Text.Whitespace */
+.highlight .mf {
+ color: #666666;
+}
+/* Literal.Number.Float */
+.highlight .mh {
+ color: #666666;
+}
+/* Literal.Number.Hex */
+.highlight .mi {
+ color: #666666;
+}
+/* Literal.Number.Integer */
+.highlight .mo {
+ color: #666666;
+}
+/* Literal.Number.Oct */
+.highlight .sb {
+ color: #BA2121;
+}
+/* Literal.String.Backtick */
+.highlight .sc {
+ color: #BA2121;
+}
+/* Literal.String.Char */
+.highlight .sd {
+ color: #BA2121;
+ font-style: italic;
+}
+/* Literal.String.Doc */
+.highlight .s2 {
+ color: #BA2121;
+}
+/* Literal.String.Double */
+.highlight .se {
+ color: #BB6622;
+ font-weight: bold;
+}
+/* Literal.String.Escape */
+.highlight .sh {
+ color: #BA2121;
+}
+/* Literal.String.Heredoc */
+.highlight .si {
+ color: #BB6688;
+ font-weight: bold;
+}
+/* Literal.String.Interpol */
+.highlight .sx {
+ color: #008000;
+}
+/* Literal.String.Other */
+.highlight .sr {
+ color: #BB6688;
+}
+/* Literal.String.Regex */
+.highlight .s1 {
+ color: #BA2121;
+}
+/* Literal.String.Single */
+.highlight .ss {
+ color: #19177C;
+}
+/* Literal.String.Symbol */
+.highlight .bp {
+ color: #008000;
+}
+/* Name.Builtin.Pseudo */
+.highlight .vc {
+ color: #19177C;
+}
+/* Name.Variable.Class */
+.highlight .vg {
+ color: #19177C;
+}
+/* Name.Variable.Global */
+.highlight .vi {
+ color: #19177C;
+}
+/* Name.Variable.Instance */
+.highlight .il {
+ color: #666666;
+}
+/* Literal.Number.Integer.Long */
+.highlight pre {
+ overflow: auto;
+}
+.highlight .lineno {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ cursor: default;
+}
+.highlight .lineno::selection {
+ background: transparent;
+ /* WebKit/Blink Browsers */
+}
+.highlight .lineno::-moz-selection {
+ background: transparent;
+ /* Gecko Browsers */
+}
+html.no-js .hide_if_nojs {
+ display: none;
+}
+html.js .show_if_nojs {
+ display: none;
+}
+.center {
+ text-align: center;
+}
+.right {
+ float: right ;
+}
+.left {
+ float: left;
+}
+.invisible {
+ display: none;
+}
+.danger {
+ background-color: #fae1e1;
+}
+.badge {
+ display: inline-block;
+ color: #fff;
+ background-color: #777;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ min-width: 10px;
+ padding: 1px 5px;
+ border-radius: 5px;
+}
+table {
+ width: 100%;
+}
+table.striped tr {
+ border-bottom: 1px solid #ececec;
+}
+th {
+ padding: 0.4em;
+}
+td {
+ padding: 0 4px;
+}
+tr:hover {
+ background: #ececec;
+}
+.dialog-error {
+ position: relative;
+ width: 70%;
+ padding: 1em 1em 1em 2.7em;
+ margin: 0em 8% 1em 8%;
+ border: 1px solid black;
+ border-radius: 4px;
+ text-align: left;
+ color: #db3434;
+ background: #fae1e1;
+ border-color: #db3434;
+}
+.dialog-error:before {
+ position: absolute;
+ top: 0.5em;
+ left: 0.5em;
+ font-family: "ion";
+ font-size: 1.5em;
+}
+.dialog-error .close {
+ float: right;
+ position: relative;
+ top: -3px;
+ color: inherit;
+ font-size: 1.5em;
+}
+.dialog-error ul,
+.dialog-error ol,
+.dialog-error p {
+ margin: 1px 0 0 0;
+}
+.dialog-error:before {
+ content: "\f110";
+}
+.dialog-warning {
+ position: relative;
+ width: 70%;
+ padding: 1em 1em 1em 2.7em;
+ margin: 0em 8% 1em 8%;
+ border: 1px solid black;
+ border-radius: 4px;
+ text-align: left;
+ color: #dbba34;
+ background: #faf5e1;
+ border-color: #dbba34;
+}
+.dialog-warning:before {
+ position: absolute;
+ top: 0.5em;
+ left: 0.5em;
+ font-family: "ion";
+ font-size: 1.5em;
+}
+.dialog-warning .close {
+ float: right;
+ position: relative;
+ top: -3px;
+ color: inherit;
+ font-size: 1.5em;
+}
+.dialog-warning ul,
+.dialog-warning ol,
+.dialog-warning p {
+ margin: 1px 0 0 0;
+}
+.dialog-warning:before {
+ content: "\f10f";
+}
+.btn-collapse {
+ cursor: pointer;
+}
+.scrollx {
+ overflow-x: auto;
+ overflow-y: hidden;
+ display: block;
+ padding: 0;
+ margin: 0;
+ border: none;
+}
+.tabs .tabs > label {
+ font-size: 90%;
+}
+.tabs {
+ display: -webkit-box;
+ display: -moz-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ flex-wrap: wrap;
+ width: 100%;
+ min-width: 100%;
+}
+.tabs > * {
+ order: 2;
+}
+.tabs > input[type=radio] {
+ display: none;
+}
+.tabs > label {
+ order: 1;
+ padding: 0.7em;
+ margin: 0 0.7em;
+ letter-spacing: 0.5px;
+ text-transform: uppercase;
+ border: solid white;
+ border-width: 0px 0px 2px 0;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ cursor: pointer;
+}
+.tabs > label:hover {
+ border-bottom: 2px solid #084999;
+}
+.tabs > section {
+ min-width: 100%;
+ padding: 0.7rem 0;
+ box-sizing: border-box;
+ border-top: 1px solid black;
+ display: none;
+}
+.tabs > label:last-of-type {
+ border-bottom: 2px solid #084999;
+ background: #3498DB;
+ color: #FFF;
+ font-weight: bold;
+ letter-spacing: -0.1px;
+}
+.tabs > section:last-of-type {
+ display: block;
+}
+html body .tabs > input:checked ~ section {
+ display: none;
+}
+html body .tabs > input:checked ~ label {
+ position: inherited;
+ background: inherit;
+ border-bottom: 2px solid transparent;
+ font-weight: normal;
+ color: inherit;
+}
+html body .tabs > input:checked ~ label:hover {
+ border-bottom: 2px solid #084999;
+}
+html body .tabs > input:checked + label {
+ border-bottom: 2px solid #084999;
+ background: #3498DB;
+ color: #FFF;
+ font-weight: bold;
+ letter-spacing: -0.1px;
+}
+html body .tabs > input:checked + label + section {
+ display: block;
+}
+select {
+ height: 28px;
+ margin: 0 1em 0 0;
+ padding: 2px 8px 2px 0 !important;
+ color: #222;
+ font-size: 12px;
+ z-index: 2;
+}
+select:hover,
+select:focus {
+ cursor: pointer;
+}
+@supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))) {
+ select {
+ appearance: none;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ border: none;
+ border-bottom: 1px solid #d7d7d7;
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat;
+ background-position-x: 105%;
+ background-size: 2em;
+ background-origin: content-box;
+ outline: medium none;
+ }
+ select:hover,
+ select:focus {
+ border-bottom: 1px solid #3498DB;
+ }
+}
+@supports (border-radius: 50px) {
+ .checkbox-onoff {
+ display: inline-block;
+ width: 40px;
+ height: 10px;
+ background: #dcdcdc;
+ margin: 8px auto;
+ position: relative;
+ border-radius: 50px;
+ }
+ .checkbox-onoff label {
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ top: -5px;
+ cursor: pointer;
+ border-radius: 50px;
+ box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.3);
+ transition: all 0.4s ease;
+ left: 27px;
+ background-color: #3498DB;
+ }
+ .checkbox-onoff input[type=checkbox] {
+ visibility: hidden;
+ }
+ .checkbox-onoff input[type=checkbox]:checked + label {
+ left: -5px;
+ background: #dcdcdc;
+ }
+}
+@supports (transform: rotate(-45deg)) {
+ .checkbox {
+ width: 20px;
+ position: relative;
+ margin: 20px auto;
+ }
+ .checkbox label {
+ width: 20px;
+ height: 20px;
+ cursor: pointer;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background: white;
+ border-radius: 4px;
+ box-shadow: inset 0px 1px 1px white, 0px 1px 4px rgba(0, 0, 0, 0.5);
+ }
+ .checkbox label:after {
+ content: '';
+ width: 9px;
+ height: 5px;
+ position: absolute;
+ top: 4px;
+ left: 4px;
+ border: 3px solid #333;
+ border-top: none;
+ border-right: none;
+ background: transparent;
+ opacity: 0;
+ transform: rotate(-45deg);
+ }
+ .checkbox input[type=checkbox] {
+ visibility: hidden;
+ }
+ .checkbox input[type=checkbox]:checked + label:after {
+ border-color: #3498DB;
+ opacity: 1;
+ }
+ .checkbox input[disabled] + label {
+ background-color: transparent !important;
+ box-shadow: none !important;
+ cursor: inherit;
+ }
+ .checkbox input:not(:checked):not([readonly]):not([disabled]) + label:hover::after {
+ opacity: 0.5;
+ }
+}
+@media screen and (max-width: 50em) {
+ .tabs > label {
+ width: 100%;
+ }
+}
+.autocomplete {
+ position: absolute;
+ max-height: 0;
+ overflow-y: hidden;
+ text-align: left;
+}
+.autocomplete:active,
+.autocomplete:focus,
+.autocomplete:hover {
+ background-color: white;
+}
+.autocomplete:empty {
+ display: none;
+}
+.autocomplete > ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+}
+.autocomplete > ul > li {
+ cursor: pointer;
+ padding: 5px 0 5px 10px;
+}
+.autocomplete > ul > li.active,
+.autocomplete > ul > li:active,
+.autocomplete > ul > li:focus {
+ background-color: #3498DB;
+}
+.autocomplete > ul > li.active a:active,
+.autocomplete > ul > li:active a:active,
+.autocomplete > ul > li:focus a:active,
+.autocomplete > ul > li.active a:focus,
+.autocomplete > ul > li:active a:focus,
+.autocomplete > ul > li:focus a:focus,
+.autocomplete > ul > li.active a:hover,
+.autocomplete > ul > li:active a:hover,
+.autocomplete > ul > li:focus a:hover {
+ text-decoration: none;
+}
+.autocomplete > ul > li.locked {
+ cursor: inherit;
+}
+.autocomplete.open {
+ display: block;
+ background-color: white;
+ border: 1px solid #3498DB;
+ max-height: 500px;
+ overflow-y: auto;
+ z-index: 100;
+}
+.autocomplete.open:empty {
+ display: none;
+}
+@media screen and (max-width: 50em) {
+ .autocomplete {
+ bottom: 0;
+ }
+ .autocomplete > ul > li {
+ padding: 7px 0 7px 10px;
+ border-bottom: 1px solid #E8E7E6;
+ text-align: left;
+ }
+}
+@font-face {
+ font-family: "ion";
+ src: url("../fonts/ion.eot?94af7082ea096aefe3a7b6642834716e");
+ src: url("../fonts/ion.eot?#iefix") format("embedded-opentype"), url("../fonts/ion.woff2?94af7082ea096aefe3a7b6642834716e") format("woff2"), url("../fonts/ion.woff?94af7082ea096aefe3a7b6642834716e") format("woff"), url("../fonts/ion.ttf?94af7082ea096aefe3a7b6642834716e") format("truetype"), url("../fonts/ion.svg?94af7082ea096aefe3a7b6642834716e#ion") format("svg");
+ font-weight: normal;
+ font-style: normal;
+}
+.ion-icon {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 1;
+ font-weight: normal;
+ font-style: normal;
+ speak: none;
+ text-decoration: inherit;
+ text-transform: none;
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+.ion-icon:before {
+ font-family: "ion";
+}
+.ion-navicon-round:before {
+ content: "\f101";
+}
+.ion-search:before {
+ content: "\f102";
+}
+.ion-play:before {
+ content: "\f103";
+}
+.ion-link:before {
+ content: "\f104";
+}
+.ion-chevron-up:before {
+ content: "\f105";
+}
+.ion-chevron-left:before {
+ content: "\f106";
+}
+.ion-chevron-right:before {
+ content: "\f107";
+}
+.ion-arrow-down-a:before {
+ content: "\f108";
+}
+.ion-arrow-up-a:before {
+ content: "\f109";
+}
+.ion-arrow-swap:before {
+ content: "\f10a";
+}
+.ion-arrow-dropdown:before {
+ content: "\f10b";
+}
+.ion-globe:before {
+ content: "\f10c";
+}
+.ion-time:before {
+ content: "\f10d";
+}
+.ion-location:before {
+ content: "\f10e";
+}
+.ion-warning:before {
+ content: "\f10f";
+}
+.ion-error:before {
+ content: "\f110";
+}
+.ion-film-outline:before {
+ content: "\f111";
+}
+.ion-music-note:before {
+ content: "\f112";
+}
+.ion-more-vertical:before {
+ content: "\f113";
+}
+.ion-magnet:before {
+ content: "\f114";
+}
+.ion-icon-big {
+ display: inline-block;
+ vertical-align: middle;
+ line-height: 1;
+ font-weight: normal;
+ font-style: normal;
+ speak: none;
+ text-decoration: inherit;
+ text-transform: none;
+ text-rendering: auto;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ font-size: 149%;
+}
+.ion-icon-big:before {
+ font-family: "ion";
+}
+.index {
+ text-align: center;
+}
+.index .title {
+ background: url('../img/searx.png') no-repeat;
+ width: 100%;
+ min-height: 80px;
+ background-position: center;
+}
+.index h1 {
+ font-size: 5em;
+ visibility: hidden;
+}
+.index #search {
+ margin: 0 auto;
+ background: inherit;
+ border: inherit;
+}
+.index .search_filters {
+ display: block;
+ margin: 1em 0;
+}
+.index .category label {
+ padding: 6px 10px;
+ border-bottom: initial !important;
+}
+@media screen and (max-width: 75em) {
+ div.title h1 {
+ font-size: 1em;
+ }
+}
+#main_preferences form {
+ width: 100%;
+}
+#main_preferences fieldset {
+ margin: 8px;
+ border: none;
+}
+#main_preferences legend {
+ margin: 0;
+ padding: 5px 0 0 0;
+ display: block;
+ float: left;
+ width: 300px;
+}
+#main_preferences .value {
+ margin: 0;
+ padding: 0;
+ float: left;
+ width: 15em;
+}
+#main_preferences .description {
+ margin: 0;
+ padding: 5px 0 0 0;
+ float: left;
+ width: 50%;
+ color: #909090;
+ font-size: 90%;
+}
+#main_preferences select {
+ width: 200px;
+ font-size: inherit !important;
+}
+#main_preferences table {
+ border-collapse: collapse;
+}
+#main_preferences table td {
+ text-align: center;
+}
+#main_preferences .name,
+#main_preferences .shortcut {
+ text-align: left;
+}
+#main_preferences .preferences_back {
+ background: none repeat scroll 0 0 #3498DB;
+ color: white;
+ border: 0 none;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ cursor: pointer;
+ display: inline-block;
+ margin: 2px 4px;
+ padding: 0.5em;
+}
+#main_preferences .preferences_back a {
+ display: block;
+ color: #FFF;
+}
+#main_preferences .preferences_back a::first-letter {
+ text-transform: uppercase;
+}
+@media screen and (max-width: 75em) {
+ .preferences_back {
+ clear: both;
+ }
+}
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*/
+#search {
+ padding: 0 2em;
+ margin: 0;
+ background: #f7f7f7;
+ border-bottom: 1px solid #d7d7d7;
+}
+#search_wrapper {
+ padding: 10px 0;
+}
+.search_box {
+ margin: 0 12px 0 0;
+ display: inline-flex;
+ flex-direction: row;
+ white-space: nowrap;
+ /*
+ &:has(q:focus) {
+ box-shadow: 0px 0px 5px #CCC;
+}
+*/
+}
+#q,
+#send_search {
+ display: block !important;
+ border-collapse: separate;
+ box-sizing: border-box;
+ position: relative;
+ margin: 0;
+ padding: 2px;
+ height: 2.2em;
+ background: none repeat scroll 0 0 #FFF;
+ border: 1px solid #3498DB;
+ border-radius: 0px;
+ outline: none;
+ color: #222;
+ font-size: 16px;
+ z-index: 2;
+}
+#q {
+ outline: medium none;
+ padding-left: 8px;
+ padding-right: 0px !important;
+ border-right: none;
+ width: 40em;
+}
+#send_search {
+ border-left: none;
+ width: 2.2em;
+}
+#send_search:hover {
+ cursor: pointer;
+ background-color: #3498DB;
+ color: #ECF0F1;
+}
+.no-js #send_search {
+ width: auto !important;
+}
+.search_filters {
+ display: inline-block;
+ vertical-align: middle;
+}
+@media screen and (max-width: 75em) {
+ #categories {
+ font-size: 90%;
+ clear: both;
+ }
+ #categories .checkbox_container {
+ margin-top: 2px;
+ margin: auto;
+ }
+ html.touch #main_index #categories_container,
+ html.touch #main_results #categories_container {
+ width: 1000px;
+ width: -moz-max-content;
+ width: -webkit-max-content;
+ width: max-content;
+ }
+ html.touch #main_index #categories_container .category,
+ html.touch #main_results #categories_container .category {
+ display: inline-block;
+ width: auto;
+ }
+ html.touch #main_index #categories,
+ html.touch #main_results #categories {
+ width: 100%;
+ margin: 0;
+ text-align: left;
+ overflow-x: scroll;
+ overflow-y: hidden;
+ -webkit-overflow-scrolling: touch;
+ }
+}
+@media screen and (max-width: 50em) {
+ #search {
+ width: 100%;
+ margin: 0;
+ padding: 0.1em 0 0 0;
+ }
+ #search_wrapper {
+ width: 100%;
+ margin: 0 0 0.7em 0;
+ padding: 0;
+ }
+ .search_box {
+ width: 99%;
+ margin: 0.1em;
+ padding: 0 0.1em 0 0;
+ display: flex;
+ flex-direction: row;
+ }
+ #q {
+ width: auto !important;
+ flex: 1;
+ }
+ .search_filters {
+ display: block;
+ margin: 0.5em;
+ }
+ .language,
+ .time_range {
+ width: 45%;
+ }
+ .category {
+ display: block;
+ width: 90%;
+ }
+ .category label {
+ border-bottom: 0;
+ }
+}
+#categories {
+ margin: 0 10px 0 0;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+#categories::-webkit-scrollbar {
+ width: 0;
+ height: 0;
+}
+.category {
+ display: inline-block;
+ position: relative;
+ margin: 0 3px;
+ padding: 0px;
+ /*label:hover {
+ border-bottom: 2px solid @color-categories-item-border-unselected-hover;
+ }*/
+}
+.category input {
+ display: none;
+}
+.category label {
+ cursor: pointer;
+ padding: 4px 10px;
+ margin: 0;
+ display: block;
+ text-transform: capitalize;
+ font-size: 0.9em;
+ border-bottom: 2px solid transparent;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.category input[type="checkbox"]:focus + label {
+ box-shadow: 0px 0px 8px #3498DB;
+}
+.category input[type="checkbox"]:checked + label {
+ background: #3498DB;
+ color: #FFF;
+ border-bottom: 2px solid #084999;
+}
+#categories_container {
+ position: relative;
+}
+#categories_container .help {
+ position: absolute;
+ width: 100%;
+ bottom: -20px;
+ overflow: hidden;
+ opacity: 0;
+ transition: opacity 1s ease;
+ font-size: 0.8em;
+ text-position: center;
+ background: white;
+}
+#categories_container:hover .help {
+ opacity: 0.8;
+ transition: opacity 1s ease;
+}
+html {
+ font-family: arial, sans-serif;
+ font-size: 0.9em;
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%;
+ -moz-text-size-adjust: 100%;
+ text-size-adjust: 100%;
+ color: #444;
+ padding: 0;
+ margin: 0;
+}
+body,
+main {
+ padding: 0;
+ margin: 0;
+}
+main {
+ width: 100%;
+}
+footer {
+ bottom: 0;
+ width: 100%;
+ height: 50px;
+}
+#main_preferences,
+#main_about,
+#main_stats {
+ margin: 3em;
+ width: auto;
+}
+footer {
+ bottom: 0;
+ height: 3em;
+ margin: 1em 0;
+ padding: 1em 0;
+ clear: both;
+ width: 100%;
+ text-align: center;
+}
+footer p {
+ font-size: 0.9em;
+}
+#main_preferences h1,
+#main_stats h1 {
+ background: url('../img/searx.png') no-repeat;
+ background-size: auto 75%;
+ min-height: 40px;
+ margin: 0 auto;
+}
+#main_preferences h1 span,
+#main_stats h1 span {
+ visibility: hidden;
+}
+input[type="submit"],
+#results button[type="submit"] {
+ padding: 0.5rem;
+ margin: 2px 4px;
+ display: inline-block;
+ background: #3498DB;
+ color: #FFF;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ border: 0;
+ cursor: pointer;
+}
+a {
+ text-decoration: none;
+ color: #29314d;
+}
+a:visited {
+ color: #684898;
+}
+a:visited .highlight {
+ color: #684898;
+}
+article[data-vim-selected] {
+ background: #f7f7f7;
+}
+article[data-vim-selected]::before {
+ position: absolute;
+ left: 1em;
+ padding: 2px;
+ content: ">";
+ font-weight: bold;
+ color: #3498DB;
+}
+article.result-images[data-vim-selected] {
+ background: #3498DB;
+}
+article.result-images[data-vim-selected]::before {
+ display: none;
+ content: "";
+}
+.result {
+ margin: 19px 0 18px 0;
+ padding: 0;
+}
+.result h3 {
+ font-size: 1.1em;
+ word-wrap: break-word;
+ margin: 5px 0 1px 0;
+ padding: 0;
+ margin-bottom: 0;
+}
+.result h3 a {
+ color: #084999;
+ font-weight: normal;
+ font-size: 1.1em;
+}
+.result h3 a:visited {
+ color: #684898;
+}
+.result h3 a:focus,
+.result h3 a:hover {
+ text-decoration: underline;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ outline: none;
+}
+.result .cache_link,
+.result .proxyfied_link {
+ font-size: 0.9em !important;
+}
+.result .content,
+.result .stat,
+.result .altlink {
+ font-size: 0.9em;
+ margin: 0;
+ padding: 0;
+ max-width: 54em;
+ word-wrap: break-word;
+ line-height: 1.24;
+}
+.result .content .highlight,
+.result .stat .highlight,
+.result .altlink .highlight {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+.result .codelines .highlight {
+ color: inherit;
+ background: inherit;
+ font-weight: normal;
+}
+.result .url {
+ font-size: 0.9em;
+ margin: 0 0 3px 0;
+ padding: 0;
+ max-width: 54em;
+ word-wrap: break-word;
+ color: #25a55b;
+}
+.result .published_date {
+ font-size: 0.8em;
+ color: #888;
+}
+.result img.thumbnail {
+ float: left;
+ padding: 0 5px 10px 0;
+ width: 20em;
+ min-width: 20em;
+ min-height: 8em;
+}
+.result img.image {
+ float: left;
+ padding: 0 5px 10px 0;
+ width: 100px;
+ max-height: 100px;
+ object-fit: scale-down;
+ object-position: right top;
+}
+.result .break {
+ clear: both;
+}
+.category-social .image {
+ width: auto !important;
+ min-width: 48px;
+ min-height: 48px;
+ padding: 0 5px 25px 0 !important;
+}
+.result-videos .content {
+ overflow: hidden;
+}
+.engines {
+ float: right;
+ color: #888;
+}
+.engines span {
+ font-size: smaller;
+ margin: 0 0.5em 0 0;
+}
+.small_font {
+ font-size: 0.8em;
+}
+.highlight {
+ color: #094089;
+ background: inherit;
+ font-weight: bold;
+}
+.result-images {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ max-height: 200px;
+}
+.result-images img {
+ float: inherit;
+ margin: 0;
+ padding: 0;
+ border: none;
+ max-height: 200px;
+ background: #084999;
+}
+.result-images span a {
+ display: none;
+ color: #FFF;
+}
+.result-images:hover span a {
+ display: block;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ padding: 4px;
+ margin: 0 0 4px 4px;
+ background-color: rgba(0, 0, 0, 0.6);
+ font-size: 0.7em;
+}
+.torrent_result {
+ border-left: 10px solid lightgray;
+ padding-left: 3px;
+}
+.torrent_result p {
+ margin: 3px;
+ font-size: 0.8em;
+}
+.torrent_result a {
+ color: #084999;
+}
+.torrent_result a:hover {
+ text-decoration: underline;
+}
+.torrent_result a:visited {
+ color: #684898;
+}
+#results {
+ margin: 2em 2em 20px 2em;
+ padding: 0;
+ width: 50em;
+}
+#suggestions .wrapper {
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: flex-end;
+}
+#suggestions .wrapper form {
+ display: inline-block;
+ flex: 1 1 50%;
+}
+#suggestions,
+#answers,
+#corrections {
+ max-width: 50em;
+}
+#suggestions input,
+#answers input,
+#infoboxes input,
+#corrections input {
+ padding: 0;
+ margin: 3px;
+ font-size: 0.9em;
+ display: inline-block;
+ background: transparent;
+ color: #444;
+ cursor: pointer;
+}
+#suggestions input[type="submit"],
+#answers input[type="submit"],
+#infoboxes input[type="submit"],
+#corrections input[type="submit"],
+#suggestions .infobox .url a,
+#answers .infobox .url a,
+#infoboxes .infobox .url a,
+#corrections .infobox .url a {
+ color: #084999;
+ text-decoration: none;
+ font-size: 0.9rem;
+}
+#suggestions input[type="submit"]:hover,
+#answers input[type="submit"]:hover,
+#infoboxes input[type="submit"]:hover,
+#corrections input[type="submit"]:hover,
+#suggestions .infobox .url a:hover,
+#answers .infobox .url a:hover,
+#infoboxes .infobox .url a:hover,
+#corrections .infobox .url a:hover {
+ text-decoration: underline;
+}
+#corrections {
+ display: flex;
+ flex-flow: row wrap;
+ margin: 1em 0;
+}
+#corrections h4,
+#corrections input[type="submit"] {
+ display: inline-block;
+ margin: 0 0.5em 0 0;
+}
+#corrections input[type="submit"]::after {
+ content: ", ";
+}
+#suggestions .title,
+#search_url .title,
+#apis .title {
+ margin: 2em 0 0.5em 0;
+ color: #444;
+}
+#answers {
+ margin: 10px 8px 10px 8px;
+ border: 1px solid #ddd;
+ padding: 0.9em;
+ box-shadow: 0px 0px 5px #CCC;
+}
+#answers h4 {
+ display: none;
+}
+#answers .answer {
+ display: block;
+ font-size: 1.2em;
+ font-weight: bold;
+}
+#answers form,
+#infoboxes form {
+ min-width: 210px;
+}
+#sidebar {
+ position: absolute;
+ top: 100px;
+ left: 57em;
+ margin: 0px 2px 5px 5px;
+ padding: 0px 2px 2px;
+ max-width: 25em;
+ word-wrap: break-word;
+}
+#sidebar .infobox {
+ margin: 10px 0 10px;
+ border: 1px solid #ddd;
+ padding: 0.9em;
+ font-size: 0.9em;
+ box-shadow: 0px 0px 5px #CCC;
+}
+#sidebar .infobox h2 {
+ margin: 0 0 .5em 0;
+}
+#sidebar .infobox img {
+ max-width: 100%;
+ max-height: 12em;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+#sidebar .infobox dl {
+ margin: 0.5em 0;
+}
+#sidebar .infobox dt {
+ display: inline;
+ margin: 0.5em 0.25em 0.5em 0;
+ padding: 0;
+ font-weight: bold;
+}
+#sidebar .infobox dd {
+ display: inline;
+ margin: 0.5em 0;
+ padding: 0;
+}
+#sidebar .infobox input {
+ font-size: 1em;
+}
+#sidebar .infobox br {
+ clear: both;
+}
+#sidebar .infobox .attributes,
+#sidebar .infobox .urls {
+ clear: both;
+}
+#search_url {
+ margin-top: 8px;
+}
+#search_url div {
+ border: 1px solid #888;
+ padding: 4px;
+ color: #444;
+ width: 100%;
+ display: block;
+ margin: 0.1em;
+ overflow: hidden;
+ height: 1.2em;
+ line-height: 1.2em;
+}
+#search_url div pre {
+ display: block;
+ width: 200em;
+ font-size: 0.8em;
+ word-break: break-all;
+ margin: 0.1em;
+ -webkit-user-select: all;
+ -moz-user-select: all;
+ -ms-user-select: all;
+ user-select: all;
+}
+#linkto_preferences {
+ position: absolute;
+ right: 10px;
+ top: 0.9em;
+ padding: 0;
+ border: 0;
+ display: block;
+ font-size: 1.2em;
+ color: #222;
+}
+#linkto_preferences a:link *,
+#linkto_preferences a:hover *,
+#linkto_preferences a:visited *,
+#linkto_preferences a:active * {
+ color: #222;
+}
+#pagination {
+ clear: both;
+}
+#pagination br {
+ clear: both;
+}
+#apis {
+ margin-top: 8px;
+ clear: both;
+}
+#backToTop {
+ border: 1px solid #ddd;
+ margin: 0 0 0 2em;
+ padding: 0;
+ font-size: 1em;
+ box-shadow: 0px 0px 5px #CCC;
+ background: white;
+ position: fixed;
+ bottom: 85px;
+ left: 50em;
+ transition: opacity 0.5s;
+ opacity: 0;
+}
+#backToTop a {
+ display: block;
+ margin: 0;
+ padding: 0.6em;
+}
+@media screen and (max-width: 75em) {
+ #main_preferences,
+ #main_about,
+ #main_stats {
+ margin: 0.5em;
+ width: auto;
+ }
+ #suggestions,
+ #answers {
+ margin-top: 1em;
+ }
+ #infoboxes {
+ position: inherit;
+ max-width: inherit;
+ }
+ #infoboxes .infobox {
+ clear: both;
+ }
+ #infoboxes .infobox img {
+ float: left;
+ max-width: 10em;
+ margin: 0.5em 0.5em 0.5em 0;
+ }
+ #sidebar {
+ position: static;
+ max-width: 50em;
+ margin: 0 0 2px 0;
+ padding: 0;
+ float: none;
+ border: none;
+ width: auto;
+ }
+ #sidebar input {
+ border: 0;
+ }
+ #apis {
+ display: none;
+ }
+ #search_url {
+ display: none;
+ }
+ .result {
+ border-bottom: 1px solid #E8E7E6;
+ margin: 0;
+ padding-top: 8px;
+ padding-bottom: 6px;
+ }
+ .result h3 {
+ margin: 0 0 1px 0;
+ }
+ .result .thumbnail {
+ max-width: 98%;
+ }
+ .result .url span.url {
+ display: block;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ width: 100%;
+ }
+ .result .url a {
+ float: right;
+ padding: 0 0.5em;
+ }
+ .result .engines {
+ float: right;
+ padding: 0 0 3px 0;
+ }
+ .result-images {
+ border-bottom: none !important;
+ }
+ .image_result {
+ max-width: 98%;
+ }
+ .image_result img {
+ max-width: 98%;
+ }
+}
+@media screen and (max-width: 50em) {
+ article[data-vim-selected]::before {
+ display: none;
+ content: "";
+ }
+ #linkto_preferences {
+ display: none;
+ postion: fixed !important;
+ top: 100px;
+ right: 0px;
+ }
+ #sidebar {
+ margin: 0 5px 2px 5px;
+ }
+ #corrections {
+ margin: 1em 5px 1em 5px;
+ }
+ #results {
+ margin: 0;
+ padding: 0;
+ width: initial;
+ }
+ #backToTop {
+ left: 40em;
+ bottom: 35px;
+ }
+ .result {
+ padding: 8px 10px 6px 10px;
+ }
+ .result-images {
+ margin: 0;
+ padding: 0;
+ border: none;
+ }
+}
+@media screen and (max-width: 35em) {
+ .result-videos img.thumbnail {
+ float: none !important;
+ }
+ .result-videos .content {
+ overflow: inherit;
+ }
+}
diff --git a/searx/static/themes/simple/css/searx.min.css b/searx/static/themes/simple/css/searx.min.css
new file mode 100644
index 000000000..0513de2b0
--- /dev/null
+++ b/searx/static/themes/simple/css/searx.min.css
@@ -0,0 +1 @@
+/*! searx | 06-08-2017 | https://github.com/asciimoo/searx *//*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-block}[type=checkbox],[type=radio],legend{padding:0;box-sizing:border-box}.badge,.center{text-align:center}.badge,progress,sub,sup{vertical-align:baseline}#q,#send_search,.tabs>section,legend{box-sizing:border-box}#apis,#pagination,#pagination br,#sidebar .infobox .attributes,#sidebar .infobox .urls,#sidebar .infobox br,.result .break,footer{clear:both}html{line-height:1.15}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.highlight pre,textarea{overflow:auto}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{padding:.35em .75em .625em}legend{color:inherit;display:table;max-width:100%;white-space:normal}.badge,.search_box{white-space:nowrap}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.highlight .c,.highlight .cm,.highlight .ge,.highlight .sd{font-style:italic}.dialog-error:before,.dialog-warning:before,.ion-icon-big:before,.ion-icon:before{font-family:ion}summary{display:list-item}.invisible,[hidden],html.js .show_if_nojs,html.no-js .hide_if_nojs,template{display:none}.highlight .hll{background-color:#ffc}.highlight .c{color:#408080}.highlight .err{border:1px solid red}.highlight .k{color:green;font-weight:700}.highlight .o{color:#666}.highlight .cm{color:#408080}.highlight .cp{color:#BC7A00}.highlight .c1,.highlight .cs{color:#408080;font-style:italic}.highlight .gd{color:#A00000}.highlight .gr{color:red}.highlight .gh{color:navy;font-weight:700}.highlight .gi{color:#00A000}.highlight .go{color:#888}.highlight .gp{color:navy;font-weight:700}.highlight .gs{font-weight:700}.highlight .gu{color:purple;font-weight:700}.highlight .gt{color:#04D}.highlight .kc,.highlight .kd,.highlight .kn{color:green;font-weight:700}.highlight .kp{color:green}.highlight .kr{color:green;font-weight:700}.highlight .kt{color:#B00040}.highlight .m{color:#666}.highlight .s{color:#BA2121}.highlight .na{color:#7D9029}.highlight .nb{color:green}.highlight .nc{color:#00F;font-weight:700}.highlight .no{color:#800}.highlight .nd{color:#A2F}.highlight .ni{color:#999;font-weight:700}.highlight .ne{color:#D2413A;font-weight:700}.highlight .nf{color:#00F}.highlight .nl{color:#A0A000}.highlight .nn{color:#00F;font-weight:700}.highlight .nt{color:green;font-weight:700}.highlight .nv{color:#19177C}.highlight .ow{color:#A2F;font-weight:700}.highlight .w{color:#bbb}.highlight .mf,.highlight .mh,.highlight .mi,.highlight .mo{color:#666}.highlight .s2,.highlight .sb,.highlight .sc{color:#BA2121}.highlight .sd{color:#BA2121}.highlight .se{color:#B62;font-weight:700}.highlight .sh{color:#BA2121}.highlight .si{color:#B68;font-weight:700}.highlight .sx{color:green}.highlight .sr{color:#B68}.highlight .s1{color:#BA2121}.highlight .ss{color:#19177C}.highlight .bp{color:green}.highlight .vc,.highlight .vg,.highlight .vi{color:#19177C}.highlight .il{color:#666}.highlight .lineno{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}#categories,.tabs>label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-touch-callout:none;-khtml-user-select:none}.btn-collapse,.tabs>label,select:focus,select:hover{cursor:pointer}.highlight .lineno::selection{background:0 0}.highlight .lineno::-moz-selection{background:0 0}.right{float:right}.left{float:left}.danger{background-color:#fae1e1}.badge{display:inline-block;color:#fff;background-color:#777;min-width:10px;padding:1px 5px;border-radius:5px}table{width:100%}table.striped tr{border-bottom:1px solid #ececec}th{padding:.4em}td{padding:0 4px}.dialog-error,.dialog-warning{width:70%;padding:1em 1em 1em 2.7em;text-align:left}tr:hover{background:#ececec}.dialog-error{position:relative;margin:0 8% 1em;border:1px solid #db3434;border-radius:4px;color:#db3434;background:#fae1e1}.dialog-error:before{position:absolute;top:.5em;left:.5em;font-size:1.5em;content:"\f110"}.dialog-error .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-error ol,.dialog-error p,.dialog-error ul{margin:1px 0 0}.dialog-warning{position:relative;margin:0 8% 1em;border:1px solid #dbba34;border-radius:4px;color:#dbba34;background:#faf5e1}.dialog-warning:before{position:absolute;top:.5em;left:.5em;font-size:1.5em;content:"\f10f"}.dialog-warning .close{float:right;position:relative;top:-3px;color:inherit;font-size:1.5em}.dialog-warning ol,.dialog-warning p,.dialog-warning ul{margin:1px 0 0}.scrollx{overflow-x:auto;overflow-y:hidden;display:block;padding:0;margin:0;border:none}.tabs .tabs>label{font-size:90%}.tabs{display:-webkit-box;display:-moz-box;display:-webkit-flex;display:-ms-flexbox;display:flex;flex-wrap:wrap;width:100%;min-width:100%}.tabs>*{order:2}.tabs>input[type=radio]{display:none}.tabs>label{order:1;padding:.7em;margin:0 .7em;letter-spacing:.5px;text-transform:uppercase;border:solid #fff;border-width:0 0 2px;user-select:none}.tabs>label:hover{border-bottom:2px solid #084999}.tabs>section{min-width:100%;padding:.7rem 0;border-top:1px solid #000;display:none}.tabs>label:last-of-type{border-bottom:2px solid #084999;background:#3498DB;color:#FFF;font-weight:700;letter-spacing:-.1px}.tabs>section:last-of-type{display:block}html body .tabs>input:checked~section{display:none}html body .tabs>input:checked~label{position:inherited;background:inherit;border-bottom:2px solid transparent;font-weight:400;color:inherit}html body .tabs>input:checked~label:hover{border-bottom:2px solid #084999}html body .tabs>input:checked+label{border-bottom:2px solid #084999;background:#3498DB;color:#FFF;font-weight:700;letter-spacing:-.1px}html body .tabs>input:checked+label+section{display:block}select{height:28px;margin:0 1em 0 0;padding:2px 8px 2px 0!important;color:#222;font-size:12px;z-index:2}@supports ((background-position-x:100%) and ((appearance:none) or (-webkit-appearance:none) or (-moz-appearance:none))){select{appearance:none;-webkit-appearance:none;-moz-appearance:none;border:none;border-bottom:1px solid #d7d7d7;background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat;background-position-x:105%;background-size:2em;background-origin:content-box;outline:0}select:focus,select:hover{border-bottom:1px solid #3498DB}}@supports (border-radius:50px){.checkbox-onoff{display:inline-block;width:40px;height:10px;background:#dcdcdc;margin:8px auto;position:relative;border-radius:50px}.checkbox-onoff label{display:block;width:20px;height:20px;position:absolute;top:-5px;cursor:pointer;border-radius:50px;box-shadow:0 3px 5px 0 rgba(0,0,0,.3);transition:all .4s ease;left:27px;background-color:#3498DB}.checkbox-onoff input[type=checkbox]{visibility:hidden}.checkbox-onoff input[type=checkbox]:checked+label{left:-5px;background:#dcdcdc}}@supports (transform:rotate(-45deg)){.checkbox{width:20px;position:relative;margin:20px auto}.checkbox label{width:20px;height:20px;cursor:pointer;position:absolute;top:0;left:0;background:#fff;border-radius:4px;box-shadow:inset 0 1px 1px #fff,0 1px 4px rgba(0,0,0,.5)}.checkbox label:after{content:'';width:9px;height:5px;position:absolute;top:4px;left:4px;border:3px solid #333;border-top:none;border-right:none;background:0 0;opacity:0;transform:rotate(-45deg)}.checkbox input[type=checkbox]{visibility:hidden}.checkbox input[type=checkbox]:checked+label:after{border-color:#3498DB;opacity:1}.checkbox input[disabled]+label{background-color:transparent!important;box-shadow:none!important;cursor:inherit}.checkbox input:not(:checked):not([readonly]):not([disabled])+label:hover::after{opacity:.5}}#main_preferences form,.index .title,footer,main{width:100%}.autocomplete{position:absolute;max-height:0;overflow-y:hidden;text-align:left}#categories_container,#q,#send_search,.category{position:relative}.autocomplete:active,.autocomplete:focus,.autocomplete:hover{background-color:#fff}.autocomplete:empty{display:none}.autocomplete>ul{list-style-type:none;margin:0;padding:0}.autocomplete>ul>li{cursor:pointer;padding:5px 0 5px 10px}.autocomplete>ul>li.active,.autocomplete>ul>li:active,.autocomplete>ul>li:focus{background-color:#3498DB}.autocomplete>ul>li.active a:active,.autocomplete>ul>li.active a:focus,.autocomplete>ul>li.active a:hover,.autocomplete>ul>li:active a:active,.autocomplete>ul>li:active a:focus,.autocomplete>ul>li:active a:hover,.autocomplete>ul>li:focus a:active,.autocomplete>ul>li:focus a:focus,.autocomplete>ul>li:focus a:hover{text-decoration:none}.autocomplete>ul>li.locked{cursor:inherit}.autocomplete.open{display:block;background-color:#fff;border:1px solid #3498DB;max-height:500px;overflow-y:auto;z-index:100}.autocomplete.open:empty{display:none}.ion-icon,.ion-icon-big{display:inline-block;line-height:1;font-weight:400;font-style:normal;speak:none;text-decoration:inherit;text-transform:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:middle}@media screen and (max-width:50em){.tabs>label{width:100%}.autocomplete{bottom:0}.autocomplete>ul>li{padding:7px 0 7px 10px;border-bottom:1px solid #E8E7E6;text-align:left}}#main_preferences table td,.index{text-align:center}@font-face{font-family:ion;src:url(../fonts/ion.eot?94af7082ea096aefe3a7b6642834716e);src:url(../fonts/ion.eot?#iefix) format("embedded-opentype"),url(../fonts/ion.woff2?94af7082ea096aefe3a7b6642834716e) format("woff2"),url(../fonts/ion.woff?94af7082ea096aefe3a7b6642834716e) format("woff"),url(../fonts/ion.ttf?94af7082ea096aefe3a7b6642834716e) format("truetype"),url(../fonts/ion.svg?94af7082ea096aefe3a7b6642834716e#ion) format("svg");font-weight:400;font-style:normal}.ion-navicon-round:before{content:"\f101"}.ion-search:before{content:"\f102"}.ion-play:before{content:"\f103"}.ion-link:before{content:"\f104"}.ion-chevron-up:before{content:"\f105"}.ion-chevron-left:before{content:"\f106"}.ion-chevron-right:before{content:"\f107"}.ion-arrow-down-a:before{content:"\f108"}.ion-arrow-up-a:before{content:"\f109"}.ion-arrow-swap:before{content:"\f10a"}.ion-arrow-dropdown:before{content:"\f10b"}.ion-globe:before{content:"\f10c"}.ion-time:before{content:"\f10d"}.ion-location:before{content:"\f10e"}.ion-warning:before{content:"\f10f"}.ion-error:before{content:"\f110"}.ion-film-outline:before{content:"\f111"}.ion-music-note:before{content:"\f112"}.ion-more-vertical:before{content:"\f113"}.ion-magnet:before{content:"\f114"}.ion-icon-big{font-size:149%}.index .title{background:url(../img/searx.png) center no-repeat;min-height:80px}.index h1{font-size:5em;visibility:hidden}.index #search{margin:0 auto;background:inherit;border:inherit}.index .search_filters{display:block;margin:1em 0}.index .category label{padding:6px 10px;border-bottom:initial!important}@media screen and (max-width:75em){div.title h1{font-size:1em}.preferences_back{clear:both}}#main_preferences fieldset{margin:8px;border:none}#main_preferences legend{margin:0;padding:5px 0 0;display:block;float:left;width:300px}#main_preferences .value{margin:0;padding:0;float:left;width:15em}#main_preferences .description{margin:0;padding:5px 0 0;float:left;width:50%;color:#909090;font-size:90%}#main_preferences select{width:200px;font-size:inherit!important}#main_preferences table{border-collapse:collapse}#main_preferences .name,#main_preferences .shortcut{text-align:left}#main_preferences .preferences_back{background:#3498DB;color:#fff;border:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:.5em}#main_preferences .preferences_back a{display:block;color:#FFF}#main_preferences .preferences_back a::first-letter{text-transform:uppercase}#search{padding:0 2em;margin:0;background:#f7f7f7;border-bottom:1px solid #d7d7d7}#search_wrapper{padding:10px 0}.search_box{margin:0 12px 0 0;display:inline-flex;flex-direction:row}#q,#send_search{display:block!important;border-collapse:separate;margin:0;padding:2px;height:2.2em;background:#FFF;border:1px solid #3498DB;border-radius:0;outline:0;color:#222;font-size:16px;z-index:2}#q{outline:0;padding-left:8px;padding-right:0!important;border-right:none;width:40em}#send_search{border-left:none;width:2.2em}#send_search:hover{cursor:pointer;background-color:#3498DB;color:#ECF0F1}.no-js #send_search{width:auto!important}.search_filters{display:inline-block;vertical-align:middle}@media screen and (max-width:75em){#categories{font-size:90%;clear:both}#categories .checkbox_container{margin:auto}html.touch #main_index #categories_container,html.touch #main_results #categories_container{width:1000px;width:-moz-max-content;width:-webkit-max-content;width:max-content}html.touch #main_index #categories_container .category,html.touch #main_results #categories_container .category{display:inline-block;width:auto}html.touch #main_index #categories,html.touch #main_results #categories{width:100%;margin:0;text-align:left;overflow-x:scroll;overflow-y:hidden;-webkit-overflow-scrolling:touch}}#search_url div,.result-videos .content{overflow:hidden}@media screen and (max-width:50em){#search{width:100%;margin:0;padding:.1em 0 0}#search_wrapper{width:100%;margin:0 0 .7em;padding:0}.search_box{width:99%;margin:.1em;padding:0 .1em 0 0;display:flex;flex-direction:row}#q{width:auto!important;flex:1}.search_filters{display:block;margin:.5em}.language,.time_range{width:45%}.category{display:block;width:90%}.category label{border-bottom:0}}#categories{margin:0 10px 0 0;user-select:none}#categories::-webkit-scrollbar{width:0;height:0}.category{display:inline-block;margin:0 3px;padding:0}.category input{display:none}.category label{cursor:pointer;padding:4px 10px;margin:0;display:block;text-transform:capitalize;font-size:.9em;border-bottom:2px solid transparent;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}body,html,main{padding:0;margin:0}.category input[type=checkbox]:focus+label{box-shadow:0 0 8px #3498DB}.category input[type=checkbox]:checked+label{background:#3498DB;color:#FFF;border-bottom:2px solid #084999}#categories_container .help{position:absolute;width:100%;bottom:-20px;overflow:hidden;opacity:0;transition:opacity 1s ease;font-size:.8em;text-position:center;background:#fff}footer p,html{font-size:.9em}#categories_container:hover .help{opacity:.8;transition:opacity 1s ease}html{font-family:arial,sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;color:#444}#main_about,#main_preferences,#main_stats{margin:3em;width:auto}footer{bottom:0;height:3em;margin:1em 0;padding:1em 0;text-align:center}#main_preferences h1,#main_stats h1{background:url(../img/searx.png) no-repeat;background-size:auto 75%;min-height:40px;margin:0 auto}#main_preferences h1 span,#main_stats h1 span{visibility:hidden}#results button[type=submit],input[type=submit]{padding:.5rem;margin:2px 4px;display:inline-block;background:#3498DB;color:#FFF;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0;cursor:pointer}a{text-decoration:none;color:#29314d}a:visited,a:visited .highlight{color:#684898}article[data-vim-selected]{background:#f7f7f7}article[data-vim-selected]::before{position:absolute;left:1em;padding:2px;content:">";font-weight:700;color:#3498DB}article.result-images[data-vim-selected]{background:#3498DB}article.result-images[data-vim-selected]::before{display:none;content:""}.result{margin:19px 0 18px;padding:0}.result h3{font-size:1.1em;word-wrap:break-word;margin:5px 0 0;padding:0}.result h3 a{color:#084999;font-weight:400;font-size:1.1em}.result h3 a:visited{color:#684898}.result h3 a:focus,.result h3 a:hover{text-decoration:underline;border:none;-webkit-box-shadow:none;box-shadow:none;outline:0}.result .cache_link,.result .proxyfied_link{font-size:.9em!important}.result .altlink,.result .content,.result .stat,.result .url{font-size:.9em;padding:0;max-width:54em;word-wrap:break-word}.result .altlink,.result .content,.result .stat{margin:0;line-height:1.24}.result .altlink .highlight,.result .content .highlight,.result .stat .highlight{color:#000;background:inherit;font-weight:700}.result .codelines .highlight{color:inherit;background:inherit;font-weight:400}.result .url{margin:0 0 3px;color:#25a55b}.result .published_date{font-size:.8em;color:#888}.result img.thumbnail{float:left;padding:0 5px 10px 0;width:20em;min-width:20em;min-height:8em}.result img.image{float:left;padding:0 5px 10px 0;width:100px;max-height:100px;object-fit:scale-down;object-position:right top}.category-social .image{width:auto!important;min-width:48px;min-height:48px;padding:0 5px 25px 0!important}.engines{float:right;color:#888}.engines span{font-size:smaller;margin:0 .5em 0 0}.result-images,.result-images img{margin:0;padding:0;max-height:200px}.small_font{font-size:.8em}.highlight{color:#094089;background:inherit;font-weight:700}.result-images{display:inline-block;position:relative}.result-images img{float:inherit;border:none;background:#084999}.result-images span a{display:none;color:#FFF}.result-images:hover span a{display:block;position:absolute;bottom:0;right:0;padding:4px;margin:0 0 4px 4px;background-color:rgba(0,0,0,.6);font-size:.7em}.torrent_result{border-left:10px solid #d3d3d3;padding-left:3px}#answers,#backToTop,#sidebar .infobox{border:1px solid #ddd;box-shadow:0 0 5px #CCC}.torrent_result p{margin:3px;font-size:.8em}.torrent_result a{color:#084999}.torrent_result a:hover{text-decoration:underline}.torrent_result a:visited{color:#684898}#results{margin:2em 2em 20px;padding:0;width:50em}#suggestions .wrapper{display:flex;flex-flow:row wrap;justify-content:flex-end}#suggestions .wrapper form{display:inline-block;flex:1 1 50%}#answers,#corrections,#suggestions{max-width:50em}#answers input,#corrections input,#infoboxes input,#suggestions input{padding:0;margin:3px;font-size:.9em;display:inline-block;background:0 0;color:#444;cursor:pointer}#answers .infobox .url a,#answers input[type=submit],#corrections .infobox .url a,#corrections input[type=submit],#infoboxes .infobox .url a,#infoboxes input[type=submit],#suggestions .infobox .url a,#suggestions input[type=submit]{color:#084999;text-decoration:none;font-size:.9rem}#answers .infobox .url a:hover,#answers input[type=submit]:hover,#corrections .infobox .url a:hover,#corrections input[type=submit]:hover,#infoboxes .infobox .url a:hover,#infoboxes input[type=submit]:hover,#suggestions .infobox .url a:hover,#suggestions input[type=submit]:hover{text-decoration:underline}#corrections{display:flex;flex-flow:row wrap;margin:1em 0}#corrections h4,#corrections input[type=submit]{display:inline-block;margin:0 .5em 0 0}#corrections input[type=submit]::after{content:", "}#apis .title,#search_url .title,#suggestions .title{margin:2em 0 .5em;color:#444}#answers{margin:10px 8px;padding:.9em}#answers h4{display:none}#answers .answer{display:block;font-size:1.2em;font-weight:700}#answers form,#infoboxes form{min-width:210px}#sidebar{position:absolute;top:100px;left:57em;margin:0 2px 5px 5px;padding:0 2px 2px;max-width:25em;word-wrap:break-word}#sidebar .infobox{margin:10px 0;padding:.9em;font-size:.9em}#sidebar .infobox h2{margin:0 0 .5em}#sidebar .infobox img{max-width:100%;max-height:12em;display:block;margin:0;padding:0}#sidebar .infobox dl{margin:.5em 0}#sidebar .infobox dt{display:inline;margin:.5em .25em .5em 0;padding:0;font-weight:700}#sidebar .infobox dd{display:inline;margin:.5em 0;padding:0}#apis,#search_url{margin-top:8px}#sidebar .infobox input{font-size:1em}#search_url div{border:1px solid #888;padding:4px;color:#444;width:100%;display:block;margin:.1em;height:1.2em;line-height:1.2em}#search_url div pre{display:block;width:200em;font-size:.8em;word-break:break-all;margin:.1em;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}#linkto_preferences{position:absolute;right:10px;top:.9em;padding:0;border:0;display:block;font-size:1.2em;color:#222}#linkto_preferences a:active *,#linkto_preferences a:hover *,#linkto_preferences a:link *,#linkto_preferences a:visited *{color:#222}#backToTop{margin:0 0 0 2em;padding:0;font-size:1em;background:#fff;position:fixed;bottom:85px;left:50em;transition:opacity .5s;opacity:0}#backToTop a{display:block;margin:0;padding:.6em}@media screen and (max-width:75em){#main_about,#main_preferences,#main_stats{margin:.5em;width:auto}#answers,#suggestions{margin-top:1em}#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em;margin:.5em .5em .5em 0}#sidebar{position:static;max-width:50em;margin:0 0 2px;padding:0;float:none;border:none;width:auto}.image_result,.image_result img,.result .thumbnail{max-width:98%}#sidebar input{border:0}#apis,#search_url{display:none}.result{border-bottom:1px solid #E8E7E6;margin:0;padding-top:8px;padding-bottom:6px}.result h3{margin:0 0 1px}.result .url span.url{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;width:100%}.result .url a{float:right;padding:0 .5em}.result .engines{float:right;padding:0 0 3px}.result-images{border-bottom:none!important}}@media screen and (max-width:50em){article[data-vim-selected]::before{display:none;content:""}#linkto_preferences{display:none;postion:fixed!important;top:100px;right:0}#sidebar{margin:0 5px 2px}#corrections{margin:1em 5px}#results{margin:0;padding:0;width:initial}#backToTop{left:40em;bottom:35px}.result{padding:8px 10px 6px}.result-images{margin:0;padding:0;border:none}}@media screen and (max-width:35em){.result-videos img.thumbnail{float:none!important}.result-videos .content{overflow:inherit}}
\ No newline at end of file
diff --git a/searx/static/themes/simple/fonts/ion.css b/searx/static/themes/simple/fonts/ion.css
new file mode 100644
index 000000000..b1b599a13
--- /dev/null
+++ b/searx/static/themes/simple/fonts/ion.css
@@ -0,0 +1,134 @@
+/* Generated by grunt-webfont */
+
+
+@font-face {
+ font-family:"ion";
+ src:url("../fonts/ion.eot?94af7082ea096aefe3a7b6642834716e");
+ src:url("../fonts/ion.eot?#iefix") format("embedded-opentype"),
+ url("../fonts/ion.woff2?94af7082ea096aefe3a7b6642834716e") format("woff2"),
+ url("../fonts/ion.woff?94af7082ea096aefe3a7b6642834716e") format("woff"),
+ url("../fonts/ion.ttf?94af7082ea096aefe3a7b6642834716e") format("truetype"),
+ url("../fonts/ion.svg?94af7082ea096aefe3a7b6642834716e#ion") format("svg");
+ font-weight:normal;
+ font-style:normal;
+}
+
+.ion-icon {
+
+ font-family:"ion";
+
+ display:inline-block;
+ vertical-align:middle;
+ line-height:1;
+ font-weight:normal;
+ font-style:normal;
+ speak:none;
+ text-decoration:inherit;
+ text-transform:none;
+ text-rendering:auto;
+ -webkit-font-smoothing:antialiased;
+ -moz-osx-font-smoothing:grayscale;
+}
+
+
+/* Icons */
+
+
+.ion-navicon-round:before {
+ content:"\f101";
+}
+
+
+.ion-search:before {
+ content:"\f102";
+}
+
+
+.ion-play:before {
+ content:"\f103";
+}
+
+
+.ion-link:before {
+ content:"\f104";
+}
+
+
+.ion-chevron-up:before {
+ content:"\f105";
+}
+
+
+.ion-chevron-left:before {
+ content:"\f106";
+}
+
+
+.ion-chevron-right:before {
+ content:"\f107";
+}
+
+
+.ion-arrow-down-a:before {
+ content:"\f108";
+}
+
+
+.ion-arrow-up-a:before {
+ content:"\f109";
+}
+
+
+.ion-arrow-swap:before {
+ content:"\f10a";
+}
+
+
+.ion-arrow-dropdown:before {
+ content:"\f10b";
+}
+
+
+.ion-globe:before {
+ content:"\f10c";
+}
+
+
+.ion-time:before {
+ content:"\f10d";
+}
+
+
+.ion-location:before {
+ content:"\f10e";
+}
+
+
+.ion-warning:before {
+ content:"\f10f";
+}
+
+
+.ion-error:before {
+ content:"\f110";
+}
+
+
+.ion-film-outline:before {
+ content:"\f111";
+}
+
+
+.ion-music-note:before {
+ content:"\f112";
+}
+
+
+.ion-more-vertical:before {
+ content:"\f113";
+}
+
+
+.ion-magnet:before {
+ content:"\f114";
+}
diff --git a/searx/static/themes/simple/fonts/ion.eot b/searx/static/themes/simple/fonts/ion.eot
new file mode 100644
index 000000000..f4fc07ec6
Binary files /dev/null and b/searx/static/themes/simple/fonts/ion.eot differ
diff --git a/searx/static/themes/simple/fonts/ion.html b/searx/static/themes/simple/fonts/ion.html
new file mode 100644
index 000000000..defea2647
--- /dev/null
+++ b/searx/static/themes/simple/fonts/ion.html
@@ -0,0 +1,261 @@
+
+
+
+
+ ion
+
+
+
+ ion
+
+
+
+
ion-navicon-round
+
+
ion-search
+
+
ion-play
+
+
ion-link
+
+
ion-chevron-up
+
+
ion-chevron-left
+
+
ion-chevron-right
+
+
ion-arrow-down-a
+
+
ion-arrow-up-a
+
+
ion-arrow-swap
+
+
ion-arrow-dropdown
+
+
ion-globe
+
+
ion-time
+
+
ion-location
+
+
ion-warning
+
+
ion-error
+
+
ion-film-outline
+
+
ion-music-note
+
+
ion-more-vertical
+
+
ion-magnet
+
+
+
+
+
+ Usage
+ <i class="ion-icon ion-name "></i>
+
+
+
+
+
+
+
diff --git a/searx/static/themes/simple/fonts/ion.svg b/searx/static/themes/simple/fonts/ion.svg
new file mode 100644
index 000000000..db43668d4
--- /dev/null
+++ b/searx/static/themes/simple/fonts/ion.svg
@@ -0,0 +1,97 @@
+
+
+
+
+
+Created by FontForge 20120731 at Fri May 26 22:22:55 2017
+ By alexandre,,,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/searx/static/themes/simple/fonts/ion.ttf b/searx/static/themes/simple/fonts/ion.ttf
new file mode 100644
index 000000000..4631e91b8
Binary files /dev/null and b/searx/static/themes/simple/fonts/ion.ttf differ
diff --git a/searx/static/themes/simple/fonts/ion.woff b/searx/static/themes/simple/fonts/ion.woff
new file mode 100644
index 000000000..767c1263a
Binary files /dev/null and b/searx/static/themes/simple/fonts/ion.woff differ
diff --git a/searx/static/themes/simple/fonts/ion.woff2 b/searx/static/themes/simple/fonts/ion.woff2
new file mode 100644
index 000000000..377710b51
Binary files /dev/null and b/searx/static/themes/simple/fonts/ion.woff2 differ
diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js
new file mode 100644
index 000000000..288ab6633
--- /dev/null
+++ b/searx/static/themes/simple/gruntfile.js
@@ -0,0 +1,150 @@
+module.exports = function(grunt) {
+
+ const path = require('path');
+
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ watch: {
+ scripts: {
+ files: ['<%= jshint.files %>', 'less/*.less'],
+ tasks: ['jshint', 'concat', 'uglify', 'webfont', 'less:development', 'less:production']
+ }
+ },
+ concat: {
+ options: {
+ separator: ';'
+ },
+ dist: {
+ src: ['js/searx_src/*.js'],
+ dest: 'js/searx.js'
+ }
+ },
+ uglify: {
+ options: {
+ banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
+ preserveComments: 'some',
+ sourceMap: true
+ },
+ dist: {
+ files: {
+ 'js/searx.min.js': ['<%= concat.dist.dest %>']
+ }
+ }
+ },
+ jshint: {
+ files: ['js/searx_src/*.js'],
+ options: {
+ proto: true,
+ // options here to override JSHint defaults
+ globals: {
+ browser: true,
+ jQuery: false,
+ devel: true
+ }
+ }
+ },
+ less: {
+ development: {
+ options: {
+ paths: ["less"],
+ banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
+ },
+ files: {
+ "css/searx.css": "less/style.less",
+ "css/searx-rtl.css": "less/style-rtl.less"
+ }
+ },
+ production: {
+ options: {
+ paths: ["less"],
+ plugins: [
+ new (require('less-plugin-clean-css'))({
+ advanced: true,
+ compatibility: 'ie8'
+ })
+ ],
+ banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
+ },
+ files: {
+ "css/searx.min.css": "less/style.less",
+ "css/searx-rtl.min.css": "less/style-rtl.less"
+ }
+ },
+ },
+ webfont: {
+ icons: {
+ // src: 'node_modules/ionicons-npm/src/*.svg',
+ src: [
+ 'node_modules/ionicons-npm/src/navicon-round.svg',
+ 'node_modules/ionicons-npm/src/search.svg',
+ 'node_modules/ionicons-npm/src/play.svg',
+ 'node_modules/ionicons-npm/src/link.svg',
+ 'node_modules/ionicons-npm/src/chevron-up.svg',
+ 'node_modules/ionicons-npm/src/chevron-left.svg',
+ 'node_modules/ionicons-npm/src/chevron-right.svg',
+ 'node_modules/ionicons-npm/src/arrow-down-a.svg',
+ 'node_modules/ionicons-npm/src/arrow-up-a.svg',
+ 'node_modules/ionicons-npm/src/arrow-swap.svg',
+ 'node_modules/ionicons-npm/src/telephone.svg',
+ 'node_modules/ionicons-npm/src/android-arrow-dropdown.svg',
+ 'node_modules/ionicons-npm/src/android-globe.svg',
+ 'node_modules/ionicons-npm/src/android-time.svg',
+ 'node_modules/ionicons-npm/src/location.svg',
+ 'node_modules/ionicons-npm/src/alert-circled.svg',
+ 'node_modules/ionicons-npm/src/android-alert.svg',
+ 'node_modules/ionicons-npm/src/ios-film-outline.svg',
+ 'node_modules/ionicons-npm/src/music-note.svg',
+ 'node_modules/ionicons-npm/src/ion-close-round.svg',
+ 'node_modules/ionicons-npm/src/android-more-vertical.svg',
+ 'magnet.svg'
+ ],
+ dest: 'fonts',
+ destLess: 'less',
+ options: {
+ font: 'ion',
+ hashes : true,
+ syntax: 'bem',
+ styles : 'font,icon',
+ types : 'eot,woff2,woff,ttf,svg',
+ order : 'eot,woff2,woff,ttf,svg',
+ stylesheets : ['css', 'less'],
+ relativeFontPath : '../fonts/',
+ autoHint : false,
+ normalize : false,
+ // ligatures : true,
+ optimize : true,
+ // fontHeight : 400,
+ rename : function(name) {
+ basename = path.basename(name);
+ if (basename === 'android-alert.svg') {
+ return 'error.svg';
+ }
+ if (basename === 'alert-circled.svg') {
+ return 'warning.svg';
+ }
+ if (basename === 'ion-close-round.svg') {
+ return 'close.svg';
+ }
+ return basename.replace(/(ios|md|android)-/i, '');
+ },
+ templateOptions: {
+ baseClass: 'ion-icon',
+ classPrefix: 'ion-'
+ }
+ }
+ }
+ }
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-less');
+ grunt.loadNpmTasks('grunt-contrib-cssmin');
+ grunt.loadNpmTasks('grunt-webfont');
+
+ grunt.registerTask('test', ['jshint']);
+
+ grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less:development', 'less:production']);
+};
diff --git a/searx/static/themes/simple/img/favicon.png b/searx/static/themes/simple/img/favicon.png
new file mode 100644
index 000000000..36be5fc01
Binary files /dev/null and b/searx/static/themes/simple/img/favicon.png differ
diff --git a/searx/static/themes/simple/img/loader.gif b/searx/static/themes/simple/img/loader.gif
new file mode 100644
index 000000000..419cdeeda
Binary files /dev/null and b/searx/static/themes/simple/img/loader.gif differ
diff --git a/searx/static/themes/simple/img/logo_searx_a.png b/searx/static/themes/simple/img/logo_searx_a.png
new file mode 100644
index 000000000..2db081710
Binary files /dev/null and b/searx/static/themes/simple/img/logo_searx_a.png differ
diff --git a/searx/static/themes/simple/img/searx.png b/searx/static/themes/simple/img/searx.png
new file mode 100644
index 000000000..98538da3a
Binary files /dev/null and b/searx/static/themes/simple/img/searx.png differ
diff --git a/searx/static/themes/simple/img/searx_logo.svg b/searx/static/themes/simple/img/searx_logo.svg
new file mode 100644
index 000000000..67a2d4588
--- /dev/null
+++ b/searx/static/themes/simple/img/searx_logo.svg
@@ -0,0 +1,203 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ image/svg+xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/searx/static/themes/simple/js/searx.js b/searx/static/themes/simple/js/searx.js
new file mode 100644
index 000000000..64329fde1
--- /dev/null
+++ b/searx/static/themes/simple/js/searx.js
@@ -0,0 +1,1534 @@
+/**
+* searx is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* searx is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with searx. If not, see < http://www.gnu.org/licenses/ >.
+*
+* (C) 2017 by Alexandre Flament,
+*
+*/
+(function(w, d, searx) {
+
+ 'use strict';
+
+ // not invented here tookit with bugs fixed elsewhere
+ // purposes : be just good enough and as small as possible
+
+ // from https://plainjs.com/javascript/events/live-binding-event-handlers-14/
+ if (w.Element) {
+ (function(ElementPrototype) {
+ ElementPrototype.matches = ElementPrototype.matches ||
+ ElementPrototype.matchesSelector ||
+ ElementPrototype.webkitMatchesSelector ||
+ ElementPrototype.msMatchesSelector ||
+ function(selector) {
+ var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;
+ while (nodes[++i] && nodes[i] != node);
+ return !!nodes[i];
+ };
+ })(Element.prototype);
+ }
+
+ function callbackSafe(callback, el, e) {
+ try {
+ callback.call(el, e);
+ } catch (exception) {
+ console.log(exception);
+ }
+ }
+
+ searx = searx || {};
+
+ searx.on = function(obj, eventType, callback, useCapture) {
+ useCapture = useCapture || false;
+ if (typeof obj !== 'string') {
+ // obj HTMLElement, HTMLDocument
+ obj.addEventListener(eventType, callback, useCapture);
+ } else {
+ // obj is a selector
+ d.addEventListener(eventType, function(e) {
+ var el = e.target || e.srcElement, found = false;
+ while (el && el.matches && el !== d && !(found = el.matches(obj))) el = el.parentElement;
+ if (found) callbackSafe(callback, el, e);
+ }, useCapture);
+ }
+ };
+
+ searx.ready = function(callback) {
+ if (document.readyState != 'loading') {
+ callback.call(w);
+ } else {
+ w.addEventListener('DOMContentLoaded', callback.bind(w));
+ }
+ };
+
+ searx.http = function(method, url, callback) {
+ var req = new XMLHttpRequest(),
+ resolve = function() {},
+ reject = function() {},
+ promise = {
+ then: function(callback) { resolve = callback; return promise; },
+ catch: function(callback) { reject = callback; return promise; }
+ };
+
+ try {
+ req.open(method, url, true);
+
+ // On load
+ req.onload = function() {
+ if (req.status == 200) {
+ resolve(req.response, req.responseType);
+ } else {
+ reject(Error(req.statusText));
+ }
+ };
+
+ // Handle network errors
+ req.onerror = function() {
+ reject(Error("Network Error"));
+ };
+
+ req.onabort = function() {
+ reject(Error("Transaction is aborted"));
+ };
+
+ // Make the request
+ req.send();
+ } catch (ex) {
+ reject(ex);
+ }
+
+ return promise;
+ };
+
+ searx.loadStyle = function(src) {
+ var path = searx.staticPath + src,
+ id = "style_" + src.replace('.', '_'),
+ s = d.getElementById(id);
+ if (s === null) {
+ s = d.createElement('link');
+ s.setAttribute('id', id);
+ s.setAttribute('rel', 'stylesheet');
+ s.setAttribute('type', 'text/css');
+ s.setAttribute('href', path);
+ d.body.appendChild(s);
+ }
+ };
+
+ searx.loadScript = function(src, callback) {
+ var path = searx.staticPath + src,
+ id = "script_" + src.replace('.', '_'),
+ s = d.getElementById(id);
+ if (s === null) {
+ s = d.createElement('script');
+ s.setAttribute('id', id);
+ s.setAttribute('src', path);
+ s.onload = callback;
+ s.onerror = function() {
+ s.setAttribute('error', '1');
+ };
+ d.body.appendChild(s);
+ } else if (!s.hasAttribute('error')) {
+ try {
+ callback.apply(s, []);
+ } catch (exception) {
+ console.log(exception);
+ }
+ } else {
+ console.log("callback not executed : script '" + path + "' not loaded.");
+ }
+ };
+
+ searx.on('.close', 'click', function(e) {
+ var el = e.target || e.srcElement;
+ this.parentNode.style.display="None";
+ });
+ return searx;
+})(window, document, window.searx);
+;(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AutoComplete = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o @baptistedonaux
+ */
+var AutoComplete = (function () {
+ // Constructor
+ function AutoComplete(params, selector) {
+ if (params === void 0) { params = {}; }
+ if (selector === void 0) { selector = "[data-autocomplete]"; }
+ if (Array.isArray(selector)) {
+ selector.forEach(function (s) {
+ new AutoComplete(params, s);
+ });
+ }
+ else if (typeof selector == "string") {
+ var elements = document.querySelectorAll(selector);
+ Array.prototype.forEach.call(elements, function (input) {
+ new AutoComplete(params, input);
+ });
+ }
+ else {
+ var specificParams = AutoComplete.merge(AutoComplete.defaults, params, {
+ DOMResults: document.createElement("div")
+ });
+ AutoComplete.prototype.create(specificParams, selector);
+ return specificParams;
+ }
+ }
+ AutoComplete.prototype.create = function (params, element) {
+ params.Input = element;
+ if (params.Input.nodeName.match(/^INPUT$/i) && (params.Input.hasAttribute("type") === false || params.Input.getAttribute("type").match(/^TEXT|SEARCH$/i))) {
+ params.Input.setAttribute("autocomplete", "off");
+ params._Position(params);
+ params.Input.parentNode.appendChild(params.DOMResults);
+ params.$Listeners = {
+ blur: params._Blur.bind(params),
+ destroy: AutoComplete.prototype.destroy.bind(null, params),
+ focus: params._Focus.bind(params),
+ keyup: AutoComplete.prototype.event.bind(null, params, EventType.KEYUP),
+ keydown: AutoComplete.prototype.event.bind(null, params, EventType.KEYDOWN),
+ position: params._Position.bind(params)
+ };
+ for (var event in params.$Listeners) {
+ params.Input.addEventListener(event, params.$Listeners[event]);
+ }
+ }
+ };
+ AutoComplete.prototype.getEventsByType = function (params, type) {
+ var mappings = {};
+ for (var key in params.KeyboardMappings) {
+ var event = EventType.KEYUP;
+ if (params.KeyboardMappings[key].Event !== undefined) {
+ event = params.KeyboardMappings[key].Event;
+ }
+ if (event == type) {
+ mappings[key] = params.KeyboardMappings[key];
+ }
+ }
+ return mappings;
+ };
+ AutoComplete.prototype.event = function (params, type, event) {
+ var eventIdentifier = function (condition) {
+ if ((match === true && mapping.Operator == ConditionOperator.AND) || (match === false && mapping.Operator == ConditionOperator.OR)) {
+ condition = AutoComplete.merge({
+ Not: false
+ }, condition);
+ if (condition.hasOwnProperty("Is")) {
+ if (condition.Is == event.keyCode) {
+ match = !condition.Not;
+ }
+ else {
+ match = condition.Not;
+ }
+ }
+ else if (condition.hasOwnProperty("From") && condition.hasOwnProperty("To")) {
+ if (event.keyCode >= condition.From && event.keyCode <= condition.To) {
+ match = !condition.Not;
+ }
+ else {
+ match = condition.Not;
+ }
+ }
+ }
+ };
+ for (var name in AutoComplete.prototype.getEventsByType(params, type)) {
+ var mapping = AutoComplete.merge({
+ Operator: ConditionOperator.AND
+ }, params.KeyboardMappings[name]), match = ConditionOperator.AND == mapping.Operator;
+ mapping.Conditions.forEach(eventIdentifier);
+ if (match === true) {
+ mapping.Callback.call(params, event);
+ }
+ }
+ };
+ AutoComplete.prototype.makeRequest = function (params, callback) {
+ var propertyHttpHeaders = Object.getOwnPropertyNames(params.HttpHeaders), request = new XMLHttpRequest(), method = params._HttpMethod(), url = params._Url(), queryParams = params._Pre(), queryParamsStringify = encodeURIComponent(params._QueryArg()) + "=" + encodeURIComponent(queryParams);
+ if (method.match(/^GET$/i)) {
+ if (url.indexOf("?") !== -1) {
+ url += "&" + queryParamsStringify;
+ }
+ else {
+ url += "?" + queryParamsStringify;
+ }
+ }
+ request.open(method, url, true);
+ for (var i = propertyHttpHeaders.length - 1; i >= 0; i--) {
+ request.setRequestHeader(propertyHttpHeaders[i], params.HttpHeaders[propertyHttpHeaders[i]]);
+ }
+ request.onreadystatechange = function () {
+ if (request.readyState == 4 && request.status == 200) {
+ params.$Cache[queryParams] = request.response;
+ callback(request.response);
+ }
+ };
+ return request;
+ };
+ AutoComplete.prototype.ajax = function (params, request, timeout) {
+ if (timeout === void 0) { timeout = true; }
+ if (params.$AjaxTimer) {
+ window.clearTimeout(params.$AjaxTimer);
+ }
+ if (timeout === true) {
+ params.$AjaxTimer = window.setTimeout(AutoComplete.prototype.ajax.bind(null, params, request, false), params.Delay);
+ }
+ else {
+ if (params.Request) {
+ params.Request.abort();
+ }
+ params.Request = request;
+ params.Request.send(params._QueryArg() + "=" + params._Pre());
+ }
+ };
+ AutoComplete.prototype.cache = function (params, callback) {
+ var response = params._Cache(params._Pre());
+ if (response === undefined) {
+ var request = AutoComplete.prototype.makeRequest(params, callback);
+ AutoComplete.prototype.ajax(params, request);
+ }
+ else {
+ callback(response);
+ }
+ };
+ AutoComplete.prototype.destroy = function (params) {
+ for (var event in params.$Listeners) {
+ params.Input.removeEventListener(event, params.$Listeners[event]);
+ }
+ params.DOMResults.parentNode.removeChild(params.DOMResults);
+ };
+ return AutoComplete;
+}());
+AutoComplete.merge = function () {
+ var merge = {}, tmp;
+ for (var i = 0; i < arguments.length; i++) {
+ for (tmp in arguments[i]) {
+ merge[tmp] = arguments[i][tmp];
+ }
+ }
+ return merge;
+};
+AutoComplete.defaults = {
+ Delay: 150,
+ EmptyMessage: "No result here",
+ Highlight: {
+ getRegex: function (value) {
+ return new RegExp(value, "ig");
+ },
+ transform: function (value) {
+ return "" + value + " ";
+ }
+ },
+ HttpHeaders: {
+ "Content-type": "application/x-www-form-urlencoded"
+ },
+ Limit: 0,
+ MinChars: 0,
+ HttpMethod: "GET",
+ QueryArg: "q",
+ Url: null,
+ KeyboardMappings: {
+ "Enter": {
+ Conditions: [{
+ Is: 13,
+ Not: false
+ }],
+ Callback: function (event) {
+ if (this.DOMResults.getAttribute("class").indexOf("open") != -1) {
+ var liActive = this.DOMResults.querySelector("li.active");
+ if (liActive !== null) {
+ event.preventDefault();
+ this._Select(liActive);
+ this.DOMResults.setAttribute("class", "autocomplete");
+ }
+ }
+ },
+ Operator: ConditionOperator.AND,
+ Event: EventType.KEYDOWN
+ },
+ "KeyUpAndDown_down": {
+ Conditions: [{
+ Is: 38,
+ Not: false
+ },
+ {
+ Is: 40,
+ Not: false
+ }],
+ Callback: function (event) {
+ event.preventDefault();
+ },
+ Operator: ConditionOperator.OR,
+ Event: EventType.KEYDOWN
+ },
+ "KeyUpAndDown_up": {
+ Conditions: [{
+ Is: 38,
+ Not: false
+ },
+ {
+ Is: 40,
+ Not: false
+ }],
+ Callback: function (event) {
+ event.preventDefault();
+ var first = this.DOMResults.querySelector("li:first-child:not(.locked)"), last = this.DOMResults.querySelector("li:last-child:not(.locked)"), active = this.DOMResults.querySelector("li.active");
+ if (active) {
+ var currentIndex = Array.prototype.indexOf.call(active.parentNode.children, active), position = currentIndex + (event.keyCode - 39), lisCount = this.DOMResults.getElementsByTagName("li").length;
+ if (position < 0) {
+ position = lisCount - 1;
+ }
+ else if (position >= lisCount) {
+ position = 0;
+ }
+ active.classList.remove("active");
+ active.parentElement.children.item(position).classList.add("active");
+ }
+ else if (last && event.keyCode == 38) {
+ last.classList.add("active");
+ }
+ else if (first) {
+ first.classList.add("active");
+ }
+ },
+ Operator: ConditionOperator.OR,
+ Event: EventType.KEYUP
+ },
+ "AlphaNum": {
+ Conditions: [{
+ Is: 13,
+ Not: true
+ }, {
+ From: 35,
+ To: 40,
+ Not: true
+ }],
+ Callback: function () {
+ var oldValue = this.Input.getAttribute("data-autocomplete-old-value"), currentValue = this._Pre();
+ if (currentValue !== "" && currentValue.length >= this._MinChars()) {
+ if (!oldValue || currentValue != oldValue) {
+ this.DOMResults.setAttribute("class", "autocomplete open");
+ }
+ AutoComplete.prototype.cache(this, function (response) {
+ this._Render(this._Post(response));
+ this._Open();
+ }.bind(this));
+ }
+ },
+ Operator: ConditionOperator.AND,
+ Event: EventType.KEYUP
+ }
+ },
+ DOMResults: null,
+ Request: null,
+ Input: null,
+ /**
+ * Return the message when no result returns
+ */
+ _EmptyMessage: function () {
+ var emptyMessage = "";
+ if (this.Input.hasAttribute("data-autocomplete-empty-message")) {
+ emptyMessage = this.Input.getAttribute("data-autocomplete-empty-message");
+ }
+ else if (this.EmptyMessage !== false) {
+ emptyMessage = this.EmptyMessage;
+ }
+ else {
+ emptyMessage = "";
+ }
+ return emptyMessage;
+ },
+ /**
+ * Returns the maximum number of results
+ */
+ _Limit: function () {
+ var limit = this.Input.getAttribute("data-autocomplete-limit");
+ if (isNaN(limit) || limit === null) {
+ return this.Limit;
+ }
+ return parseInt(limit, 10);
+ },
+ /**
+ * Returns the minimum number of characters entered before firing ajax
+ */
+ _MinChars: function () {
+ var minchars = this.Input.getAttribute("data-autocomplete-minchars");
+ if (isNaN(minchars) || minchars === null) {
+ return this.MinChars;
+ }
+ return parseInt(minchars, 10);
+ },
+ /**
+ * Apply transformation on labels response
+ */
+ _Highlight: function (label) {
+ return label.replace(this.Highlight.getRegex(this._Pre()), this.Highlight.transform);
+ },
+ /**
+ * Returns the HHTP method to use
+ */
+ _HttpMethod: function () {
+ if (this.Input.hasAttribute("data-autocomplete-method")) {
+ return this.Input.getAttribute("data-autocomplete-method");
+ }
+ return this.HttpMethod;
+ },
+ /**
+ * Returns the query param to use
+ */
+ _QueryArg: function () {
+ if (this.Input.hasAttribute("data-autocomplete-param-name")) {
+ return this.Input.getAttribute("data-autocomplete-param-name");
+ }
+ return this.QueryArg;
+ },
+ /**
+ * Returns the URL to use for AJAX request
+ */
+ _Url: function () {
+ if (this.Input.hasAttribute("data-autocomplete")) {
+ return this.Input.getAttribute("data-autocomplete");
+ }
+ return this.Url;
+ },
+ /**
+ * Manage the close
+ */
+ _Blur: function (now) {
+ if (now === true) {
+ this.DOMResults.setAttribute("class", "autocomplete");
+ this.Input.setAttribute("data-autocomplete-old-value", this.Input.value);
+ }
+ else {
+ var params = this;
+ setTimeout(function () {
+ params._Blur(true);
+ }, 150);
+ }
+ },
+ /**
+ * Manage the cache
+ */
+ _Cache: function (value) {
+ return this.$Cache[value];
+ },
+ /**
+ * Manage the open
+ */
+ _Focus: function () {
+ var oldValue = this.Input.getAttribute("data-autocomplete-old-value");
+ if ((!oldValue || this.Input.value != oldValue) && this._MinChars() <= this.Input.value.length) {
+ this.DOMResults.setAttribute("class", "autocomplete open");
+ }
+ },
+ /**
+ * Bind all results item if one result is opened
+ */
+ _Open: function () {
+ var params = this;
+ Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"), function (li) {
+ if (li.getAttribute("class") != "locked") {
+ li.onclick = function (event) {
+ params._Select(li);
+ };
+ li.onmouseenter = function () {
+ var active = params.DOMResults.querySelector("li.active");
+ if (active !== li) {
+ if (active !== null) {
+ active.classList.remove("active");
+ }
+ li.classList.add("active");
+ }
+ };
+ }
+ });
+ },
+ /**
+ * Position the results HTML element
+ */
+ _Position: function () {
+ this.DOMResults.setAttribute("class", "autocomplete");
+ this.DOMResults.setAttribute("style", "top:" + (this.Input.offsetTop + this.Input.offsetHeight) + "px;left:" + this.Input.offsetLeft + "px;width:" + this.Input.clientWidth + "px;");
+ },
+ /**
+ * Execute the render of results DOM element
+ */
+ _Render: function (response) {
+ var ul;
+ if (typeof response == "string") {
+ ul = this._RenderRaw(response);
+ }
+ else {
+ ul = this._RenderResponseItems(response);
+ }
+ if (this.DOMResults.hasChildNodes()) {
+ this.DOMResults.removeChild(this.DOMResults.childNodes[0]);
+ }
+ this.DOMResults.appendChild(ul);
+ },
+ /**
+ * ResponseItems[] rendering
+ */
+ _RenderResponseItems: function (response) {
+ var ul = document.createElement("ul"), li = document.createElement("li"), limit = this._Limit();
+ // Order
+ if (limit < 0) {
+ response = response.reverse();
+ }
+ else if (limit === 0) {
+ limit = response.length;
+ }
+ for (var item = 0; item < Math.min(Math.abs(limit), response.length); item++) {
+ li.innerHTML = response[item].Label;
+ li.setAttribute("data-autocomplete-value", response[item].Value);
+ ul.appendChild(li);
+ li = document.createElement("li");
+ }
+ return ul;
+ },
+ /**
+ * string response rendering (RAW HTML)
+ */
+ _RenderRaw: function (response) {
+ var ul = document.createElement("ul"), li = document.createElement("li");
+ if (response.length > 0) {
+ this.DOMResults.innerHTML = response;
+ }
+ else {
+ var emptyMessage = this._EmptyMessage();
+ if (emptyMessage !== "") {
+ li.innerHTML = emptyMessage;
+ li.setAttribute("class", "locked");
+ ul.appendChild(li);
+ }
+ }
+ return ul;
+ },
+ /**
+ * Deal with request response
+ */
+ _Post: function (response) {
+ try {
+ var returnResponse = [];
+ //JSON return
+ var json = JSON.parse(response);
+ if (Object.keys(json).length === 0) {
+ return "";
+ }
+ if (Array.isArray(json)) {
+ for (var i = 0; i < Object.keys(json).length; i++) {
+ returnResponse[returnResponse.length] = { "Value": json[i], "Label": this._Highlight(json[i]) };
+ }
+ }
+ else {
+ for (var value in json) {
+ returnResponse.push({
+ "Value": value,
+ "Label": this._Highlight(json[value])
+ });
+ }
+ }
+ return returnResponse;
+ }
+ catch (event) {
+ //HTML return
+ return response;
+ }
+ },
+ /**
+ * Return the autocomplete value to send (before request)
+ */
+ _Pre: function () {
+ return this.Input.value;
+ },
+ /**
+ * Choice one result item
+ */
+ _Select: function (item) {
+ console.log('test test test');
+ if (item.hasAttribute("data-autocomplete-value")) {
+ this.Input.value = item.getAttribute("data-autocomplete-value");
+ }
+ else {
+ this.Input.value = item.innerHTML;
+ }
+ this.Input.setAttribute("data-autocomplete-old-value", this.Input.value);
+ },
+ $AjaxTimer: null,
+ $Cache: {},
+ $Listeners: {}
+};
+module.exports = AutoComplete;
+
+},{}]},{},[1])(1)
+});
+;/**
+*
+* Google Image Layout v0.0.1
+* Description, by Anh Trinh.
+* Heavily modified for searx
+* http://trinhtrunganh.com
+*
+* @license Free to use under the MIT License.
+*
+*/
+(function(w, d) {
+ 'use strict';
+
+ function ImageLayout(container_selector, results_selector, img_selector, maxHeight) {
+ this.container_selector = container_selector;
+ this.results_selector = results_selector;
+ this.img_selector = img_selector;
+ this.margin = 10;
+ this.maxHeight = maxHeight;
+ this._alignAllDone = true;
+ }
+
+ /**
+ * Get the height that make all images fit the container
+ *
+ * width = w1 + w2 + w3 + ... = r1*h + r2*h + r3*h + ...
+ *
+ * @param {[type]} images the images to be calculated
+ * @param {[type]} width the container witdth
+ * @param {[type]} margin the margin between each image
+ *
+ * @return {[type]} the height
+ */
+ ImageLayout.prototype._getHeigth = function(images, width) {
+ var r = 0,
+ img;
+
+ width -= images.length * this.margin;
+ for (var i = 0; i < images.length; i++) {
+ img = images[i];
+ if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {
+ r += img.naturalWidth / img.naturalHeight;
+ } else {
+ // assume that not loaded images are square
+ r += 1;
+ }
+ }
+
+ return width / r; //have to round down because Firefox will automatically roundup value with number of decimals > 3
+ };
+
+ ImageLayout.prototype._setSize = function(images, height) {
+ var img, imgWidth, imagesLength = images.length;
+ for (var i = 0; i < imagesLength; i++) {
+ img = images[i];
+ if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {
+ imgWidth = height * img.naturalWidth / img.naturalHeight;
+ } else {
+ // not loaded image : make it square as _getHeigth said it
+ imgWidth = height;
+ }
+ img.style.width = imgWidth + 'px';
+ img.style.height = height + 'px';
+ img.style.marginLeft = '3px';
+ img.style.marginTop = '3px';
+ img.style.marginRight = this.margin - 7 + 'px'; // -4 is the negative margin of the inline element
+ img.style.marginBottom = this.margin - 7 + 'px';
+ }
+ };
+
+ ImageLayout.prototype._alignImgs = function(imgGroup) {
+ var slice, h,
+ containerWidth = d.querySelector(this.container_selector).clientWidth;
+
+ w: while (imgGroup.length > 0) {
+ for (var i = 1; i <= imgGroup.length; i++) {
+ slice = imgGroup.slice(0, i);
+ h = this._getHeigth(slice, containerWidth);
+ if (h < this.maxHeight) {
+ this._setSize(slice, h);
+ imgGroup = imgGroup.slice(i);
+ continue w;
+ }
+ }
+ this._setSize(slice, Math.min(this.maxHeight, h));
+ break;
+ }
+ };
+
+ ImageLayout.prototype.align = function(results_selector) {
+ var results_selectorNode = d.querySelectorAll(this.results_selector),
+ results_length = results_selectorNode.length,
+ previous = null,
+ current = null,
+ imgGroup = [];
+ for (var i = 0; i < results_length; i++) {
+ current = results_selectorNode[i];
+ if (current.previousElementSibling !== previous && imgGroup.length > 0) {
+ // the current image is not conected to previous one
+ // so the current image is the start of a new group of images.
+ // so call _alignImgs to align the current group
+ this._alignImgs(imgGroup);
+ // and start a new empty group of images
+ imgGroup = [];
+ }
+ // add the current image to the group (only the img tag)
+ imgGroup.push(current.querySelector(this.img_selector));
+ // update the previous variable
+ previous = current;
+ }
+ // align the remaining images
+ if (imgGroup.length > 0) {
+ this._alignImgs(imgGroup);
+ }
+ };
+
+ ImageLayout.prototype.watch = function() {
+ var i, img, imgGroup, imgNodeLength,
+ obj = this,
+ results_nodes = d.querySelectorAll(this.results_selector),
+ results_length = results_nodes.length;
+
+ function align(e) {
+ obj.align();
+ }
+
+ function throttleAlign(e) {
+ if (obj._alignAllDone) {
+ obj._alignAllDone = false;
+ setTimeout(function() {
+ obj.align();
+ obj._alignAllDone = true;
+ }, 100);
+ }
+ }
+
+ w.addEventListener('resize', throttleAlign);
+ w.addEventListener('pageshow', align);
+
+ for (i = 0; i < results_length; i++) {
+ img = results_nodes[i].querySelector(this.img_selector);
+ if (typeof img !== 'undefined') {
+ img.addEventListener('load', throttleAlign);
+ img.addEventListener('error', throttleAlign);
+ }
+ }
+ };
+
+ w.searx.ImageLayout = ImageLayout;
+
+})(window, document);
+;searx.ready(function() {
+
+ searx.on('.result', 'click', function() {
+ highlightResult(this)(true);
+ });
+
+ searx.on('.result a', 'focus', function(e) {
+ var el = e.target;
+ while (el !== undefined) {
+ if (el.classList.contains('result')) {
+ if (el.getAttribute("data-vim-selected") === null) {
+ highlightResult(el)(true);
+ }
+ break;
+ }
+ el = el.parentNode;
+ }
+ }, true);
+
+ var vimKeys = {
+ 27: {
+ key: 'Escape',
+ fun: removeFocus,
+ des: 'remove focus from the focused input',
+ cat: 'Control'
+ },
+ 73: {
+ key: 'i',
+ fun: searchInputFocus,
+ des: 'focus on the search input',
+ cat: 'Control'
+ },
+ 66: {
+ key: 'b',
+ fun: scrollPage(-window.innerHeight),
+ des: 'scroll one page up',
+ cat: 'Navigation'
+ },
+ 70: {
+ key: 'f',
+ fun: scrollPage(window.innerHeight),
+ des: 'scroll one page down',
+ cat: 'Navigation'
+ },
+ 85: {
+ key: 'u',
+ fun: scrollPage(-window.innerHeight / 2),
+ des: 'scroll half a page up',
+ cat: 'Navigation'
+ },
+ 68: {
+ key: 'd',
+ fun: scrollPage(window.innerHeight / 2),
+ des: 'scroll half a page down',
+ cat: 'Navigation'
+ },
+ 71: {
+ key: 'g',
+ fun: scrollPageTo(-document.body.scrollHeight, 'top'),
+ des: 'scroll to the top of the page',
+ cat: 'Navigation'
+ },
+ 86: {
+ key: 'v',
+ fun: scrollPageTo(document.body.scrollHeight, 'bottom'),
+ des: 'scroll to the bottom of the page',
+ cat: 'Navigation'
+ },
+ 75: {
+ key: 'k',
+ fun: highlightResult('up'),
+ des: 'select previous search result',
+ cat: 'Results'
+ },
+ 74: {
+ key: 'j',
+ fun: highlightResult('down'),
+ des: 'select next search result',
+ cat: 'Results'
+ },
+ 80: {
+ key: 'p',
+ fun: pageButtonClick(0),
+ des: 'go to previous page',
+ cat: 'Results'
+ },
+ 78: {
+ key: 'n',
+ fun: pageButtonClick(1),
+ des: 'go to next page',
+ cat: 'Results'
+ },
+ 79: {
+ key: 'o',
+ fun: openResult(false),
+ des: 'open search result',
+ cat: 'Results'
+ },
+ 84: {
+ key: 't',
+ fun: openResult(true),
+ des: 'open the result in a new tab',
+ cat: 'Results'
+ },
+ 82: {
+ key: 'r',
+ fun: reloadPage,
+ des: 'reload page from the server',
+ cat: 'Control'
+ },
+ 72: {
+ key: 'h',
+ fun: toggleHelp,
+ des: 'toggle help window',
+ cat: 'Other'
+ }
+ };
+
+ searx.on(document, "keyup", function(e) {
+ // check for modifiers so we don't break browser's hotkeys
+ if (vimKeys.hasOwnProperty(e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) {
+ var tagName = e.target.tagName.toLowerCase();
+ if (e.keyCode === 27) {
+ if (tagName === 'input' || tagName === 'select' || tagName === 'textarea') {
+ vimKeys[e.keyCode].fun();
+ }
+ } else {
+ if (e.target === document.body || tagName === 'a' || tagName === 'button') {
+ vimKeys[e.keyCode].fun();
+ }
+ }
+ }
+ });
+
+ function highlightResult(which) {
+ return function(noScroll) {
+ var current = document.querySelector('.result[data-vim-selected]'),
+ effectiveWhich = which;
+ if (current === null) {
+ // no selection : choose the first one
+ current = document.querySelector('.result');
+ if (current === null) {
+ // no first one : there are no results
+ return;
+ }
+ // replace up/down actions by selecting first one
+ if (which === "down" || which === "up") {
+ effectiveWhich = current;
+ }
+ }
+
+ var next, results = document.querySelectorAll('.result');
+
+ if (typeof effectiveWhich !== 'string') {
+ next = effectiveWhich;
+ } else {
+ switch (effectiveWhich) {
+ case 'visible':
+ var top = document.documentElement.scrollTop || document.body.scrollTop;
+ var bot = top + document.documentElement.clientHeight;
+
+ for (var i = 0; i < results.length; i++) {
+ next = results[i];
+ var etop = next.offsetTop;
+ var ebot = etop + next.clientHeight;
+
+ if ((ebot <= bot) && (etop > top)) {
+ break;
+ }
+ }
+ break;
+ case 'down':
+ next = current.nextElementSibling;
+ if (next === null) {
+ next = results[0];
+ }
+ break;
+ case 'up':
+ next = current.previousElementSibling;
+ if (next === null) {
+ next = results[results.length - 1];
+ }
+ break;
+ case 'bottom':
+ next = results[results.length - 1];
+ break;
+ case 'top':
+ /* falls through */
+ default:
+ next = results[0];
+ }
+ }
+
+ if (next) {
+ current.removeAttribute('data-vim-selected');
+ next.setAttribute('data-vim-selected', 'true');
+ var link = next.querySelector('h3 a') || next.querySelector('a');
+ if (link !== null) {
+ link.focus();
+ }
+ if (!noScroll) {
+ scrollPageToSelected();
+ }
+ }
+ };
+ }
+
+ function reloadPage() {
+ document.location.reload(true);
+ }
+
+ function removeFocus() {
+ if (document.activeElement) {
+ document.activeElement.blur();
+ }
+ }
+
+ function pageButtonClick(num) {
+ return function() {
+ var buttons = $('div#pagination button[type="submit"]');
+ if (buttons.length !== 2) {
+ console.log('page navigation with this theme is not supported');
+ return;
+ }
+ if (num >= 0 && num < buttons.length) {
+ buttons[num].click();
+ } else {
+ console.log('pageButtonClick(): invalid argument');
+ }
+ };
+ }
+
+ function scrollPageToSelected() {
+ var sel = document.querySelector('.result[data-vim-selected]');
+ if (sel === null) {
+ return;
+ }
+ var wtop = document.documentElement.scrollTop || document.body.scrollTop,
+ wheight = document.documentElement.clientHeight,
+ etop = sel.offsetTop,
+ ebot = etop + sel.clientHeight,
+ offset = 120;
+ // first element ?
+ if ((sel.previousElementSibling === null) && (ebot < wheight)) {
+ // set to the top of page if the first element
+ // is fully included in the viewport
+ window.scroll(window.scrollX, 0);
+ return;
+ }
+ if (wtop > (etop - offset)) {
+ window.scroll(window.scrollX, etop - offset);
+ } else {
+ var wbot = wtop + wheight;
+ if (wbot < (ebot + offset)) {
+ window.scroll(window.scrollX, ebot - wheight + offset);
+ }
+ }
+ }
+
+ function scrollPage(amount) {
+ return function() {
+ window.scrollBy(0, amount);
+ highlightResult('visible')();
+ };
+ }
+
+ function scrollPageTo(position, nav) {
+ return function() {
+ window.scrollTo(0, position);
+ highlightResult(nav)();
+ };
+ }
+
+ function searchInputFocus() {
+ window.scrollTo(0, 0);
+ document.querySelector('#q').focus();
+ }
+
+ function openResult(newTab) {
+ return function() {
+ var link = document.querySelector('.result[data-vim-selected] h3 a');
+ if (link !== null) {
+ var url = link.getAttribute('href');
+ if (newTab) {
+ window.open(url);
+ } else {
+ window.location.href = url;
+ }
+ }
+ };
+ }
+
+ function toggleHelp() {
+ var helpPanel = document.querySelector('#vim-hotkeys-help');
+ if (helpPanel.length) {
+ helpPanel.classList.toggle('hidden');
+ return;
+ }
+
+ var categories = {};
+
+ for (var k in vimKeys) {
+ var key = vimKeys[k];
+ categories[key.cat] = categories[key.cat] || [];
+ categories[key.cat].push(key);
+ }
+
+ var sorted = Object.keys(categories).sort(function(a, b) {
+ return categories[b].length - categories[a].length;
+ });
+
+ if (sorted.length === 0) {
+ return;
+ }
+
+ var html = '';
+ html += '
';
+
+ html += '
';
+ html += '
';
+ html += '
How to navigate searx with Vim-like hotkeys ';
+ html += ''; // col-sm-12
+ html += '
'; // row
+
+ for (var i = 0; i < sorted.length; i++) {
+ var cat = categories[sorted[i]];
+
+ var lastCategory = i === (sorted.length - 1);
+ var first = i % 2 === 0;
+
+ if (first) {
+ html += '
';
+ }
+ html += '
';
+
+ html += '
';
+ html += '
' + cat[0].cat + '
';
+ html += '
';
+ html += '
';
+
+ for (var cj in cat) {
+ html += '' + cat[cj].key + ' ' + cat[cj].des + ' ';
+ }
+
+ html += ' ';
+ html += '
'; // panel-body
+ html += '
'; // panel
+ html += '
'; // col-sm-*
+
+ if (!first || lastCategory) {
+ html += '
'; // row
+ }
+ }
+
+ html += '
'; // container-fluid
+ html += '
'; // vim-hotkeys-help
+
+ $('body').append(html);
+ }
+});
+;/**
+* searx is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* searx is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with searx. If not, see < http://www.gnu.org/licenses/ >.
+*
+* (C) 2014 by Thomas Pointhuber,
+* (C) 2017 by Alexandre Flament,
+*/
+(function (w, d, searx) {
+ 'use strict';
+
+ searx.ready(function () {
+ searx.on('.searx_overpass_request', 'click', function(event) {
+ // no more request
+ this.classList.remove("searx_overpass_request");
+
+ //
+ var overpass_url = "https://overpass-api.de/api/interpreter?data=";
+ var query_start = overpass_url + "[out:json][timeout:25];(";
+ var query_end = ");out meta;";
+
+ var osm_id = this.dataset.osmId;
+ var osm_type = this.dataset.osmType;
+ var result_table = d.querySelector("#" + this.dataset.resultTable);
+ var result_table_loadicon = d.querySelector("#" + this.dataset.resultTableLoadicon);
+
+ // tags which can be ignored
+ var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ];
+
+ if(osm_id && osm_type && result_table) {
+ var query = null;
+ switch(osm_type) {
+ case 'node':
+ query = query_start + "node(" + osm_id + ");" + query_end;
+ break;
+ case 'way':
+ query = query_start + "way(" + osm_id + ");" + query_end;
+ break;
+ case 'relation':
+ query = query_start + "relation(" + osm_id + ");" + query_end;
+ break;
+ default:
+ break;
+ }
+ if(query) {
+ // console.log(query);
+ searx.http( 'GET', query ).then(function(html, contentType) {
+ html = JSON.parse(html);
+ if(html && html.elements && html.elements[0]) {
+ var element = html.elements[0];
+ var newHtml = "";
+ for (var row in element.tags) {
+ if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) {
+ newHtml += "" + row + " ";
+ switch(row) {
+ case "phone":
+ case "fax":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "email":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "website":
+ case "url":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "wikidata":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "wikipedia":
+ if(element.tags[row].indexOf(":") != -1) {
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ }
+ /* jshint ignore:start */
+ default:
+ /* jshint ignore:end */
+ newHtml += element.tags[row];
+ break;
+ }
+ newHtml += " ";
+ }
+ }
+ result_table_loadicon.classList.add('invisible');
+ result_table.classList.remove('invisible');
+ result_table.querySelector("tbody").innerHTML = newHtml;
+ }
+ })
+ .catch(function() {
+ result_table_loadicon.innerHTML = result_table_loadicon.innerHTML + "could not load data!
";
+ });
+ }
+ }
+
+ // this event occour only once per element
+ event.preventDefault();
+ });
+
+ searx.on('.searx_init_map', 'click', function(event) {
+ // no more request
+ this.classList.remove("searx_init_map");
+
+ //
+ var leaflet_target = this.dataset.leafletTarget;
+ var map_lon = parseFloat(this.dataset.mapLon);
+ var map_lat = parseFloat(this.dataset.mapLat);
+ var map_zoom = parseFloat(this.dataset.mapZoom);
+ var map_boundingbox = JSON.parse(this.dataset.mapBoundingbox);
+ var map_geojson = JSON.parse(this.dataset.mapGeojson);
+
+ searx.loadStyle('leaflet/leaflet.css');
+ searx.loadScript('leaflet/leaflet.js', function() {
+ var map_bounds = null;
+ if(map_boundingbox) {
+ var southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
+ var northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]);
+ map_bounds = L.latLngBounds(southWest, northEast);
+ }
+
+ // init map
+ var map = L.map(leaflet_target);
+ // create the tile layer with correct attribution
+ var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ var osmMapnikAttrib='Map data © OpenStreetMap contributors';
+ var osmMapnik = new L.TileLayer(osmMapnikUrl, {minZoom: 1, maxZoom: 19, attribution: osmMapnikAttrib});
+ var osmWikimediaUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png';
+ var osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © OpenStreetMap contributors';
+ var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib});
+ // init map view
+ if(map_bounds) {
+ // TODO hack: https://github.com/Leaflet/Leaflet/issues/2021
+ // Still useful ?
+ setTimeout(function () {
+ map.fitBounds(map_bounds, {
+ maxZoom:17
+ });
+ }, 0);
+ } else if (map_lon && map_lat) {
+ if(map_zoom) {
+ map.setView(new L.latLng(map_lat, map_lon),map_zoom);
+ } else {
+ map.setView(new L.latLng(map_lat, map_lon),8);
+ }
+ }
+
+ map.addLayer(osmMapnik);
+
+ var baseLayers = {
+ "OSM Mapnik": osmMapnik/*,
+ "OSM Wikimedia": osmWikimedia*/
+ };
+
+ L.control.layers(baseLayers).addTo(map);
+
+ if(map_geojson) {
+ L.geoJson(map_geojson).addTo(map);
+ } /*else if(map_bounds) {
+ L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);
+ }*/
+ });
+
+ // this event occour only once per element
+ event.preventDefault();
+ });
+ });
+})(window, document, window.searx);
+;/**
+* searx is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* searx is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with searx. If not, see < http://www.gnu.org/licenses/ >.
+*
+* (C) 2017 by Alexandre Flament,
+*/
+(function(w, d, searx) {
+ 'use strict';
+
+ searx.ready(function() {
+ searx.image_thumbnail_layout = new searx.ImageLayout('#urls', '#urls .result-images', 'img.image_thumbnail', 200);
+ searx.image_thumbnail_layout.watch();
+
+ searx.on('.btn-collapse', 'click', function(event) {
+ var btnLabelCollapsed = this.getAttribute('data-btn-text-collapsed');
+ var btnLabelNotCollapsed = this.getAttribute('data-btn-text-not-collapsed');
+ var target = this.getAttribute('data-target');
+ var targetElement = d.querySelector(target);
+ var html = this.innerHTML;
+ if (this.classList.contains('collapsed')) {
+ html = html.replace(btnLabelCollapsed, btnLabelNotCollapsed);
+ } else {
+ html = html.replace(btnLabelNotCollapsed, btnLabelCollapsed);
+ }
+ this.innerHTML = html;
+ this.classList.toggle('collapsed');
+ targetElement.classList.toggle('invisible');
+ });
+
+ searx.on('.media-loader', 'click', function(event) {
+ var target = this.getAttribute('data-target');
+ var iframe_load = d.querySelector(target + ' > iframe');
+ var srctest = iframe_load.getAttribute('src');
+ if (srctest === null || srctest === undefined || srctest === false) {
+ iframe_load.setAttribute('src', iframe_load.getAttribute('data-src'));
+ }
+ });
+
+ w.addEventListener('scroll', function() {
+ var e = d.getElementById('backToTop'),
+ scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
+ if (e !== null) {
+ if (scrollTop >= 200) {
+ e.style.opacity = 1;
+ } else {
+ e.style.opacity = 0;
+ }
+ }
+ });
+
+ });
+
+})(window, document, window.searx);
+;/**
+* searx is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* searx is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with searx. If not, see < http://www.gnu.org/licenses/ >.
+*
+* (C) 2017 by Alexandre Flament,
+*/
+(function(w, d, searx) {
+ 'use strict';
+
+ var firstFocus = true, qinput_id = "q", qinput;
+
+ function placeCursorAtEnd(element) {
+ if (element.setSelectionRange) {
+ var len = element.value.length;
+ element.setSelectionRange(len, len);
+ }
+ }
+
+ function submitIfQuery() {
+ if (qinput.value.length > 0) {
+ var search = document.getElementById('search');
+ setTimeout(search.submit.bind(search), 0);
+ }
+ }
+
+ searx.ready(function() {
+ qinput = d.getElementById(qinput_id);
+
+ function placeCursorAtEndOnce(e) {
+ if (firstFocus) {
+ placeCursorAtEnd(qinput);
+ firstFocus = false;
+ } else {
+ // e.preventDefault();
+ }
+ }
+
+ if (qinput !== null) {
+ // autocompleter
+ if (searx.autocompleter) {
+ searx.autocomplete = AutoComplete.call(w, {
+ Url: "./autocompleter",
+ EmptyMessage: searx.noItemFound,
+ HttpMethod: searx.method,
+ MinChars: 4,
+ Delay: 300,
+ }, "#" + qinput_id);
+
+ // hack, see : https://github.com/autocompletejs/autocomplete.js/issues/37
+ w.addEventListener('resize', function() {
+ var event = new CustomEvent("position");
+ qinput.dispatchEvent(event);
+ });
+ }
+
+ qinput.addEventListener('focus', placeCursorAtEndOnce, false);
+ qinput.focus();
+ }
+
+ // vanilla js version of search_on_category_select.js
+ if (qinput !== null && searx.search_on_category_select) {
+ d.querySelector('.help').className='invisible';
+
+ searx.on('#categories input', 'change', function(e) {
+ var i, categories = d.querySelectorAll('#categories input[type="checkbox"]');
+ for(i=0; i=e.From&&a.keyCode<=e.To?!e.Not:e.Not))}),!0===s&&r.Callback.call(e,a)}},t.prototype.makeRequest=function(t,e){var n=Object.getOwnPropertyNames(t.HttpHeaders),o=new XMLHttpRequest,a=t._HttpMethod(),i=t._Url(),r=t._Pre(),s=encodeURIComponent(t._QueryArg())+"="+encodeURIComponent(r);a.match(/^GET$/i)&&(-1!==i.indexOf("?")?i+="&"+s:i+="?"+s),o.open(a,i,!0);for(var l=n.length-1;l>=0;l--)o.setRequestHeader(n[l],t.HttpHeaders[n[l]]);return o.onreadystatechange=function(){4==o.readyState&&200==o.status&&(t.$Cache[r]=o.response,e(o.response))},o},t.prototype.ajax=function(e,n,o){void 0===o&&(o=!0),e.$AjaxTimer&&window.clearTimeout(e.$AjaxTimer),!0===o?e.$AjaxTimer=window.setTimeout(t.prototype.ajax.bind(null,e,n,!1),e.Delay):(e.Request&&e.Request.abort(),e.Request=n,e.Request.send(e._QueryArg()+"="+e._Pre()))},t.prototype.cache=function(e,n){var o=e._Cache(e._Pre());if(void 0===o){var a=t.prototype.makeRequest(e,n);t.prototype.ajax(e,a)}else n(o)},t.prototype.destroy=function(t){for(var e in t.$Listeners)t.Input.removeEventListener(e,t.$Listeners[e]);t.DOMResults.parentNode.removeChild(t.DOMResults)},t}();i.merge=function(){for(var t,e={},n=0;n"+t+""}},HttpHeaders:{"Content-type":"application/x-www-form-urlencoded"},Limit:0,MinChars:0,HttpMethod:"GET",QueryArg:"q",Url:null,KeyboardMappings:{Enter:{Conditions:[{Is:13,Not:!1}],Callback:function(t){if(-1!=this.DOMResults.getAttribute("class").indexOf("open")){var e=this.DOMResults.querySelector("li.active");null!==e&&(t.preventDefault(),this._Select(e),this.DOMResults.setAttribute("class","autocomplete"))}},Operator:o.AND,Event:a.KEYDOWN},KeyUpAndDown_down:{Conditions:[{Is:38,Not:!1},{Is:40,Not:!1}],Callback:function(t){t.preventDefault()},Operator:o.OR,Event:a.KEYDOWN},KeyUpAndDown_up:{Conditions:[{Is:38,Not:!1},{Is:40,Not:!1}],Callback:function(t){t.preventDefault();var e=this.DOMResults.querySelector("li:first-child:not(.locked)"),n=this.DOMResults.querySelector("li:last-child:not(.locked)"),o=this.DOMResults.querySelector("li.active");if(o){var a=Array.prototype.indexOf.call(o.parentNode.children,o)+(t.keyCode-39),i=this.DOMResults.getElementsByTagName("li").length;a<0?a=i-1:a>=i&&(a=0),o.classList.remove("active"),o.parentElement.children.item(a).classList.add("active")}else n&&38==t.keyCode?n.classList.add("active"):e&&e.classList.add("active")},Operator:o.OR,Event:a.KEYUP},AlphaNum:{Conditions:[{Is:13,Not:!0},{From:35,To:40,Not:!0}],Callback:function(){var t=this.Input.getAttribute("data-autocomplete-old-value"),e=this._Pre();""!==e&&e.length>=this._MinChars()&&(t&&e==t||this.DOMResults.setAttribute("class","autocomplete open"),i.prototype.cache(this,function(t){this._Render(this._Post(t)),this._Open()}.bind(this)))},Operator:o.AND,Event:a.KEYUP}},DOMResults:null,Request:null,Input:null,_EmptyMessage:function(){return this.Input.hasAttribute("data-autocomplete-empty-message")?this.Input.getAttribute("data-autocomplete-empty-message"):!1!==this.EmptyMessage?this.EmptyMessage:""},_Limit:function(){var t=this.Input.getAttribute("data-autocomplete-limit");return isNaN(t)||null===t?this.Limit:parseInt(t,10)},_MinChars:function(){var t=this.Input.getAttribute("data-autocomplete-minchars");return isNaN(t)||null===t?this.MinChars:parseInt(t,10)},_Highlight:function(t){return t.replace(this.Highlight.getRegex(this._Pre()),this.Highlight.transform)},_HttpMethod:function(){return this.Input.hasAttribute("data-autocomplete-method")?this.Input.getAttribute("data-autocomplete-method"):this.HttpMethod},_QueryArg:function(){return this.Input.hasAttribute("data-autocomplete-param-name")?this.Input.getAttribute("data-autocomplete-param-name"):this.QueryArg},_Url:function(){return this.Input.hasAttribute("data-autocomplete")?this.Input.getAttribute("data-autocomplete"):this.Url},_Blur:function(t){if(!0===t)this.DOMResults.setAttribute("class","autocomplete"),this.Input.setAttribute("data-autocomplete-old-value",this.Input.value);else{var e=this;setTimeout(function(){e._Blur(!0)},150)}},_Cache:function(t){return this.$Cache[t]},_Focus:function(){var t=this.Input.getAttribute("data-autocomplete-old-value");(!t||this.Input.value!=t)&&this._MinChars()<=this.Input.value.length&&this.DOMResults.setAttribute("class","autocomplete open")},_Open:function(){var t=this;Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"),function(e){"locked"!=e.getAttribute("class")&&(e.onclick=function(n){t._Select(e)},e.onmouseenter=function(){var n=t.DOMResults.querySelector("li.active");n!==e&&(null!==n&&n.classList.remove("active"),e.classList.add("active"))})})},_Position:function(){this.DOMResults.setAttribute("class","autocomplete"),this.DOMResults.setAttribute("style","top:"+(this.Input.offsetTop+this.Input.offsetHeight)+"px;left:"+this.Input.offsetLeft+"px;width:"+this.Input.clientWidth+"px;")},_Render:function(t){var e;e="string"==typeof t?this._RenderRaw(t):this._RenderResponseItems(t),this.DOMResults.hasChildNodes()&&this.DOMResults.removeChild(this.DOMResults.childNodes[0]),this.DOMResults.appendChild(e)},_RenderResponseItems:function(t){var e=document.createElement("ul"),n=document.createElement("li"),o=this._Limit();o<0?t=t.reverse():0===o&&(o=t.length);for(var a=0;a0)this.DOMResults.innerHTML=t;else{var o=this._EmptyMessage();""!==o&&(n.innerHTML=o,n.setAttribute("class","locked"),e.appendChild(n))}return e},_Post:function(t){try{var e=[],n=JSON.parse(t);if(0===Object.keys(n).length)return"";if(Array.isArray(n))for(var o=0;o0&&n.naturalHeight>0?o+=n.naturalWidth/n.naturalHeight:o+=1;return e/o},n.prototype._setSize=function(t,e){for(var n,o,a=t.length,i=0;i0&&n.naturalHeight>0?e*n.naturalWidth/n.naturalHeight:e,n.style.width=o+"px",n.style.height=e+"px",n.style.marginLeft="3px",n.style.marginTop="3px",n.style.marginRight=this.margin-7+"px",n.style.marginBottom=this.margin-7+"px"},n.prototype._alignImgs=function(t){var n,o,a=e.querySelector(this.container_selector).clientWidth;t:for(;t.length>0;){for(var i=1;i<=t.length;i++)if(n=t.slice(0,i),(o=this._getHeigth(n,a))0&&(this._alignImgs(r),r=[]),r.push(i.querySelector(this.img_selector)),a=i;r.length>0&&this._alignImgs(r)},n.prototype.watch=function(){function n(t){i._alignAllDone&&(i._alignAllDone=!1,setTimeout(function(){i.align(),i._alignAllDone=!0},100))}var o,a,i=this,r=e.querySelectorAll(this.results_selector),s=r.length;for(t.addEventListener("resize",n),t.addEventListener("pageshow",function(t){i.align()}),o=0;os)break}break;case"down":null===(i=o.nextElementSibling)&&(i=r[0]);break;case"up":null===(i=o.previousElementSibling)&&(i=r[r.length-1]);break;case"bottom":i=r[r.length-1];break;case"top":default:i=r[0]}if(i){o.removeAttribute("data-vim-selected"),i.setAttribute("data-vim-selected","true");var d=i.querySelector("h3 a")||i.querySelector("a");null!==d&&d.focus(),e||n()}}}function e(t){return function(){var e=$('div#pagination button[type="submit"]');2===e.length?t>=0&&to-120?window.scroll(window.scrollX,o-120):e+n',i+='',i+='
',i+="
How to navigate searx with Vim-like hotkeys ",i+="",i+="
";for(var s=0;s '),i+='',i+='
',i+='
'+l[0].cat+"
",i+='
',i+='
';for(var d in l)i+=""+l[d].key+" "+l[d].des+" ";i+=" ",i+="
",i+="
",i+="
",c&&!u||(i+="")}i+="",i+="",$("body").append(i)}}},des:"toggle help window",cat:"Other"}};searx.on(document,"keyup",function(t){if(r.hasOwnProperty(t.keyCode)&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.metaKey){var e=t.target.tagName.toLowerCase();27===t.keyCode?"input"!==e&&"select"!==e&&"textarea"!==e||r[t.keyCode].fun():t.target!==document.body&&"a"!==e&&"button"!==e||r[t.keyCode].fun()}})}),function(t,e,n){"use strict";n.ready(function(){n.on(".searx_overpass_request","click",function(t){this.classList.remove("searx_overpass_request");var o="https://overpass-api.de/api/interpreter?data=[out:json][timeout:25];(",a=this.dataset.osmId,i=this.dataset.osmType,r=e.querySelector("#"+this.dataset.resultTable),s=e.querySelector("#"+this.dataset.resultTableLoadicon),l=["addr:city","addr:country","addr:housenumber","addr:postcode","addr:street"];if(a&&i&&r){var u=null;switch(i){case"node":u=o+"node("+a+"););out meta;";break;case"way":u=o+"way("+a+"););out meta;";break;case"relation":u=o+"relation("+a+"););out meta;"}u&&n.http("GET",u).then(function(t,e){if((t=JSON.parse(t))&&t.elements&&t.elements[0]){var n=t.elements[0],o="";for(var a in n.tags)if(null===n.tags.name||-1==l.indexOf(a)){switch(o+=""+a+" ",a){case"phone":case"fax":o+=''+n.tags[a]+" ";break;case"email":o+=''+n.tags[a]+" ";break;case"website":case"url":o+=''+n.tags[a]+" ";break;case"wikidata":o+=''+n.tags[a]+" ";break;case"wikipedia":if(-1!=n.tags[a].indexOf(":")){o+=''+n.tags[a]+" ";break}default:o+=n.tags[a]}o+=" "}s.classList.add("invisible"),r.classList.remove("invisible"),r.querySelector("tbody").innerHTML=o}}).catch(function(){s.innerHTML=s.innerHTML+'could not load data!
'})}t.preventDefault()}),n.on(".searx_init_map","click",function(t){this.classList.remove("searx_init_map");var e=this.dataset.leafletTarget,o=parseFloat(this.dataset.mapLon),a=parseFloat(this.dataset.mapLat),i=parseFloat(this.dataset.mapZoom),r=JSON.parse(this.dataset.mapBoundingbox),s=JSON.parse(this.dataset.mapGeojson);n.loadStyle("leaflet/leaflet.css"),n.loadScript("leaflet/leaflet.js",function(){var t=null;if(r){var n=L.latLng(r[0],r[2]),l=L.latLng(r[1],r[3]);t=L.latLngBounds(n,l)}var u=L.map(e),c=new L.TileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{minZoom:1,maxZoom:19,attribution:'Map data © OpenStreetMap contributors'});new L.TileLayer("https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png",{minZoom:1,maxZoom:19,attribution:'Wikimedia maps beta | Maps data © OpenStreetMap contributors'});t?setTimeout(function(){u.fitBounds(t,{maxZoom:17})},0):o&&a&&(i?u.setView(new L.latLng(a,o),i):u.setView(new L.latLng(a,o),8)),u.addLayer(c);var d={"OSM Mapnik":c};L.control.layers(d).addTo(u),s&&L.geoJson(s).addTo(u)}),t.preventDefault()})})}(window,document,window.searx),function(t,e,n){"use strict";n.ready(function(){n.image_thumbnail_layout=new n.ImageLayout("#urls","#urls .result-images","img.image_thumbnail",200),n.image_thumbnail_layout.watch(),n.on(".btn-collapse","click",function(t){var n=this.getAttribute("data-btn-text-collapsed"),o=this.getAttribute("data-btn-text-not-collapsed"),a=this.getAttribute("data-target"),i=e.querySelector(a),r=this.innerHTML;r=this.classList.contains("collapsed")?r.replace(n,o):r.replace(o,n),this.innerHTML=r,this.classList.toggle("collapsed"),i.classList.toggle("invisible")}),n.on(".media-loader","click",function(t){var n=this.getAttribute("data-target"),o=e.querySelector(n+" > iframe"),a=o.getAttribute("src");null!==a&&void 0!==a&&!1!==a||o.setAttribute("src",o.getAttribute("data-src"))}),t.addEventListener("scroll",function(){var t=e.getElementById("backToTop"),n=document.documentElement.scrollTop||document.body.scrollTop;null!==t&&(t.style.opacity=n>=200?1:0)})})}(window,document,window.searx),function(t,e,n){"use strict";function o(t){if(t.setSelectionRange){var e=t.value.length;t.setSelectionRange(e,e)}}function a(){if(i.value.length>0){var t=document.getElementById("search");setTimeout(t.submit.bind(t),0)}}var i,r=!0;n.ready(function(){null!==(i=e.getElementById("q"))&&(n.autocompleter&&(n.autocomplete=AutoComplete.call(t,{Url:"./autocompleter",EmptyMessage:n.noItemFound,HttpMethod:n.method,MinChars:4,Delay:300},"#q"),t.addEventListener("resize",function(){var t=new CustomEvent("position");i.dispatchEvent(t)})),i.addEventListener("focus",function(t){r&&(o(i),r=!1)},!1),i.focus()),null!==i&&n.search_on_category_select&&(e.querySelector(".help").className="invisible",n.on("#categories input","change",function(t){var n,o=e.querySelectorAll('#categories input[type="checkbox"]');for(n=0;n.
+*
+* (C) 2017 by Alexandre Flament,
+*
+*/
+(function(w, d, searx) {
+
+ 'use strict';
+
+ // not invented here tookit with bugs fixed elsewhere
+ // purposes : be just good enough and as small as possible
+
+ // from https://plainjs.com/javascript/events/live-binding-event-handlers-14/
+ if (w.Element) {
+ (function(ElementPrototype) {
+ ElementPrototype.matches = ElementPrototype.matches ||
+ ElementPrototype.matchesSelector ||
+ ElementPrototype.webkitMatchesSelector ||
+ ElementPrototype.msMatchesSelector ||
+ function(selector) {
+ var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;
+ while (nodes[++i] && nodes[i] != node);
+ return !!nodes[i];
+ };
+ })(Element.prototype);
+ }
+
+ function callbackSafe(callback, el, e) {
+ try {
+ callback.call(el, e);
+ } catch (exception) {
+ console.log(exception);
+ }
+ }
+
+ searx = searx || {};
+
+ searx.on = function(obj, eventType, callback, useCapture) {
+ useCapture = useCapture || false;
+ if (typeof obj !== 'string') {
+ // obj HTMLElement, HTMLDocument
+ obj.addEventListener(eventType, callback, useCapture);
+ } else {
+ // obj is a selector
+ d.addEventListener(eventType, function(e) {
+ var el = e.target || e.srcElement, found = false;
+ while (el && el.matches && el !== d && !(found = el.matches(obj))) el = el.parentElement;
+ if (found) callbackSafe(callback, el, e);
+ }, useCapture);
+ }
+ };
+
+ searx.ready = function(callback) {
+ if (document.readyState != 'loading') {
+ callback.call(w);
+ } else {
+ w.addEventListener('DOMContentLoaded', callback.bind(w));
+ }
+ };
+
+ searx.http = function(method, url, callback) {
+ var req = new XMLHttpRequest(),
+ resolve = function() {},
+ reject = function() {},
+ promise = {
+ then: function(callback) { resolve = callback; return promise; },
+ catch: function(callback) { reject = callback; return promise; }
+ };
+
+ try {
+ req.open(method, url, true);
+
+ // On load
+ req.onload = function() {
+ if (req.status == 200) {
+ resolve(req.response, req.responseType);
+ } else {
+ reject(Error(req.statusText));
+ }
+ };
+
+ // Handle network errors
+ req.onerror = function() {
+ reject(Error("Network Error"));
+ };
+
+ req.onabort = function() {
+ reject(Error("Transaction is aborted"));
+ };
+
+ // Make the request
+ req.send();
+ } catch (ex) {
+ reject(ex);
+ }
+
+ return promise;
+ };
+
+ searx.loadStyle = function(src) {
+ var path = searx.staticPath + src,
+ id = "style_" + src.replace('.', '_'),
+ s = d.getElementById(id);
+ if (s === null) {
+ s = d.createElement('link');
+ s.setAttribute('id', id);
+ s.setAttribute('rel', 'stylesheet');
+ s.setAttribute('type', 'text/css');
+ s.setAttribute('href', path);
+ d.body.appendChild(s);
+ }
+ };
+
+ searx.loadScript = function(src, callback) {
+ var path = searx.staticPath + src,
+ id = "script_" + src.replace('.', '_'),
+ s = d.getElementById(id);
+ if (s === null) {
+ s = d.createElement('script');
+ s.setAttribute('id', id);
+ s.setAttribute('src', path);
+ s.onload = callback;
+ s.onerror = function() {
+ s.setAttribute('error', '1');
+ };
+ d.body.appendChild(s);
+ } else if (!s.hasAttribute('error')) {
+ try {
+ callback.apply(s, []);
+ } catch (exception) {
+ console.log(exception);
+ }
+ } else {
+ console.log("callback not executed : script '" + path + "' not loaded.");
+ }
+ };
+
+ searx.on('.close', 'click', function(e) {
+ var el = e.target || e.srcElement;
+ this.parentNode.style.display="None";
+ });
+ return searx;
+})(window, document, window.searx);
diff --git a/searx/static/themes/simple/js/searx_src/autocomplete.js b/searx/static/themes/simple/js/searx_src/autocomplete.js
new file mode 100644
index 000000000..b95fbcfb2
--- /dev/null
+++ b/searx/static/themes/simple/js/searx_src/autocomplete.js
@@ -0,0 +1,536 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AutoComplete = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o @baptistedonaux
+ */
+var AutoComplete = (function () {
+ // Constructor
+ function AutoComplete(params, selector) {
+ if (params === void 0) { params = {}; }
+ if (selector === void 0) { selector = "[data-autocomplete]"; }
+ if (Array.isArray(selector)) {
+ selector.forEach(function (s) {
+ new AutoComplete(params, s);
+ });
+ }
+ else if (typeof selector == "string") {
+ var elements = document.querySelectorAll(selector);
+ Array.prototype.forEach.call(elements, function (input) {
+ new AutoComplete(params, input);
+ });
+ }
+ else {
+ var specificParams = AutoComplete.merge(AutoComplete.defaults, params, {
+ DOMResults: document.createElement("div")
+ });
+ AutoComplete.prototype.create(specificParams, selector);
+ return specificParams;
+ }
+ }
+ AutoComplete.prototype.create = function (params, element) {
+ params.Input = element;
+ if (params.Input.nodeName.match(/^INPUT$/i) && (params.Input.hasAttribute("type") === false || params.Input.getAttribute("type").match(/^TEXT|SEARCH$/i))) {
+ params.Input.setAttribute("autocomplete", "off");
+ params._Position(params);
+ params.Input.parentNode.appendChild(params.DOMResults);
+ params.$Listeners = {
+ blur: params._Blur.bind(params),
+ destroy: AutoComplete.prototype.destroy.bind(null, params),
+ focus: params._Focus.bind(params),
+ keyup: AutoComplete.prototype.event.bind(null, params, EventType.KEYUP),
+ keydown: AutoComplete.prototype.event.bind(null, params, EventType.KEYDOWN),
+ position: params._Position.bind(params)
+ };
+ for (var event in params.$Listeners) {
+ params.Input.addEventListener(event, params.$Listeners[event]);
+ }
+ }
+ };
+ AutoComplete.prototype.getEventsByType = function (params, type) {
+ var mappings = {};
+ for (var key in params.KeyboardMappings) {
+ var event = EventType.KEYUP;
+ if (params.KeyboardMappings[key].Event !== undefined) {
+ event = params.KeyboardMappings[key].Event;
+ }
+ if (event == type) {
+ mappings[key] = params.KeyboardMappings[key];
+ }
+ }
+ return mappings;
+ };
+ AutoComplete.prototype.event = function (params, type, event) {
+ var eventIdentifier = function (condition) {
+ if ((match === true && mapping.Operator == ConditionOperator.AND) || (match === false && mapping.Operator == ConditionOperator.OR)) {
+ condition = AutoComplete.merge({
+ Not: false
+ }, condition);
+ if (condition.hasOwnProperty("Is")) {
+ if (condition.Is == event.keyCode) {
+ match = !condition.Not;
+ }
+ else {
+ match = condition.Not;
+ }
+ }
+ else if (condition.hasOwnProperty("From") && condition.hasOwnProperty("To")) {
+ if (event.keyCode >= condition.From && event.keyCode <= condition.To) {
+ match = !condition.Not;
+ }
+ else {
+ match = condition.Not;
+ }
+ }
+ }
+ };
+ for (var name in AutoComplete.prototype.getEventsByType(params, type)) {
+ var mapping = AutoComplete.merge({
+ Operator: ConditionOperator.AND
+ }, params.KeyboardMappings[name]), match = ConditionOperator.AND == mapping.Operator;
+ mapping.Conditions.forEach(eventIdentifier);
+ if (match === true) {
+ mapping.Callback.call(params, event);
+ }
+ }
+ };
+ AutoComplete.prototype.makeRequest = function (params, callback) {
+ var propertyHttpHeaders = Object.getOwnPropertyNames(params.HttpHeaders), request = new XMLHttpRequest(), method = params._HttpMethod(), url = params._Url(), queryParams = params._Pre(), queryParamsStringify = encodeURIComponent(params._QueryArg()) + "=" + encodeURIComponent(queryParams);
+ if (method.match(/^GET$/i)) {
+ if (url.indexOf("?") !== -1) {
+ url += "&" + queryParamsStringify;
+ }
+ else {
+ url += "?" + queryParamsStringify;
+ }
+ }
+ request.open(method, url, true);
+ for (var i = propertyHttpHeaders.length - 1; i >= 0; i--) {
+ request.setRequestHeader(propertyHttpHeaders[i], params.HttpHeaders[propertyHttpHeaders[i]]);
+ }
+ request.onreadystatechange = function () {
+ if (request.readyState == 4 && request.status == 200) {
+ params.$Cache[queryParams] = request.response;
+ callback(request.response);
+ }
+ };
+ return request;
+ };
+ AutoComplete.prototype.ajax = function (params, request, timeout) {
+ if (timeout === void 0) { timeout = true; }
+ if (params.$AjaxTimer) {
+ window.clearTimeout(params.$AjaxTimer);
+ }
+ if (timeout === true) {
+ params.$AjaxTimer = window.setTimeout(AutoComplete.prototype.ajax.bind(null, params, request, false), params.Delay);
+ }
+ else {
+ if (params.Request) {
+ params.Request.abort();
+ }
+ params.Request = request;
+ params.Request.send(params._QueryArg() + "=" + params._Pre());
+ }
+ };
+ AutoComplete.prototype.cache = function (params, callback) {
+ var response = params._Cache(params._Pre());
+ if (response === undefined) {
+ var request = AutoComplete.prototype.makeRequest(params, callback);
+ AutoComplete.prototype.ajax(params, request);
+ }
+ else {
+ callback(response);
+ }
+ };
+ AutoComplete.prototype.destroy = function (params) {
+ for (var event in params.$Listeners) {
+ params.Input.removeEventListener(event, params.$Listeners[event]);
+ }
+ params.DOMResults.parentNode.removeChild(params.DOMResults);
+ };
+ return AutoComplete;
+}());
+AutoComplete.merge = function () {
+ var merge = {}, tmp;
+ for (var i = 0; i < arguments.length; i++) {
+ for (tmp in arguments[i]) {
+ merge[tmp] = arguments[i][tmp];
+ }
+ }
+ return merge;
+};
+AutoComplete.defaults = {
+ Delay: 150,
+ EmptyMessage: "No result here",
+ Highlight: {
+ getRegex: function (value) {
+ return new RegExp(value, "ig");
+ },
+ transform: function (value) {
+ return "" + value + " ";
+ }
+ },
+ HttpHeaders: {
+ "Content-type": "application/x-www-form-urlencoded"
+ },
+ Limit: 0,
+ MinChars: 0,
+ HttpMethod: "GET",
+ QueryArg: "q",
+ Url: null,
+ KeyboardMappings: {
+ "Enter": {
+ Conditions: [{
+ Is: 13,
+ Not: false
+ }],
+ Callback: function (event) {
+ if (this.DOMResults.getAttribute("class").indexOf("open") != -1) {
+ var liActive = this.DOMResults.querySelector("li.active");
+ if (liActive !== null) {
+ event.preventDefault();
+ this._Select(liActive);
+ this.DOMResults.setAttribute("class", "autocomplete");
+ }
+ }
+ },
+ Operator: ConditionOperator.AND,
+ Event: EventType.KEYDOWN
+ },
+ "KeyUpAndDown_down": {
+ Conditions: [{
+ Is: 38,
+ Not: false
+ },
+ {
+ Is: 40,
+ Not: false
+ }],
+ Callback: function (event) {
+ event.preventDefault();
+ },
+ Operator: ConditionOperator.OR,
+ Event: EventType.KEYDOWN
+ },
+ "KeyUpAndDown_up": {
+ Conditions: [{
+ Is: 38,
+ Not: false
+ },
+ {
+ Is: 40,
+ Not: false
+ }],
+ Callback: function (event) {
+ event.preventDefault();
+ var first = this.DOMResults.querySelector("li:first-child:not(.locked)"), last = this.DOMResults.querySelector("li:last-child:not(.locked)"), active = this.DOMResults.querySelector("li.active");
+ if (active) {
+ var currentIndex = Array.prototype.indexOf.call(active.parentNode.children, active), position = currentIndex + (event.keyCode - 39), lisCount = this.DOMResults.getElementsByTagName("li").length;
+ if (position < 0) {
+ position = lisCount - 1;
+ }
+ else if (position >= lisCount) {
+ position = 0;
+ }
+ active.classList.remove("active");
+ active.parentElement.children.item(position).classList.add("active");
+ }
+ else if (last && event.keyCode == 38) {
+ last.classList.add("active");
+ }
+ else if (first) {
+ first.classList.add("active");
+ }
+ },
+ Operator: ConditionOperator.OR,
+ Event: EventType.KEYUP
+ },
+ "AlphaNum": {
+ Conditions: [{
+ Is: 13,
+ Not: true
+ }, {
+ From: 35,
+ To: 40,
+ Not: true
+ }],
+ Callback: function () {
+ var oldValue = this.Input.getAttribute("data-autocomplete-old-value"), currentValue = this._Pre();
+ if (currentValue !== "" && currentValue.length >= this._MinChars()) {
+ if (!oldValue || currentValue != oldValue) {
+ this.DOMResults.setAttribute("class", "autocomplete open");
+ }
+ AutoComplete.prototype.cache(this, function (response) {
+ this._Render(this._Post(response));
+ this._Open();
+ }.bind(this));
+ }
+ },
+ Operator: ConditionOperator.AND,
+ Event: EventType.KEYUP
+ }
+ },
+ DOMResults: null,
+ Request: null,
+ Input: null,
+ /**
+ * Return the message when no result returns
+ */
+ _EmptyMessage: function () {
+ var emptyMessage = "";
+ if (this.Input.hasAttribute("data-autocomplete-empty-message")) {
+ emptyMessage = this.Input.getAttribute("data-autocomplete-empty-message");
+ }
+ else if (this.EmptyMessage !== false) {
+ emptyMessage = this.EmptyMessage;
+ }
+ else {
+ emptyMessage = "";
+ }
+ return emptyMessage;
+ },
+ /**
+ * Returns the maximum number of results
+ */
+ _Limit: function () {
+ var limit = this.Input.getAttribute("data-autocomplete-limit");
+ if (isNaN(limit) || limit === null) {
+ return this.Limit;
+ }
+ return parseInt(limit, 10);
+ },
+ /**
+ * Returns the minimum number of characters entered before firing ajax
+ */
+ _MinChars: function () {
+ var minchars = this.Input.getAttribute("data-autocomplete-minchars");
+ if (isNaN(minchars) || minchars === null) {
+ return this.MinChars;
+ }
+ return parseInt(minchars, 10);
+ },
+ /**
+ * Apply transformation on labels response
+ */
+ _Highlight: function (label) {
+ return label.replace(this.Highlight.getRegex(this._Pre()), this.Highlight.transform);
+ },
+ /**
+ * Returns the HHTP method to use
+ */
+ _HttpMethod: function () {
+ if (this.Input.hasAttribute("data-autocomplete-method")) {
+ return this.Input.getAttribute("data-autocomplete-method");
+ }
+ return this.HttpMethod;
+ },
+ /**
+ * Returns the query param to use
+ */
+ _QueryArg: function () {
+ if (this.Input.hasAttribute("data-autocomplete-param-name")) {
+ return this.Input.getAttribute("data-autocomplete-param-name");
+ }
+ return this.QueryArg;
+ },
+ /**
+ * Returns the URL to use for AJAX request
+ */
+ _Url: function () {
+ if (this.Input.hasAttribute("data-autocomplete")) {
+ return this.Input.getAttribute("data-autocomplete");
+ }
+ return this.Url;
+ },
+ /**
+ * Manage the close
+ */
+ _Blur: function (now) {
+ if (now === true) {
+ this.DOMResults.setAttribute("class", "autocomplete");
+ this.Input.setAttribute("data-autocomplete-old-value", this.Input.value);
+ }
+ else {
+ var params = this;
+ setTimeout(function () {
+ params._Blur(true);
+ }, 150);
+ }
+ },
+ /**
+ * Manage the cache
+ */
+ _Cache: function (value) {
+ return this.$Cache[value];
+ },
+ /**
+ * Manage the open
+ */
+ _Focus: function () {
+ var oldValue = this.Input.getAttribute("data-autocomplete-old-value");
+ if ((!oldValue || this.Input.value != oldValue) && this._MinChars() <= this.Input.value.length) {
+ this.DOMResults.setAttribute("class", "autocomplete open");
+ }
+ },
+ /**
+ * Bind all results item if one result is opened
+ */
+ _Open: function () {
+ var params = this;
+ Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"), function (li) {
+ if (li.getAttribute("class") != "locked") {
+ li.onclick = function (event) {
+ params._Select(li);
+ };
+ li.onmouseenter = function () {
+ var active = params.DOMResults.querySelector("li.active");
+ if (active !== li) {
+ if (active !== null) {
+ active.classList.remove("active");
+ }
+ li.classList.add("active");
+ }
+ };
+ }
+ });
+ },
+ /**
+ * Position the results HTML element
+ */
+ _Position: function () {
+ this.DOMResults.setAttribute("class", "autocomplete");
+ this.DOMResults.setAttribute("style", "top:" + (this.Input.offsetTop + this.Input.offsetHeight) + "px;left:" + this.Input.offsetLeft + "px;width:" + this.Input.clientWidth + "px;");
+ },
+ /**
+ * Execute the render of results DOM element
+ */
+ _Render: function (response) {
+ var ul;
+ if (typeof response == "string") {
+ ul = this._RenderRaw(response);
+ }
+ else {
+ ul = this._RenderResponseItems(response);
+ }
+ if (this.DOMResults.hasChildNodes()) {
+ this.DOMResults.removeChild(this.DOMResults.childNodes[0]);
+ }
+ this.DOMResults.appendChild(ul);
+ },
+ /**
+ * ResponseItems[] rendering
+ */
+ _RenderResponseItems: function (response) {
+ var ul = document.createElement("ul"), li = document.createElement("li"), limit = this._Limit();
+ // Order
+ if (limit < 0) {
+ response = response.reverse();
+ }
+ else if (limit === 0) {
+ limit = response.length;
+ }
+ for (var item = 0; item < Math.min(Math.abs(limit), response.length); item++) {
+ li.innerHTML = response[item].Label;
+ li.setAttribute("data-autocomplete-value", response[item].Value);
+ ul.appendChild(li);
+ li = document.createElement("li");
+ }
+ return ul;
+ },
+ /**
+ * string response rendering (RAW HTML)
+ */
+ _RenderRaw: function (response) {
+ var ul = document.createElement("ul"), li = document.createElement("li");
+ if (response.length > 0) {
+ this.DOMResults.innerHTML = response;
+ }
+ else {
+ var emptyMessage = this._EmptyMessage();
+ if (emptyMessage !== "") {
+ li.innerHTML = emptyMessage;
+ li.setAttribute("class", "locked");
+ ul.appendChild(li);
+ }
+ }
+ return ul;
+ },
+ /**
+ * Deal with request response
+ */
+ _Post: function (response) {
+ try {
+ var returnResponse = [];
+ //JSON return
+ var json = JSON.parse(response);
+ if (Object.keys(json).length === 0) {
+ return "";
+ }
+ if (Array.isArray(json)) {
+ for (var i = 0; i < Object.keys(json).length; i++) {
+ returnResponse[returnResponse.length] = { "Value": json[i], "Label": this._Highlight(json[i]) };
+ }
+ }
+ else {
+ for (var value in json) {
+ returnResponse.push({
+ "Value": value,
+ "Label": this._Highlight(json[value])
+ });
+ }
+ }
+ return returnResponse;
+ }
+ catch (event) {
+ //HTML return
+ return response;
+ }
+ },
+ /**
+ * Return the autocomplete value to send (before request)
+ */
+ _Pre: function () {
+ return this.Input.value;
+ },
+ /**
+ * Choice one result item
+ */
+ _Select: function (item) {
+ console.log('test test test');
+ if (item.hasAttribute("data-autocomplete-value")) {
+ this.Input.value = item.getAttribute("data-autocomplete-value");
+ }
+ else {
+ this.Input.value = item.innerHTML;
+ }
+ this.Input.setAttribute("data-autocomplete-old-value", this.Input.value);
+ },
+ $AjaxTimer: null,
+ $Cache: {},
+ $Listeners: {}
+};
+module.exports = AutoComplete;
+
+},{}]},{},[1])(1)
+});
diff --git a/searx/static/themes/simple/js/searx_src/searx_imageresult.js b/searx/static/themes/simple/js/searx_src/searx_imageresult.js
new file mode 100644
index 000000000..7bbfc1454
--- /dev/null
+++ b/searx/static/themes/simple/js/searx_src/searx_imageresult.js
@@ -0,0 +1,151 @@
+/**
+*
+* Google Image Layout v0.0.1
+* Description, by Anh Trinh.
+* Heavily modified for searx
+* http://trinhtrunganh.com
+*
+* @license Free to use under the MIT License.
+*
+*/
+(function(w, d) {
+ 'use strict';
+
+ function ImageLayout(container_selector, results_selector, img_selector, maxHeight) {
+ this.container_selector = container_selector;
+ this.results_selector = results_selector;
+ this.img_selector = img_selector;
+ this.margin = 10;
+ this.maxHeight = maxHeight;
+ this._alignAllDone = true;
+ }
+
+ /**
+ * Get the height that make all images fit the container
+ *
+ * width = w1 + w2 + w3 + ... = r1*h + r2*h + r3*h + ...
+ *
+ * @param {[type]} images the images to be calculated
+ * @param {[type]} width the container witdth
+ * @param {[type]} margin the margin between each image
+ *
+ * @return {[type]} the height
+ */
+ ImageLayout.prototype._getHeigth = function(images, width) {
+ var r = 0,
+ img;
+
+ width -= images.length * this.margin;
+ for (var i = 0; i < images.length; i++) {
+ img = images[i];
+ if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {
+ r += img.naturalWidth / img.naturalHeight;
+ } else {
+ // assume that not loaded images are square
+ r += 1;
+ }
+ }
+
+ return width / r; //have to round down because Firefox will automatically roundup value with number of decimals > 3
+ };
+
+ ImageLayout.prototype._setSize = function(images, height) {
+ var img, imgWidth, imagesLength = images.length;
+ for (var i = 0; i < imagesLength; i++) {
+ img = images[i];
+ if ((img.naturalWidth > 0) && (img.naturalHeight > 0)) {
+ imgWidth = height * img.naturalWidth / img.naturalHeight;
+ } else {
+ // not loaded image : make it square as _getHeigth said it
+ imgWidth = height;
+ }
+ img.style.width = imgWidth + 'px';
+ img.style.height = height + 'px';
+ img.style.marginLeft = '3px';
+ img.style.marginTop = '3px';
+ img.style.marginRight = this.margin - 7 + 'px'; // -4 is the negative margin of the inline element
+ img.style.marginBottom = this.margin - 7 + 'px';
+ }
+ };
+
+ ImageLayout.prototype._alignImgs = function(imgGroup) {
+ var slice, h,
+ containerWidth = d.querySelector(this.container_selector).clientWidth;
+
+ w: while (imgGroup.length > 0) {
+ for (var i = 1; i <= imgGroup.length; i++) {
+ slice = imgGroup.slice(0, i);
+ h = this._getHeigth(slice, containerWidth);
+ if (h < this.maxHeight) {
+ this._setSize(slice, h);
+ imgGroup = imgGroup.slice(i);
+ continue w;
+ }
+ }
+ this._setSize(slice, Math.min(this.maxHeight, h));
+ break;
+ }
+ };
+
+ ImageLayout.prototype.align = function(results_selector) {
+ var results_selectorNode = d.querySelectorAll(this.results_selector),
+ results_length = results_selectorNode.length,
+ previous = null,
+ current = null,
+ imgGroup = [];
+ for (var i = 0; i < results_length; i++) {
+ current = results_selectorNode[i];
+ if (current.previousElementSibling !== previous && imgGroup.length > 0) {
+ // the current image is not conected to previous one
+ // so the current image is the start of a new group of images.
+ // so call _alignImgs to align the current group
+ this._alignImgs(imgGroup);
+ // and start a new empty group of images
+ imgGroup = [];
+ }
+ // add the current image to the group (only the img tag)
+ imgGroup.push(current.querySelector(this.img_selector));
+ // update the previous variable
+ previous = current;
+ }
+ // align the remaining images
+ if (imgGroup.length > 0) {
+ this._alignImgs(imgGroup);
+ }
+ };
+
+ ImageLayout.prototype.watch = function() {
+ var i, img, imgGroup, imgNodeLength,
+ obj = this,
+ results_nodes = d.querySelectorAll(this.results_selector),
+ results_length = results_nodes.length;
+
+ function align(e) {
+ obj.align();
+ }
+
+ function throttleAlign(e) {
+ if (obj._alignAllDone) {
+ obj._alignAllDone = false;
+ setTimeout(function() {
+ obj.align();
+ obj._alignAllDone = true;
+ }, 100);
+ }
+ }
+
+ w.addEventListener('resize', throttleAlign);
+ w.addEventListener('pageshow', align);
+
+ for (i = 0; i < results_length; i++) {
+ img = results_nodes[i].querySelector(this.img_selector);
+ if (typeof img !== 'undefined') {
+ img.addEventListener('load', throttleAlign);
+ img.addEventListener('error', throttleAlign);
+ }
+ }
+ };
+
+ w.searx.ImageLayout = ImageLayout;
+
+})(window, document);
diff --git a/searx/static/themes/simple/js/searx_src/searx_keyboard.js b/searx/static/themes/simple/js/searx_src/searx_keyboard.js
new file mode 100644
index 000000000..6365b5243
--- /dev/null
+++ b/searx/static/themes/simple/js/searx_src/searx_keyboard.js
@@ -0,0 +1,360 @@
+searx.ready(function() {
+
+ searx.on('.result', 'click', function() {
+ highlightResult(this)(true);
+ });
+
+ searx.on('.result a', 'focus', function(e) {
+ var el = e.target;
+ while (el !== undefined) {
+ if (el.classList.contains('result')) {
+ if (el.getAttribute("data-vim-selected") === null) {
+ highlightResult(el)(true);
+ }
+ break;
+ }
+ el = el.parentNode;
+ }
+ }, true);
+
+ var vimKeys = {
+ 27: {
+ key: 'Escape',
+ fun: removeFocus,
+ des: 'remove focus from the focused input',
+ cat: 'Control'
+ },
+ 73: {
+ key: 'i',
+ fun: searchInputFocus,
+ des: 'focus on the search input',
+ cat: 'Control'
+ },
+ 66: {
+ key: 'b',
+ fun: scrollPage(-window.innerHeight),
+ des: 'scroll one page up',
+ cat: 'Navigation'
+ },
+ 70: {
+ key: 'f',
+ fun: scrollPage(window.innerHeight),
+ des: 'scroll one page down',
+ cat: 'Navigation'
+ },
+ 85: {
+ key: 'u',
+ fun: scrollPage(-window.innerHeight / 2),
+ des: 'scroll half a page up',
+ cat: 'Navigation'
+ },
+ 68: {
+ key: 'd',
+ fun: scrollPage(window.innerHeight / 2),
+ des: 'scroll half a page down',
+ cat: 'Navigation'
+ },
+ 71: {
+ key: 'g',
+ fun: scrollPageTo(-document.body.scrollHeight, 'top'),
+ des: 'scroll to the top of the page',
+ cat: 'Navigation'
+ },
+ 86: {
+ key: 'v',
+ fun: scrollPageTo(document.body.scrollHeight, 'bottom'),
+ des: 'scroll to the bottom of the page',
+ cat: 'Navigation'
+ },
+ 75: {
+ key: 'k',
+ fun: highlightResult('up'),
+ des: 'select previous search result',
+ cat: 'Results'
+ },
+ 74: {
+ key: 'j',
+ fun: highlightResult('down'),
+ des: 'select next search result',
+ cat: 'Results'
+ },
+ 80: {
+ key: 'p',
+ fun: pageButtonClick(0),
+ des: 'go to previous page',
+ cat: 'Results'
+ },
+ 78: {
+ key: 'n',
+ fun: pageButtonClick(1),
+ des: 'go to next page',
+ cat: 'Results'
+ },
+ 79: {
+ key: 'o',
+ fun: openResult(false),
+ des: 'open search result',
+ cat: 'Results'
+ },
+ 84: {
+ key: 't',
+ fun: openResult(true),
+ des: 'open the result in a new tab',
+ cat: 'Results'
+ },
+ 82: {
+ key: 'r',
+ fun: reloadPage,
+ des: 'reload page from the server',
+ cat: 'Control'
+ },
+ 72: {
+ key: 'h',
+ fun: toggleHelp,
+ des: 'toggle help window',
+ cat: 'Other'
+ }
+ };
+
+ searx.on(document, "keyup", function(e) {
+ // check for modifiers so we don't break browser's hotkeys
+ if (vimKeys.hasOwnProperty(e.keyCode) && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) {
+ var tagName = e.target.tagName.toLowerCase();
+ if (e.keyCode === 27) {
+ if (tagName === 'input' || tagName === 'select' || tagName === 'textarea') {
+ vimKeys[e.keyCode].fun();
+ }
+ } else {
+ if (e.target === document.body || tagName === 'a' || tagName === 'button') {
+ vimKeys[e.keyCode].fun();
+ }
+ }
+ }
+ });
+
+ function highlightResult(which) {
+ return function(noScroll) {
+ var current = document.querySelector('.result[data-vim-selected]'),
+ effectiveWhich = which;
+ if (current === null) {
+ // no selection : choose the first one
+ current = document.querySelector('.result');
+ if (current === null) {
+ // no first one : there are no results
+ return;
+ }
+ // replace up/down actions by selecting first one
+ if (which === "down" || which === "up") {
+ effectiveWhich = current;
+ }
+ }
+
+ var next, results = document.querySelectorAll('.result');
+
+ if (typeof effectiveWhich !== 'string') {
+ next = effectiveWhich;
+ } else {
+ switch (effectiveWhich) {
+ case 'visible':
+ var top = document.documentElement.scrollTop || document.body.scrollTop;
+ var bot = top + document.documentElement.clientHeight;
+
+ for (var i = 0; i < results.length; i++) {
+ next = results[i];
+ var etop = next.offsetTop;
+ var ebot = etop + next.clientHeight;
+
+ if ((ebot <= bot) && (etop > top)) {
+ break;
+ }
+ }
+ break;
+ case 'down':
+ next = current.nextElementSibling;
+ if (next === null) {
+ next = results[0];
+ }
+ break;
+ case 'up':
+ next = current.previousElementSibling;
+ if (next === null) {
+ next = results[results.length - 1];
+ }
+ break;
+ case 'bottom':
+ next = results[results.length - 1];
+ break;
+ case 'top':
+ /* falls through */
+ default:
+ next = results[0];
+ }
+ }
+
+ if (next) {
+ current.removeAttribute('data-vim-selected');
+ next.setAttribute('data-vim-selected', 'true');
+ var link = next.querySelector('h3 a') || next.querySelector('a');
+ if (link !== null) {
+ link.focus();
+ }
+ if (!noScroll) {
+ scrollPageToSelected();
+ }
+ }
+ };
+ }
+
+ function reloadPage() {
+ document.location.reload(true);
+ }
+
+ function removeFocus() {
+ if (document.activeElement) {
+ document.activeElement.blur();
+ }
+ }
+
+ function pageButtonClick(num) {
+ return function() {
+ var buttons = $('div#pagination button[type="submit"]');
+ if (buttons.length !== 2) {
+ console.log('page navigation with this theme is not supported');
+ return;
+ }
+ if (num >= 0 && num < buttons.length) {
+ buttons[num].click();
+ } else {
+ console.log('pageButtonClick(): invalid argument');
+ }
+ };
+ }
+
+ function scrollPageToSelected() {
+ var sel = document.querySelector('.result[data-vim-selected]');
+ if (sel === null) {
+ return;
+ }
+ var wtop = document.documentElement.scrollTop || document.body.scrollTop,
+ wheight = document.documentElement.clientHeight,
+ etop = sel.offsetTop,
+ ebot = etop + sel.clientHeight,
+ offset = 120;
+ // first element ?
+ if ((sel.previousElementSibling === null) && (ebot < wheight)) {
+ // set to the top of page if the first element
+ // is fully included in the viewport
+ window.scroll(window.scrollX, 0);
+ return;
+ }
+ if (wtop > (etop - offset)) {
+ window.scroll(window.scrollX, etop - offset);
+ } else {
+ var wbot = wtop + wheight;
+ if (wbot < (ebot + offset)) {
+ window.scroll(window.scrollX, ebot - wheight + offset);
+ }
+ }
+ }
+
+ function scrollPage(amount) {
+ return function() {
+ window.scrollBy(0, amount);
+ highlightResult('visible')();
+ };
+ }
+
+ function scrollPageTo(position, nav) {
+ return function() {
+ window.scrollTo(0, position);
+ highlightResult(nav)();
+ };
+ }
+
+ function searchInputFocus() {
+ window.scrollTo(0, 0);
+ document.querySelector('#q').focus();
+ }
+
+ function openResult(newTab) {
+ return function() {
+ var link = document.querySelector('.result[data-vim-selected] h3 a');
+ if (link !== null) {
+ var url = link.getAttribute('href');
+ if (newTab) {
+ window.open(url);
+ } else {
+ window.location.href = url;
+ }
+ }
+ };
+ }
+
+ function toggleHelp() {
+ var helpPanel = document.querySelector('#vim-hotkeys-help');
+ if (helpPanel.length) {
+ helpPanel.classList.toggle('hidden');
+ return;
+ }
+
+ var categories = {};
+
+ for (var k in vimKeys) {
+ var key = vimKeys[k];
+ categories[key.cat] = categories[key.cat] || [];
+ categories[key.cat].push(key);
+ }
+
+ var sorted = Object.keys(categories).sort(function(a, b) {
+ return categories[b].length - categories[a].length;
+ });
+
+ if (sorted.length === 0) {
+ return;
+ }
+
+ var html = '';
+ html += '
';
+
+ html += '
';
+ html += '
';
+ html += '
How to navigate searx with Vim-like hotkeys ';
+ html += ''; // col-sm-12
+ html += '
'; // row
+
+ for (var i = 0; i < sorted.length; i++) {
+ var cat = categories[sorted[i]];
+
+ var lastCategory = i === (sorted.length - 1);
+ var first = i % 2 === 0;
+
+ if (first) {
+ html += '
';
+ }
+ html += '
';
+
+ html += '
';
+ html += '
' + cat[0].cat + '
';
+ html += '
';
+ html += '
';
+
+ for (var cj in cat) {
+ html += '' + cat[cj].key + ' ' + cat[cj].des + ' ';
+ }
+
+ html += ' ';
+ html += '
'; // panel-body
+ html += '
'; // panel
+ html += '
'; // col-sm-*
+
+ if (!first || lastCategory) {
+ html += '
'; // row
+ }
+ }
+
+ html += '
'; // container-fluid
+ html += '
'; // vim-hotkeys-help
+
+ $('body').append(html);
+ }
+});
diff --git a/searx/static/themes/simple/js/searx_src/searx_mapresult.js b/searx/static/themes/simple/js/searx_src/searx_mapresult.js
new file mode 100644
index 000000000..823f64815
--- /dev/null
+++ b/searx/static/themes/simple/js/searx_src/searx_mapresult.js
@@ -0,0 +1,175 @@
+/**
+* searx is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* searx is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with searx. If not, see < http://www.gnu.org/licenses/ >.
+*
+* (C) 2014 by Thomas Pointhuber,
+* (C) 2017 by Alexandre Flament,
+*/
+(function (w, d, searx) {
+ 'use strict';
+
+ searx.ready(function () {
+ searx.on('.searx_overpass_request', 'click', function(event) {
+ // no more request
+ this.classList.remove("searx_overpass_request");
+
+ //
+ var overpass_url = "https://overpass-api.de/api/interpreter?data=";
+ var query_start = overpass_url + "[out:json][timeout:25];(";
+ var query_end = ");out meta;";
+
+ var osm_id = this.dataset.osmId;
+ var osm_type = this.dataset.osmType;
+ var result_table = d.querySelector("#" + this.dataset.resultTable);
+ var result_table_loadicon = d.querySelector("#" + this.dataset.resultTableLoadicon);
+
+ // tags which can be ignored
+ var osm_ignore_tags = [ "addr:city", "addr:country", "addr:housenumber", "addr:postcode", "addr:street" ];
+
+ if(osm_id && osm_type && result_table) {
+ var query = null;
+ switch(osm_type) {
+ case 'node':
+ query = query_start + "node(" + osm_id + ");" + query_end;
+ break;
+ case 'way':
+ query = query_start + "way(" + osm_id + ");" + query_end;
+ break;
+ case 'relation':
+ query = query_start + "relation(" + osm_id + ");" + query_end;
+ break;
+ default:
+ break;
+ }
+ if(query) {
+ // console.log(query);
+ searx.http( 'GET', query ).then(function(html, contentType) {
+ html = JSON.parse(html);
+ if(html && html.elements && html.elements[0]) {
+ var element = html.elements[0];
+ var newHtml = "";
+ for (var row in element.tags) {
+ if(element.tags.name === null || osm_ignore_tags.indexOf(row) == -1) {
+ newHtml += "" + row + " ";
+ switch(row) {
+ case "phone":
+ case "fax":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "email":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "website":
+ case "url":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "wikidata":
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ case "wikipedia":
+ if(element.tags[row].indexOf(":") != -1) {
+ newHtml += "" + element.tags[row] + " ";
+ break;
+ }
+ /* jshint ignore:start */
+ default:
+ /* jshint ignore:end */
+ newHtml += element.tags[row];
+ break;
+ }
+ newHtml += " ";
+ }
+ }
+ result_table_loadicon.classList.add('invisible');
+ result_table.classList.remove('invisible');
+ result_table.querySelector("tbody").innerHTML = newHtml;
+ }
+ })
+ .catch(function() {
+ result_table_loadicon.innerHTML = result_table_loadicon.innerHTML + "could not load data!
";
+ });
+ }
+ }
+
+ // this event occour only once per element
+ event.preventDefault();
+ });
+
+ searx.on('.searx_init_map', 'click', function(event) {
+ // no more request
+ this.classList.remove("searx_init_map");
+
+ //
+ var leaflet_target = this.dataset.leafletTarget;
+ var map_lon = parseFloat(this.dataset.mapLon);
+ var map_lat = parseFloat(this.dataset.mapLat);
+ var map_zoom = parseFloat(this.dataset.mapZoom);
+ var map_boundingbox = JSON.parse(this.dataset.mapBoundingbox);
+ var map_geojson = JSON.parse(this.dataset.mapGeojson);
+
+ searx.loadStyle('leaflet/leaflet.css');
+ searx.loadScript('leaflet/leaflet.js', function() {
+ var map_bounds = null;
+ if(map_boundingbox) {
+ var southWest = L.latLng(map_boundingbox[0], map_boundingbox[2]);
+ var northEast = L.latLng(map_boundingbox[1], map_boundingbox[3]);
+ map_bounds = L.latLngBounds(southWest, northEast);
+ }
+
+ // init map
+ var map = L.map(leaflet_target);
+ // create the tile layer with correct attribution
+ var osmMapnikUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ var osmMapnikAttrib='Map data © OpenStreetMap contributors';
+ var osmMapnik = new L.TileLayer(osmMapnikUrl, {minZoom: 1, maxZoom: 19, attribution: osmMapnikAttrib});
+ var osmWikimediaUrl='https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png';
+ var osmWikimediaAttrib = 'Wikimedia maps beta | Maps data © OpenStreetMap contributors';
+ var osmWikimedia = new L.TileLayer(osmWikimediaUrl, {minZoom: 1, maxZoom: 19, attribution: osmWikimediaAttrib});
+ // init map view
+ if(map_bounds) {
+ // TODO hack: https://github.com/Leaflet/Leaflet/issues/2021
+ // Still useful ?
+ setTimeout(function () {
+ map.fitBounds(map_bounds, {
+ maxZoom:17
+ });
+ }, 0);
+ } else if (map_lon && map_lat) {
+ if(map_zoom) {
+ map.setView(new L.latLng(map_lat, map_lon),map_zoom);
+ } else {
+ map.setView(new L.latLng(map_lat, map_lon),8);
+ }
+ }
+
+ map.addLayer(osmMapnik);
+
+ var baseLayers = {
+ "OSM Mapnik": osmMapnik/*,
+ "OSM Wikimedia": osmWikimedia*/
+ };
+
+ L.control.layers(baseLayers).addTo(map);
+
+ if(map_geojson) {
+ L.geoJson(map_geojson).addTo(map);
+ } /*else if(map_bounds) {
+ L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);
+ }*/
+ });
+
+ // this event occour only once per element
+ event.preventDefault();
+ });
+ });
+})(window, document, window.searx);
diff --git a/searx/static/themes/simple/js/searx_src/searx_results.js b/searx/static/themes/simple/js/searx_src/searx_results.js
new file mode 100644
index 000000000..b13da8391
--- /dev/null
+++ b/searx/static/themes/simple/js/searx_src/searx_results.js
@@ -0,0 +1,63 @@
+/**
+* searx is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* searx is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with searx. If not, see < http://www.gnu.org/licenses/ >.
+*
+* (C) 2017 by Alexandre Flament,
+*/
+(function(w, d, searx) {
+ 'use strict';
+
+ searx.ready(function() {
+ searx.image_thumbnail_layout = new searx.ImageLayout('#urls', '#urls .result-images', 'img.image_thumbnail', 200);
+ searx.image_thumbnail_layout.watch();
+
+ searx.on('.btn-collapse', 'click', function(event) {
+ var btnLabelCollapsed = this.getAttribute('data-btn-text-collapsed');
+ var btnLabelNotCollapsed = this.getAttribute('data-btn-text-not-collapsed');
+ var target = this.getAttribute('data-target');
+ var targetElement = d.querySelector(target);
+ var html = this.innerHTML;
+ if (this.classList.contains('collapsed')) {
+ html = html.replace(btnLabelCollapsed, btnLabelNotCollapsed);
+ } else {
+ html = html.replace(btnLabelNotCollapsed, btnLabelCollapsed);
+ }
+ this.innerHTML = html;
+ this.classList.toggle('collapsed');
+ targetElement.classList.toggle('invisible');
+ });
+
+ searx.on('.media-loader', 'click', function(event) {
+ var target = this.getAttribute('data-target');
+ var iframe_load = d.querySelector(target + ' > iframe');
+ var srctest = iframe_load.getAttribute('src');
+ if (srctest === null || srctest === undefined || srctest === false) {
+ iframe_load.setAttribute('src', iframe_load.getAttribute('data-src'));
+ }
+ });
+
+ w.addEventListener('scroll', function() {
+ var e = d.getElementById('backToTop'),
+ scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
+ if (e !== null) {
+ if (scrollTop >= 200) {
+ e.style.opacity = 1;
+ } else {
+ e.style.opacity = 0;
+ }
+ }
+ });
+
+ });
+
+})(window, document, window.searx);
diff --git a/searx/static/themes/simple/js/searx_src/searx_search.js b/searx/static/themes/simple/js/searx_src/searx_search.js
new file mode 100644
index 000000000..1b93f9039
--- /dev/null
+++ b/searx/static/themes/simple/js/searx_src/searx_search.js
@@ -0,0 +1,94 @@
+/**
+* searx is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* searx is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with searx. If not, see < http://www.gnu.org/licenses/ >.
+*
+* (C) 2017 by Alexandre Flament,
+*/
+(function(w, d, searx) {
+ 'use strict';
+
+ var firstFocus = true, qinput_id = "q", qinput;
+
+ function placeCursorAtEnd(element) {
+ if (element.setSelectionRange) {
+ var len = element.value.length;
+ element.setSelectionRange(len, len);
+ }
+ }
+
+ function submitIfQuery() {
+ if (qinput.value.length > 0) {
+ var search = document.getElementById('search');
+ setTimeout(search.submit.bind(search), 0);
+ }
+ }
+
+ searx.ready(function() {
+ qinput = d.getElementById(qinput_id);
+
+ function placeCursorAtEndOnce(e) {
+ if (firstFocus) {
+ placeCursorAtEnd(qinput);
+ firstFocus = false;
+ } else {
+ // e.preventDefault();
+ }
+ }
+
+ if (qinput !== null) {
+ // autocompleter
+ if (searx.autocompleter) {
+ searx.autocomplete = AutoComplete.call(w, {
+ Url: "./autocompleter",
+ EmptyMessage: searx.noItemFound,
+ HttpMethod: searx.method,
+ MinChars: 4,
+ Delay: 300,
+ }, "#" + qinput_id);
+
+ // hack, see : https://github.com/autocompletejs/autocomplete.js/issues/37
+ w.addEventListener('resize', function() {
+ var event = new CustomEvent("position");
+ qinput.dispatchEvent(event);
+ });
+ }
+
+ qinput.addEventListener('focus', placeCursorAtEndOnce, false);
+ qinput.focus();
+ }
+
+ // vanilla js version of search_on_category_select.js
+ if (qinput !== null && searx.search_on_category_select) {
+ d.querySelector('.help').className='invisible';
+
+ searx.on('#categories input', 'change', function(e) {
+ var i, categories = d.querySelectorAll('#categories input[type="checkbox"]');
+ for(i=0; i svg,
+.leaflet-pane > canvas,
+.leaflet-zoom-box,
+.leaflet-image-layer,
+.leaflet-layer {
+ position: absolute;
+ left: 0;
+ top: 0;
+ }
+.leaflet-container {
+ overflow: hidden;
+ }
+.leaflet-tile,
+.leaflet-marker-icon,
+.leaflet-marker-shadow {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+ -webkit-user-drag: none;
+ }
+/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
+.leaflet-safari .leaflet-tile {
+ image-rendering: -webkit-optimize-contrast;
+ }
+/* hack that prevents hw layers "stretching" when loading new tiles */
+.leaflet-safari .leaflet-tile-container {
+ width: 1600px;
+ height: 1600px;
+ -webkit-transform-origin: 0 0;
+ }
+.leaflet-marker-icon,
+.leaflet-marker-shadow {
+ display: block;
+ }
+/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
+/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
+.leaflet-container .leaflet-overlay-pane svg,
+.leaflet-container .leaflet-marker-pane img,
+.leaflet-container .leaflet-shadow-pane img,
+.leaflet-container .leaflet-tile-pane img,
+.leaflet-container img.leaflet-image-layer {
+ max-width: none !important;
+ }
+
+.leaflet-container.leaflet-touch-zoom {
+ -ms-touch-action: pan-x pan-y;
+ touch-action: pan-x pan-y;
+ }
+.leaflet-container.leaflet-touch-drag {
+ -ms-touch-action: pinch-zoom;
+ }
+.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
+ -ms-touch-action: none;
+ touch-action: none;
+}
+.leaflet-tile {
+ filter: inherit;
+ visibility: hidden;
+ }
+.leaflet-tile-loaded {
+ visibility: inherit;
+ }
+.leaflet-zoom-box {
+ width: 0;
+ height: 0;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ z-index: 800;
+ }
+/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
+.leaflet-overlay-pane svg {
+ -moz-user-select: none;
+ }
+
+.leaflet-pane { z-index: 400; }
+
+.leaflet-tile-pane { z-index: 200; }
+.leaflet-overlay-pane { z-index: 400; }
+.leaflet-shadow-pane { z-index: 500; }
+.leaflet-marker-pane { z-index: 600; }
+.leaflet-tooltip-pane { z-index: 650; }
+.leaflet-popup-pane { z-index: 700; }
+
+.leaflet-map-pane canvas { z-index: 100; }
+.leaflet-map-pane svg { z-index: 200; }
+
+.leaflet-vml-shape {
+ width: 1px;
+ height: 1px;
+ }
+.lvml {
+ behavior: url(#default#VML);
+ display: inline-block;
+ position: absolute;
+ }
+
+
+/* control positioning */
+
+.leaflet-control {
+ position: relative;
+ z-index: 800;
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
+ pointer-events: auto;
+ }
+.leaflet-top,
+.leaflet-bottom {
+ position: absolute;
+ z-index: 1000;
+ pointer-events: none;
+ }
+.leaflet-top {
+ top: 0;
+ }
+.leaflet-right {
+ right: 0;
+ }
+.leaflet-bottom {
+ bottom: 0;
+ }
+.leaflet-left {
+ left: 0;
+ }
+.leaflet-control {
+ float: left;
+ clear: both;
+ }
+.leaflet-right .leaflet-control {
+ float: right;
+ }
+.leaflet-top .leaflet-control {
+ margin-top: 10px;
+ }
+.leaflet-bottom .leaflet-control {
+ margin-bottom: 10px;
+ }
+.leaflet-left .leaflet-control {
+ margin-left: 10px;
+ }
+.leaflet-right .leaflet-control {
+ margin-right: 10px;
+ }
+
+
+/* zoom and fade animations */
+
+.leaflet-fade-anim .leaflet-tile {
+ will-change: opacity;
+ }
+.leaflet-fade-anim .leaflet-popup {
+ opacity: 0;
+ -webkit-transition: opacity 0.2s linear;
+ -moz-transition: opacity 0.2s linear;
+ -o-transition: opacity 0.2s linear;
+ transition: opacity 0.2s linear;
+ }
+.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
+ opacity: 1;
+ }
+.leaflet-zoom-animated {
+ -webkit-transform-origin: 0 0;
+ -ms-transform-origin: 0 0;
+ transform-origin: 0 0;
+ }
+.leaflet-zoom-anim .leaflet-zoom-animated {
+ will-change: transform;
+ }
+.leaflet-zoom-anim .leaflet-zoom-animated {
+ -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
+ -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
+ -o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1);
+ transition: transform 0.25s cubic-bezier(0,0,0.25,1);
+ }
+.leaflet-zoom-anim .leaflet-tile,
+.leaflet-pan-anim .leaflet-tile {
+ -webkit-transition: none;
+ -moz-transition: none;
+ -o-transition: none;
+ transition: none;
+ }
+
+.leaflet-zoom-anim .leaflet-zoom-hide {
+ visibility: hidden;
+ }
+
+
+/* cursors */
+
+.leaflet-interactive {
+ cursor: pointer;
+ }
+.leaflet-grab {
+ cursor: -webkit-grab;
+ cursor: -moz-grab;
+ }
+.leaflet-crosshair,
+.leaflet-crosshair .leaflet-interactive {
+ cursor: crosshair;
+ }
+.leaflet-popup-pane,
+.leaflet-control {
+ cursor: auto;
+ }
+.leaflet-dragging .leaflet-grab,
+.leaflet-dragging .leaflet-grab .leaflet-interactive,
+.leaflet-dragging .leaflet-marker-draggable {
+ cursor: move;
+ cursor: -webkit-grabbing;
+ cursor: -moz-grabbing;
+ }
+
+/* marker & overlays interactivity */
+.leaflet-marker-icon,
+.leaflet-marker-shadow,
+.leaflet-image-layer,
+.leaflet-pane > svg path,
+.leaflet-tile-container {
+ pointer-events: none;
+ }
+
+.leaflet-marker-icon.leaflet-interactive,
+.leaflet-image-layer.leaflet-interactive,
+.leaflet-pane > svg path.leaflet-interactive {
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
+ pointer-events: auto;
+ }
+
+/* visual tweaks */
+
+.leaflet-container {
+ background: #ddd;
+ outline: 0;
+ }
+.leaflet-container a {
+ color: #0078A8;
+ }
+.leaflet-container a.leaflet-active {
+ outline: 2px solid orange;
+ }
+.leaflet-zoom-box {
+ border: 2px dotted #38f;
+ background: rgba(255,255,255,0.5);
+ }
+
+
+/* general typography */
+.leaflet-container {
+ font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
+ }
+
+
+/* general toolbar styles */
+
+.leaflet-bar {
+ box-shadow: 0 1px 5px rgba(0,0,0,0.65);
+ border-radius: 4px;
+ }
+.leaflet-bar a,
+.leaflet-bar a:hover {
+ background-color: #fff;
+ border-bottom: 1px solid #ccc;
+ width: 26px;
+ height: 26px;
+ line-height: 26px;
+ display: block;
+ text-align: center;
+ text-decoration: none;
+ color: black;
+ }
+.leaflet-bar a,
+.leaflet-control-layers-toggle {
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+ display: block;
+ }
+.leaflet-bar a:hover {
+ background-color: #f4f4f4;
+ }
+.leaflet-bar a:first-child {
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ }
+.leaflet-bar a:last-child {
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ border-bottom: none;
+ }
+.leaflet-bar a.leaflet-disabled {
+ cursor: default;
+ background-color: #f4f4f4;
+ color: #bbb;
+ }
+
+.leaflet-touch .leaflet-bar a {
+ width: 30px;
+ height: 30px;
+ line-height: 30px;
+ }
+
+
+/* zoom control */
+
+.leaflet-control-zoom-in,
+.leaflet-control-zoom-out {
+ font: bold 18px 'Lucida Console', Monaco, monospace;
+ text-indent: 1px;
+ }
+.leaflet-control-zoom-out {
+ font-size: 20px;
+ }
+
+.leaflet-touch .leaflet-control-zoom-in {
+ font-size: 22px;
+ }
+.leaflet-touch .leaflet-control-zoom-out {
+ font-size: 24px;
+ }
+
+
+/* layers control */
+
+.leaflet-control-layers {
+ box-shadow: 0 1px 5px rgba(0,0,0,0.4);
+ background: #fff;
+ border-radius: 5px;
+ }
+.leaflet-control-layers-toggle {
+ background-image: url(images/layers.png);
+ width: 36px;
+ height: 36px;
+ }
+.leaflet-retina .leaflet-control-layers-toggle {
+ background-image: url(images/layers-2x.png);
+ background-size: 26px 26px;
+ }
+.leaflet-touch .leaflet-control-layers-toggle {
+ width: 44px;
+ height: 44px;
+ }
+.leaflet-control-layers .leaflet-control-layers-list,
+.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
+ display: none;
+ }
+.leaflet-control-layers-expanded .leaflet-control-layers-list {
+ display: block;
+ position: relative;
+ }
+.leaflet-control-layers-expanded {
+ padding: 6px 10px 6px 6px;
+ color: #333;
+ background: #fff;
+ }
+.leaflet-control-layers-scrollbar {
+ overflow-y: scroll;
+ padding-right: 5px;
+ }
+.leaflet-control-layers-selector {
+ margin-top: 2px;
+ position: relative;
+ top: 1px;
+ }
+.leaflet-control-layers label {
+ display: block;
+ }
+.leaflet-control-layers-separator {
+ height: 0;
+ border-top: 1px solid #ddd;
+ margin: 5px -10px 5px -6px;
+ }
+
+/* Default icon URLs */
+.leaflet-default-icon-path {
+ background-image: url(images/marker-icon.png);
+ }
+
+
+/* attribution and scale controls */
+
+.leaflet-container .leaflet-control-attribution {
+ background: #fff;
+ background: rgba(255, 255, 255, 0.7);
+ margin: 0;
+ }
+.leaflet-control-attribution,
+.leaflet-control-scale-line {
+ padding: 0 5px;
+ color: #333;
+ }
+.leaflet-control-attribution a {
+ text-decoration: none;
+ }
+.leaflet-control-attribution a:hover {
+ text-decoration: underline;
+ }
+.leaflet-container .leaflet-control-attribution,
+.leaflet-container .leaflet-control-scale {
+ font-size: 11px;
+ }
+.leaflet-left .leaflet-control-scale {
+ margin-left: 5px;
+ }
+.leaflet-bottom .leaflet-control-scale {
+ margin-bottom: 5px;
+ }
+.leaflet-control-scale-line {
+ border: 2px solid #777;
+ border-top: none;
+ line-height: 1.1;
+ padding: 2px 5px 1px;
+ font-size: 11px;
+ white-space: nowrap;
+ overflow: hidden;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+
+ background: #fff;
+ background: rgba(255, 255, 255, 0.5);
+ }
+.leaflet-control-scale-line:not(:first-child) {
+ border-top: 2px solid #777;
+ border-bottom: none;
+ margin-top: -2px;
+ }
+.leaflet-control-scale-line:not(:first-child):not(:last-child) {
+ border-bottom: 2px solid #777;
+ }
+
+.leaflet-touch .leaflet-control-attribution,
+.leaflet-touch .leaflet-control-layers,
+.leaflet-touch .leaflet-bar {
+ box-shadow: none;
+ }
+.leaflet-touch .leaflet-control-layers,
+.leaflet-touch .leaflet-bar {
+ border: 2px solid rgba(0,0,0,0.2);
+ background-clip: padding-box;
+ }
+
+
+/* popup */
+
+.leaflet-popup {
+ position: absolute;
+ text-align: center;
+ margin-bottom: 20px;
+ }
+.leaflet-popup-content-wrapper {
+ padding: 1px;
+ text-align: left;
+ border-radius: 12px;
+ }
+.leaflet-popup-content {
+ margin: 13px 19px;
+ line-height: 1.4;
+ }
+.leaflet-popup-content p {
+ margin: 18px 0;
+ }
+.leaflet-popup-tip-container {
+ width: 40px;
+ height: 20px;
+ position: absolute;
+ left: 50%;
+ margin-left: -20px;
+ overflow: hidden;
+ pointer-events: none;
+ }
+.leaflet-popup-tip {
+ width: 17px;
+ height: 17px;
+ padding: 1px;
+
+ margin: -10px auto 0;
+
+ -webkit-transform: rotate(45deg);
+ -moz-transform: rotate(45deg);
+ -ms-transform: rotate(45deg);
+ -o-transform: rotate(45deg);
+ transform: rotate(45deg);
+ }
+.leaflet-popup-content-wrapper,
+.leaflet-popup-tip {
+ background: white;
+ color: #333;
+ box-shadow: 0 3px 14px rgba(0,0,0,0.4);
+ }
+.leaflet-container a.leaflet-popup-close-button {
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 4px 4px 0 0;
+ border: none;
+ text-align: center;
+ width: 18px;
+ height: 14px;
+ font: 16px/14px Tahoma, Verdana, sans-serif;
+ color: #c3c3c3;
+ text-decoration: none;
+ font-weight: bold;
+ background: transparent;
+ }
+.leaflet-container a.leaflet-popup-close-button:hover {
+ color: #999;
+ }
+.leaflet-popup-scrolled {
+ overflow: auto;
+ border-bottom: 1px solid #ddd;
+ border-top: 1px solid #ddd;
+ }
+
+.leaflet-oldie .leaflet-popup-content-wrapper {
+ zoom: 1;
+ }
+.leaflet-oldie .leaflet-popup-tip {
+ width: 24px;
+ margin: 0 auto;
+
+ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
+ filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
+ }
+.leaflet-oldie .leaflet-popup-tip-container {
+ margin-top: -1px;
+ }
+
+.leaflet-oldie .leaflet-control-zoom,
+.leaflet-oldie .leaflet-control-layers,
+.leaflet-oldie .leaflet-popup-content-wrapper,
+.leaflet-oldie .leaflet-popup-tip {
+ border: 1px solid #999;
+ }
+
+
+/* div icon */
+
+.leaflet-div-icon {
+ background: #fff;
+ border: 1px solid #666;
+ }
+
+
+/* Tooltip */
+/* Base styles for the element that has a tooltip */
+.leaflet-tooltip {
+ position: absolute;
+ padding: 6px;
+ background-color: #fff;
+ border: 1px solid #fff;
+ border-radius: 3px;
+ color: #222;
+ white-space: nowrap;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ pointer-events: none;
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4);
+ }
+.leaflet-tooltip.leaflet-clickable {
+ cursor: pointer;
+ pointer-events: auto;
+ }
+.leaflet-tooltip-top:before,
+.leaflet-tooltip-bottom:before,
+.leaflet-tooltip-left:before,
+.leaflet-tooltip-right:before {
+ position: absolute;
+ pointer-events: none;
+ border: 6px solid transparent;
+ background: transparent;
+ content: "";
+ }
+
+/* Directions */
+
+.leaflet-tooltip-bottom {
+ margin-top: 6px;
+}
+.leaflet-tooltip-top {
+ margin-top: -6px;
+}
+.leaflet-tooltip-bottom:before,
+.leaflet-tooltip-top:before {
+ left: 50%;
+ margin-left: -6px;
+ }
+.leaflet-tooltip-top:before {
+ bottom: 0;
+ margin-bottom: -12px;
+ border-top-color: #fff;
+ }
+.leaflet-tooltip-bottom:before {
+ top: 0;
+ margin-top: -12px;
+ margin-left: -6px;
+ border-bottom-color: #fff;
+ }
+.leaflet-tooltip-left {
+ margin-left: -6px;
+}
+.leaflet-tooltip-right {
+ margin-left: 6px;
+}
+.leaflet-tooltip-left:before,
+.leaflet-tooltip-right:before {
+ top: 50%;
+ margin-top: -6px;
+ }
+.leaflet-tooltip-left:before {
+ right: 0;
+ margin-right: -12px;
+ border-left-color: #fff;
+ }
+.leaflet-tooltip-right:before {
+ left: 0;
+ margin-left: -12px;
+ border-right-color: #fff;
+ }
diff --git a/searx/static/themes/simple/leaflet/leaflet.js b/searx/static/themes/simple/leaflet/leaflet.js
new file mode 100644
index 000000000..24042d125
--- /dev/null
+++ b/searx/static/themes/simple/leaflet/leaflet.js
@@ -0,0 +1,9 @@
+/*
+ Leaflet 1.0.3+ed36a04, a JS library for interactive maps. http://leafletjs.com
+ (c) 2010-2016 Vladimir Agafonkin, (c) 2010-2011 CloudMade
+*/
+!function(t,e,i){function n(){var e=t.L;o.noConflict=function(){return t.L=e,this},t.L=o}var o={version:"1.0.3+ed36a04"};"object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),"undefined"!=typeof t&&n(),o.Util={extend:function(t){var e,i,n,o;for(i=1,n=arguments.length;i1}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new o.Point(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new o.Point(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new o.Point(t.x,t.y):new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,r=s.x>=e.x&&n.x<=i.x,a=s.y>=e.y&&n.y<=i.y;return r&&a},overlaps:function(t){t=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,r=s.x>e.x&&n.xe.y&&n.y0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,r=n.length;s=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),r=s.lat>=e.lat&&n.lat<=i.lat,a=s.lng>=e.lng&&n.lng<=i.lng;return r&&a},overlaps:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),r=s.lat>e.lat&&n.late.lng&&n.lngthis.options.maxZoom?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,o.latLngBounds(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},invalidateSize:function(t){if(!this._loaded)return this;t=o.extend({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),r=n.subtract(s);return r.x||r.y?(t.animate&&t.pan?this.panBy(r):(t.pan&&this._rawPanBy(r),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=o.extend({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=n.toBounds(t.coords.accuracy),r=this._locateOptions;if(r.setView){var a=this.getBoundsZoom(s);this.setView(n,r.maxZoom?Math.min(a,r.maxZoom):a)}var h={latlng:n,bounds:s,timestamp:t.timestamp};for(var l in t.coords)"number"==typeof t.coords[l]&&(h[l]=t.coords[l]);this.fire("locationfound",h)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=i,this._containerId=i}o.DomUtil.remove(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this._loaded&&this.fire("unload");for(var t in this._layers)this._layers[t].remove();return this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=o.DomUtil.create("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t),i=o.point(i||[0,0]);var n=this.getZoom()||0,s=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),h=t.getSouthEast(),l=this.getSize().subtract(i),u=o.bounds(this.project(h,n),this.project(a,n)).getSize(),c=o.Browser.any3d?this.options.zoomSnap:1,d=Math.min(l.x/u.x,l.y/u.y);return n=this.getScaleZoom(d,n),c&&(n=Math.round(n/(c/100))*(c/100),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(s,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new o.Point(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new o.Bounds(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===i?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=e===i?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=e===i?this._zoom:e;var o=n.zoom(t*n.scale(e));return isNaN(o)?1/0:o},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(o.latLng(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(o.latLng(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(o.latLngBounds(t))},distance:function(t,e){return this.options.crs.distance(o.latLng(t),o.latLng(e))},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");o.DomEvent.addListener(e,"scroll",this._onScroll,this),this._containerId=o.Util.stamp(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&o.Browser.any3d,
+o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(o.Browser.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,"leaflet-zoom-hide"),o.DomUtil.addClass(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){o.DomUtil.setPosition(this._mapPane,new o.Point(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t){return t&&this.fire("zoomstart"),this.fire("movestart")},_move:function(t,e,n){e===i&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return o.Util.cancelAnimFrame(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){this._targets={},this._targets[o.stamp(this._container)]=this;var i=e?"off":"on";o.DomEvent[i](this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this),this.options.trackResize&&o.DomEvent[i](t,"resize",this._onResize,this),o.Browser.any3d&&this.options.transform3DLimit&&this[i]("moveend",this._onMoveEnd)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],s="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if(i=this._targets[o.stamp(r)],i&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(s&&!o.DomEvent._isExternalTarget(r,t))break;if(n.push(i),s)break}if(r===this._container)break;r=r.parentNode}return n.length||a||s||!o.DomEvent._isExternalTarget(r,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e="keypress"===t.type&&13===t.keyCode?"click":t.type;"mousedown"===e&&o.DomUtil.preventOutline(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_fireDOMEvent:function(t,e,i){if("click"===t.type){var n=o.Util.extend({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}if(!t._stopped&&(i=(i||[]).concat(this._findEventTargets(t,e)),i.length)){var s=i[0];"contextmenu"===e&&s.listens(e,!0)&&o.DomEvent.preventDefault(t);var r={originalEvent:t};if("keypress"!==t.type){var a=s instanceof o.Marker;r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var h=0;h0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=o.Browser.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return!((e&&e.animate)!==!0&&!this.getSize().contains(i))&&(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=o.DomUtil.create("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=o.DomUtil.TRANSFORM,n=t.style[i];o.DomUtil.setTransform(t,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===t.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",function(){var e=this.getCenter(),i=this.getZoom();o.DomUtil.setTransform(t,this.project(e,i),this.getZoomScale(i,1))},this)},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),s=this._getCenterOffset(t)._divideBy(1-1/n);return!(i.animate!==!0&&!this.getSize().contains(s))&&(o.Util.requestAnimFrame(function(){this._moveStart(!0)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(o.bind(this._onZoomTransitionEnd,this),250)},_onZoomTransitionEnd:function(){this._animatingZoom&&(o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),o.Util.requestAnimFrame(function(){this._moveEnd(!0)},this))}}),o.map=function(t,e){return new o.Map(t,e)},o.Layer=o.Evented.extend({options:{pane:"overlayPane",nonBubblingEvents:[],attribution:null},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[o.stamp(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[o.stamp(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}}),o.Map.include({addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&o.stamp(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===i&&this._layersMinZoom&&this.getZoom()100&&n<500||t.target._simulatedClick&&!t._simulated?void o.DomEvent.stop(t):(o.DomEvent._lastClick=i,void e(t))}},o.DomEvent.addListener=o.DomEvent.on,o.DomEvent.removeListener=o.DomEvent.off,o.PosAnimation=o.Evented.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e1e-7;l++)e=r*Math.sin(h),e=Math.pow((1-e)/(1+e),r/2),u=Math.PI/2-2*Math.atan(a*e)-h,h+=u;return new o.LatLng(h*i,t.x*i/n)}},o.CRS.EPSG3395=o.extend({},o.CRS.Earth,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=.5/(Math.PI*o.Projection.Mercator.R);return new o.Transformation(t,.5,-t,.5)}()}),o.GridLayer=o.Layer.extend({options:{tileSize:256,opacity:1,updateWhenIdle:o.Browser.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:i,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){o.setOptions(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),o.DomUtil.remove(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=null},bringToFront:function(){return this._map&&(o.DomUtil.toFront(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(o.DomUtil.toBack(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=o.Util.throttle(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return e.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof o.Point?t:new o.Point(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-(1/0),1/0),o=0,s=i.length;othis.options.maxZoom||in&&this._retainParent(s,r,a,n))},_retainChildren:function(t,e,i,n){for(var s=2*t;s<2*t+2;s++)for(var r=2*e;r<2*e+2;r++){var a=new o.Point(s,r);a.z=i+1;var h=this._tileCoordsToKey(a),l=this._tiles[h];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1this.options.maxZoom||this.options.minZoom!==i&&s1)return void this._setView(t,s);for(var m=a.min.y;m<=a.max.y;m++)for(var p=a.min.x;p<=a.max.x;p++){var f=new o.Point(p,m);if(f.z=this._tileZoom,this._isValidTile(f)){var g=this._tiles[this._tileCoordsToKey(f)];g?g.current=!0:l.push(f)}}if(l.sort(function(t,e){return t.distanceTo(h)-e.distanceTo(h)}),0!==l.length){this._loading||(this._loading=!0,this.fire("loading"));var v=e.createDocumentFragment();for(p=0;pi.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return o.latLngBounds(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToBounds:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),s=n.add(i),r=e.unproject(n,t.z),a=e.unproject(s,t.z),h=new o.LatLngBounds(r,a);return this.options.noWrap||e.wrapLatLngBounds(h),h},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new o.Point(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(o.DomUtil.remove(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){o.DomUtil.addClass(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=o.Util.falseFn,t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity<1&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.android&&!o.Browser.android23&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o.bind(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&o.Util.requestAnimFrame(o.bind(this._tileReady,this,t,null,s)),o.DomUtil.setPosition(s,i),this._tiles[n]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){if(this._map){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);i=this._tiles[n],i&&(i.loaded=+new Date,this._map._fadeAnimated?(o.DomUtil.setOpacity(i.el,0),o.Util.cancelAnimFrame(this._fadeFrame),this._fadeFrame=o.Util.requestAnimFrame(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(o.DomUtil.addClass(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),o.Browser.ielt9||!this._map._fadeAnimated?o.Util.requestAnimFrame(this._pruneTiles,this):setTimeout(o.bind(this._pruneTiles,this),250)))}},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new o.Point(this._wrapX?o.Util.wrapNum(t.x,this._wrapX):t.x,this._wrapY?o.Util.wrapNum(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new o.Bounds(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),o.gridLayer=function(t){return new o.GridLayer(t)},o.TileLayer=o.GridLayer.extend({options:{minZoom:0,maxZoom:18,maxNativeZoom:null,minNativeZoom:null,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),o.Browser.android||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},createTile:function(t,i){var n=e.createElement("img");return o.DomEvent.on(n,"load",o.bind(this._tileOnLoad,this,i,n)),o.DomEvent.on(n,"error",o.bind(this._tileOnError,this,i,n)),this.options.crossOrigin&&(n.crossOrigin=""),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:o.Browser.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return o.Util.template(this._url,o.extend(e,this.options))},_tileOnLoad:function(t,e){o.Browser.ielt9?setTimeout(o.bind(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.src!==n&&(e.src=n),t(i,e)},getTileSize:function(){var t=this._map,e=o.GridLayer.prototype.getTileSize.call(this),i=this._tileZoom+this.options.zoomOffset,n=this.options.minNativeZoom,s=this.options.maxNativeZoom;return null!==n&&is?e.divideBy(t.getZoomScale(s,i)).round():e},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset,o=this.options.minNativeZoom,s=this.options.maxNativeZoom;return i&&(t=e-t),t+=n,null!==o&&ts?s:t},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=o.Util.falseFn,e.onerror=o.Util.falseFn,e.complete||(e.src=o.Util.emptyImageUrl,o.DomUtil.remove(e)))}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=o.setOptions(this,e),i.width=i.height=e.tileSize*(e.detectRetina&&o.Browser.retina?2:1),this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToBounds(t),i=this._crs.project(e.getNorthWest()),n=this._crs.project(e.getSouthEast()),s=(this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[n.y,i.x,i.y,n.x]:[i.x,n.y,n.x,i.y]).join(","),r=o.TileLayer.prototype.getTileUrl.call(this,t);return r+o.Util.getParamString(this.wmsParams,r,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.ImageOverlay=o.Layer.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(o.DomUtil.addClass(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){o.DomUtil.remove(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&o.DomUtil.toFront(this._image),this},bringToBack:function(){return this._map&&o.DomUtil.toBack(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=t,this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._image=o.DomUtil.create("img","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""));t.onselectstart=o.Util.falseFn,t.onmousemove=o.Util.falseFn,t.onload=o.bind(this.fire,this,"load"),this.options.crossOrigin&&(t.crossOrigin=""),t.src=this._url,t.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;
+o.DomUtil.setTransform(this._image,i,e)},_reset:function(){var t=this._image,e=new o.Bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();o.DomUtil.setPosition(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({initialize:function(t){o.setOptions(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var s=o.point(n),r=o.point("shadow"===e&&i.shadowAnchor||i.iconAnchor||s&&s.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return i=i||e.createElement("img"),i.src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return o.Icon.Default.imagePath||(o.Icon.Default.imagePath=this._detectIconPath()),(this.options.imagePath||o.Icon.Default.imagePath)+o.Icon.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=o.DomUtil.create("div","leaflet-default-icon-path",e.body),i=o.DomUtil.getStyle(t,"background-image")||o.DomUtil.getStyle(t,"backgroundImage");return e.body.removeChild(t),0===i.indexOf("url")?i.replace(/^url\([\"\']?/,"").replace(/marker-icon\.png[\"\']?\)$/,""):""}}),o.Marker=o.Layer.extend({options:{icon:new o.Icon.Default,interactive:!0,draggable:!1,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",nonBubblingEvents:["click","dblclick","mouseover","mouseout","contextmenu"]},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=o.latLng(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),t.alt&&(i.alt=t.alt)),o.DomUtil.addClass(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var s=t.icon.createShadow(this._shadow),r=!1;s!==this._shadow&&(this._removeShadow(),r=!0),s&&(o.DomUtil.addClass(s,e),s.alt=""),this._shadow=s,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),s&&r&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),o.DomUtil.remove(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&o.DomUtil.remove(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(o.DomUtil.addClass(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),o.Handler.MarkerDrag)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new o.Handler.MarkerDrag(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;o.DomUtil.setOpacity(this._icon,t),this._shadow&&o.DomUtil.setOpacity(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor||[0,0]},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor||[0,0]}}),o.marker=function(t,e){return new o.Marker(t,e)},o.DivIcon=o.Icon.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var i=t&&"DIV"===t.tagName?t:e.createElement("div"),n=this.options;if(i.innerHTML=n.html!==!1?n.html:"",n.bgPos){var s=o.point(n.bgPos);i.style.backgroundPosition=-s.x+"px "+-s.y+"px"}return this._setIconStyles(i,"icon"),i},createShadow:function(){return null}}),o.divIcon=function(t){return new o.DivIcon(t)},o.DivOverlay=o.Layer.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){o.setOptions(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&o.DomUtil.setOpacity(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&o.DomUtil.setOpacity(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(o.DomUtil.setOpacity(this._container,0),this._removeTimeout=setTimeout(o.bind(o.DomUtil.remove,o.DomUtil,this._container),200)):o.DomUtil.remove(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&o.DomUtil.toFront(this._container),this},bringToBack:function(){return this._map&&o.DomUtil.toBack(this._container),this},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=o.point(this.options.offset),i=this._getAnchor();this._zoomAnimated?o.DomUtil.setPosition(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,s=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=s+"px"}},_getAnchor:function(){return[0,0]}}),o.Popup=o.DivOverlay.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){o.DivOverlay.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof o.Path||this._source.on("preclick",o.DomEvent.stopPropagation))},onRemove:function(t){o.DivOverlay.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof o.Path||this._source.off("preclick",o.DomEvent.stopPropagation))},getEvents:function(){var t=o.DivOverlay.prototype.getEvents.call(this);return("closeOnClick"in this.options?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=o.DomUtil.create("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated");if(this.options.closeButton){var i=this._closeButton=o.DomUtil.create("a",t+"-close-button",e);i.href="#close",i.innerHTML="×",o.DomEvent.on(i,"click",this._onCloseButtonClick,this)}var n=this._wrapper=o.DomUtil.create("div",t+"-content-wrapper",e);this._contentNode=o.DomUtil.create("div",t+"-content",n),o.DomEvent.disableClickPropagation(n).disableScrollPropagation(this._contentNode).on(n,"contextmenu",o.DomEvent.stopPropagation),this._tipContainer=o.DomUtil.create("div",t+"-tip-container",e),this._tip=o.DomUtil.create("div",t+"-tip",this._tipContainer)},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,s=this.options.maxHeight,r="leaflet-popup-scrolled";s&&n>s?(e.height=s+"px",o.DomUtil.addClass(t,r)):o.DomUtil.removeClass(t,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();o.DomUtil.setPosition(this._container,e.add(i))},_adjustPan:function(){if(!(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)){var t=this._map,e=parseInt(o.DomUtil.getStyle(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,s=new o.Point(this._containerLeft,-i-this._containerBottom);s._add(o.DomUtil.getPosition(this._container));var r=t.layerPointToContainerPoint(s),a=o.point(this.options.autoPanPadding),h=o.point(this.options.autoPanPaddingTopLeft||a),l=o.point(this.options.autoPanPaddingBottomRight||a),u=t.getSize(),c=0,d=0;r.x+n+l.x>u.x&&(c=r.x+n-u.x+l.x),r.x-c-h.x<0&&(c=r.x-h.x),r.y+i+l.y>u.y&&(d=r.y+i-u.y+l.y),r.y-d-h.y<0&&(d=r.y-h.y),(c||d)&&t.fire("autopanstart").panBy([c,d])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)},_getAnchor:function(){return o.point(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.mergeOptions({closePopupOnClick:!0}),o.Map.include({openPopup:function(t,e,i){return t instanceof o.Popup||(t=new o.Popup(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),o.Layer.include({bindPopup:function(t,e){return t instanceof o.Popup?(o.setOptions(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new o.Popup(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){if(t instanceof o.Layer||(e=t,t=this),t instanceof o.FeatureGroup)for(var i in this._layers){t=this._layers[i];break}return e||(e=t.getCenter?t.getCenter():t.getLatLng()),this._popup&&this._map&&(this._popup._source=t,this._popup.update(),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;if(this._popup&&this._map)return o.DomEvent.stop(t),e instanceof o.Path?void this.openPopup(t.layer||t.target,t.latlng):void(this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.Tooltip=o.DivOverlay.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){o.DivOverlay.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){o.DivOverlay.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=o.DivOverlay.prototype.getEvents.call(this);return o.Browser.touch&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=o.DomUtil.create("div",e)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e=this._map,i=this._container,n=e.latLngToContainerPoint(e.getCenter()),s=e.layerPointToContainerPoint(t),r=this.options.direction,a=i.offsetWidth,h=i.offsetHeight,l=o.point(this.options.offset),u=this._getAnchor();"top"===r?t=t.add(o.point(-a/2+l.x,-h+l.y+u.y,!0)):"bottom"===r?t=t.subtract(o.point(a/2-l.x,-l.y,!0)):"center"===r?t=t.subtract(o.point(a/2+l.x,h/2-u.y+l.y,!0)):"right"===r||"auto"===r&&s.xh&&(s=r,h=a);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,r=e.x,a=e.y,h=i.x-r,l=i.y-a,u=h*h+l*l;return u>0&&(s=((t.x-r)*h+(t.y-a)*l)/u,s>1?(r=i.x,a=i.y):s>0&&(r+=h*s,a+=l*s)),h=t.x-r,l=t.y-a,n?h*h+l*l:new o.Point(r,a)}},o.Polyline=o.Path.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){o.setOptions(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,s=null,r=o.LineUtil._sqClosestPointOnSegment,a=0,h=this._parts.length;ae)return r=(n-e)/i,this._map.layerPointToLatLng([s.x-r*(s.x-o.x),s.y-r*(s.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=o.latLng(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new o.LatLngBounds,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return o.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=o.Polyline._flat(t),n=0,s=t.length;n=2&&e[0]instanceof o.LatLng&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){o.Polyline.prototype._setLatLngs.call(this,t),o.Polyline._flat(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return o.Polyline._flat(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new o.Point(e,e);if(t=new o.Bounds(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t)){if(this.options.noClip)return void(this._parts=this._rings);for(var n,s=0,r=this._rings.length;s ';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}(),o.SVG.include(o.Browser.vml?{_initContainer:function(){this._container=o.DomUtil.create("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(o.Renderer.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=o.SVG.create("shape");o.DomUtil.addClass(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=o.SVG.create("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[o.stamp(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;o.DomUtil.remove(e),t.removeInteractiveTarget(e),delete this._layers[o.stamp(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,s=t._container;s.stroked=!!n.stroke,s.filled=!!n.fill,n.stroke?(e||(e=t._stroke=o.SVG.create("stroke")),s.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=o.Util.isArray(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(s.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=o.SVG.create("fill")),s.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(s.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){o.DomUtil.toFront(t._container)},_bringToBack:function(t){o.DomUtil.toBack(t._container)}}:{}),o.Browser.vml&&(o.SVG.create=function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}()),o.Canvas=o.Renderer.extend({getEvents:function(){var t=o.Renderer.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){o.Renderer.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=e.createElement("canvas");o.DomEvent.on(t,"mousemove",o.Util.throttle(this._onMouseMove,32,this),this).on(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this).on(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={},o.Renderer.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=o.Browser.retina?2:1;o.DomUtil.setPosition(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",o.Browser.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){o.Renderer.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[o.stamp(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[o.stamp(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(t.options.dashArray){var e,i=t.options.dashArray.split(","),n=[];for(e=0;et.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(u=!u);return u||o.Polyline.prototype._containsPoint.call(this,t,!0)},o.CircleMarker.prototype._containsPoint=function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()},o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;e1)return void(this._moved=!0);var n=i.touches&&1===i.touches.length?i.touches[0]:i,s=new o.Point(n.clientX,n.clientY),r=s.subtract(this._startPoint);(r.x||r.y)&&(Math.abs(r.x)+Math.abs(r.y)50&&(this._positions.shift(),this._times.shift())}this._map.fire("move",t).fire("drag",t)},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,e,i){function n(t){var e;if(o.Browser.pointer){if(!o.Browser.edge||"mouse"===t.pointerType)return;e=o.DomEvent._pointersCount}else e=t.touches.length;if(!(e>1)){var i=Date.now(),n=i-(r||i);a=t.touches?t.touches[0]:t,h=n>0&&n<=l,r=i}}function s(t){if(h&&!a.cancelBubble){if(o.Browser.pointer){if(!o.Browser.edge||"mouse"===t.pointerType)return;var i,n,s={};for(n in a)i=a[n],s[n]=i&&i.bind?i.bind(a):i;a=s}a.type="dblclick",e(a),r=null}}var r,a,h=!1,l=250,u="_leaflet_",c=this._touchstart,d=this._touchend;return t[u+c+i]=n,t[u+d+i]=s,t[u+"dblclick"+i]=e,t.addEventListener(c,n,!1),t.addEventListener(d,s,!1),t.addEventListener("dblclick",e,!1),this},removeDoubleTapListener:function(t,e){var i="_leaflet_",n=t[i+this._touchstart+e],s=t[i+this._touchend+e],r=t[i+"dblclick"+e];return t.removeEventListener(this._touchstart,n,!1),t.removeEventListener(this._touchend,s,!1),o.Browser.edge||t.removeEventListener("dblclick",r,!1),this}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",TAG_WHITE_LIST:["INPUT","SELECT","OPTION"],_pointers:{},_pointersCount:0,addPointerListener:function(t,e,i,n){return"touchstart"===e?this._addPointerStart(t,i,n):"touchmove"===e?this._addPointerMove(t,i,n):"touchend"===e&&this._addPointerEnd(t,i,n),this},removePointerListener:function(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(this.POINTER_DOWN,n,!1):"touchmove"===e?t.removeEventListener(this.POINTER_MOVE,n,!1):"touchend"===e&&(t.removeEventListener(this.POINTER_UP,n,!1),t.removeEventListener(this.POINTER_CANCEL,n,!1)),this},_addPointerStart:function(t,i,n){var s=o.bind(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(this.TAG_WHITE_LIST.indexOf(t.target.tagName)<0))return;o.DomEvent.preventDefault(t)}this._handlePointer(t,i)},this);if(t["_leaflet_touchstart"+n]=s,t.addEventListener(this.POINTER_DOWN,s,!1),!this._pointerDocListener){var r=o.bind(this._globalPointerUp,this);e.documentElement.addEventListener(this.POINTER_DOWN,o.bind(this._globalPointerDown,this),!0),e.documentElement.addEventListener(this.POINTER_MOVE,o.bind(this._globalPointerMove,this),!0),e.documentElement.addEventListener(this.POINTER_UP,r,!0),e.documentElement.addEventListener(this.POINTER_CANCEL,r,!0),this._pointerDocListener=!0}},_globalPointerDown:function(t){this._pointers[t.pointerId]=t,this._pointersCount++},_globalPointerMove:function(t){this._pointers[t.pointerId]&&(this._pointers[t.pointerId]=t)},_globalPointerUp:function(t){delete this._pointers[t.pointerId],this._pointersCount--},_handlePointer:function(t,e){t.touches=[];for(var i in this._pointers)t.touches.push(this._pointers[i]);t.changedTouches=[t],e(t)},_addPointerMove:function(t,e,i){var n=o.bind(function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&this._handlePointer(t,e)},this);t["_leaflet_touchmove"+i]=n,t.addEventListener(this.POINTER_MOVE,n,!1)},_addPointerEnd:function(t,e,i){var n=o.bind(function(t){this._handlePointer(t,e)},this);t["_leaflet_touchend"+i]=n,t.addEventListener(this.POINTER_UP,n,!1),t.addEventListener(this.POINTER_CANCEL,n,!1)}}),o.Map.mergeOptions({touchZoom:o.Browser.touch&&!o.Browser.android23,bounceAtZoomLimits:!0}),o.Map.TouchZoom=o.Handler.extend({addHooks:function(){o.DomUtil.addClass(this._map._container,"leaflet-touch-zoom"),o.DomEvent.on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){o.DomUtil.removeClass(this._map._container,"leaflet-touch-zoom"),o.DomEvent.off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var n=i.mouseEventToContainerPoint(t.touches[0]),s=i.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=i.getSize()._divideBy(2),this._startLatLng=i.containerPointToLatLng(this._centerPoint),"center"!==i.options.touchZoom&&(this._pinchStartLatLng=i.containerPointToLatLng(n.add(s)._divideBy(2))),this._startDist=n.distanceTo(s),this._startZoom=i.getZoom(),this._moved=!1,this._zooming=!0,i._stop(),o.DomEvent.on(e,"touchmove",this._onTouchMove,this).on(e,"touchend",this._onTouchEnd,this),o.DomEvent.preventDefault(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest);var a=o.bind(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=o.Util.requestAnimFrame(a,this,!0),o.DomEvent.preventDefault(t)}},_onTouchEnd:function(){return this._moved&&this._zooming?(this._zooming=!1,o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd),void(this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom)))):void(this._zooming=!1)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),this._simulateEvent("mousedown",i),o.DomEvent.on(e,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._simulateEvent("mouseup",i),
+this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_resetState:function(){this._moved=!1},_onMouseDown:function(t){return!(!t.shiftKey||1!==t.which&&1!==t.button)&&(this._resetState(),o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startPoint=this._map.mouseEventToContainerPoint(t),void o.DomEvent.on(e,{contextmenu:o.DomEvent.stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this))},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=o.DomUtil.create("div","leaflet-zoom-box",this._container),o.DomUtil.addClass(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new o.Bounds(this._point,this._startPoint),i=e.getSize();o.DomUtil.setPosition(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(o.DomUtil.remove(this._box),o.DomUtil.removeClass(this._container,"leaflet-crosshair")),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,{contextmenu:o.DomEvent.stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){setTimeout(o.bind(this._resetState,this),0);var e=new o.LatLngBounds(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanDelta:80}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),o.DomEvent.on(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),o.DomEvent.off(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e0&&t.screenY>0&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){function t(t,s){var r=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",r,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){o.DomUtil.remove(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,s){var r=o.DomUtil.create("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),o.DomEvent.on(r,"mousedown dblclick",o.DomEvent.stopPropagation).on(r,"click",o.DomEvent.stop).on(r,"click",s,this).on(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&o.DomUtil.addClass(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet '},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent&&o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(new o.Control.Attribution).addTo(this)}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=o.DomUtil.create("div",e,i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(o.stamp(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,i){var n=' ",o=e.createElement("div");return o.innerHTML=n,o.firstChild},_addItem:function(t){var i,n=e.createElement("label"),s=this._map.hasLayer(t.layer);t.overlay?(i=e.createElement("input"),i.type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=s):i=this._createRadioElement("leaflet-base-layers",s),i.layerId=o.stamp(t.layer),o.DomEvent.on(i,"click",this._onInputClick,this);var r=e.createElement("span");r.innerHTML=" "+t.name;var a=e.createElement("div");n.appendChild(a),a.appendChild(i),a.appendChild(r);var h=t.overlay?this._overlaysList:this._baseLayersList;return h.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,i,n=this._form.getElementsByTagName("input"),o=[],s=[];this._handlingClick=!0;for(var r=n.length-1;r>=0;r--)t=n[r],e=this._getLayer(t.layerId).layer,i=this._map.hasLayer(e),t.checked&&!i?o.push(e):!t.checked&&i&&s.push(e);for(r=0;r=0;s--)t=n[s],e=this._getLayer(t.layerId).layer,t.disabled=e.options.minZoom!==i&&oe.options.maxZoom},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)}}(window,document);
\ No newline at end of file
diff --git a/searx/static/themes/simple/less/autocomplete.less b/searx/static/themes/simple/less/autocomplete.less
new file mode 100644
index 000000000..0a90d0df8
--- /dev/null
+++ b/searx/static/themes/simple/less/autocomplete.less
@@ -0,0 +1,67 @@
+@background_color: white;
+
+.autocomplete {
+ position: absolute;
+ max-height: 0;
+ overflow-y: hidden;
+ text-align: left;
+
+ &:active, &:focus, &:hover {
+ background-color: @background_color;
+ }
+
+ &:empty {
+ display: none;
+ }
+
+ > ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+
+ > li {
+ cursor: pointer;
+ padding: 5px 0 5px 10px;
+
+ &.active, &:active, &:focus {
+ background-color: @color-base;
+
+ a:active, a:focus, a:hover {
+ text-decoration: none;
+ }
+ }
+
+ &.locked {
+ cursor: inherit;
+ }
+ }
+ }
+
+ &.open {
+ display: block;
+ background-color: @background_color;
+ border: 1px solid @color-base;
+ max-height: 500px;
+ overflow-y: auto;
+ z-index:100;
+
+ &:empty {
+ display: none;
+ }
+ }
+}
+
+
+@media screen and (max-width: @results-width) {
+
+ .autocomplete {
+ bottom: 0;
+ }
+
+ .autocomplete > ul > li {
+ padding: 7px 0 7px 10px;
+ border-bottom: 1px solid @color-result-top-border;
+ text-align: left;
+ }
+
+}
diff --git a/searx/static/themes/simple/less/code.less b/searx/static/themes/simple/less/code.less
new file mode 100644
index 000000000..a688dd98d
--- /dev/null
+++ b/searx/static/themes/simple/less/code.less
@@ -0,0 +1,83 @@
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #f8f8f8; }
+.highlight .c { color: #408080; font-style: italic } /* Comment */
+.highlight .err { border: 1px solid #FF0000 } /* Error */
+.highlight .k { color: #008000; font-weight: bold } /* Keyword */
+.highlight .o { color: #666666 } /* Operator */
+.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
+.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
+.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #008000 } /* Keyword.Pseudo */
+.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #B00040 } /* Keyword.Type */
+.highlight .m { color: #666666 } /* Literal.Number */
+.highlight .s { color: #BA2121 } /* Literal.String */
+.highlight .na { color: #7D9029 } /* Name.Attribute */
+.highlight .nb { color: #008000 } /* Name.Builtin */
+.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
+.highlight .no { color: #880000 } /* Name.Constant */
+.highlight .nd { color: #AA22FF } /* Name.Decorator */
+.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0000FF } /* Name.Function */
+.highlight .nl { color: #A0A000 } /* Name.Label */
+.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
+.highlight .nv { color: #19177C } /* Name.Variable */
+.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mf { color: #666666 } /* Literal.Number.Float */
+.highlight .mh { color: #666666 } /* Literal.Number.Hex */
+.highlight .mi { color: #666666 } /* Literal.Number.Integer */
+.highlight .mo { color: #666666 } /* Literal.Number.Oct */
+.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
+.highlight .sc { color: #BA2121 } /* Literal.String.Char */
+.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
+.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
+.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
+.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+.highlight .sx { color: #008000 } /* Literal.String.Other */
+.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
+.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
+.highlight .ss { color: #19177C } /* Literal.String.Symbol */
+.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
+.highlight .vc { color: #19177C } /* Name.Variable.Class */
+.highlight .vg { color: #19177C } /* Name.Variable.Global */
+.highlight .vi { color: #19177C } /* Name.Variable.Instance */
+.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
+
+.highlight pre {
+ overflow: auto;
+}
+
+.highlight .lineno {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ cursor: default;
+
+ &::selection {
+ background: transparent; /* WebKit/Blink Browsers */
+ }
+ &::-moz-selection {
+ background: transparent; /* Gecko Browsers */
+ }
+}
diff --git a/searx/static/themes/simple/less/definitions.less b/searx/static/themes/simple/less/definitions.less
new file mode 100644
index 000000000..7a43720b8
--- /dev/null
+++ b/searx/static/themes/simple/less/definitions.less
@@ -0,0 +1,135 @@
+/*
+ * searx, A privacy-respecting, hackable metasearch engine
+ *
+ * To change the colors of the site, simple edit this variables
+ */
+
+/// Basic Colors
+
+@color-base: #3498DB;
+@color-base-dark: #084999;
+@color-base-light: #ECF0F1;
+@color-highlight: #094089;
+@color-black: #000000;
+
+///
+@color-error: #db3434;
+@color-error-background: lighten(@color-error, 40%);
+
+@color-warning: #dbba34;
+@color-warning-background: lighten(@color-warning, 40%);
+
+/// General
+
+@color-font: #444;
+@color-font-light: #888;
+
+@color-red: #25a55b;
+
+@color-url-font: #29314d;
+@color-url-visited-font: #684898;
+@results-width: 50em;
+@search-width: 40em;
+
+//
+@color-a-font: @color-base;
+@color-a-font-hover: @color-base;
+
+
+/// Start-Screen
+
+
+
+/// Search-Input
+
+@color-search-border: @color-base;
+@color-search-background: #FFF;
+@color-search-font: #222;
+
+/// Autocompleter
+
+@color-autocompleter-choices-background: #FFF;
+@color-autocompleter-choices-border: @color-base;
+@color-autocompleter-choices-border-left-right: @color-base;
+@color-autocompleter-choices-border-bottom: @color-base;
+
+@color-autocompleter-choices-font: #444;
+
+/// Answers
+@color-answers-border: @color-base-dark;
+
+// Selected
+@color-autocompleter-selected-background: #444;
+@color-autocompleter-selected-font: #FFF;
+@color-autocompleter-selected-queried-font: #9FCFFF;
+
+/// Categories
+
+@color-categories-item-selected: @color-base;
+@color-categories-item-selected-font: #FFF;
+
+@color-categories-item-border-selected: @color-base-dark;
+@color-categories-item-border-unselected: #E8E7E6;
+@color-categories-item-border-unselected-hover: @color-base;
+
+
+/// Results
+
+@color-suggestions-button-background: @color-base;
+@color-suggestions-button-font: #FFF;
+
+@color-download-button-background: @color-base;
+@color-download-button-font: #FFF;
+
+@color-result-search-background: @color-base-light;
+
+@color-result-definition-border: gray;
+@color-result-torrent-border: lightgray;
+@color-result-top-border: #E8E7E6;
+
+// Link to result
+@color-result-link-font: @color-base-dark;
+@color-result-link-visited-font: @color-url-visited-font;
+
+// Url to result
+@color-result-url-font: @color-red;
+
+// Publish Date
+@color-result-publishdate-font: @color-font-light;
+
+// Images
+@color-result-image-span-background-hover: rgba(0, 0, 0, 0.6);
+@color-result-image-span-font: #FFF;
+
+// Search-URL
+@color-result-search-url-border: #888;
+@color-result-search-url-font: #444;
+
+
+/// Settings
+
+@color-settings-fieldset: @color-base;
+@color-settings-table-striped: #dbdbdb;
+@color-settings-tr-hover: #ececec;
+
+// Labels
+@color-settings-label-allowed-background: #E74C3C;
+@color-settings-label-allowed-font: #FFF;
+
+@color-settings-label-deny-background: #2ECC71;
+@color-settings-label-deny-font: @color-font;
+
+@color-settings-return-background: @color-base;
+@color-settings-return-font: #FFF;
+
+/// Other
+
+@color-engines-font: @color-font-light;
+@color-percentage-div-background: #444;
+
+/// Load fonts from this directory.
+@icon-font-path: "../../../fonts/";
+//** File name for all font files.
+@icon-font-name: "glyphicons-halflings-regular";
+//** Element ID within SVG icon file.
+@icon-font-svg-id: "glyphicons_halflingsregular";
diff --git a/searx/static/themes/simple/less/index.less b/searx/static/themes/simple/less/index.less
new file mode 100644
index 000000000..e1efdac90
--- /dev/null
+++ b/searx/static/themes/simple/less/index.less
@@ -0,0 +1,43 @@
+.index {
+
+ text-align: center;
+
+ .title {
+ background: url('../img/searx.png') no-repeat;
+ width: 100%;
+ min-height: 80px;
+ background-position: center;
+ }
+
+ h1 {
+ font-size: 5em;
+ visibility: hidden;
+ }
+
+ #search {
+ margin: 0 auto;
+ background: inherit;
+ border: inherit;
+ }
+
+ .search_filters {
+ display: block;
+ margin: 1em 0;
+ }
+
+ .category label {
+ padding: 6px 10px;
+ border-bottom: initial !important;
+ }
+
+}
+
+@media screen and (max-width: 75em) {
+
+ div.title {
+ h1 {
+ font-size: 1em;
+ }
+ }
+
+}
diff --git a/searx/static/themes/simple/less/ion.less b/searx/static/themes/simple/less/ion.less
new file mode 100644
index 000000000..9ec6b9955
--- /dev/null
+++ b/searx/static/themes/simple/less/ion.less
@@ -0,0 +1,174 @@
+// Generated by grunt-webfont
+
+
+@font-face {
+ font-family:"ion";
+ src:url("../fonts/ion.eot?94af7082ea096aefe3a7b6642834716e");
+ src:url("../fonts/ion.eot?#iefix") format("embedded-opentype"),
+ url("../fonts/ion.woff2?94af7082ea096aefe3a7b6642834716e") format("woff2"),
+ url("../fonts/ion.woff?94af7082ea096aefe3a7b6642834716e") format("woff"),
+ url("../fonts/ion.ttf?94af7082ea096aefe3a7b6642834716e") format("truetype"),
+ url("../fonts/ion.svg?94af7082ea096aefe3a7b6642834716e#ion") format("svg");
+ font-weight:normal;
+ font-style:normal;
+}
+
+.ion-icon {
+ &:before {
+ font-family:"ion";
+ }
+ display:inline-block;
+ vertical-align:middle;
+ line-height:1;
+ font-weight:normal;
+ font-style:normal;
+ speak:none;
+ text-decoration:inherit;
+ text-transform:none;
+ text-rendering:auto;
+ -webkit-font-smoothing:antialiased;
+ -moz-osx-font-smoothing:grayscale;
+}
+
+
+// Icons
+
+.ion-navicon-round {
+ &:before {
+ content:"\f101";
+ }
+}
+
+
+.ion-search {
+ &:before {
+ content:"\f102";
+ }
+}
+
+
+.ion-play {
+ &:before {
+ content:"\f103";
+ }
+}
+
+
+.ion-link {
+ &:before {
+ content:"\f104";
+ }
+}
+
+
+.ion-chevron-up {
+ &:before {
+ content:"\f105";
+ }
+}
+
+
+.ion-chevron-left {
+ &:before {
+ content:"\f106";
+ }
+}
+
+
+.ion-chevron-right {
+ &:before {
+ content:"\f107";
+ }
+}
+
+
+.ion-arrow-down-a {
+ &:before {
+ content:"\f108";
+ }
+}
+
+
+.ion-arrow-up-a {
+ &:before {
+ content:"\f109";
+ }
+}
+
+
+.ion-arrow-swap {
+ &:before {
+ content:"\f10a";
+ }
+}
+
+
+.ion-arrow-dropdown {
+ &:before {
+ content:"\f10b";
+ }
+}
+
+
+.ion-globe {
+ &:before {
+ content:"\f10c";
+ }
+}
+
+
+.ion-time {
+ &:before {
+ content:"\f10d";
+ }
+}
+
+
+.ion-location {
+ &:before {
+ content:"\f10e";
+ }
+}
+
+
+.ion-warning {
+ &:before {
+ content:"\f10f";
+ }
+}
+
+
+.ion-error {
+ &:before {
+ content:"\f110";
+ }
+}
+
+
+.ion-film-outline {
+ &:before {
+ content:"\f111";
+ }
+}
+
+
+.ion-music-note {
+ &:before {
+ content:"\f112";
+ }
+}
+
+
+.ion-more-vertical {
+ &:before {
+ content:"\f113";
+ }
+}
+
+
+.ion-magnet {
+ &:before {
+ content:"\f114";
+ }
+}
+
diff --git a/searx/static/themes/simple/less/mixins.less b/searx/static/themes/simple/less/mixins.less
new file mode 100644
index 000000000..097ab4964
--- /dev/null
+++ b/searx/static/themes/simple/less/mixins.less
@@ -0,0 +1,62 @@
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*/
+
+// Mixins
+.text-size-adjust (@property: 100%) {
+ -webkit-text-size-adjust: @property;
+ -ms-text-size-adjust: @property;
+ -moz-text-size-adjust: @property;
+ text-size-adjust: @property;
+}
+
+.rounded-corners (@radius: 4px) {
+ -webkit-border-radius: @radius;
+ -moz-border-radius: @radius;
+ border-radius: @radius;
+}
+
+// disable user selection
+.disable-user-select () {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+// select all on focus
+.select-all-on-focus() {
+ -webkit-user-select: all;
+ -moz-user-select: all;
+ -ms-user-select: all;
+ user-select: all;
+}
+
+// see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Advanced_layouts_with_flexbox
+.flexbox() {
+ display: -webkit-box;
+ display: -moz-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+}
+
+.inline-flex() {
+ display: -webkit-inline-box;
+ display: -moz-inline-box;
+ display: -webkit-inline-flex;
+ display: -ms-inline-flexbox;
+ display: inline-flex;
+}
+
+.flex-direction-row() {
+ -webkit-box-direction: normal;
+ -webkit-box-orient: horizontal;
+ -moz-box-direction: normal;
+ -moz-box-orient: horizontal;
+ -webkit-flex-direction: row;
+ -ms-flex-direction: row;
+ flex-direction: row;
+}
diff --git a/searx/static/themes/simple/less/normalize.less b/searx/static/themes/simple/less/normalize.less
new file mode 100644
index 000000000..fa4e73dd4
--- /dev/null
+++ b/searx/static/themes/simple/less/normalize.less
@@ -0,0 +1,447 @@
+/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
+
+/* Document
+ ========================================================================== */
+
+/**
+ * 1. Correct the line height in all browsers.
+ * 2. Prevent adjustments of font size after orientation changes in
+ * IE on Windows Phone and in iOS.
+ */
+
+html {
+ line-height: 1.15; /* 1 */
+ -ms-text-size-adjust: 100%; /* 2 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/* Sections
+ ========================================================================== */
+
+/**
+ * Remove the margin in all browsers (opinionated).
+ */
+
+body {
+ margin: 0;
+}
+
+/**
+ * Add the correct display in IE 9-.
+ */
+
+article,
+aside,
+footer,
+header,
+nav,
+section {
+ display: block;
+}
+
+/**
+ * Correct the font size and margin on `h1` elements within `section` and
+ * `article` contexts in Chrome, Firefox, and Safari.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+/* Grouping content
+ ========================================================================== */
+
+/**
+ * Add the correct display in IE 9-.
+ * 1. Add the correct display in IE.
+ */
+
+figcaption,
+figure,
+main { /* 1 */
+ display: block;
+}
+
+/**
+ * Add the correct margin in IE 8.
+ */
+
+figure {
+ margin: 1em 40px;
+}
+
+/**
+ * 1. Add the correct box sizing in Firefox.
+ * 2. Show the overflow in Edge and IE.
+ */
+
+hr {
+ box-sizing: content-box; /* 1 */
+ height: 0; /* 1 */
+ overflow: visible; /* 2 */
+}
+
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+
+pre {
+ font-family: monospace, monospace; /* 1 */
+ font-size: 1em; /* 2 */
+}
+
+/* Text-level semantics
+ ========================================================================== */
+
+/**
+ * 1. Remove the gray background on active links in IE 10.
+ * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
+ */
+
+a {
+ background-color: transparent; /* 1 */
+ -webkit-text-decoration-skip: objects; /* 2 */
+}
+
+/**
+ * 1. Remove the bottom border in Chrome 57- and Firefox 39-.
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
+ */
+
+abbr[title] {
+ border-bottom: none; /* 1 */
+ text-decoration: underline; /* 2 */
+ text-decoration: underline dotted; /* 2 */
+}
+
+/**
+ * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
+ */
+
+b,
+strong {
+ font-weight: inherit;
+}
+
+/**
+ * Add the correct font weight in Chrome, Edge, and Safari.
+ */
+
+b,
+strong {
+ font-weight: bolder;
+}
+
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+
+code,
+kbd,
+samp {
+ font-family: monospace, monospace; /* 1 */
+ font-size: 1em; /* 2 */
+}
+
+/**
+ * Add the correct font style in Android 4.3-.
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/**
+ * Add the correct background and color in IE 9-.
+ */
+
+mark {
+ background-color: #ff0;
+ color: #000;
+}
+
+/**
+ * Add the correct font size in all browsers.
+ */
+
+small {
+ font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` elements from affecting the line height in
+ * all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+sup {
+ top: -0.5em;
+}
+
+/* Embedded content
+ ========================================================================== */
+
+/**
+ * Add the correct display in IE 9-.
+ */
+
+audio,
+video {
+ display: inline-block;
+}
+
+/**
+ * Add the correct display in iOS 4-7.
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/**
+ * Remove the border on images inside links in IE 10-.
+ */
+
+img {
+ border-style: none;
+}
+
+/**
+ * Hide the overflow in IE.
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+/* Forms
+ ========================================================================== */
+
+/**
+ * 1. Change the font styles in all browsers (opinionated).
+ * 2. Remove the margin in Firefox and Safari.
+ */
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ font-family: sans-serif; /* 1 */
+ font-size: 100%; /* 1 */
+ line-height: 1.15; /* 1 */
+ margin: 0; /* 2 */
+}
+
+/**
+ * Show the overflow in IE.
+ * 1. Show the overflow in Edge.
+ */
+
+button,
+input { /* 1 */
+ overflow: visible;
+}
+
+/**
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
+ * 1. Remove the inheritance of text transform in Firefox.
+ */
+
+button,
+select { /* 1 */
+ text-transform: none;
+}
+
+/**
+ * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
+ * controls in Android 4.
+ * 2. Correct the inability to style clickable types in iOS and Safari.
+ */
+
+button,
+html [type="button"], /* 1 */
+[type="reset"],
+[type="submit"] {
+ -webkit-appearance: button; /* 2 */
+}
+
+/**
+ * Remove the inner border and padding in Firefox.
+ */
+
+button::-moz-focus-inner,
+[type="button"]::-moz-focus-inner,
+[type="reset"]::-moz-focus-inner,
+[type="submit"]::-moz-focus-inner {
+ border-style: none;
+ padding: 0;
+}
+
+/**
+ * Restore the focus styles unset by the previous rule.
+ */
+
+button:-moz-focusring,
+[type="button"]:-moz-focusring,
+[type="reset"]:-moz-focusring,
+[type="submit"]:-moz-focusring {
+ outline: 1px dotted ButtonText;
+}
+
+/**
+ * Correct the padding in Firefox.
+ */
+
+fieldset {
+ padding: 0.35em 0.75em 0.625em;
+}
+
+/**
+ * 1. Correct the text wrapping in Edge and IE.
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
+ * 3. Remove the padding so developers are not caught out when they zero out
+ * `fieldset` elements in all browsers.
+ */
+
+legend {
+ box-sizing: border-box; /* 1 */
+ color: inherit; /* 2 */
+ display: table; /* 1 */
+ max-width: 100%; /* 1 */
+ padding: 0; /* 3 */
+ white-space: normal; /* 1 */
+}
+
+/**
+ * 1. Add the correct display in IE 9-.
+ * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
+ */
+
+progress {
+ display: inline-block; /* 1 */
+ vertical-align: baseline; /* 2 */
+}
+
+/**
+ * Remove the default vertical scrollbar in IE.
+ */
+
+textarea {
+ overflow: auto;
+}
+
+/**
+ * 1. Add the correct box sizing in IE 10-.
+ * 2. Remove the padding in IE 10-.
+ */
+
+[type="checkbox"],
+[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Correct the cursor style of increment and decrement buttons in Chrome.
+ */
+
+[type="number"]::-webkit-inner-spin-button,
+[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+
+/**
+ * 1. Correct the odd appearance in Chrome and Safari.
+ * 2. Correct the outline style in Safari.
+ */
+
+[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ outline-offset: -2px; /* 2 */
+}
+
+/**
+ * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
+ */
+
+[type="search"]::-webkit-search-cancel-button,
+[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/**
+ * 1. Correct the inability to style clickable types in iOS and Safari.
+ * 2. Change font properties to `inherit` in Safari.
+ */
+
+::-webkit-file-upload-button {
+ -webkit-appearance: button; /* 1 */
+ font: inherit; /* 2 */
+}
+
+/* Interactive
+ ========================================================================== */
+
+/*
+ * Add the correct display in IE 9-.
+ * 1. Add the correct display in Edge, IE, and Firefox.
+ */
+
+details, /* 1 */
+menu {
+ display: block;
+}
+
+/*
+ * Add the correct display in all browsers.
+ */
+
+summary {
+ display: list-item;
+}
+
+/* Scripting
+ ========================================================================== */
+
+/**
+ * Add the correct display in IE 9-.
+ */
+
+canvas {
+ display: inline-block;
+}
+
+/**
+ * Add the correct display in IE.
+ */
+
+template {
+ display: none;
+}
+
+/* Hidden
+ ========================================================================== */
+
+/**
+ * Add the correct display in IE 10-.
+ */
+
+[hidden] {
+ display: none;
+}
diff --git a/searx/static/themes/simple/less/preferences.less b/searx/static/themes/simple/less/preferences.less
new file mode 100644
index 000000000..b8e096cd5
--- /dev/null
+++ b/searx/static/themes/simple/less/preferences.less
@@ -0,0 +1,78 @@
+#main_preferences {
+ form {
+ width: 100%;
+ }
+
+ fieldset {
+ margin: 8px;
+ border: none;
+ }
+
+ legend {
+ margin: 0;
+ padding: 5px 0 0 0;
+ display: block;
+ float:left;
+ width: 300px;
+ }
+
+ .value {
+ margin: 0;
+ padding: 0;
+ float:left;
+ width: 15em;
+ }
+
+ .description {
+ margin: 0;
+ padding: 5px 0 0 0;
+ float:left;
+ width: 50%;
+ color: darken(#dcdcdc, 30%);
+ font-size: 90%;
+ }
+
+ select {
+ width: 200px;
+ font-size: inherit !important;
+ }
+
+ table {
+ border-collapse: collapse;
+ }
+
+ table td {
+ text-align: center;
+ }
+
+ .name, .shortcut {
+ text-align: left;
+ }
+
+ .preferences_back {
+ background: none repeat scroll 0 0 @color-settings-return-background;
+ color: white;
+ border: 0 none;
+ .rounded-corners;
+ cursor: pointer;
+ display: inline-block;
+ margin: 2px 4px;
+ padding: 0.5em;
+
+ a {
+ display: block;
+ color: @color-settings-return-font;
+ }
+
+ a::first-letter {
+ text-transform: uppercase;
+ }
+ }
+
+}
+
+@media screen and (max-width: 75em) {
+ .preferences_back {
+ clear: both;
+ }
+}
diff --git a/searx/static/themes/simple/less/search.less b/searx/static/themes/simple/less/search.less
new file mode 100644
index 000000000..beeac3e8a
--- /dev/null
+++ b/searx/static/themes/simple/less/search.less
@@ -0,0 +1,232 @@
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*/
+
+#search {
+ padding: 0 2em;
+ margin: 0;
+ background: #f7f7f7;
+ border-bottom: 1px solid #d7d7d7;
+}
+
+#search_wrapper {
+ padding: 10px 0;
+}
+
+.search_box {
+ margin: 0 12px 0 0;
+ display: inline-flex;
+ flex-direction: row;
+
+ white-space: nowrap;
+ /*
+ &:has(q:focus) {
+ box-shadow: 0px 0px 5px #CCC;
+}
+*/
+}
+
+#q, #send_search {
+ display: block !important;
+ border-collapse: separate;
+ box-sizing: border-box;
+ position: relative;
+
+ margin: 0;
+ padding: 2px;
+ height: 2.2em;
+ background: none repeat scroll 0 0 @color-search-background;
+ border: 1px solid @color-search-border;
+ border-radius: 0px;
+ outline: none;
+ color: @color-search-font;
+ font-size: 16px;
+ z-index: 2;
+}
+
+#q {
+ outline: medium none;
+ padding-left: 8px;
+ padding-right: 0px !important;
+ border-right: none;
+ width: @search-width;
+}
+
+#send_search {
+ border-left: none;
+ width: 2.2em;
+
+ &:hover {
+ cursor: pointer;
+ background-color: @color-search-border;
+ color: @color-base-light;
+ }
+}
+
+.no-js #send_search {
+ width: auto !important;
+}
+
+.search_filters {
+ display: inline-block;
+ vertical-align: middle;
+}
+
+@media screen and (max-width: 75em) {
+
+ #categories {
+ font-size: 90%;
+ clear: both;
+
+ .checkbox_container {
+ margin-top: 2px;
+ margin: auto;
+ }
+ }
+
+ html.touch {
+ #main_index, #main_results {
+
+ #categories_container {
+ width: 1000px;
+ width: -moz-max-content;
+ width: -webkit-max-content;
+ width: max-content;
+
+ .category {
+ display: inline-block;
+ width: auto;
+ }
+ }
+
+ #categories {
+ width: 100%;
+ margin: 0;
+ text-align: left;
+ overflow-x: scroll;
+ overflow-y: hidden;
+ -webkit-overflow-scrolling: touch;
+ }
+ }
+ }
+
+}
+
+@media screen and (max-width: @results-width) {
+
+ #search {
+ width: 100%;
+ margin: 0;
+ padding: 0.1em 0 0 0;
+ }
+
+ #search_wrapper {
+ width: 100%;
+ margin: 0 0 0.7em 0;
+ padding: 0;
+ }
+
+ .search_box {
+ // hack, should bew 100% ?
+ width: 99%;
+ margin: 0.1em;
+ padding: 0 0.1em 0 0;
+ display: flex;
+ flex-direction: row;
+ }
+
+ #q {
+ width: auto !important;
+ flex: 1;
+ }
+
+ .search_filters {
+ display: block;
+ margin: 0.5em;
+ }
+
+ .language, .time_range {
+ width: 45%;
+ }
+
+ .category {
+ display: block;
+ width: 90%;
+
+ label {
+ border-bottom: 0;
+ }
+ }
+
+}
+
+#categories {
+ margin: 0 10px 0 0;
+ .disable-user-select;
+
+ &::-webkit-scrollbar {
+ width: 0;
+ height: 0;
+ }
+}
+
+.category {
+ display: inline-block;
+ position: relative;
+ margin: 0 3px;
+ padding: 0px;
+
+ input {
+ display: none;
+ }
+
+ label {
+ cursor: pointer;
+ padding: 4px 10px;
+ margin: 0;
+ display: block;
+ text-transform: capitalize;
+ font-size: 0.9em;
+ border-bottom: 2px solid transparent;
+ .disable-user-select;
+ }
+
+ input[type="checkbox"]:focus + label {
+ box-shadow: 0px 0px 8px #3498DB;
+ }
+
+ /*label:hover {
+ border-bottom: 2px solid @color-categories-item-border-unselected-hover;
+ }*/
+
+ input[type="checkbox"]:checked + label {
+ background: @color-categories-item-selected;
+ color: @color-categories-item-selected-font;
+ border-bottom: 2px solid @color-categories-item-border-selected;
+ }
+}
+
+#categories_container {
+
+ position: relative;
+
+ .help {
+ position: absolute;
+ width: 100%;
+ bottom: -20px;
+ overflow: hidden;
+
+ opacity: 0;
+ transition: opacity 1s ease;
+
+ font-size: 0.8em;
+ text-position: center;
+ background: white;
+ }
+
+ &:hover .help {
+ opacity: 0.8;
+ transition: opacity 1s ease;
+ }
+
+}
diff --git a/searx/static/themes/simple/less/stats.less b/searx/static/themes/simple/less/stats.less
new file mode 100644
index 000000000..c134bd0ec
--- /dev/null
+++ b/searx/static/themes/simple/less/stats.less
@@ -0,0 +1,8 @@
+.percentage {
+ position: relative;
+ width: 300px;
+
+ div {
+ background: @color-percentage-div-background;
+ }
+}
diff --git a/searx/static/themes/simple/less/style-rtl.less b/searx/static/themes/simple/less/style-rtl.less
new file mode 100644
index 000000000..2b68bcfde
--- /dev/null
+++ b/searx/static/themes/simple/less/style-rtl.less
@@ -0,0 +1,6 @@
+@import "style.less";
+
+#search_submit {
+ left: 1px;
+ right:auto;
+}
diff --git a/searx/static/themes/simple/less/style.less b/searx/static/themes/simple/less/style.less
new file mode 100644
index 000000000..b79b3eb24
--- /dev/null
+++ b/searx/static/themes/simple/less/style.less
@@ -0,0 +1,709 @@
+/*
+* searx, A privacy-respecting, hackable metasearch engine
+*
+* To convert "style.less" to "style.css" run: $make styles
+*/
+
+@import "normalize.less";
+
+@import "definitions.less";
+
+@import "mixins.less";
+
+@import "code.less";
+
+@import "toolkit.less";
+
+@import "autocomplete.less";
+
+// ion-icon
+@import "ion.less";
+
+.ion-icon-big {
+ .ion-icon;
+ font-size: 149%;
+}
+
+// for index.html template
+@import "index.less";
+
+// for preferences.html template
+@import "preferences.less";
+
+// Search-Field
+@import "search.less";
+
+// Main LESS-Code
+html {
+ font-family: arial, sans-serif;
+ font-size: 0.9em;
+ .text-size-adjust;
+ color: @color-font;
+ padding: 0;
+ margin: 0;
+}
+
+body, main {
+ padding: 0;
+ margin: 0;
+}
+
+main {
+ width: 100%;
+ // position: absolute;
+}
+
+footer {
+ // position:absolute;
+ bottom:0;
+ width:100%;
+ height:50px;
+}
+
+#main_preferences, #main_about, #main_stats {
+ margin: 3em;
+ width: auto;
+}
+
+footer {
+ bottom: 0;
+ height: 3em;
+ margin: 1em 0;
+ padding: 1em 0;
+ clear: both;
+ width: 100%;
+ text-align: center;
+
+ p {
+ font-size: 0.9em;
+ }
+}
+
+#main_preferences h1, #main_stats h1 {
+ background: url('../img/searx.png') no-repeat;
+ background-size: auto 75%;
+ min-height: 40px;
+ margin: 0 auto;
+
+ span {
+ visibility: hidden;
+ }
+}
+
+input[type="submit"], #results button[type="submit"] {
+ padding: 0.5rem;
+ margin: 2px 4px;
+ display: inline-block;
+ background: @color-download-button-background;
+ color: @color-download-button-font;
+ .rounded-corners;
+ border: 0;
+ cursor: pointer;
+}
+
+a {
+ text-decoration: none;
+ color: @color-url-font;
+
+ &:visited {
+ color: @color-url-visited-font;
+
+ .highlight {
+ color: @color-url-visited-font;
+ }
+ }
+}
+
+article[data-vim-selected] {
+ background: #f7f7f7;
+}
+
+article[data-vim-selected]::before {
+ position: absolute;
+ left: 1em;
+ padding: 2px;
+ content: ">";
+ font-weight: bold;
+ color: @color-base;
+}
+
+article.result-images[data-vim-selected] {
+ background: @color-base;
+}
+
+article.result-images[data-vim-selected]::before {
+ display: none;
+ content: "";
+}
+
+.result {
+ margin: 19px 0 18px 0;
+ padding: 0;
+
+ h3 {
+ font-size: 1.1em;
+ word-wrap:break-word;
+ margin: 5px 0 1px 0;
+ padding: 0;
+ margin-bottom: 0;
+
+ a {
+ color: @color-result-link-font;
+ font-weight: normal;
+ font-size: 1.1em;
+
+ &:visited {
+ color: @color-result-link-visited-font;
+ }
+
+ &:focus, &:hover {
+ text-decoration: underline;
+ border: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ outline:none;
+ }
+ }
+ }
+
+ .cache_link, .proxyfied_link {
+ font-size: 0.9em !important;
+ }
+
+ .content, .stat, .altlink {
+ font-size: 0.9em;
+ margin: 0;
+ padding: 0;
+ max-width: 54em;
+ word-wrap:break-word;
+ line-height: 1.24;
+
+ .highlight {
+ color: @color-black;
+ background: inherit;
+ font-weight: bold;
+ }
+ }
+
+ .codelines {
+ .highlight {
+ color: inherit;
+ background: inherit;
+ font-weight: normal;
+ }
+ }
+
+ .url {
+ font-size: 0.9em;
+ margin: 0 0 3px 0;
+ padding: 0;
+ max-width: 54em;
+ word-wrap:break-word;
+ color: @color-result-url-font;
+ }
+
+ .published_date {
+ font-size: 0.8em;
+ color: @color-result-publishdate-font;
+ }
+
+ img {
+
+ &.thumbnail {
+ float: left;
+ padding: 0 5px 10px 0;
+ width: 20em;
+ min-width: 20em;
+ min-height: 8em;
+ // background: @color-base-light;
+ }
+
+ &.image {
+ float: left;
+ padding: 0 5px 10px 0;
+ width: 100px;
+ max-height: 100px;
+ object-fit: scale-down;
+ object-position: right top;
+ }
+
+ }
+
+ .break {
+ clear: both;
+ }
+
+}
+
+.category-social .image {
+ width: auto !important;
+ min-width: 48px;
+ min-height: 48px;
+ padding: 0 5px 25px 0 !important;
+}
+
+.result-videos .content {
+ overflow: hidden;
+}
+
+.engines {
+ float: right;
+ color: @color-engines-font;
+
+ span {
+ font-size: smaller;
+ margin: 0 0.5em 0 0;
+ }
+}
+
+.small_font {
+ font-size: 0.8em;
+}
+
+.highlight {
+ color: @color-highlight;
+ background: inherit;
+ font-weight: bold;
+}
+
+.result-images {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ max-height: 200px;
+
+ img {
+ float: inherit;
+ margin: 0;
+ padding: 0;
+ border: none;
+ max-height: 200px;
+ background: @color-base-dark;
+ }
+
+ span a {
+ display: none;
+ color: @color-result-image-span-font;
+ }
+
+ &:hover span a {
+ display: block;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ padding: 4px;
+ margin: 0 0 4px 4px;
+ background-color: @color-result-image-span-background-hover;
+ font-size: 0.7em;
+ }
+}
+
+.torrent_result {
+ border-left: 10px solid @color-result-torrent-border;
+ padding-left: 3px;
+
+ p {
+ margin: 3px;
+ font-size: 0.8em;
+ }
+
+ a {
+ color: @color-result-link-font;
+
+ &:hover {
+ text-decoration: underline;
+ }
+
+ &:visited {
+ color: @color-result-link-visited-font;
+ }
+ }
+}
+
+#results {
+ margin: 2em 2em 20px 2em;
+ padding: 0;
+ width: @results-width;
+}
+
+#suggestions {
+
+ .wrapper {
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: flex-end;
+
+ form {
+ display: inline-block;
+ flex: 1 1 50%;
+ }
+ }
+}
+
+#suggestions, #answers, #corrections {
+ max-width: @results-width;
+}
+
+#suggestions, #answers, #infoboxes, #corrections {
+
+ input {
+ padding: 0;
+ margin: 3px;
+ font-size: 0.9em;
+ display: inline-block;
+ background: transparent;
+ color: @color-result-search-url-font;
+ cursor: pointer;
+ }
+
+ input[type="submit"], .infobox .url a {
+ color: @color-result-link-font;
+ text-decoration: none;
+ font-size: 0.9rem;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+
+}
+
+#corrections {
+ display: flex;
+ flex-flow: row wrap;
+ margin: 1em 0;
+
+ h4, input[type="submit"] {
+ display: inline-block;
+ margin: 0 0.5em 0 0;
+ }
+
+ input[type="submit"]::after {
+ content: ", "
+ }
+
+}
+
+#suggestions .title, #search_url .title, #apis .title {
+ margin: 2em 0 0.5em 0;
+ color: @color-font;
+}
+
+#answers {
+ margin: 10px 8px 10px 8px;
+ border: 1px solid #ddd;
+ padding: 0.9em;
+ box-shadow: 0px 0px 5px #CCC;
+
+ h4 {
+ display: none;
+ }
+
+ .answer {
+ display: block;
+ font-size: 1.2em;
+ font-weight: bold;
+ }
+}
+
+#answers, #infoboxes {
+ form {
+ min-width: 210px;
+ }
+}
+
+#sidebar {
+ position: absolute;
+ top: 100px;
+ left: 57em;
+
+ margin: 0px 2px 5px 5px;
+ padding: 0px 2px 2px;
+ max-width: 25em;
+ word-wrap: break-word;
+
+ .infobox {
+ margin: 10px 0 10px;
+ border: 1px solid #ddd;
+ padding: 0.9em;
+ font-size: 0.9em;
+ box-shadow: 0px 0px 5px #CCC;
+
+ h2 {
+ margin: 0 0 .5em 0;
+ }
+
+ img {
+ max-width: 100%;
+ max-height: 12em;
+ display: block;
+ margin: 0;
+ padding: 0;
+ }
+
+ dl {
+ margin: 0.5em 0;
+ }
+
+ dt {
+ display: inline;
+ margin: 0.5em 0.25em 0.5em 0;
+ padding: 0;
+ font-weight: bold;
+ }
+
+ dd {
+ display: inline;
+ margin: 0.5em 0;
+ padding: 0;
+ }
+
+ input {
+ font-size: 1em;
+ }
+
+ br {
+ clear: both;
+ }
+
+ .attributes, .urls {
+ clear: both;
+ }
+
+ }
+}
+
+#search_url {
+ margin-top: 8px;
+
+ div {
+ display: block;
+ border: 1px solid @color-result-search-url-border;
+ padding: 4px;
+ color: @color-result-search-url-font;
+ width: 100%;
+ display: block;
+ margin: 0.1em;
+ overflow: hidden;
+ height: 1.2em;
+ line-height: 1.2em;
+
+ pre {
+ display: block;
+ width: 200em;
+ font-size: 0.8em;
+ word-break: break-all;
+ margin: 0.1em;
+ .select-all-on-focus();
+ }
+ }
+}
+
+#linkto_preferences {
+ position: absolute;
+ right: 10px;
+ top: 0.9em;
+ padding: 0;
+ border: 0;
+ display: block;
+
+ font-size: 1.2em;
+ color: @color-search-font;
+
+ a:link *, a:hover *, a:visited *, a:active * {
+ color: @color-search-font;
+ }
+}
+
+#pagination {
+ clear: both;
+
+ br {
+ clear: both;
+ }
+}
+
+#apis {
+ margin-top: 8px;
+ clear: both;
+}
+
+#backToTop {
+ border: 1px solid #ddd;
+ margin: 0 0 0 2em;
+ padding: 0;
+ font-size: 1em;
+ box-shadow: 0px 0px 5px #CCC;
+ background: white;
+ position: fixed;
+ bottom: 85px;
+ left: @results-width;
+ transition: opacity 0.5s;
+ opacity: 0;
+
+ a {
+ display: block;
+ margin: 0;
+ padding: 0.6em;
+ }
+}
+
+@media screen and (max-width: 75em) {
+
+ #main_preferences, #main_about, #main_stats {
+ margin: 0.5em;
+ width: auto;
+ }
+
+ #suggestions, #answers {
+ margin-top: 1em;
+ }
+
+ #infoboxes {
+ position: inherit;
+ max-width: inherit;
+
+ .infobox {
+ clear:both;
+
+ img {
+ float: left;
+ max-width: 10em;
+ margin: 0.5em 0.5em 0.5em 0;
+ }
+ }
+
+ }
+
+ #sidebar {
+ position: static;
+ max-width: @results-width;
+ margin: 0 0 2px 0;
+ padding: 0;
+ float: none;
+ border: none;
+ width: auto;
+
+ input {
+ border: 0;
+ }
+ }
+
+ #apis {
+ display: none;
+ }
+
+ #search_url {
+ display: none;
+ }
+
+ .result {
+ border-bottom: 1px solid @color-result-top-border;
+ margin: 0;
+ padding-top: 8px;
+ padding-bottom: 6px;
+
+ h3 {
+ margin: 0 0 1px 0;
+ }
+
+ .thumbnail {
+ max-width: 98%;
+ }
+
+ .url {
+
+ span.url {
+ display: block;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ width: 100%;
+ }
+
+ a {
+ float: right;
+ padding: 0 0.5em;
+ }
+
+ }
+
+ .engines {
+ float: right;
+ padding: 0 0 3px 0;
+ }
+ }
+
+ .result-images {
+ border-bottom: none !important;
+ }
+
+ .image_result {
+ max-width: 98%;
+ img {
+ max-width: 98%;
+ }
+ }
+}
+
+
+@media screen and (max-width: @results-width) {
+
+ article[data-vim-selected]::before {
+ display: none;
+ content: "";
+ }
+
+ #linkto_preferences {
+ display: none;
+ postion: fixed !important;
+ top: 100px;
+ right: 0px;
+ }
+
+ #sidebar {
+ margin: 0 5px 2px 5px;
+ }
+
+ #corrections {
+ margin: 1em 5px 1em 5px;
+ }
+
+ #results {
+ margin: 0;
+ padding: 0;
+ width: initial;
+ }
+
+ #backToTop {
+ left: 40em;
+ bottom: 35px;
+ }
+
+ .result {
+ padding: 8px 10px 6px 10px;
+ }
+
+ .result-images {
+ margin: 0;
+ padding: 0;
+ border: none;
+ }
+
+}
+
+@media screen and (max-width: 35em) {
+
+ .result-videos {
+
+ img.thumbnail {
+ float: none !important;
+ }
+ .content {
+ overflow: inherit;
+ }
+
+ }
+
+}
diff --git a/searx/static/themes/simple/less/toolkit.less b/searx/static/themes/simple/less/toolkit.less
new file mode 100644
index 000000000..641747c6c
--- /dev/null
+++ b/searx/static/themes/simple/less/toolkit.less
@@ -0,0 +1,346 @@
+// other solution : http://stackoverflow.com/questions/1577598/how-to-hide-parts-of-html-when-javascript-is-disabled/13857783#13857783
+html.no-js .hide_if_nojs {
+ display: none;
+}
+
+html.js .show_if_nojs {
+ display: none;
+}
+
+.center {
+ text-align: center;
+}
+
+.right {
+ float: right ;
+}
+
+.left {
+ float: left;
+}
+
+.invisible {
+ display: none;
+}
+
+.danger {
+ background-color: @color-error-background;
+}
+
+.badge {
+ display: inline-block;
+ color: #fff;
+ background-color: #777;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ min-width: 10px;
+ padding: 1px 5px;
+ border-radius: 5px;
+}
+
+// table
+table {
+
+ width: 100%;
+
+ &.striped {
+ tr {
+ border-bottom: 1px solid @color-settings-tr-hover;
+ }
+ }
+}
+
+th {
+ padding: 0.4em;
+}
+
+td {
+ padding: 0 4px;
+}
+
+tr {
+ &:hover {
+ background: @color-settings-tr-hover;
+ }
+}
+
+// dialog
+.dialog() {
+ position: relative;
+ width: 70%;
+ padding: 1em 1em 1em 2.7em;
+ margin: 0em 8% 1em 8%;
+ border: 1px solid black;
+ border-radius: 4px;
+ text-align: left;
+
+ &:before {
+ position: absolute;
+ top: 0.5em;
+ left: 0.5em;
+ font-family:"ion";
+ font-size: 1.5em;
+ }
+
+ .close {
+ float:right;
+ position: relative;
+ top: -3px;
+ color: inherit;
+ font-size: 1.5em;
+ }
+
+ ul, ol, p {
+ margin: 1px 0 0 0;
+ }
+
+}
+
+.dialog-error {
+ .dialog();
+ color: @color-error;
+ background: @color-error-background;
+ border-color: @color-error;
+ .ion-error();
+}
+
+.dialog-warning {
+ .dialog();
+ color: @color-warning;
+ background: @color-warning-background;
+ border-color: @color-warning;
+ .ion-warning();
+}
+
+// btn-collapse
+.btn-collapse {
+ cursor: pointer;
+}
+
+//
+.scrollx {
+ overflow-x: auto;
+ overflow-y: hidden;
+ display: block;
+ padding: 0;
+ margin: 0;
+ border: none;
+}
+
+// tabs
+.tabs .tabs > label {
+ font-size: 90%;
+}
+
+.tabs {
+ .flexbox();
+ flex-wrap: wrap;
+ width: 100%;
+ min-width: 100%;
+
+ & > * {
+ order: 2;
+ }
+
+ & > input[type=radio] {
+ display: none;
+ }
+
+ & > label {
+ order: 1;
+ padding: 0.7em;
+ margin: 0 0.7em;
+ letter-spacing:0.5px;
+ text-transform: uppercase;
+
+ border: solid white;
+ border-width: 0px 0px 2px 0;
+
+ .disable-user-select();
+ cursor: pointer;
+ }
+
+ & > label:hover {
+ border-bottom: 2px solid @color-categories-item-border-selected;
+ }
+
+ & > section {
+ min-width: 100%;
+ padding: 0.7rem 0;
+ box-sizing: border-box;
+ border-top: 1px solid black;
+ display: none;
+ }
+
+ // default selection
+ & > label:last-of-type {
+ border-bottom: 2px solid @color-categories-item-border-selected;
+ background: @color-categories-item-selected;
+ color: @color-categories-item-selected-font;
+ font-weight: bold;
+ letter-spacing:-0.1px;
+ }
+
+ & > section:last-of-type {
+ display: block;
+ }
+
+}
+
+html body .tabs > input:checked {
+ ~ section {
+ display: none;
+ }
+ ~ label {
+ position: inherited;
+ background: inherit;
+ border-bottom: 2px solid transparent;
+ font-weight: normal;
+ color: inherit;
+
+ &:hover {
+ border-bottom: 2px solid @color-categories-item-border-selected;
+ }
+ }
+ + label {
+ border-bottom: 2px solid @color-categories-item-border-selected;
+ background: @color-categories-item-selected;
+ color: @color-categories-item-selected-font;
+ font-weight: bold;
+ letter-spacing:-0.1px;
+ }
+ + label + section {
+ display: block;
+ }
+}
+
+// select
+select {
+ height: 28px;
+ margin: 0 1em 0 0;
+ padding: 2px 8px 2px 0 !important;
+ color: @color-search-font;
+ font-size: 12px;
+ z-index: 2;
+
+ &:hover, &:focus {
+ cursor: pointer;
+ }
+}
+
+@supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))) {
+
+ select {
+ appearance: none;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ border: none;
+ border-bottom: 1px solid #d7d7d7;
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat;
+ background-position-x: 105%;
+ background-size: 2em;
+ background-origin: content-box;
+ outline: medium none;
+
+ &:hover, &:focus {
+ border-bottom: 1px solid @color-search-border;
+ }
+
+ }
+
+}
+
+// checkbox-onoff
+@supports (border-radius: 50px) {
+ .checkbox-onoff {
+ display: inline-block;
+ width: 40px;
+ height: 10px;
+ background: #dcdcdc;
+ margin: 8px auto;
+ position: relative;
+ border-radius: 50px;
+ label {
+ display: block;
+ width: 20px;
+ height: 20px;
+ position: absolute;
+ top: -5px;
+ cursor: pointer;
+ border-radius: 50px;
+ box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.3);
+ transition: all 0.4s ease;
+
+ left: 27px;
+ background-color: #3498DB;
+ }
+ input[type=checkbox] {
+ visibility: hidden;
+ &:checked + label {
+ left: -5px;
+ background: #dcdcdc;
+ }
+ }
+ }
+}
+
+// checkbox
+@supports (transform: rotate(-45deg)) {
+ .checkbox {
+ width: 20px;
+ position: relative;
+ margin: 20px auto;
+ label {
+ width: 20px;
+ height: 20px;
+ cursor: pointer;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background: white;
+ border-radius: 4px;
+ box-shadow: inset 0px 1px 1px white, 0px 1px 4px rgba(0,0,0,0.5);
+ &:after {
+ content: '';
+ width: 9px;
+ height: 5px;
+ position: absolute;
+ top: 4px;
+ left: 4px;
+ border: 3px solid #333;
+ border-top: none;
+ border-right: none;
+ background: transparent;
+ opacity: 0;
+ transform: rotate(-45deg);
+ }
+ }
+
+ input[type=checkbox] {
+ visibility: hidden;
+ &:checked + label:after {
+ border-color: #3498DB;
+ opacity: 1;
+ }
+ }
+
+ // disabled : can't be focused, show only the check mark
+ input[disabled] + label {
+ background-color: transparent !important;
+ box-shadow: none !important;
+ cursor: inherit;;
+ }
+
+ // if not checked and possible to checked then display a "light" check mark on hover
+ input:not(:checked):not([readonly]):not([disabled]) + label:hover::after {
+ opacity: 0.5;
+ }
+ }
+}
+
+@media screen and (max-width: 50em) {
+ .tabs > label {
+ width: 100%;
+ }
+}
diff --git a/searx/static/themes/simple/magnet.svg b/searx/static/themes/simple/magnet.svg
new file mode 100644
index 000000000..5a7a16329
--- /dev/null
+++ b/searx/static/themes/simple/magnet.svg
@@ -0,0 +1 @@
+Created by Dmitry Baranovskiy from the Noun Project
\ No newline at end of file
diff --git a/searx/static/themes/simple/package.json b/searx/static/themes/simple/package.json
new file mode 100644
index 000000000..f3d6bbfe2
--- /dev/null
+++ b/searx/static/themes/simple/package.json
@@ -0,0 +1,20 @@
+{
+ "devDependencies": {
+ "grunt": "~1.0.1",
+ "grunt-contrib-concat": "~1.0.1",
+ "grunt-contrib-cssmin": "^2.2.1",
+ "grunt-contrib-jshint": "~1.1.0",
+ "grunt-contrib-less": "^1.4.1",
+ "grunt-contrib-uglify": "~3.0.1",
+ "grunt-contrib-watch": "~1.0.0",
+ "grunt-webfont": "^1.6.0",
+ "ionicons-npm": "^2.0.1",
+ "jslint": "^0.10.3",
+ "less-plugin-clean-css": "^1.5.1"
+ },
+ "scripts": {
+ "build": "npm install && grunt",
+ "start": "grunt watch",
+ "test": "grunt"
+ }
+}
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html
index 49f67bcd8..afb389e44 100644
--- a/searx/templates/oscar/preferences.html
+++ b/searx/templates/oscar/preferences.html
@@ -171,7 +171,7 @@
{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
{{ search_engine.name }}
- {{ shortcuts[search_engine.name] }}
+ {{ shortcuts[search_engine.name] }}
diff --git a/searx/templates/simple/404.html b/searx/templates/simple/404.html
new file mode 100644
index 000000000..1843c9892
--- /dev/null
+++ b/searx/templates/simple/404.html
@@ -0,0 +1,9 @@
+{% extends "simple/base.html" %}
+{% block content %}
+
+
{{ _('Page not found') }}
+ {% autoescape false %}
+
{{ _('Go to %(search_page)s.', search_page='{} '.decode('utf-8').format(url_for('index'), _('search page'))) }}
+ {% endautoescape %}
+
+{% endblock %}
diff --git a/searx/templates/simple/about.html b/searx/templates/simple/about.html
new file mode 100644
index 000000000..1913879da
--- /dev/null
+++ b/searx/templates/simple/about.html
@@ -0,0 +1,4 @@
+{% extends 'simple/base.html' %}
+{% block content %}
+{% include '__common__/about.html' %}
+{% endblock %}
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html
new file mode 100644
index 000000000..0003f113e
--- /dev/null
+++ b/searx/templates/simple/base.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {% block title %}{% endblock %}searx
+ {% if rtl %}
+
+ {% else %}
+
+ {% endif %}
+ {% block styles %}{% endblock %}
+ {% block meta %}{% endblock %}
+ {% block head %}
+
+ {% endblock %}
+
+
+
+
+
+ {% if errors %}
+
+
×
+
+ {% for message in errors %}
+ {{ message }}
+ {% endfor %}
+
+
+ {% endif %}
+
+ {% block content %}
+ {% endblock %}
+
+
+
+
+
+
+
diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html
new file mode 100644
index 000000000..127d55b2b
--- /dev/null
+++ b/searx/templates/simple/categories.html
@@ -0,0 +1,8 @@
+{{- '' -}}
+
+ {%- for category in categories -%}
+
{{ _(category) }}
+ {%- endfor -%}
+ {%- if display_tooltip %}
{{ _('Click on the magnifier to perform search') }}
{% endif -%}
+
{{- '' -}}
+
diff --git a/searx/templates/simple/index.html b/searx/templates/simple/index.html
new file mode 100644
index 000000000..4e8e76cce
--- /dev/null
+++ b/searx/templates/simple/index.html
@@ -0,0 +1,12 @@
+{% extends "simple/base.html" %}
+{% from 'simple/macros.html' import icon %}
+{% block meta %}
+
+{% endblock %}
+{% block content %}
+{{ icon('navicon-round') }}
+
+
searx
+ {% include 'simple/search.html' %}
+
+{% endblock %}
diff --git a/searx/templates/simple/infobox.html b/searx/templates/simple/infobox.html
new file mode 100644
index 000000000..d99806ac4
--- /dev/null
+++ b/searx/templates/simple/infobox.html
@@ -0,0 +1,46 @@
+
+ {{ infobox.infobox }}
+ {% if infobox.img_src %} {% endif %}
+ {{ infobox.entity }}
+ {{ infobox.content | safe }}
+ {% if infobox.attributes %}
+
+ {% for attribute in infobox.attributes %}
+
+ {{ attribute.label }} :
+ {%- if attribute.image -%}
+
+ {%- else -%}
+ {{ attribute.value }}
+ {%- endif -%}
+
+ {% endfor %}
+
+ {% endif %}
+
+ {% if infobox.urls %}
+
+ {% endif %}
+
+ {% if infobox.relatedTopics %}
+
+ {% endif %}
+
diff --git a/searx/templates/simple/languages.html b/searx/templates/simple/languages.html
new file mode 100644
index 000000000..dd928ff68
--- /dev/null
+++ b/searx/templates/simple/languages.html
@@ -0,0 +1,8 @@
+{{- '' -}}
+ {{ _('Default language') }}
+ {%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%}
+
+ {{- lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id -}}
+
+ {%- endfor -%}
+
diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html
new file mode 100644
index 000000000..76c53a635
--- /dev/null
+++ b/searx/templates/simple/macros.html
@@ -0,0 +1,86 @@
+
+{% macro icon(action) -%}
+
+{%- endmacro %}
+
+{% macro icon_small(action) -%}
+
+{%- endmacro %}
+
+
+
+{% macro draw_favicon(favicon) -%}
+
+{%- endmacro %}
+
+{% macro result_open_link(url, classes='') -%}
+
+{%- endmacro %}
+
+{%- macro result_close_link() -%}
+
+{%- endmacro %}
+
+{%- macro result_link(url, title, classes='') -%}
+ {{ result_open_link(url, classes) }}{{ title }}{{ result_close_link() }}
+{%- endmacro -%}
+
+
+{% macro result_header(result, favicons, image_proxify) -%}
+
+ {%- if result.img_src %}{{ result_open_link(result.url) }} {{ result_close_link() }}{% endif -%}
+ {%- if result.thumbnail %}{{ result_open_link(result.url) }} {{ result_close_link() }}{% endif -%}
+ {{ result_link(result.url, result.title|safe) }}
+{%- endmacro -%}
+
+
+{%- macro result_sub_header(result) -%}
+ {% if result.publishedDate %}{{ result.publishedDate }} {% endif %}
+{%- endmacro -%}
+
+
+{%- macro result_sub_footer(result, proxify) -%}
+{% for engine in result.engines %}{{ engine }} {% endfor %}
{{- '' -}}
+{{ result.pretty_url }} {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "cache_link") }} {% if proxify %} {{ result_link(proxify(result.url), icon('link') + _('proxied'), "proxyfied_link") }} {% endif %}
{{- '' -}}
+
{{- '' -}}
+{%- endmacro -%}
+
+
+{%- macro result_footer(result) -%}
+
+{%- endmacro -%}
+
+
+{%- macro tabs_open() -%}
+
+{%- endmacro -%}
+
+{%- macro tab_header(name, id, label) -%}
+
+{{ label }}
+
+{%- endmacro -%}
+
+{%- macro tab_footer() -%}
+
+{%- endmacro -%}
+
+{%- macro tabs_close() -%}
+
+{%- endmacro -%}
+
+{%- macro checkbox_onoff(name, checked) -%}
+{{- '' -}}
+ {{- '' -}}
+ {{- '' -}}
+
+{%- endmacro -%}
+
+{%- macro checkbox(name, checked, readonly, disabled) -%}
+{{- '' -}}
+ {{- '' -}}
+ {{- '' -}}
+
+{%- endmacro -%}
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html
new file mode 100644
index 000000000..4529fea8c
--- /dev/null
+++ b/searx/templates/simple/preferences.html
@@ -0,0 +1,190 @@
+{% from 'simple/macros.html' import tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %}
+
+{% extends "simple/base.html" %}
+
+{%- macro plugin_preferences(section) -%}
+{%- for plugin in plugins -%}
+{%- if plugin.preference_section == section -%}
+{{- '' -}}
+ {{ _(plugin.name) }} {{- '' -}}
+
+ {{- checkbox_onoff('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
+
{{- '' -}}
+
+ {{- _(plugin.description) -}}
+
{{- '' -}}
+
+{%- endif -%}
+{%- endfor -%}
+{%- endmacro -%}
+
+{% block head %} {% endblock %}
+{% block content %}
+
+searx
+
+{{ _('Preferences') }}
+
+