nodebb-plugin-ezoic-infinite 1.7.53 → 1.7.55

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.7.53",
3
+ "version": "1.7.55",
4
4
  "description": "Production-ready Ezoic infinite ads integration for NodeBB 4.x",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/public/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * NodeBB Ezoic Infinite Ads — client.js v59
2
+ * NodeBB Ezoic Infinite Ads — client.js v60
3
3
  *
4
4
  * Historique
5
5
  * ──────────
@@ -18,6 +18,7 @@
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
+ * v60 is-empty réintroduit avec délai 60s et collapse à 0px (ligne visible).
21
22
  * v59 CSS : min-height 90px sur ezoic-ad-between (anti-CLS AMP ads).
22
23
  * v58 tcfObs survit aux navigations : ne plus déconnecter dans cleanup().
23
24
  * L'iframe __tcfapiLocator doit exister en permanence pour le CMP —
@@ -36,6 +37,7 @@
36
37
  const A_ANCHOR = 'data-ezoic-anchor'; // "kindClass:stableId"
37
38
  const A_WRAPID = 'data-ezoic-wrapid'; // id Ezoic
38
39
 
40
+ const EMPTY_CHECK_MS = 60_000; // délai avant collapse wrap vide (60s — laisser le temps au CMP/enchères)
39
41
  const MAX_INSERTS_RUN = 6; // insertions max par appel runCore
40
42
  const MAX_INFLIGHT = 4; // showAds() simultanés max
41
43
  const SHOW_THROTTLE_MS = 900; // anti-spam showAds() par id
@@ -413,6 +415,19 @@
413
415
  startShow(id);
414
416
  }
415
417
 
418
+ function scheduleEmptyCheck(id, showTs) {
419
+ setTimeout(() => {
420
+ try {
421
+ const ph = document.getElementById(`${PH_PREFIX}${id}`);
422
+ const wrap = ph?.closest?.(`.${WRAP_CLASS}`);
423
+ if (!wrap || !ph?.isConnected) return;
424
+ // Ne pas écraser un showAds plus récent
425
+ if ((S.lastShow.get(id) ?? 0) > showTs) return;
426
+ wrap.classList.toggle('is-empty', !isFilled(ph));
427
+ } catch (_) {}
428
+ }, EMPTY_CHECK_MS);
429
+ }
430
+
416
431
  function drainQueue() {
417
432
  if (isBlocked()) return;
418
433
  while (S.inflight < MAX_INFLIGHT && S.pending.length) {
@@ -445,6 +460,7 @@
445
460
  const ez = window.ezstandalone;
446
461
  const doShow = () => {
447
462
  try { ez.showAds(id); } catch (_) {}
463
+ scheduleEmptyCheck(id, t);
448
464
  setTimeout(() => { clearTimeout(timer); release(); }, 700);
449
465
  };
450
466
  Array.isArray(ez.cmd) ? ez.cmd.push(doShow) : doShow();
package/public/style.css CHANGED
@@ -60,13 +60,27 @@
60
60
  /*
61
61
  Réserve 90px avant que la pub charge (hauteur standard leaderboard).
62
62
  Évite le saut de layout (CLS) quand AMP/Ezoic redimensionne l'iframe.
63
- ezoic-ad-message (posts) et ezoic-ad-categories n'ont pas de hauteur fixe
64
- car leur format varie — seul between (entre topics) est standardisé.
65
63
  */
66
64
  .nodebb-ezoic-wrap.ezoic-ad-between {
67
65
  min-height: 90px;
68
66
  }
69
67
 
68
+ /* ── État vide ────────────────────────────────────────────────────────────── */
69
+ /*
70
+ Ajouté 60s après showAds si aucun fill détecté (délai généreux pour CMP/enchères).
71
+ Collapse à 0 : évite la ligne de quelques pixels visible quand Ezoic
72
+ injecte un conteneur vide mais ne sert pas de pub.
73
+ */
74
+ .nodebb-ezoic-wrap.is-empty {
75
+ display: block !important;
76
+ height: 0 !important;
77
+ min-height: 0 !important;
78
+ max-height: 0 !important;
79
+ margin: 0 !important;
80
+ padding: 0 !important;
81
+ overflow: hidden !important;
82
+ }
83
+
70
84
  /* ── Ezoic global (hors de nos wraps) ────────────────────────────────────── */
71
85
  .ezoic-ad {
72
86
  margin: 0 !important;