From 6911f037d68763d1331c877df6b97160c1a9682e Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 16 Mar 2021 16:10:16 -0300 Subject: fix "random" links going to "undefined" --- static/client.js | 23 +++++++---------------- upd8.js | 2 +- 2 files changed, 8 insertions(+), 17 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); diff --git a/upd8.js b/upd8.js index 2d08b9c7..ace352fe 100755 --- a/upd8.js +++ b/upd8.js @@ -131,7 +131,7 @@ const genThumbs = require('./gen-thumbs'); const C = require('./common/common'); -const CACHEBUST = 3; +const CACHEBUST = 4; const WIKI_INFO_FILE = 'wiki-info.txt'; const HOMEPAGE_INFO_FILE = 'homepage.txt'; -- cgit 1.3.0-6-gf8a5