Tolérer les coquilles HTML sans const OVERVIEW (alias gardé dans app.js)
This commit is contained in:
@ -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 <img> 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) {
|
||||
|
||||
Reference in New Issue
Block a user