nodebb-plugin-ezoic-infinite 1.7.56 → 1.7.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/client.js +8 -7
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NodeBB Ezoic Infinite Ads — client.js
|
|
2
|
+
* NodeBB Ezoic Infinite Ads — client.js v62
|
|
3
3
|
*
|
|
4
4
|
* Historique
|
|
5
5
|
* ──────────
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
* v53 S.recycling garde double-recyclage. pickId early-exit. cleanup complet.
|
|
19
19
|
* v54 ensureTcfLocator rappelé à chaque ajaxify.end.
|
|
20
20
|
* v56 scheduleEmptyCheck / is-empty supprimés (collapse prématuré).
|
|
21
|
+
* v62 is-empty réintroduit : collapse 60s après insertion du wrap (pas après
|
|
22
|
+
* showAds) si isFilled est toujours false. Évite les trous permanents.
|
|
21
23
|
* v61 recycleAndMove : ne pas recycler un wrap rempli depuis moins de 30s.
|
|
22
24
|
* Empêche qu'une pub qui vient de charger soit déplacée immédiatement.
|
|
23
25
|
* v59 CSS : min-height 90px sur ezoic-ad-between (anti-CLS AMP ads).
|
|
@@ -331,6 +333,7 @@
|
|
|
331
333
|
mutate(() => el.insertAdjacentElement('afterend', w));
|
|
332
334
|
S.mountedIds.add(id);
|
|
333
335
|
S.wrapByKey.set(key, w);
|
|
336
|
+
scheduleEmptyCheck(id);
|
|
334
337
|
return w;
|
|
335
338
|
}
|
|
336
339
|
|
|
@@ -422,15 +425,14 @@
|
|
|
422
425
|
startShow(id);
|
|
423
426
|
}
|
|
424
427
|
|
|
425
|
-
function scheduleEmptyCheck(id
|
|
428
|
+
function scheduleEmptyCheck(id) {
|
|
426
429
|
setTimeout(() => {
|
|
427
430
|
try {
|
|
428
431
|
const ph = document.getElementById(`${PH_PREFIX}${id}`);
|
|
429
432
|
const wrap = ph?.closest?.(`.${WRAP_CLASS}`);
|
|
430
433
|
if (!wrap || !ph?.isConnected) return;
|
|
431
|
-
//
|
|
432
|
-
if ((
|
|
433
|
-
wrap.classList.toggle('is-empty', !isFilled(ph));
|
|
434
|
+
// Collapse uniquement si vraiment vide après 60s
|
|
435
|
+
if (!isFilled(wrap)) wrap.classList.add('is-empty');
|
|
434
436
|
} catch (_) {}
|
|
435
437
|
}, EMPTY_CHECK_MS);
|
|
436
438
|
}
|
|
@@ -464,12 +466,11 @@
|
|
|
464
466
|
if (t - (S.lastShow.get(id) ?? 0) < SHOW_THROTTLE_MS) { clearTimeout(timer); return release(); }
|
|
465
467
|
S.lastShow.set(id, t);
|
|
466
468
|
// Marquer le wrap avec le timestamp de fill pour bloquer le recyclage
|
|
467
|
-
try { const w = document.getElementById(`${PH_PREFIX}${id}`)?.closest?.(`.${WRAP_CLASS}`); if (w) w.setAttribute('data-ezoic-filled', String(t)); } catch (_) {}
|
|
469
|
+
try { const w = document.getElementById(`${PH_PREFIX}${id}`)?.closest?.(`.${WRAP_CLASS}`); if (w) { w.setAttribute('data-ezoic-filled', String(t)); w.classList.remove('is-empty'); } } catch (_) {}
|
|
468
470
|
window.ezstandalone = window.ezstandalone || {};
|
|
469
471
|
const ez = window.ezstandalone;
|
|
470
472
|
const doShow = () => {
|
|
471
473
|
try { ez.showAds(id); } catch (_) {}
|
|
472
|
-
scheduleEmptyCheck(id, t);
|
|
473
474
|
setTimeout(() => { clearTimeout(timer); release(); }, 700);
|
|
474
475
|
};
|
|
475
476
|
Array.isArray(ez.cmd) ? ez.cmd.push(doShow) : doShow();
|