nodebb-plugin-ezoic-infinite 1.7.62 → 1.7.63

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/client.js +10 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.7.62",
3
+ "version": "1.7.63",
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
@@ -138,6 +138,14 @@
138
138
  S.pools.posts = parseIds(cfg.messagePlaceholderIds);
139
139
  S.pools.categories = parseIds(cfg.categoryPlaceholderIds);
140
140
  S.poolsReady = true;
141
+ // Déclarer tous les ids du pool une seule fois — Ezoic les enregistre en interne
142
+ const allIds = [...S.pools.topics, ...S.pools.posts, ...S.pools.categories];
143
+ if (allIds.length) {
144
+ window.ezstandalone = window.ezstandalone || {};
145
+ const ez = window.ezstandalone;
146
+ const doDef = () => { try { ez.define(allIds); } catch (_) {} };
147
+ typeof ez.cmd?.push === 'function' ? ez.cmd.push(doDef) : doDef();
148
+ }
141
149
  }
142
150
 
143
151
  // ── Page identity ──────────────────────────────────────────────────────────
@@ -403,15 +411,8 @@
403
411
  window.ezstandalone = window.ezstandalone || {};
404
412
  const ez = window.ezstandalone;
405
413
  const doShow = () => {
406
- // define + displayMore remettent le slot en état actif si Ezoic l'a oublié
407
- try { ez.define([id]); } catch (_) {}
408
- setTimeout(() => {
409
- try { ez.displayMore([id]); } catch (_) {}
410
- setTimeout(() => {
411
- try { ez.showAds(id); } catch (_) {}
412
- setTimeout(() => { clearTimeout(timer); release(); }, 700);
413
- }, 200);
414
- }, 200);
414
+ try { ez.showAds(id); } catch (_) {}
415
+ setTimeout(() => { clearTimeout(timer); release(); }, 700);
415
416
  };
416
417
  Array.isArray(ez.cmd) ? ez.cmd.push(doShow) : doShow();
417
418
  } catch (_) { clearTimeout(timer); release(); }