Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consoleVersionSelect: add version prefix #2538

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/_internal/consoleVersionSelect.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
</table>
<div id="selectversion" class="selectversion">
<br>
<select id="major">
<select id="prefix">
<option />
<option>Ver.</option>
<option>Sys.</option>
<option>Emu.</option>
<option>{{ $frontmatter.otherPrefix }}</option>
</select>&nbsp;<select id="major">
<option />
<option>11</option>
<option>10</option>
Expand Down
1 change: 1 addition & 0 deletions docs/get-started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
noneSelected: System model is required.
invalidVersion: This doesn't seem to be a valid system version.
otherPrefix: (Other)
head: [
['script', {src: '/assets/js/common.js'}],
['script', {src: '/assets/js/selecting.js'}]
Expand Down
8 changes: 7 additions & 1 deletion docs/public/assets/js/selecting.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function can_mset9(major, minor, native, region, model) {
- All models
*/
function redirect() {
const prefix = document.getElementById("prefix").value;
const major = document.getElementById("major").value;
const minor = document.getElementById("minor").value;
const nver = document.getElementById("nver").value;
Expand All @@ -170,14 +171,19 @@ function redirect() {
if(isO3DS) model = DEVICE_O3DS
else if(isN3DS) model = DEVICE_N3DS;

if (!validate_version(major, minor, nver, region, model)) {
if (prefix == '' || !validate_version(major, minor, nver, region, model)) {
document.getElementById("result_invalidVersion").style.display = "block";
return;
}

// Store selected version for some later pages
sessionStorage.setItem("selected_version", JSON.stringify({major, minor, nver, region, model}));

if(prefix != "Ver.") {
window.location.href = "checking-for-cfw";
return true;
}

const redirected = [
can_soundhax,
can_ssloth,
Expand Down