From 4a13cdb3f592d283d5491aebd86b0974a6cb14e7 Mon Sep 17 00:00:00 2001 From: Antoine Jacquin Date: Sun, 20 Sep 2026 00:28:59 +0200 Subject: [PATCH] =?UTF-8?q?Tol=C3=A9rer=20les=20coquilles=20HTML=20sans=20?= =?UTF-8?q?const=20OVERVIEW=20(alias=20gard=C3=A9=20dans=20app.js)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lidar_pipeline/index.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lidar_pipeline/index.py b/lidar_pipeline/index.py index 4ce6cb9..15949a4 100644 --- a/lidar_pipeline/index.py +++ b/lidar_pipeline/index.py @@ -2365,7 +2365,11 @@ const OV_HOLD_POLL_MS = 120; // sondage « gagnant affiché ? » const OV_FADE_MS = 340; // fondu du perdant + marge de libération const OV_HOLD_CAP_MS = 2500; // délai maxi avant de libérer quand même -const ovMeta = () => { for (const k in OVERVIEW) return OVERVIEW[k]; return null; }; +// Coquilles anciennes : l'index.html embarqué peut dater d'avant cette +// couche (pas de const OVERVIEW) — alias sûr, jamais de référence directe. +const OVM = (typeof OVERVIEW !== 'undefined' && OVERVIEW) ? OVERVIEW : {}; + +const ovMeta = () => { for (const k in OVM) return OVM[k]; return null; }; function registerOverview() { const meta = ovMeta(); @@ -2570,13 +2574,13 @@ function syncTileLayers() { // Overview : mêmes couches actives, une par couche disponible. if (ovEntry && ovEntry.div) { for (const k of Object.keys(ovEntry.imgs)) { - if (act.includes(k) && OVERVIEW[k]) continue; + if (act.includes(k) && OVM[k]) continue; ovEntry.imgs[k].src = ''; ovEntry.imgs[k].remove(); delete ovEntry.imgs[k]; } act.forEach((k, i) => { - if (!OVERVIEW[k]) return; + if (!OVM[k]) return; let img = ovEntry.imgs[k]; if (!img) { img = document.createElement('img'); @@ -2705,8 +2709,8 @@ function updateImages() { if (ovEntry) { for (const k in ovEntry.imgs) { const img = ovEntry.imgs[k]; - if (ovOn && OVERVIEW[k]) { - plan.push([img, OVERVIEW[k].url]); + if (ovOn && OVM[k]) { + plan.push([img, OVM[k].url]); } else if (img.getAttribute('src') !== null) { img.dataset.want = ''; if (ovLoser && !img.dataset.loser) { @@ -4283,9 +4287,9 @@ function mergeTilesData(data) { let ovChanged = false; if (data.overview) { for (const k of Object.keys(data.overview)) { - const cur = OVERVIEW[k]; + const cur = OVM[k]; if (cur && cur.url === data.overview[k].url) continue; - OVERVIEW[k] = data.overview[k]; + OVM[k] = data.overview[k]; ovChanged = true; } if (ovChanged && !ovEntry) {