From 8ac4b80a17ce9d8d5235df6f58883079b2ce5d7d Mon Sep 17 00:00:00 2001 From: Varrience <105261606+Varrience@users.noreply.github.com> Date: Fri, 24 Jan 2025 15:11:05 -0500 Subject: [PATCH] add wk file-end recognition allows for wk (watermelon katana) configuration files to be hosted for your projects on your repo without needing a deploy link to serve the files --- API/Project/project.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/API/Project/project.js b/API/Project/project.js index 93b3a11..0e23b24 100644 --- a/API/Project/project.js +++ b/API/Project/project.js @@ -10,7 +10,7 @@ processLink(link,thumbnail) { const iscdo = link.match(/^https?:\/\/studio\.code\.org\/projects\/(applab|gamelab)\/([^/]+)/); const isscratch = link.match(/^https?:\/\/scratch\.mit\.edu\/projects\/(\d+)/) || link.match(/^https?:\/\/turbowarp\.org\/(\d+)/); const iskhan = link.match(/^https?:\/\/www\.khanacademy\.org\/computer-programming\/([^/]+\/\d+)/); - const isjsfile = link.match(/^https?:\/\/[^\s]*\.js$/); + const iswk = link.match(/^https?:\/\/[^\s]*\.wk$/); const isswf = link.match(/^https?:\/\/[^\s]*\.swf$/); if (!thumbnail && iscdo) thumbnail = `https://studio.code.org/v3/files/${iscdo[2]}/.metadata/thumbnail.png`; if (!thumbnail && isscratch) thumbnail = `https://uploads.scratch.mit.edu/get_image/project/${isscratch[1]}_432x288.png`; @@ -28,9 +28,9 @@ processLink(link,thumbnail) { link = iskhan[0]; platform = "khan"; } - if (isjsfile) { - link = isjsfile[0]; - platform = "js"; + if (iswk) { + link = iswk[0]; + platform = "wk"; } if (isswf) { link = isswf[0];