summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-02-07 21:59:21 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-02-13 14:20:47 +0100
commit98cab4cf754752e8a615b7b6c2685021592889a7 (patch)
tree8aac9568766473950db0747cd6a12e1b098384e5 /searx/templates
parentb9a2e8b387212d35cc83da50a07ee8fa47d2a56e (diff)
downloadsearxng-98cab4cf754752e8a615b7b6c2685021592889a7.tar.gz
searxng-98cab4cf754752e8a615b7b6c2685021592889a7.zip
[mod] result_templates/default.html replace embedded HTML by data_src audio_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' (and 'audio_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/default.html15
-rw-r--r--searx/templates/simple/result_templates/default.html13
2 files changed, 20 insertions, 8 deletions
diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html
index 535630499..72a5f8c56 100644
--- a/searx/templates/oscar/result_templates/default.html
+++ b/searx/templates/oscar/result_templates/default.html
@@ -3,13 +3,13 @@
{{- 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-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}" aria-labelledby="result-{{loop.index}}">{{ icon('music') }} {{ _('show media') }}</a></small>
{%- endif -%}
-{%- if result.embedded -%}
-<div id="result-media-{{ index }}" class="collapse">
- {{- result.embedded|safe -}}
+{% if result.data_src -%}
+<div id="result-media-{{ index }}" class="embedded-content invisible">
+ <iframe data-src="{{result.data_src}}" frameborder="0" allowfullscreen></iframe>
</div>
{%- endif -%}
@@ -24,6 +24,13 @@
{%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%}
{%- endif -%}
+{% if result.audio_src -%}
+<div id="result-media-{{ index }}" class="audio-control">
+ <audio controls><source src="{{result.audio_src}}"></audio>
+</div>
+{%- endif %}
+
+
{%- if rtl -%}
{{ result_footer_rtl(result, loop.index) }}
{%- else -%}
diff --git a/searx/templates/simple/result_templates/default.html b/searx/templates/simple/result_templates/default.html
index 7c74a06d0..9e4dae138 100644
--- a/searx/templates/simple/result_templates/default.html
+++ b/searx/templates/simple/result_templates/default.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-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music-note') }} {{ _('show media') }}</a></p>
{%- endif %}
{%- if result.content %}
@@ -15,9 +15,14 @@
</p>
{% endif -%}
{{- result_sub_footer(result, proxify) -}}
-{% if result.embedded -%}
-<div id="result-media-{{ index }}" class="invisible">
- {{- result.embedded|safe -}}
+{% if result.data_src -%}
+<div id="result-media-{{ index }}" class="embedded-content invisible">
+ <iframe data-src="{{result.data_src}}" frameborder="0" allowfullscreen></iframe>
+</div>
+{%- endif %}
+{% if result.audio_src -%}
+<div id="result-media-{{ index }}" class="audio-control">
+ <audio controls><source src="{{result.audio_src}}"></audio>
</div>
{%- endif %}
{{- result_footer(result) }}