Compare commits
No commits in common. "7cfcdc7205953d12d73e719a7ef155395ab23dbb" and "58ef9c153eb3af190cc60e6695c16d05c80be158" have entirely different histories.
7cfcdc7205
...
58ef9c153e
@ -1,2 +1,2 @@
|
|||||||
export const version: string = "2025.01.1";
|
export const version: string = "2024.11.4";
|
||||||
export const versionTag: string = "";
|
export const versionTag: string = "";
|
||||||
|
@ -7,11 +7,37 @@
|
|||||||
const title = "Submit Registration";
|
const title = "Submit Registration";
|
||||||
let state = false;
|
let state = false;
|
||||||
let status: string;
|
let status: string;
|
||||||
let inputString: string;
|
|
||||||
|
let inputs: { id: string; value: string }[] = [
|
||||||
|
{ id: "1", value: "" },
|
||||||
|
{ id: "2", value: "" },
|
||||||
|
{ id: "3", value: "" },
|
||||||
|
{ id: "4", value: "" },
|
||||||
|
{ id: "5", value: "" },
|
||||||
|
{ id: "6", value: "" },
|
||||||
|
];
|
||||||
|
|
||||||
|
function handleInput(index: number, event: KeyboardEvent): void {
|
||||||
|
if (event.key === "Backspace" && index > 0 && inputs[index].value === "") {
|
||||||
|
const prevInput = document.getElementById(`input-${index}`);
|
||||||
|
if (prevInput) {
|
||||||
|
prevInput.focus();
|
||||||
|
}
|
||||||
|
} else if (inputs[index].value.length === 1) {
|
||||||
|
const nextInput = document.getElementById(`input-${index + 2}`);
|
||||||
|
if (nextInput) {
|
||||||
|
nextInput.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
console.log(`Code: ${inputString}`);
|
let submitString: string = "";
|
||||||
const res = await submit(inputString);
|
for (const input of inputs) {
|
||||||
|
submitString += input.value.toUpperCase();
|
||||||
|
}
|
||||||
|
console.log(`Code: ${submitString}`);
|
||||||
|
const res = await submit(submitString);
|
||||||
console.log(`Registration Status: ${res}`);
|
console.log(`Registration Status: ${res}`);
|
||||||
if (res == 201) {
|
if (res == 201) {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
@ -59,7 +85,9 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<p class="title-ish">Enter your registration code below</p>
|
<p class="title-ish">Enter your registration code below</p>
|
||||||
<form on:submit={handleSubmit} id="codeInputForm">
|
<form on:submit={handleSubmit} id="codeInputForm">
|
||||||
<input class="code-in" bind:value={inputString} id={'input'} maxlength="6" autocomplete="off">
|
{#each inputs as input, index}
|
||||||
|
<input class="code-in" bind:value={input.value} id={`input-${input.id}`} maxlength="1" autocomplete="off" on:keydown={(event) => handleInput(index, event)} />
|
||||||
|
{/each}
|
||||||
<br />
|
<br />
|
||||||
<button type="submit">Submit</button>
|
<button type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
@ -74,7 +102,7 @@
|
|||||||
.code-in {
|
.code-in {
|
||||||
margin: 3px;
|
margin: 3px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
width: calc(29px * 6);
|
width: 29px;
|
||||||
height: 39px;
|
height: 39px;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -73,11 +73,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if ($uuid == null || $uuid == "") {
|
toast("Registration soon required for PIS features.\n\nClick 'Register' in the menu.", {
|
||||||
toast("This feature will soon require registration. Register in the menu.", {
|
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const resultsCard: CardConfig = {
|
const resultsCard: CardConfig = {
|
||||||
|
@ -48,11 +48,10 @@
|
|||||||
id = (await getHeadcode()) || "";
|
id = (await getHeadcode()) || "";
|
||||||
load();
|
load();
|
||||||
|
|
||||||
if ($uuid == null || $uuid == "") {
|
toast("Registration soon required for timetable features.\n\nClick 'Register' in the menu.", {
|
||||||
toast("PIS Codes will soon be hidden for unregistered users. Register in the menu.", {
|
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function load() {
|
function load() {
|
||||||
@ -71,7 +70,7 @@
|
|||||||
{
|
{
|
||||||
loading: 'Searching Timetable',
|
loading: 'Searching Timetable',
|
||||||
success: 'Done',
|
success: 'Done',
|
||||||
error: 'No Services Found'
|
error: 'Error'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user