mirror of
https://github.com/hacks-guide/Guide_3DS.git
synced 2025-08-18 14:31:30 +02:00
automatically replace link to file accordingly to selected version
This commit is contained in:
committed by
lifehackerhansol
parent
18c99906c7
commit
c791cbaffe
43
docs/public/assets/js/skater-link.js
Normal file
43
docs/public/assets/js/skater-link.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright (C) 2024 DannyAAM
|
||||
|
||||
SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
(() => {
|
||||
|
||||
const BASE = "https://hacksguidewiki.sfo3.digitaloceanspaces.com/hacksguidewiki/Super-skaterhax";
|
||||
|
||||
window.MATCH = "skater.nintendohomebrew.com";
|
||||
|
||||
window.generateLink = (major, minor, nver, region, model, link) => {
|
||||
const fileRegion = FILENAME_REGION_MAP[region];
|
||||
|
||||
if (model != DEVICE_N3DS || major < 11) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let fileVersion;
|
||||
switch (region) {
|
||||
case "U":
|
||||
if (minor == 17) {
|
||||
fileVersion = "v11.17";
|
||||
} else {
|
||||
fileVersion = "pre17";
|
||||
}
|
||||
break;
|
||||
case "K":
|
||||
if (minor == 17) {
|
||||
return null;
|
||||
} else {
|
||||
fileVersion = "pre17";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fileVersion = "all";
|
||||
break;
|
||||
}
|
||||
return `${BASE}-${fileRegion}-${fileVersion}.zip`;
|
||||
}
|
||||
|
||||
})();
|
Reference in New Issue
Block a user