« get me outta code hell

content: generateChronologyLinksScopeSwitcher - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateScopedTrackChronologyLinks.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-23 16:33:45 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-30 20:48:17 -0300
commit53483407a9f1f7fe20db6574fd4127d0c875e2ce (patch)
tree2b564866c638e5f45906a9c92c1ee8e7c15ce5e4 /src/content/dependencies/generateScopedTrackChronologyLinks.js
parent7fe20d1365068c5da45b7d3123b6cea82300e6e9 (diff)
content: generateChronologyLinksScopeSwitcher
Diffstat (limited to 'src/content/dependencies/generateScopedTrackChronologyLinks.js')
-rw-r--r--src/content/dependencies/generateScopedTrackChronologyLinks.js54
1 files changed, 15 insertions, 39 deletions
diff --git a/src/content/dependencies/generateScopedTrackChronologyLinks.js b/src/content/dependencies/generateScopedTrackChronologyLinks.js
index 7cb9ee63..87a7c0fd 100644
--- a/src/content/dependencies/generateScopedTrackChronologyLinks.js
+++ b/src/content/dependencies/generateScopedTrackChronologyLinks.js
@@ -10,8 +10,6 @@ export default {
     'linkTrack',
   ],
 
-  extraDependencies: ['html', 'language'],
-
   relations(relation, album, track) {
     const albumFilter =
       (album
@@ -73,41 +71,19 @@ export default {
     };
   },
 
-  slots: {
-    scope: {
-      validate: v => v.is('wiki', 'album'),
-    },
-
-    visible: {type: 'boolean'},
-  },
-
-  generate: (relations, slots, {html, language}) =>
-    html.tag('div', {class: 'scoped-chronology'},
-      {class: 'scope-' + slots.scope},
-      slots.visible && {style: 'display: block'},
-
-      [
-        html.tag('p',
-          language.$('trackPage.nav.chronology.scope', {
-            scope:
-              html.tag('a', {class: 'scoped-chronology-switcher'},
-                {href: '#'},
-                language.$('trackPage.nav.chronology.scope', slots.scope)),
-          })),
-
-        relations.chronologyLinks.slots({
-          showOnly: true,
-
-          chronologyInfoSets: [
-            {
-              headingString: 'misc.chronology.heading.track',
-              contributions: relations.artistChronologyContributions,
-            },
-            {
-              headingString: 'misc.chronology.heading.coverArt',
-              contributions: relations.coverArtistChronologyContributions,
-            },
-          ],
-        }),
-      ]),
+  generate: (relations) =>
+    relations.chronologyLinks.slots({
+      showOnly: true,
+
+      chronologyInfoSets: [
+        {
+          headingString: 'misc.chronology.heading.track',
+          contributions: relations.artistChronologyContributions,
+        },
+        {
+          headingString: 'misc.chronology.heading.coverArt',
+          contributions: relations.coverArtistChronologyContributions,
+        },
+      ],
+    }),
 };