diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-05-13 09:18:15 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-31 12:11:52 -0300 |
commit | 685cbad73cab59210f7f8842e4399d0550f03905 (patch) | |
tree | d27578ce708ae6a8be078341ccece5020b5c46e5 /src/static/js | |
parent | fa0b2b56ec1d69d4c74918ca587f572bb4a9e1d0 (diff) |
search, client: custom display for results w/ artwork warnings
Diffstat (limited to 'src/static/js')
-rw-r--r-- | src/static/js/client.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/static/js/client.js b/src/static/js/client.js index bee82938..31e16aa2 100644 --- a/src/static/js/client.js +++ b/src/static/js/client.js @@ -3891,17 +3891,25 @@ function generateSidebarSearchResultTemplate(slots) { } } + const imgContainer = document.createElement('span'); + imgContainer.classList.add('wiki-search-result-image-container'); + if (slots.imageSource) { const img = document.createElement('img'); img.classList.add('wiki-search-result-image'); img.setAttribute('src', slots.imageSource); - link.appendChild(img); + imgContainer.appendChild(img); + if (slots.imageSource.endsWith('.mini.jpg')) { + img.classList.add('has-warning'); + } } else { const placeholder = document.createElement('span'); placeholder.classList.add('wiki-search-result-image-placeholder'); - link.appendChild(placeholder); + imgContainer.appendChild(placeholder); } + link.appendChild(imgContainer); + const text = document.createElement('span'); text.classList.add('wiki-search-result-text-area'); |