nodebb-plugin-ezoic-infinite 1.4.30 → 1.4.32

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 +15 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.30",
3
+ "version": "1.4.32",
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
@@ -328,6 +328,9 @@
328
328
 
329
329
  function callShowAdsWhenReady(id) {
330
330
  if (!id) return;
331
+ if (window.location.pathname !== '/') {
332
+ console.log('[AJAXIFY] callShowAdsWhenReady ID:', id);
333
+ }
331
334
 
332
335
  const now = Date.now(), last = state.lastShowById.get(id) || 0;
333
336
  if (now - last < 3500) return;
@@ -354,6 +357,9 @@
354
357
  attempts += 1;
355
358
  const el = document.getElementById(phId);
356
359
  if (el && el.isConnected) {
360
+ if (window.location.pathname !== '/') {
361
+ console.log('[AJAXIFY] Placeholder', id, 'trouvé, appel showAds');
362
+ }
357
363
  // Si doCall() réussit, Ezoic est chargé et showAds a été appelé → sortir
358
364
  if (doCall()) {
359
365
  state.pendingById.delete(id); // nettoyage au cas où
@@ -553,6 +559,8 @@
553
559
  }
554
560
 
555
561
  async function runCore() {
562
+ const isAjaxify = window.location.pathname !== '/';
563
+ if (isAjaxify) console.log('[AJAXIFY] runCore - pageKey:', state.pageKey);
556
564
  patchShowAds();
557
565
 
558
566
  const cfg = await fetchConfig();
@@ -589,6 +597,10 @@
589
597
  }
590
598
  }
591
599
 
600
+ if (window.location.pathname !== '/') {
601
+ console.log('[AJAXIFY] Inserted:', inserted, 'wrappers. Items count:', count);
602
+ }
603
+
592
604
  enforceNoAdjacentAds();
593
605
 
594
606
  // If nothing inserted and list isn't in DOM yet (first click), retry a bit
@@ -639,14 +651,11 @@
639
651
  $(window).on('action:ajaxify.start.ezoicInfinite', () => cleanup());
640
652
 
641
653
  $(window).on('action:ajaxify.end.ezoicInfinite', () => {
654
+ console.log('[AJAXIFY] ajaxify.end - juste update pageKey');
642
655
  state.pageKey = getPageKey();
643
656
  ensureObserver();
644
-
645
- // Attendre que le DOM soit construit par NodeBB
646
- setTimeout(() => {
647
- // Puis attendre que Ezoic soit prêt (comme au chargement initial)
648
- waitForEzoicThenRun();
649
- }, 500);
657
+ // NE RIEN FAIRE d'autre ici
658
+ // Les hooks category.loaded/topics.loaded/etc. vont déclencher scheduleRun
650
659
  });
651
660
 
652
661
  $(window).on('action:category.loaded.ezoicInfinite', () => {