Compare commits

..

2 Commits

2 changed files with 13 additions and 13 deletions

14
app.js
View File

@@ -121,7 +121,7 @@ function initSetupPage() {
const competitionFields = Array.from(document.querySelectorAll("[data-competition-field]")); const competitionFields = Array.from(document.querySelectorAll("[data-competition-field]"));
const moveSecondsField = document.querySelector("#moveSecondsField"); const moveSecondsField = document.querySelector("#moveSecondsField");
const timeInitialField = document.querySelector("#timeInitialField"); const timeInitialField = document.querySelector("#timeInitialField");
const blockSecondsLabel = document.querySelector("#blockSecondsLabel"); const blockDurationLabel = document.querySelector("#blockDurationLabel");
const moveSecondsInput = form?.querySelector('[name="moveSeconds"]'); const moveSecondsInput = form?.querySelector('[name="moveSeconds"]');
const timeInitialInput = form?.querySelector('[name="timeInitialMinutes"]'); const timeInitialInput = form?.querySelector('[name="timeInitialMinutes"]');
@@ -171,7 +171,7 @@ function initSetupPage() {
const mode = getRadioValue(form, "mode") || "twice"; const mode = getRadioValue(form, "mode") || "twice";
const preset = getRadioValue(form, "preset") || "fast"; const preset = getRadioValue(form, "preset") || "fast";
const quota = PRESETS[preset].quota; const quota = PRESETS[preset].quota;
const blockDurationMs = getDurationInputMs(form, "blockSeconds", DEFAULT_BLOCK_DURATION_MS); const blockDurationMs = getMinuteInputMs(form, "blockMinutes", DEFAULT_BLOCK_DURATION_MS);
const moveLimitMs = getDurationInputMs(form, "moveSeconds", DEFAULT_MOVE_LIMIT_MS); const moveLimitMs = getDurationInputMs(form, "moveSeconds", DEFAULT_MOVE_LIMIT_MS);
const timeInitialMs = getMinuteInputMs(form, "timeInitialMinutes", TIME_MODE_INITIAL_CLOCK_MS); const timeInitialMs = getMinuteInputMs(form, "timeInitialMinutes", TIME_MODE_INITIAL_CLOCK_MS);
const blockLabel = getBlockLabel(mode); const blockLabel = getBlockLabel(mode);
@@ -205,9 +205,9 @@ function initSetupPage() {
document.body.classList.toggle("time-setup-mode", !moveLimitActive); document.body.classList.toggle("time-setup-mode", !moveLimitActive);
if (blockSecondsLabel instanceof HTMLElement) { if (blockDurationLabel instanceof HTMLElement) {
blockSecondsLabel.textContent = blockDurationLabel.textContent =
blockLabel === "Block" ? "Temps du Block (secondes)" : "Temps partie (secondes)"; blockLabel === "Block" ? "Temps du Block (minutes)" : "Temps partie (minutes)";
} }
syncCompetitionFields(); syncCompetitionFields();
@@ -299,7 +299,7 @@ function initSetupPage() {
competitionMode: isCheckboxChecked(form, "competitionMode"), competitionMode: isCheckboxChecked(form, "competitionMode"),
mode: getRadioValue(form, "mode") || "twice", mode: getRadioValue(form, "mode") || "twice",
preset: getRadioValue(form, "preset") || "fast", preset: getRadioValue(form, "preset") || "fast",
blockDurationMs: getDurationInputMs(form, "blockSeconds", DEFAULT_BLOCK_DURATION_MS), blockDurationMs: getMinuteInputMs(form, "blockMinutes", DEFAULT_BLOCK_DURATION_MS),
moveLimitMs: getDurationInputMs(form, "moveSeconds", DEFAULT_MOVE_LIMIT_MS), moveLimitMs: getDurationInputMs(form, "moveSeconds", DEFAULT_MOVE_LIMIT_MS),
timeInitialMs: getMinuteInputMs(form, "timeInitialMinutes", TIME_MODE_INITIAL_CLOCK_MS), timeInitialMs: getMinuteInputMs(form, "timeInitialMinutes", TIME_MODE_INITIAL_CLOCK_MS),
whiteName: sanitizeText(data.get("whiteName")) || "Blanc", whiteName: sanitizeText(data.get("whiteName")) || "Blanc",
@@ -2032,7 +2032,7 @@ function loadDemo(form, onRender) {
setInputValue(form, "matchLabel", "Demo officielle ChessCubing"); setInputValue(form, "matchLabel", "Demo officielle ChessCubing");
setRadioValue(form, "mode", "twice"); setRadioValue(form, "mode", "twice");
setRadioValue(form, "preset", "freeze"); setRadioValue(form, "preset", "freeze");
setInputValue(form, "blockSeconds", "180"); setInputValue(form, "blockMinutes", "3");
setInputValue(form, "moveSeconds", "20"); setInputValue(form, "moveSeconds", "20");
setInputValue(form, "timeInitialMinutes", "10"); setInputValue(form, "timeInitialMinutes", "10");
setInputValue(form, "whiteName", "Nora"); setInputValue(form, "whiteName", "Nora");

View File

@@ -169,14 +169,14 @@
<legend>Temps personnalisés</legend> <legend>Temps personnalisés</legend>
<div class="timing-grid"> <div class="timing-grid">
<label class="field"> <label class="field">
<span id="blockSecondsLabel">Temps partie (secondes)</span> <span id="blockDurationLabel">Temps partie (minutes)</span>
<input <input
name="blockSeconds" name="blockMinutes"
type="number" type="number"
min="30" min="1"
max="1800" max="180"
step="5" step="1"
value="180" value="3"
/> />
</label> </label>
<label class="field" id="timeInitialField" hidden> <label class="field" id="timeInitialField" hidden>