« get me outta code hell

content, css, client: generateTextWithTooltip - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/client3.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-01-13 19:05:57 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-01-13 20:55:51 -0400
commit3c8ee4341f682edb419f9193e07f214d96209384 (patch)
tree5a3d18728d8fda6b124db25d811fecaec5055125 /src/static/client3.js
parent35720bd44ef2d6d2a2de4ca4946bfc9ee108d4a8 (diff)
content, css, client: generateTextWithTooltip
Diffstat (limited to 'src/static/client3.js')
-rw-r--r--src/static/client3.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/static/client3.js b/src/static/client3.js
index 51b1e7d..77e7e92 100644
--- a/src/static/client3.js
+++ b/src/static/client3.js
@@ -2086,28 +2086,28 @@ for (const info of groupContributionsTableInfo) {
   });
 }
 
-// Artist link icon tooltips ------------------------------
+// Generic links with tooltips ----------------------------
 
-const externalIconTooltipInfo = initInfo('externalIconTooltipInfo', {
+const textWithTooltipInfo = initInfo('textWithTooltipInfo', {
   hoverables: null,
   tooltips: null,
 });
 
-function getExternalIconTooltipReferences() {
-  const info = externalIconTooltipInfo;
+function getTextWithTooltipReferences() {
+  const info = textWithTooltipInfo;
 
   const spans =
-    Array.from(document.querySelectorAll('span.contribution.has-tooltip'));
+    Array.from(document.querySelectorAll('.text-with-tooltip'));
 
   info.hoverables =
-    spans.map(span => span.querySelector('a'));
+    spans.map(span => span.children[0]);
 
   info.tooltips =
-    spans.map(span => span.querySelector('span.icons-tooltip'));
+    spans.map(span => span.children[1]);
 }
 
-function addExternalIconTooltipPageListeners() {
-  const info = externalIconTooltipInfo;
+function addTextWithTooltipPageListeners() {
+  const info = textWithTooltipInfo;
 
   for (const {hoverable, tooltip} of stitchArrays({
     hoverable: info.hoverables,
@@ -2118,8 +2118,8 @@ function addExternalIconTooltipPageListeners() {
   }
 }
 
-clientSteps.getPageReferences.push(getExternalIconTooltipReferences);
-clientSteps.addPageListeners.push(addExternalIconTooltipPageListeners);
+clientSteps.getPageReferences.push(getTextWithTooltipReferences);
+clientSteps.addPageListeners.push(addTextWithTooltipPageListeners);
 
 // Datetimestamp tooltips ---------------------------------