nodebb-plugin-ezoic-infinite 1.7.48 → 1.7.50
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 +1 -18
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
const A_CREATED = 'data-ezoic-created'; // timestamp création ms
|
|
39
39
|
const A_SHOWN = 'data-ezoic-shown'; // timestamp dernier showAds ms
|
|
40
40
|
|
|
41
|
-
const EMPTY_CHECK_MS = 20_000; // délai avant collapse d'un wrap vide post-show
|
|
42
41
|
const MAX_INSERTS_RUN = 6; // max insertions par appel runCore
|
|
43
42
|
const MAX_INFLIGHT = 4; // max showAds() simultanés
|
|
44
43
|
const SHOW_THROTTLE_MS = 900; // anti-spam showAds() par id
|
|
@@ -329,15 +328,11 @@
|
|
|
329
328
|
// Délais requis : destroyPlaceholders est asynchrone en interne
|
|
330
329
|
const doDestroy = () => { try { ez.destroyPlaceholders([id]); } catch (_) {} setTimeout(doDefine, 300); };
|
|
331
330
|
const doDefine = () => { try { ez.define([id]); } catch (_) {} setTimeout(doDisplay, 300); };
|
|
332
|
-
// Fix #4 : re-observer le ph après displayMore pour déclencher scheduleEmptyCheck
|
|
333
|
-
// si la pub ne charge pas (détection wrap vide).
|
|
334
331
|
const doDisplay = () => {
|
|
335
332
|
try { ez.displayMore([id]); } catch (_) {}
|
|
336
333
|
S.recycling.delete(id); // Fix #1 : séquence terminée
|
|
337
334
|
observePh(id);
|
|
338
|
-
|
|
339
|
-
try { best.setAttribute(A_SHOWN, String(t)); } catch (_) {}
|
|
340
|
-
scheduleEmptyCheck(id, t);
|
|
335
|
+
try { best.setAttribute(A_SHOWN, String(ts())); } catch (_) {}
|
|
341
336
|
};
|
|
342
337
|
try { (typeof ez.cmd?.push === 'function') ? ez.cmd.push(doDestroy) : doDestroy(); } catch (_) {}
|
|
343
338
|
|
|
@@ -511,7 +506,6 @@
|
|
|
511
506
|
const ez = window.ezstandalone;
|
|
512
507
|
const doShow = () => {
|
|
513
508
|
try { ez.showAds(id); } catch (_) {}
|
|
514
|
-
scheduleEmptyCheck(id, t);
|
|
515
509
|
setTimeout(() => { clearTimeout(timer); release(); }, 700);
|
|
516
510
|
};
|
|
517
511
|
Array.isArray(ez.cmd) ? ez.cmd.push(doShow) : doShow();
|
|
@@ -519,17 +513,6 @@
|
|
|
519
513
|
});
|
|
520
514
|
}
|
|
521
515
|
|
|
522
|
-
function scheduleEmptyCheck(id, showTs) {
|
|
523
|
-
setTimeout(() => {
|
|
524
|
-
try {
|
|
525
|
-
const ph = document.getElementById(`${PH_PREFIX}${id}`);
|
|
526
|
-
const wrap = ph?.closest?.(`.${WRAP_CLASS}`);
|
|
527
|
-
if (!wrap || !ph?.isConnected) return;
|
|
528
|
-
if (parseInt(wrap.getAttribute(A_SHOWN) || '0', 10) > showTs) return;
|
|
529
|
-
wrap.classList.toggle('is-empty', !isFilled(ph));
|
|
530
|
-
} catch (_) {}
|
|
531
|
-
}, EMPTY_CHECK_MS);
|
|
532
|
-
}
|
|
533
516
|
|
|
534
517
|
// ── Patch Ezoic showAds ────────────────────────────────────────────────────
|
|
535
518
|
//
|