summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/src/js
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-11-30 12:33:44 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2021-11-30 12:42:52 +0100
commit7dc9cc91a89ba482b4de2ea2acb47044aca87bcb (patch)
tree31d6a6c5c4f4c556f0be92c0b93bfb744bca6362 /searx/static/themes/simple/src/js
parenteff08844987eb184ea67a0a96d2ca4089f72f2d9 (diff)
[mod] simple theme, JS: introduce window.searxng.theme namespace
In window.searxng.theme the theme data can be passed through to JS implementations. Initial the window.searxng.theme namespace starts with a value for `img_load_error`:: // image that is displayed if load of <img src='...'> failed img_load_error: 'img/img_load_error.svg' The searx/static/themes/__common__/js/image_layout.js is patched to uses the value, if the theme defines a value for img_load_error in this namespace. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/static/themes/simple/src/js')
-rw-r--r--searx/static/themes/simple/src/js/head/00_init.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/static/themes/simple/src/js/head/00_init.js b/searx/static/themes/simple/src/js/head/00_init.js
index 21b1754bf..dab0e368a 100644
--- a/searx/static/themes/simple/src/js/head/00_init.js
+++ b/searx/static/themes/simple/src/js/head/00_init.js
@@ -24,6 +24,10 @@
hotkeys: script.getAttribute('data-hotkeys') === 'true',
static_path: script.getAttribute('data-static-path'),
translations: JSON.parse(script.getAttribute('data-translations')),
+ theme : {
+ // image that is displayed if load of <img src='...'> failed
+ img_load_error: 'img/img_load_error.svg'
+ }
};
// update the css