« get me outta code hell

content: remove old chronology links - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateChronologyLinks.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-18 14:28:15 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:17 -0300
commit9e361235d7403961a117dc36a3fb4fb04537ef77 (patch)
tree80839c0233e21ba03fc88da538c15fe11be7b0e4 /src/content/dependencies/generateChronologyLinks.js
parent32d31bc3a36a77c51441f915440a990604ebbdd3 (diff)
content: remove old chronology links
Diffstat (limited to 'src/content/dependencies/generateChronologyLinks.js')
-rw-r--r--src/content/dependencies/generateChronologyLinks.js112
1 files changed, 0 insertions, 112 deletions
diff --git a/src/content/dependencies/generateChronologyLinks.js b/src/content/dependencies/generateChronologyLinks.js
deleted file mode 100644
index 7f24ded7..00000000
--- a/src/content/dependencies/generateChronologyLinks.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import {accumulateSum, empty} from '#sugar';
-
-export default {
-  extraDependencies: ['html', 'language'],
-
-  slots: {
-    allowCollapsing: {
-      type: 'boolean',
-      default: true,
-    },
-
-    showOnly: {
-      type: 'boolean',
-      default: false,
-    },
-
-    chronologyInfoSets: {
-      validate: v =>
-        v.strictArrayOf(
-          v.validateProperties({
-            headingString: v.isString,
-            contributions: v.strictArrayOf(v.validateProperties({
-              index: v.isCountingNumber,
-              only: v.isBoolean,
-              artistDirectory: v.isDirectory,
-              artistLink: v.isHTML,
-              previousLink: v.isHTML,
-              nextLink: v.isHTML,
-            })),
-          })),
-    }
-  },
-
-  generate(slots, {html, language}) {
-    if (empty(slots.chronologyInfoSets)) {
-      return html.blank();
-    }
-
-    let infoSets = slots.chronologyInfoSets;
-
-    if (!slots.showOnly) {
-      infoSets = infoSets
-        .map(({contributions, ...entry}) => ({
-          ...entry,
-          contributions:
-            contributions
-              .filter(({only}) => !only),
-        }))
-        .filter(({contributions}) => !empty(contributions));
-    }
-
-    const totalContributionCount =
-      accumulateSum(
-        infoSets,
-        ({contributions}) => contributions.length);
-
-    if (totalContributionCount === 0) {
-      return html.blank();
-    }
-
-    if (slots.allowCollapsing && totalContributionCount > 8) {
-      return html.tag('div', {class: 'chronology'},
-        language.$('misc.chronology.seeArtistPages'));
-    }
-
-    return html.tags(
-      infoSets.map(({
-        headingString,
-        contributions,
-      }) =>
-        contributions.map(({
-          index,
-          artistLink,
-          previousLink,
-          nextLink,
-          only,
-        }) => {
-          const heading =
-            html.tag('span', {class: 'heading'},
-              language.$(headingString, {
-                index:
-                  (only
-                    ? language.formatString('misc.chronology.heading.onlyIndex')
-                    : language.formatIndex(index)),
-
-                artist: artistLink,
-              }));
-
-          const navigation =
-            !only &&
-              html.tag('span', {class: 'buttons'},
-                language.formatUnitList([
-                  previousLink?.slots({
-                    tooltipStyle: 'browser',
-                    color: false,
-                    content: language.$('misc.nav.previous'),
-                  }),
-
-                  nextLink?.slots({
-                    tooltipStyle: 'browser',
-                    color: false,
-                    content: language.$('misc.nav.next'),
-                  }),
-                ].filter(Boolean)));
-
-          return html.tag('div', {class: 'chronology'},
-            (navigation
-              ? language.$('misc.chronology.withNavigation', {heading, navigation})
-              : heading));
-        })));
-  },
-};