summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-02-07 16:16:57 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-02-13 14:20:47 +0100
commit46e131fdadd94910c0e258aa4e855ad8019edbf7 (patch)
tree3e4de6dae4274331631bfefb3e3446e13bc9c022 /searx/templates
parenta4942213a1dc6404616e239e0d2fb55a6e19a499 (diff)
downloadsearxng-46e131fdadd94910c0e258aa4e855ad8019edbf7.tar.gz
searxng-46e131fdadd94910c0e258aa4e855ad8019edbf7.zip
[mod] result_templates/videos.html: replace embedded HTML by data_src
Embedded HTML breaks SearXNG architecture. To modularize, HTML is generated in the templates (oscar & simple) and result parameter 'embedded' is replaced by 'data_src', an URL for embedded content (<iframe>). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/oscar/result_templates/videos.html10
-rw-r--r--searx/templates/simple/result_templates/videos.html8
2 files changed, 9 insertions, 9 deletions
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html
index ad17ffe33..586dffc22 100644
--- a/searx/templates/oscar/result_templates/videos.html
+++ b/searx/templates/oscar/result_templates/videos.html
@@ -3,15 +3,15 @@
{{- result_header(result, favicons, loop.index) -}}
{{- result_sub_header(result, loop.index) -}}
-{%- if result.embedded -%}
+{%- if result.data_src -%}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}" aria-labelledby="result-{{loop.index}}">{{ icon('film') }} {{ _('show video') }}</a></small>
{%- endif -%}
-{%- if result.embedded -%}
-<div id="result-video-{{ index }}" class="collapse">
- {{- result.embedded|safe -}}
+{% if result.data_src -%}
+<div id="result-video-{{ index }}" class="embedded-video collapse">
+ <iframe data-src="{{result.data_src}}" width="540" height="304" frameborder="0" allowfullscreen></iframe>
</div>
-{%- endif -%}
+{%- endif %}
<div class="container-fluid">{{- "" -}}
<div class="row">{{- "" -}}
diff --git a/searx/templates/simple/result_templates/videos.html b/searx/templates/simple/result_templates/videos.html
index 1b2e1c84e..6da70a8a2 100644
--- a/searx/templates/simple/result_templates/videos.html
+++ b/searx/templates/simple/result_templates/videos.html
@@ -2,7 +2,7 @@
{{ result_header(result, favicons, image_proxify) }}
{{ result_sub_header(result) }}
-{% if result.embedded -%}
+{% if result.data_src -%}
<p class="altlink"> &bull; <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p>
{%- endif %}
{%- if result.content %}
@@ -16,9 +16,9 @@
{% endif -%}
</p>
{{- result_sub_footer(result, proxify) -}}
-{% if result.embedded -%}
-<div id="result-video-{{ index }}" class="invisible">
- {{- result.embedded|safe -}}
+{% if result.data_src -%}
+<div id="result-video-{{ index }}" class="embedded-video invisible">
+ <iframe data-src="{{result.data_src}}" frameborder="0" allowfullscreen></iframe>
</div>
{%- endif %}
{{ result_footer(result) }}