PGN-Parser verbessert: robustes Tokenizing mit Kommentar- und %clk-Erkennung; app.js: manuelle Partieauswahl bleibt nach Klick erhalten

This commit is contained in:
2026-05-24 14:49:07 +02:00
parent 15b6f31f62
commit 0d94cac60c
2 changed files with 40 additions and 16 deletions

12
app.js
View File

@@ -16,6 +16,7 @@ let countdown = 0;
let serverLastFetch = null;
let laraColor = null;
let currentMoveIndex = -1;
let userSelectedGame = false;
/**
* Lädt die PGN-Datei und aktualisiert die Anzeige
@@ -46,11 +47,11 @@ async function loadPGN() {
return;
}
// Finde die aktuelle/live Partie
const liveGame = getLiveGame(allLaraGames);
const targetGame = liveGame || getLatestGame(allLaraGames);
currentGame = targetGame;
// Nur automatisch wechseln, wenn der Benutzer keine andere Partie ausgewählt hat
if (!userSelectedGame) {
const liveGame = getLiveGame(allLaraGames);
currentGame = liveGame || getLatestGame(allLaraGames);
}
updateBoard();
updatePlayerInfo();
updateMovesList();
@@ -306,6 +307,7 @@ function updateAllGamesList() {
`;
entry.addEventListener('click', () => {
userSelectedGame = true;
currentGame = game;
updateBoard();
updatePlayerInfo();