diff options
Diffstat (limited to 'src/write/bind-utilities.js')
-rw-r--r-- | src/write/bind-utilities.js | 157 |
1 files changed, 10 insertions, 147 deletions
diff --git a/src/write/bind-utilities.js b/src/write/bind-utilities.js index ffaaa7a7..99df1e9c 100644 --- a/src/write/bind-utilities.js +++ b/src/write/bind-utilities.js @@ -5,51 +5,18 @@ import chroma from 'chroma-js'; import { - fancifyFlashURL, - fancifyURL, - getAlbumGridHTML, - getAlbumStylesheet, - getArtistString, - getCarouselHTML, - getFlashGridHTML, - getGridHTML, - getRevealStringFromArtTags, - getRevealStringFromContentWarningMessage, - getThemeString, - generateAdditionalFilesList, - generateAdditionalFilesShortcut, - generateChronologyLinks, - generateContentHeading, - generateCoverLink, - generateInfoGalleryLinks, - generateTrackListDividedByGroups, - generateNavigationLinks, - generateStickyHeadingContainer, - iconifyURL, - img, -} from '../misc-templates.js'; - -import { replacerSpec, transformInline, - transformLyrics, - transformMultiline, + // transformLyrics, + // transformMultiline, } from '../util/transform-content.js'; import * as html from '../util/html.js'; -import {bindOpts, withEntries} from '../util/sugar.js'; +import {bindOpts} from '../util/sugar.js'; import {getColors} from '../util/colors.js'; import {bindFind} from '../util/find.js'; - -import link, {getLinkThemeString} from '../util/link.js'; - -import { - getAlbumCover, - getArtistAvatar, - getFlashCover, - getTrackCover, -} from '../util/wiki-data.js'; +import {thumb} from '../util/urls.js'; export function bindUtilities({ absoluteTo, @@ -75,36 +42,13 @@ export function bindUtilities({ html, language, languages, + thumb, to, urls, wikiData, - }) - - bound.img = bindOpts(img, { - [bindOpts.bindIndex]: 0, - getSizeOfImageFile, - html, - to, }); - bound.getColors = bindOpts(getColors, { - chroma, - }); - - bound.getLinkThemeString = bindOpts(getLinkThemeString, { - getColors: bound.getColors, - }); - - bound.getThemeString = bindOpts(getThemeString, { - getColors: bound.getColors, - }); - - bound.link = withEntries(link, (entries) => - entries - .map(([key, fn]) => [key, bindOpts(fn, { - getLinkThemeString: bound.getLinkThemeString, - to, - })])); + bound.getColors = bindOpts(getColors, {chroma}); bound.find = bindFind(wikiData, {mode: 'warn'}); @@ -117,6 +61,7 @@ export function bindUtilities({ wikiData, }); + /* bound.transformMultiline = bindOpts(transformMultiline, { img: bound.img, to, @@ -127,81 +72,14 @@ export function bindUtilities({ transformInline: bound.transformInline, transformMultiline: bound.transformMultiline, }); + */ - bound.iconifyURL = bindOpts(iconifyURL, { - html, - language, - to, - }); - - bound.fancifyURL = bindOpts(fancifyURL, { - html, - language, - }); - - bound.fancifyFlashURL = bindOpts(fancifyFlashURL, { - [bindOpts.bindIndex]: 2, - html, - language, - - fancifyURL: bound.fancifyURL, - }); - - bound.getRevealStringFromContentWarningMessage = bindOpts(getRevealStringFromContentWarningMessage, { - html, - language, - }); - - bound.getRevealStringFromArtTags = bindOpts(getRevealStringFromArtTags, { - language, - - getRevealStringFromContentWarningMessage: bound.getRevealStringFromContentWarningMessage, - }); - - bound.getArtistString = bindOpts(getArtistString, { - html, - link: bound.link, - language, - - iconifyURL: bound.iconifyURL, - }); - - bound.getAlbumCover = bindOpts(getAlbumCover, { - to, - }); - - bound.getTrackCover = bindOpts(getTrackCover, { - to, - }); - - bound.getFlashCover = bindOpts(getFlashCover, { - to, - }); - - bound.getArtistAvatar = bindOpts(getArtistAvatar, { - to, - }); - - bound.generateAdditionalFilesShortcut = bindOpts(generateAdditionalFilesShortcut, { - html, - language, - }); - - bound.generateAdditionalFilesList = bindOpts(generateAdditionalFilesList, { - html, - language, - }); - + /* bound.generateNavigationLinks = bindOpts(generateNavigationLinks, { link: bound.link, language, }); - bound.generateContentHeading = bindOpts(generateContentHeading, { - [bindOpts.bindIndex]: 0, - html, - }); - bound.generateStickyHeadingContainer = bindOpts(generateStickyHeadingContainer, { [bindOpts.bindIndex]: 0, html, @@ -217,18 +95,6 @@ export function bindUtilities({ generateNavigationLinks: bound.generateNavigationLinks, }); - bound.generateCoverLink = bindOpts(generateCoverLink, { - [bindOpts.bindIndex]: 0, - html, - img: bound.img, - link: bound.link, - language, - to, - wikiData, - - getRevealStringFromArtTags: bound.getRevealStringFromArtTags, - }); - bound.generateInfoGalleryLinks = bindOpts(generateInfoGalleryLinks, { [bindOpts.bindIndex]: 2, link: bound.link, @@ -271,11 +137,8 @@ export function bindUtilities({ [bindOpts.bindIndex]: 0, img: bound.img, html, - }) - - bound.getAlbumStylesheet = bindOpts(getAlbumStylesheet, { - to, }); + */ return bound; } |