« 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/generateChronologyLinksScopeSwitcher.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/generateChronologyLinksScopeSwitcher.js
parent32d31bc3a36a77c51441f915440a990604ebbdd3 (diff)
content: remove old chronology links
Diffstat (limited to 'src/content/dependencies/generateChronologyLinksScopeSwitcher.js')
-rw-r--r--src/content/dependencies/generateChronologyLinksScopeSwitcher.js68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/content/dependencies/generateChronologyLinksScopeSwitcher.js b/src/content/dependencies/generateChronologyLinksScopeSwitcher.js
deleted file mode 100644
index 4a1b67a7..00000000
--- a/src/content/dependencies/generateChronologyLinksScopeSwitcher.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import {stitchArrays} from '#sugar';
-
-export default {
-  extraDependencies: ['html', 'language'],
-
-  slots: {
-    scopes: {
-      validate: v => v.strictArrayOf(v.isStringNonEmpty),
-    },
-
-    contents: {
-      validate: v => v.strictArrayOf(v.isHTML),
-    },
-
-    open: {
-      type: 'boolean',
-      default: true,
-    },
-  },
-
-  generate(slots, {html, language}) {
-    // TODO: Manual [html.onlyIfContent]-alike here is a bit unfortunate.
-    // We can't use a normal [html.onlyIfContent] because the summary counts
-    // as content - we'd need to encode that we want to exclude it from the
-    // content check (for the <details> element), somehow.
-    if (slots.contents.every(content => html.isBlank(content))) {
-      return html.blank();
-    }
-
-    const summary =
-      html.tag('summary',
-        {class: 'underline-white'},
-
-        html.tag('span',
-          language.encapsulate('trackPage.nav.chronology.scope', capsule =>
-            language.$(capsule, 'title', {
-              scope:
-                slots.scopes.map((scope, index) =>
-                  html.tag('a', {class: 'switcher-link'},
-                    {href: '#'},
-
-                    (index === 0
-                      ? {style: 'display: inline'}
-                      : {style: 'display: none'}),
-
-                    language.$(capsule, scope))),
-            }))));
-
-    const scopeContents =
-      stitchArrays({
-        scope: slots.scopes,
-        content: slots.contents,
-      }).map(({scope, content}, index) =>
-          html.tag('div', {class: 'scope-' + scope},
-            (index === 0
-              ? {style: 'display: block'}
-              : {style: 'display: none'}),
-
-            content));
-
-    return (
-      html.tag('details', {class: 'scoped-chronology-switcher'},
-        slots.open &&
-          {open: true},
-
-        [summary, scopeContents]));
-  },
-};