« get me outta code hell

content: generateFlashActSidebar: use flash act listTermonology - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-24 10:48:10 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-24 10:48:59 -0300
commitf64118417ea45178cfa50c181c9c102e5c8ff1b5 (patch)
tree3ce713141d10037d2247feb479ffa56ec23f09bc
parentf461941ac3d39b307ac32e21f9ff41b47fba638b (diff)
content: generateFlashActSidebar: use flash act listTermonology
-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 ff5dc04..f8ad33d 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 7a7fa04..b6471bd 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}",