« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/client.js23
1 files changed, 7 insertions, 16 deletions
diff --git a/static/client.js b/static/client.js
index 9c0e621a..2b58ccb6 100644
--- a/static/client.js
+++ b/static/client.js
@@ -41,21 +41,12 @@ function getFlash(el) {
     return flashData.find(flash => flash.directory === directory);
 }
 
-function openAlbum(directory) {
-    return rebase(`${C.ALBUM_DIRECTORY}/${directory}/`);
-}
-
-function openTrack(directory) {
-    return rebase(`${C.TRACK_DIRECTORY}/${directory}/`);
-}
-
-function openArtist(directory) {
-    return rebase(`${C.ARTIST_DIRECTORY}/${directory}/`);
-}
-
-function openFlash(flash) {
-    return rebase(`${C.FLASH_DIRECTORY}/${flash.directory}/`);
-}
+// TODO: These should pro8a8ly access some shared urlSpec path. We'd need to
+// separ8te the tooling around that into common-shared code too.
+const openAlbum = d => rebase(`album/${d}`);
+const openTrack = d => rebase(`track/${d}`);
+const openArtist = d => rebase(`artist/${d}`);
+const openFlash = d => rebase(`flash/${d}`);
 
 /* i implemented these functions but we dont actually use them anywhere lol
 function isFlashPage() {
@@ -102,7 +93,7 @@ for (const a of document.body.querySelectorAll('[data-random]')) {
         }
 
         setTimeout(() => {
-            a.href = rebase(C.JS_DISABLED_DIRECTORY);
+            a.href = rebase('js-disabled');
         });
         switch (a.dataset.random) {
             case 'album': return a.href = openAlbum(pick(albumData).directory);