undo button is back
This commit is contained in:
parent
fa979cb973
commit
84d9222a1c
@ -93,12 +93,16 @@ function loadGame(state) {
|
|||||||
box.placeholder = state.boxesPlaceholders[i]
|
box.placeholder = state.boxesPlaceholders[i]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
restartLink.classList.remove("disabled")
|
||||||
|
undoButton.disabled = false
|
||||||
fixGridLink.href = "?" + state.boxesValues.map(value => value || UNKNOWN).join("")
|
fixGridLink.href = "?" + state.boxesValues.map(value => value || UNKNOWN).join("")
|
||||||
} else {
|
} else {
|
||||||
boxes.filter(box => !box.disabled).forEach(box => {
|
boxes.filter(box => !box.disabled).forEach(box => {
|
||||||
box.value = ""
|
box.value = ""
|
||||||
box.placeholder = ""
|
box.placeholder = ""
|
||||||
})
|
})
|
||||||
|
restartLink.classList.add("disabled")
|
||||||
|
undoButton.disabled = true
|
||||||
fixGridLink.href = ""
|
fixGridLink.href = ""
|
||||||
}
|
}
|
||||||
boxes.forEach(searchCandidatesOf)
|
boxes.forEach(searchCandidatesOf)
|
||||||
@ -168,6 +172,8 @@ function oninput() {
|
|||||||
saveGame()
|
saveGame()
|
||||||
fixGridLink.href = "?" + boxes.map(box => box.value || UNKNOWN).join("")
|
fixGridLink.href = "?" + boxes.map(box => box.value || UNKNOWN).join("")
|
||||||
}
|
}
|
||||||
|
restartLink.classList.remove("disabled")
|
||||||
|
undoButton.disabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkBox(box) {
|
function checkBox(box) {
|
||||||
|
@ -27,7 +27,8 @@
|
|||||||
<label for='highlighterCheckbox' class='btn btn-info' title='Surligner les lignes, colonnes et régions contenant déjà le chiffre sélectionné'><i class="ri-mark-pen-fill"></i></label>
|
<label for='highlighterCheckbox' class='btn btn-info' title='Surligner les lignes, colonnes et régions contenant déjà le chiffre sélectionné'><i class="ri-mark-pen-fill"></i></label>
|
||||||
</div>
|
</div>
|
||||||
<button id="hintButton" type="button" class='btn btn-info' onclick="showHint()" title="Montrer une case avec une seule possibilité" accesskey="H" disabled=""><i class="ri-lightbulb-line"></i></button>
|
<button id="hintButton" type="button" class='btn btn-info' onclick="showHint()" title="Montrer une case avec une seule possibilité" accesskey="H" disabled=""><i class="ri-lightbulb-line"></i></button>
|
||||||
<a class='btn btn-primary' href="" title='Recommencer'><i class="ri-restart-line"></i></a>
|
<a id='restartLink' class='btn btn-primary disabled' href="" title='Recommencer'><i class="ri-restart-line"></i></a>
|
||||||
|
<button id='undoButton' type='button' class='btn btn-primary' onclick='window.history.back()' disabled title='Annuler' accesskey='Z'><i class="ri-arrow-go-back-fill"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<form id='sudokuForm' class='needs-validation' novalidate>
|
<form id='sudokuForm' class='needs-validation' novalidate>
|
||||||
<table id='grid' class='table mb-2'>
|
<table id='grid' class='table mb-2'>
|
||||||
@ -71,7 +72,7 @@
|
|||||||
if (isset($warning))
|
if (isset($warning))
|
||||||
echo("<strong>⚠️ $warning ⚠️</strong><br/>");
|
echo("<strong>⚠️ $warning ⚠️</strong><br/>");
|
||||||
else
|
else
|
||||||
echo("<p>Remplissez la grille de sorte que chaque ligne, colonne et région (carré de 3×3 cases) contienne tous les chiffres de 1 à 9.</p>\n<p>Vous pouvez annuler une action en revenant à la page précédente.</p>")
|
echo("Remplissez la grille de sorte que chaque ligne, colonne et région (carré de 3×3 cases) contienne tous les chiffres de 1 à 9.")
|
||||||
?></div>
|
?></div>
|
||||||
<ul id='contextMenu' class='context-menu modal-content shadow list-group w-auto position-absolute'></ul>
|
<ul id='contextMenu' class='context-menu modal-content shadow list-group w-auto position-absolute'></ul>
|
||||||
<footer>
|
<footer>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user