diff options
-rw-r--r-- | src/misc-templates.js | 27 | ||||
-rw-r--r-- | src/write/bind-utilities.js | 16 | ||||
-rw-r--r-- | src/write/page-template.js | 4 |
3 files changed, 23 insertions, 24 deletions
diff --git a/src/misc-templates.js b/src/misc-templates.js index 7cfdc86c..9c089978 100644 --- a/src/misc-templates.js +++ b/src/misc-templates.js @@ -220,7 +220,7 @@ function unbound_generateChronologyLinks(currentThing, { // Content warning tags -function unbound_getRevealStringFromWarnings(warnings, { +function unbound_getRevealStringFromContentWarningMessage(warnings, { html, language, }) { @@ -232,14 +232,13 @@ function unbound_getRevealStringFromWarnings(warnings, { ); } -function unbound_getRevealStringFromTags(tags, { +function unbound_getRevealStringFromArtTags(tags, { + getRevealStringFromContentWarningMessage, language, - - getRevealStringFromWarnings, }) { return ( tags?.some(tag => tag.isContentWarning) && - getRevealStringFromWarnings( + getRevealStringFromContentWarningMessage( language.formatUnitList( tags .filter(tag => tag.isContentWarning) @@ -255,7 +254,7 @@ function unbound_generateCoverLink({ language, link, - getRevealStringFromTags, + getRevealStringFromArtTags, alt, path, @@ -284,7 +283,7 @@ function unbound_generateCoverLink({ id: 'cover-art', link: true, square: true, - reveal: getRevealStringFromTags(tags), + reveal: getRevealStringFromArtTags(tags), }), wikiInfo.enableArtTagUI && @@ -572,7 +571,7 @@ function unbound_getGridHTML({ html, language, - getRevealStringFromTags, + getRevealStringFromArtTags, entries, srcFn, @@ -593,7 +592,7 @@ function unbound_getGridHTML({ thumb: 'medium', lazy: typeof lazy === 'number' ? i >= lazy : lazy, square: true, - reveal: getRevealStringFromTags(item.artTags, {language}), + reveal: getRevealStringFromArtTags(item.artTags, {language}), noSrcText: noSrcTextFn(item), }), html.tag('span', item.name), @@ -929,14 +928,14 @@ function unbound_generateNavigationLinks(current, { // Sticky heading, ooooo function unbound_generateStickyHeadingContainer({ - getRevealStringFromTags, + getRevealStringFromArtTags, html, img, class: classes, coverSrc, coverAlt, - coverTags, + coverArtTags, title, }) { return html.tag('div', @@ -957,7 +956,7 @@ function unbound_generateStickyHeadingContainer({ thumb: 'small', link: false, square: true, - reveal: getRevealStringFromTags(coverTags), + reveal: getRevealStringFromArtTags(coverArtTags), }))), ]), @@ -1012,8 +1011,8 @@ export { unbound_generateChronologyLinks as generateChronologyLinks, - unbound_getRevealStringFromWarnings as getRevealStringFromWarnings, - unbound_getRevealStringFromTags as getRevealStringFromTags, + unbound_getRevealStringFromContentWarningMessage as getRevealStringFromContentWarningMessage, + unbound_getRevealStringFromArtTags as getRevealStringFromArtTags, unbound_generateCoverLink as generateCoverLink, diff --git a/src/write/bind-utilities.js b/src/write/bind-utilities.js index 6212b824..127afe2c 100644 --- a/src/write/bind-utilities.js +++ b/src/write/bind-utilities.js @@ -13,8 +13,8 @@ import { getCarouselHTML, getFlashGridHTML, getGridHTML, - getRevealStringFromTags, - getRevealStringFromWarnings, + getRevealStringFromArtTags, + getRevealStringFromContentWarningMessage, getThemeString, generateAdditionalFilesList, generateAdditionalFilesShortcut, @@ -142,15 +142,15 @@ export function bindUtilities({ fancifyURL: bound.fancifyURL, }); - bound.getRevealStringFromWarnings = bindOpts(getRevealStringFromWarnings, { + bound.getRevealStringFromContentWarningMessage = bindOpts(getRevealStringFromContentWarningMessage, { html, language, }); - bound.getRevealStringFromTags = bindOpts(getRevealStringFromTags, { + bound.getRevealStringFromArtTags = bindOpts(getRevealStringFromArtTags, { language, - getRevealStringFromWarnings: bound.getRevealStringFromWarnings, + getRevealStringFromContentWarningMessage: bound.getRevealStringFromContentWarningMessage, }); bound.getArtistString = bindOpts(getArtistString, { @@ -194,7 +194,7 @@ export function bindUtilities({ bound.generateStickyHeadingContainer = bindOpts(generateStickyHeadingContainer, { [bindOpts.bindIndex]: 0, - getRevealStringFromTags: bound.getRevealStringFromTags, + getRevealStringFromArtTags: bound.getRevealStringFromArtTags, html, img: bound.img, }); @@ -217,7 +217,7 @@ export function bindUtilities({ to, wikiData, - getRevealStringFromTags: bound.getRevealStringFromTags, + getRevealStringFromArtTags: bound.getRevealStringFromArtTags, }); bound.generateInfoGalleryLinks = bindOpts(generateInfoGalleryLinks, { @@ -238,7 +238,7 @@ export function bindUtilities({ html, language, - getRevealStringFromTags: bound.getRevealStringFromTags, + getRevealStringFromArtTags: bound.getRevealStringFromArtTags, }); bound.getAlbumGridHTML = bindOpts(getAlbumGridHTML, { diff --git a/src/write/page-template.js b/src/write/page-template.js index 6ed9fcf5..33b36d5f 100644 --- a/src/write/page-template.js +++ b/src/write/page-template.js @@ -5,7 +5,7 @@ import {getColors} from '../util/colors.js'; import { getFooterLocalizationLinks, - getRevealStringFromWarnings, + getRevealStringFromContentWarningMessage, img, } from '../misc-templates.js'; @@ -378,7 +378,7 @@ export function generateDocumentHTML(pageInfo, { src: '', link: true, square: true, - reveal: getRevealStringFromWarnings( + reveal: getRevealStringFromContentWarningMessage( html.tag('span', {class: 'info-card-art-warnings'}), {html, language}), })), |