diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-04-16 12:30:06 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-04-16 12:30:06 -0300 |
commit | d005f9f543d44670f88b831a55b695b515e81454 (patch) | |
tree | 4c985d3dd0b9b9784fd16666d9beced6c7f2df8f /src | |
parent | 743c70043fb14c6b0a6a434803de0e6562f834e0 (diff) |
content, client: yeet some unused lyrics code
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateTrackInfoPage.js | 12 | ||||
-rw-r--r-- | src/static/js/client/index.js | 2 | ||||
-rw-r--r-- | src/static/js/client/lyrics-switcher.js | 70 |
3 files changed, 0 insertions, 84 deletions
diff --git a/src/content/dependencies/generateTrackInfoPage.js b/src/content/dependencies/generateTrackInfoPage.js index ca6f82b9..11d179ad 100644 --- a/src/content/dependencies/generateTrackInfoPage.js +++ b/src/content/dependencies/generateTrackInfoPage.js @@ -311,18 +311,6 @@ export default { relations.lyricsSection, - // html.tags([ - // relations.contentHeading.clone() - // .slots({ - // attributes: {id: 'lyrics'}, - // title: language.$('releaseInfo.lyrics'), - // }), - - // html.tag('blockquote', - // {[html.onlyIfContent]: true}, - // relations.lyrics.slot('mode', 'lyrics')), - // ]), - html.tags([ relations.contentHeading.clone() .slots({ diff --git a/src/static/js/client/index.js b/src/static/js/client/index.js index b2343f07..81ea3415 100644 --- a/src/static/js/client/index.js +++ b/src/static/js/client/index.js @@ -15,7 +15,6 @@ import * as hoverableTooltipModule from './hoverable-tooltip.js'; import * as imageOverlayModule from './image-overlay.js'; import * as intrapageDotSwitcherModule from './intrapage-dot-switcher.js'; import * as liveMousePositionModule from './live-mouse-position.js'; -import * as lyricsSwitcherModule from './lyrics-switcher.js'; import * as quickDescriptionModule from './quick-description.js'; import * as scriptedLinkModule from './scripted-link.js'; import * as sidebarSearchModule from './sidebar-search.js'; @@ -38,7 +37,6 @@ export const modules = [ imageOverlayModule, intrapageDotSwitcherModule, liveMousePositionModule, - lyricsSwitcherModule, quickDescriptionModule, scriptedLinkModule, sidebarSearchModule, diff --git a/src/static/js/client/lyrics-switcher.js b/src/static/js/client/lyrics-switcher.js deleted file mode 100644 index b350ea50..00000000 --- a/src/static/js/client/lyrics-switcher.js +++ /dev/null @@ -1,70 +0,0 @@ -/* eslint-env browser */ - -import {stitchArrays} from '../../shared-util/sugar.js'; - -import {cssProp} from '../client-util.js'; - -export const info = { - id: 'lyricsSwitcherInfo', - - entries: null, - switchLinks: null, - currentLinks: null, -}; - -export function getPageReferences() { - const content = document.getElementById('content'); - - if (!content) return; - - const switcher = content.querySelector('.lyrics-switcher'); - - if (!switcher) return; - - info.entries = - Array.from(content.querySelectorAll('.lyrics-entry')); - - info.currentLinks = - Array.from(switcher.querySelectorAll('a.current')); - - info.switchLinks = - Array.from(switcher.querySelectorAll('a:not(.current)')); -} - -export function addPageListeners() { - if (!info.switchLinks) return; - - for (const {switchLink, entry} of stitchArrays({ - switchLink: info.switchLinks, - entry: info.entries, - })) { - switchLink.addEventListener('click', domEvent => { - domEvent.preventDefault(); - showLyricsEntry(entry); - }); - } -} - -function showLyricsEntry(entry) { - const entryToShow = entry; - - stitchArrays({ - entry: info.entries, - currentLink: info.currentLinks, - switchLink: info.switchLinks, - }).forEach(({ - entry, - currentLink, - switchLink, - }) => { - if (entry === entryToShow) { - cssProp(entry, 'display', null); - cssProp(currentLink, 'display', null); - cssProp(switchLink, 'display', 'none'); - } else { - cssProp(entry, 'display', 'none'); - cssProp(currentLink, 'display', 'none'); - cssProp(switchLink, 'display', null); - } - }); -} |