diff options
| author | stonedDiscord <Tukz@gmx.de> | 2025-09-03 17:37:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-03 17:37:36 +0200 |
| commit | 0d2a3994e203755702ebe4afbd0f3c721ee8ce38 (patch) | |
| tree | 9347303eaa9daad5e10420ab1d90e24593c70df1 /webAO/client/fetchLists.ts | |
| parent | 8e46e304f4defc7f9f4eb01922812b28a8585307 (diff) | |
| parent | 035951baf3819f56093f7156b345689aa5093f28 (diff) | |
Merge pull request #270 from AttorneyOnline/ext
Let the webhost specify the extensions use
Diffstat (limited to 'webAO/client/fetchLists.ts')
| -rw-r--r-- | webAO/client/fetchLists.ts | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/webAO/client/fetchLists.ts b/webAO/client/fetchLists.ts index 2489c97..2f2fd59 100644 --- a/webAO/client/fetchLists.ts +++ b/webAO/client/fetchLists.ts @@ -50,8 +50,6 @@ export const fetchEvidenceList = async () => { try { const evidata = await request(`${AO_HOST}evidence.json`); const evi_array = JSON.parse(evidata); - // the try catch will fail before here when there is no file - evi_array.forEach((evi: string) => { evi_select.add(new Option(evi)); }); @@ -60,12 +58,19 @@ export const fetchEvidenceList = async () => { } }; -export const fetchManifest = async () => { +export const fetchExtensions = async () => { try { - const manifestdata = await request(`${AO_HOST}manifest.txt`); - client.manifest = manifestdata.split(/\r\n|\n\r|\n|\r/); - // the try catch will fail before here when there is no file + const extensiondata = await request(`${AO_HOST}extensions.json`); + const allextensions = JSON.parse(extensiondata); + client.charicon_extensions = allextensions.charicon_extensions || [".png", ".webp"]; + client.emote_extensions = allextensions.emote_extensions || [".gif", ".png", ".apng", ".webp", ".webp.static"]; + client.emotions_extensions = allextensions.emotions_extensions || [".png", ".webp"]; + client.background_extensions = allextensions.background_extensions || [".png", ".gif", ".webp", ".apng"]; + console.log("charicons "+client.charicon_extensions) + console.log("emotes "+client.emote_extensions) + console.log("emotions "+client.emotions_extensions) + console.log("backgrounds "+client.background_extensions) } catch (err) { - console.warn("there was no manifest.txt file"); + console.warn("there was no extensions.json file"); } }; |
