diff options
author | Alexandre Flament <alex@al-f.net> | 2021-03-10 14:34:33 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-03-10 19:01:15 +0100 |
commit | bdb41bea7b4db6e97611a8303e4880e580334a74 (patch) | |
tree | 39211e5fc74706d5a1b4d6790762a0a7899b5d76 /searx/templates | |
parent | 2f3d5ec2afc175bde65b294674f4640969e2fa6f (diff) | |
download | searxng-bdb41bea7b4db6e97611a8303e4880e580334a74.tar.gz searxng-bdb41bea7b4db6e97611a8303e4880e580334a74.zip |
[mod] theme: remove require-2.1.15.min.js
See https://github.com/requirejs/requirejs/issues/1816
requirejs loads one file: leaflet.
This commit:
* removes requirejs
* load leaflet using <script src...> HTML tag in searx/templates/oscar/base.html
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/oscar/base.html | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index 2205eb952..033be89b8 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -19,7 +19,12 @@ {{' '}}<link rel="stylesheet" href="{{ url_for('static', filename='css/logicodev.min.css') }}" type="text/css" /> {%- endif %} - <link rel="stylesheet" href="{{ url_for('static', filename='css/leaflet.min.css') }}" type="text/css" /> + {% set templates = results|map(attribute='template')|unique|list -%} + {%- set load_leaflet = 'map.html' in templates -%} + {%- if load_leaflet -%} + {{' '}}<link rel="stylesheet" href="{{ url_for('static', filename='css/leaflet.min.css') }}" type="text/css" /> + {%- endif %} + {%- for css in styles %} <link rel="stylesheet" href="{{ url_for('static', filename=css) }}" type="text/css" /> {% endfor %} @@ -96,9 +101,9 @@ </div> <script src="{{ url_for('static', filename='js/jquery-1.11.1.min.js') }}"></script> <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script> - {% if autocomplete %} <script src="{{ url_for('static', filename='js/typeahead.bundle.min.js') }}"></script>{% endif %} + {% if load_leaflet %}{{" "}}<script src="{{ url_for('static', filename='js/leaflet-0.7.3.min.js') }}"></script>{{ "\n" }}{% endif %} + {% if autocomplete %}{{" "}}<script src="{{ url_for('static', filename='js/typeahead.bundle.min.js') }}"></script>{{ "\n" }}{% endif %} - <script src="{{ url_for('static', filename='js/require-2.1.15.min.js') }}"></script> <script src="{{ url_for('static', filename='js/searx.min.js') }}" data-method="{{ method or 'POST' }}" data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}"></script> |