Fusionne la correction du temps personnalise en minutes
This commit is contained in:
14
app.js
14
app.js
@@ -121,7 +121,7 @@ function initSetupPage() {
|
||||
const competitionFields = Array.from(document.querySelectorAll("[data-competition-field]"));
|
||||
const moveSecondsField = document.querySelector("#moveSecondsField");
|
||||
const timeInitialField = document.querySelector("#timeInitialField");
|
||||
const blockSecondsLabel = document.querySelector("#blockSecondsLabel");
|
||||
const blockDurationLabel = document.querySelector("#blockDurationLabel");
|
||||
const moveSecondsInput = form?.querySelector('[name="moveSeconds"]');
|
||||
const timeInitialInput = form?.querySelector('[name="timeInitialMinutes"]');
|
||||
|
||||
@@ -171,7 +171,7 @@ function initSetupPage() {
|
||||
const mode = getRadioValue(form, "mode") || "twice";
|
||||
const preset = getRadioValue(form, "preset") || "fast";
|
||||
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 timeInitialMs = getMinuteInputMs(form, "timeInitialMinutes", TIME_MODE_INITIAL_CLOCK_MS);
|
||||
const blockLabel = getBlockLabel(mode);
|
||||
@@ -205,9 +205,9 @@ function initSetupPage() {
|
||||
|
||||
document.body.classList.toggle("time-setup-mode", !moveLimitActive);
|
||||
|
||||
if (blockSecondsLabel instanceof HTMLElement) {
|
||||
blockSecondsLabel.textContent =
|
||||
blockLabel === "Block" ? "Temps du Block (secondes)" : "Temps partie (secondes)";
|
||||
if (blockDurationLabel instanceof HTMLElement) {
|
||||
blockDurationLabel.textContent =
|
||||
blockLabel === "Block" ? "Temps du Block (minutes)" : "Temps partie (minutes)";
|
||||
}
|
||||
|
||||
syncCompetitionFields();
|
||||
@@ -299,7 +299,7 @@ function initSetupPage() {
|
||||
competitionMode: isCheckboxChecked(form, "competitionMode"),
|
||||
mode: getRadioValue(form, "mode") || "twice",
|
||||
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),
|
||||
timeInitialMs: getMinuteInputMs(form, "timeInitialMinutes", TIME_MODE_INITIAL_CLOCK_MS),
|
||||
whiteName: sanitizeText(data.get("whiteName")) || "Blanc",
|
||||
@@ -2032,7 +2032,7 @@ function loadDemo(form, onRender) {
|
||||
setInputValue(form, "matchLabel", "Demo officielle ChessCubing");
|
||||
setRadioValue(form, "mode", "twice");
|
||||
setRadioValue(form, "preset", "freeze");
|
||||
setInputValue(form, "blockSeconds", "180");
|
||||
setInputValue(form, "blockMinutes", "3");
|
||||
setInputValue(form, "moveSeconds", "20");
|
||||
setInputValue(form, "timeInitialMinutes", "10");
|
||||
setInputValue(form, "whiteName", "Nora");
|
||||
|
||||
@@ -169,14 +169,14 @@
|
||||
<legend>Temps personnalisés</legend>
|
||||
<div class="timing-grid">
|
||||
<label class="field">
|
||||
<span id="blockSecondsLabel">Temps partie (secondes)</span>
|
||||
<span id="blockDurationLabel">Temps partie (minutes)</span>
|
||||
<input
|
||||
name="blockSeconds"
|
||||
name="blockMinutes"
|
||||
type="number"
|
||||
min="30"
|
||||
max="1800"
|
||||
step="5"
|
||||
value="180"
|
||||
min="1"
|
||||
max="180"
|
||||
step="1"
|
||||
value="3"
|
||||
/>
|
||||
</label>
|
||||
<label class="field" id="timeInitialField" hidden>
|
||||
|
||||
Reference in New Issue
Block a user