« get me outta code hell

content: transformContent: show tooltip for images with links - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-05 17:19:19 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-07 13:36:26 -0300
commitab873b3b0594ca7424d22cbc7094e15ff33252e2 (patch)
tree3f6db69fb962a9b4c32689fe9c05d3337fe9ae51 /src/content
parentb67f0b104ae0a2f15bdc63c795a2d1150c4f1fe8 (diff)
content: transformContent: show tooltip for images with links
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/transformContent.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 654bb258..42790e7c 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -266,13 +266,22 @@ export default {
                     {class: 'pixelate'});
 
               if (link) {
-                // TODO: Would be nice to use an external link component here,
-                // just for the title text (ex. "YouTube (opens in new tab)")
                 content =
                   html.tag('a',
                     {href: link},
                     {target: '_blank'},
 
+                    {title:
+                      language.$('misc.external.opensInNewTab', {
+                        link:
+                          language.formatExternalLink(link, {
+                            style: 'platform',
+                          }),
+
+                        annotation:
+                          language.$('misc.external.opensInNewTab.annotation'),
+                      }).toString()},
+
                     content);
               }