add: button to start all players
This commit is contained in:
parent
b00a936c6c
commit
6517d381af
1 changed files with 19 additions and 1 deletions
20
index.html
20
index.html
|
@ -59,7 +59,19 @@
|
||||||
const nameInput = document.getElementById("nameInput");
|
const nameInput = document.getElementById("nameInput");
|
||||||
const addButton = document.getElementById("addButton");
|
const addButton = document.getElementById("addButton");
|
||||||
const resultsTable = document.getElementById("resultsTable");
|
const resultsTable = document.getElementById("resultsTable");
|
||||||
|
const startAllButton = document.getElementById("startAllButton");
|
||||||
|
|
||||||
|
startAllButton.addEventListener("click", () => {
|
||||||
|
Object.keys(players).forEach((id) => {
|
||||||
|
if (players[id].length === 0) {
|
||||||
|
players[id].push(Date.now());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setCookies(players);
|
||||||
|
renderPlayers();
|
||||||
|
reloadResultsTable();
|
||||||
|
});
|
||||||
|
|
||||||
const getCookies = () => {
|
const getCookies = () => {
|
||||||
const cookies = document.cookie.split("; ").reduce((acc, cookie) => {
|
const cookies = document.cookie.split("; ").reduce((acc, cookie) => {
|
||||||
const [key, value] = cookie.split("=");
|
const [key, value] = cookie.split("=");
|
||||||
|
@ -214,6 +226,12 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<button id="startAllButton" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
|
||||||
|
Lancer tous les chronos
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const exportToCSV = () => {
|
const exportToCSV = () => {
|
||||||
|
|
Loading…
Reference in a new issue