diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2024-11-29 16:57:28 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-12-01 15:04:05 +0100 |
commit | 8c3f0c3d527d8d33295abf576d443570c1d03a29 (patch) | |
tree | 89f84056276fe9802fd76d075ba7274a96980a6e /searx | |
parent | 4a8d333d5b7f28984efec92dca3fb21e4211497e (diff) | |
download | searxng-8c3f0c3d527d8d33295abf576d443570c1d03a29.tar.gz searxng-8c3f0c3d527d8d33295abf576d443570c1d03a29.zip |
[fix] if image load fails on client side, show default image
BTW: change icon color from red to gray
Closes:
- https://github.com/searxng/searxng/issues/4066
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/static/themes/simple/src/js/main/results.js | 9 | ||||
-rw-r--r-- | searx/static/themes/simple/svg4web.svgo.js | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/searx/static/themes/simple/src/js/main/results.js b/searx/static/themes/simple/src/js/main/results.js index 7342f94b2..5e3f8ed40 100644 --- a/searx/static/themes/simple/src/js/main/results.js +++ b/searx/static/themes/simple/src/js/main/results.js @@ -7,13 +7,14 @@ } searxng.ready(function () { - d.querySelectorAll('#urls img.image').forEach( + d.querySelectorAll('#urls img').forEach( img => img.addEventListener( 'error', () => { - img.style.display = 'none'; - img.error = null; - } + // console.log("ERROR can't load: " + img.src); + img.src = window.searxng.settings.theme_static_path + "/img/img_load_error.svg"; + }, + {once: true} )); if (d.querySelector('#search_url button#copy_url')) { diff --git a/searx/static/themes/simple/svg4web.svgo.js b/searx/static/themes/simple/svg4web.svgo.js index 83f74cde1..5e12251f3 100644 --- a/searx/static/themes/simple/svg4web.svgo.js +++ b/searx/static/themes/simple/svg4web.svgo.js @@ -14,6 +14,5 @@ module.exports = { 'sortAttrs', // Optimize SVG for WEB usage 'convertStyleToAttrs', - 'removeXMLNS' ], }; |