« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/generateFlashActSidebar.js31
-rw-r--r--src/strings-default.json4
2 files changed, 8 insertions, 27 deletions
diff --git a/src/content/dependencies/generateFlashActSidebar.js b/src/content/dependencies/generateFlashActSidebar.js
index ff5dc049..f8ad33db 100644
--- a/src/content/dependencies/generateFlashActSidebar.js
+++ b/src/content/dependencies/generateFlashActSidebar.js
@@ -75,27 +75,9 @@ export default {
     const currentActIndex =
       currentSideActs.indexOf(act);
 
-    const visualNovelActs = [
-      findFlashAct('flash-act:friendsim'),
-      findFlashAct('flash-act:pesterquest'),
-      findFlashAct('flash-act:psycholonials'),
-    ];
-
-    const gameSeriesActs = [
-      findFlashAct('flash-act:hiveswap'),
-    ];
-
-    const listTerminology =
-      (visualNovelActs.includes(act)
-        ? 'volumesInThisGame'
-     : gameSeriesActs.includes(act)
-        ? 'gamesInThisSeries'
-     : act === findFlashAct('flash-act:other-fan-adventures')
-        ? 'flashesInThisSection'
-     : currentSideIndex <= 1
+    const fallbackListTerminology =
+      (currentSideIndex <= 1
         ? 'flashesInThisAct'
-     : currentSideIndex === 3
-        ? 'flashesInThisStory'
         : 'entriesInThisSection');
 
     return {
@@ -109,7 +91,7 @@ export default {
       currentActFlashes,
       currentFlashIndex,
 
-      listTerminology,
+      fallbackListTerminology,
     };
   },
 
@@ -140,7 +122,8 @@ export default {
     currentActIndex: query.currentActIndex,
     currentFlashIndex: query.currentFlashIndex,
 
-    listTerminology: query.listTerminology,
+    customListTerminology: act.listTerminology,
+    fallbackListTerminology: query.fallbackListTerminology,
   }),
 
   generate(data, relations, {getColors, html, language}) {
@@ -154,7 +137,9 @@ export default {
         [
           html.tag('summary',
             html.tag('span', {class: 'group-name'},
-              language.$('flashSidebar.flashList', data.listTerminology))),
+              (data.customListTerminology
+                ? language.sanitize(data.customListTerminology)
+                : language.$('flashSidebar.flashList', data.fallbackListTerminology)))),
 
           html.tag('ul',
             relations.currentActFlashLinks
diff --git a/src/strings-default.json b/src/strings-default.json
index 7a7fa041..b6471bdf 100644
--- a/src/strings-default.json
+++ b/src/strings-default.json
@@ -324,10 +324,6 @@
   "flashPage.title": "{FLASH}",
   "flashPage.nav.flash": "{FLASH}",
   "flashSidebar.flashList.flashesInThisAct": "Flashes in this act",
-  "flashSidebar.flashList.flashesInThisStory": "Flashes in this story",
-  "flashSidebar.flashList.flashesInThisSection": "Flashes in this section",
-  "flashSidebar.flashList.volumesInThisGame": "Volumes in this game",
-  "flashSidebar.flashList.gamesInThisSeries": "Games in this series",
   "flashSidebar.flashList.entriesInThisSection": "Entries in this section",
   "groupSidebar.title": "Groups",
   "groupSidebar.groupList.category": "{CATEGORY}",