« get me outta code hell

update old wikiInfo.features.X style accesses - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-02-16 22:31:36 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-02-16 22:31:36 -0400
commitebfd6037093b7bb28418b3f56b888df2f95692a3 (patch)
treeb274813359a45b0a2d06d4481176348107bd1330 /src/page
parentb3695dbb8cfdd819a82c6d0eed32b5f94a0c1e51 (diff)
update old wikiInfo.features.X style accesses
Diffstat (limited to 'src/page')
-rw-r--r--src/page/artist.js10
-rw-r--r--src/page/flash.js2
-rw-r--r--src/page/group.js8
-rw-r--r--src/page/homepage.js8
-rw-r--r--src/page/listing.js2
-rw-r--r--src/page/news.js2
-rw-r--r--src/page/tag.js4
-rw-r--r--src/page/track.js4
8 files changed, 20 insertions, 20 deletions
diff --git a/src/page/artist.js b/src/page/artist.js
index e6160be3..5cdb97f1 100644
--- a/src/page/artist.js
+++ b/src/page/artist.js
@@ -114,7 +114,7 @@ export function write(artist, {wikiData}) {
     const artGroups = countGroups(artThingsAll);
 
     let flashes, flashListChunks;
-    if (wikiInfo.features.flashesAndGames) {
+    if (wikiInfo.enableFlashesAndGames) {
         flashes = sortByDate(artist.flashes.asContributor.slice());
         flashListChunks = (
             chunkByProperties(flashes.map(flash => ({
@@ -232,7 +232,7 @@ export function write(artist, {wikiData}) {
                     asWallpaperArtist: artist.albums.asWallpaperArtist.map(serializeArtistsAndContrib('wallpaperArtists')),
                     asBannerArtist: artist.albums.asBannerArtist.map(serializeArtistsAndContrib('bannerArtists'))
                 },
-                flashes: wikiInfo.features.flashesAndGames ? {
+                flashes: wikiInfo.enableFlashesAndGames ? {
                     asContributor: artist.flashes.asContributor
                         .map(flash => getArtistsAndContrib(flash, 'contributors'))
                         .map(({ contrib, thing: flash }) => ({
@@ -303,7 +303,7 @@ export function write(artist, {wikiData}) {
                                     unreleasedTracks.length && `(<a href="#unreleased-tracks">${strings('artistPage.unreleasedTrackList.title')}</a>)`
                                 ].filter(Boolean).join(' '),
                                 artThingsAll.length && `<a href="#art">${strings('artistPage.artList.title')}</a>`,
-                                wikiInfo.features.flashesAndGames && flashes.length && `<a href="#flashes">${strings('artistPage.flashList.title')}</a>`,
+                                wikiInfo.enableFlashesAndGames && flashes.length && `<a href="#flashes">${strings('artistPage.flashList.title')}</a>`,
                                 commentaryThings.length && `<a href="#commentary">${strings('artistPage.commentaryList.title')}</a>`
                             ].filter(Boolean))
                         })}</p>
@@ -369,7 +369,7 @@ export function write(artist, {wikiData}) {
                                 `).join('\n')}
                             </dl>
                         `}
-                        ${wikiInfo.features.flashesAndGames && flashes.length && fixWS`
+                        ${wikiInfo.enableFlashesAndGames && flashes.length && fixWS`
                             <h2 id="flashes">${strings('artistPage.flashList.title')}</h2>
                             <dl>
                                 ${flashListChunks.map(({act, chunk, dateFirst, dateLast}) => fixWS`
@@ -492,7 +492,7 @@ function generateNavForArtist(artist, isGallery, hasGallery, {
     return {
         links: [
             {toHome: true},
-            wikiInfo.features.listings &&
+            wikiInfo.enableListings &&
             {
                 path: ['localized.listingIndex'],
                 title: strings('listingIndex.title')
diff --git a/src/page/flash.js b/src/page/flash.js
index 9c59016d..9d88bc79 100644
--- a/src/page/flash.js
+++ b/src/page/flash.js
@@ -13,7 +13,7 @@ import {
 // Page exports
 
 export function condition({wikiData}) {
-    return wikiData.wikiInfo.features.flashesAndGames;
+    return wikiData.wikiInfo.enableFlashesAndGames;
 }
 
 export function targets({wikiData}) {
diff --git a/src/page/group.js b/src/page/group.js
index 7282fc81..47828965 100644
--- a/src/page/group.js
+++ b/src/page/group.js
@@ -132,7 +132,7 @@ export function write(group, {wikiData}) {
                             time: `<b>${strings.count.duration(totalDuration, {unit: true})}</b>`
                         })
                     }</p>
-                    ${wikiInfo.features.groupUI && wikiInfo.features.listings && html.tag('p',
+                    ${wikiInfo.enableGroupUI && wikiInfo.enableListings && html.tag('p',
                         {class: 'quick-info'},
                         strings('groupGalleryPage.anotherGroupLine', {
                             link: link.listing(listingSpec.find(l => l.directory === 'groups/by-category'), {
@@ -179,7 +179,7 @@ function generateGroupSidebar(currentGroup, isGallery, {
 }) {
     const { groupCategoryData, wikiInfo } = wikiData;
 
-    if (!wikiInfo.features.groupUI) {
+    if (!wikiInfo.enableGroupUI) {
         return null;
     }
 
@@ -222,7 +222,7 @@ function generateGroupNav(currentGroup, isGallery, {
 }) {
     const { groupData, wikiInfo } = wikiData;
 
-    if (!wikiInfo.features.groupUI) {
+    if (!wikiInfo.enableGroupUI) {
         return {simple: true};
     }
 
@@ -242,7 +242,7 @@ function generateGroupNav(currentGroup, isGallery, {
     return {
         links: [
             {toHome: true},
-            wikiInfo.features.listings &&
+            wikiInfo.enableListings &&
             {
                 path: ['localized.listingIndex'],
                 title: strings('listingIndex.title')
diff --git a/src/page/homepage.js b/src/page/homepage.js
index e60256dc..e40392a1 100644
--- a/src/page/homepage.js
+++ b/src/page/homepage.js
@@ -87,7 +87,7 @@ export function writeTargetless({wikiData}) {
                 // And no, I will not make [[news]] into part of transformMultiline
                 // (even though that would 8e hilarious).
                 content: (transformMultiline(homepageInfo.sidebar.replace('[[news]]', '__GENERATE_NEWS__'))
-                    .replace('<p>__GENERATE_NEWS__</p>', wikiInfo.features.news ? fixWS`
+                    .replace('<p>__GENERATE_NEWS__</p>', wikiInfo.enableNews ? fixWS`
                         <h1>${strings('homepage.news.title')}</h1>
                         ${newsData.slice(0, 3).map((entry, i) => html.tag('article',
                             {class: ['news-entry', i === 0 && 'first-news-entry']},
@@ -106,11 +106,11 @@ export function writeTargetless({wikiData}) {
                     <h2 class="dot-between-spans">
                         ${[
                             link.home('', {text: wikiInfo.shortName, class: 'current', to}),
-                            wikiInfo.features.listings &&
+                            wikiInfo.enableListings &&
                             link.listingIndex('', {text: strings('listingIndex.title'), to}),
-                            wikiInfo.features.news &&
+                            wikiInfo.enableNews &&
                             link.newsIndex('', {text: strings('newsIndex.title'), to}),
-                            wikiInfo.features.flashesAndGames &&
+                            wikiInfo.enableFlashesAndGames &&
                             link.flashIndex('', {text: strings('flashIndex.title'), to}),
                             ...staticPageData.filter(page => page.listed).map(page =>
                                 link.staticPage(page, {text: page.shortName}))
diff --git a/src/page/listing.js b/src/page/listing.js
index d3ab79e0..3083a599 100644
--- a/src/page/listing.js
+++ b/src/page/listing.js
@@ -25,7 +25,7 @@ import {
 // Page exports
 
 export function condition({wikiData}) {
-    return wikiData.wikiInfo.features.listings;
+    return wikiData.wikiInfo.enableListings;
 }
 
 export function targets({wikiData}) {
diff --git a/src/page/news.js b/src/page/news.js
index 99cbe8d5..75ae9e48 100644
--- a/src/page/news.js
+++ b/src/page/news.js
@@ -7,7 +7,7 @@ import fixWS from 'fix-whitespace';
 // Page exports
 
 export function condition({wikiData}) {
-    return wikiData.wikiInfo.features.news;
+    return wikiData.wikiInfo.enableNews;
 }
 
 export function targets({wikiData}) {
diff --git a/src/page/tag.js b/src/page/tag.js
index 791c713d..60b8d217 100644
--- a/src/page/tag.js
+++ b/src/page/tag.js
@@ -7,7 +7,7 @@ import fixWS from 'fix-whitespace';
 // Page exports
 
 export function condition({wikiData}) {
-    return wikiData.wikiInfo.features.artTagUI;
+    return wikiData.wikiInfo.enableArtTagUI;
 }
 
 export function targets({wikiData}) {
@@ -89,7 +89,7 @@ function generateTagNav(tag, {
     return {
         links: [
             {toHome: true},
-            wikiData.wikiInfo.features.listings &&
+            wikiData.wikiInfo.enableListings &&
             {
                 path: ['localized.listingIndex'],
                 title: strings('listingIndex.title')
diff --git a/src/page/track.js b/src/page/track.js
index c2f2c592..b3cec414 100644
--- a/src/page/track.js
+++ b/src/page/track.js
@@ -49,7 +49,7 @@ export function write(track, {wikiData}) {
     const listTag = getAlbumListTag(album);
 
     let flashesThatFeature;
-    if (wikiInfo.features.flashesAndGames) {
+    if (wikiInfo.enableFlashesAndGames) {
         flashesThatFeature = sortByDate([track, ...otherReleases]
             .flatMap(track => track.flashes.map(flash => ({flash, as: track}))));
     }
@@ -250,7 +250,7 @@ export function write(track, {wikiData}) {
                             `}
                             ${!useDividedReferences && generateTrackList(tracksThatReference)}
                         `}
-                        ${wikiInfo.features.flashesAndGames && flashesThatFeature.length && fixWS`
+                        ${wikiInfo.enableFlashesAndGames && flashesThatFeature.length && fixWS`
                             <p>${strings('releaseInfo.flashesThatFeature', {track: `<i>${track.name}</i>`})}</p>
                             <ul>
                                 ${flashesThatFeature.map(({ flash, as }) => html.tag('li',