nodebb-plugin-ezoic-infinite 1.4.31 → 1.4.33

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 +7 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.4.31",
3
+ "version": "1.4.33",
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,9 +328,6 @@
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
- }
334
331
 
335
332
  const now = Date.now(), last = state.lastShowById.get(id) || 0;
336
333
  if (now - last < 3500) return;
@@ -357,9 +354,6 @@
357
354
  attempts += 1;
358
355
  const el = document.getElementById(phId);
359
356
  if (el && el.isConnected) {
360
- if (window.location.pathname !== '/') {
361
- console.log('[AJAXIFY] Placeholder', id, 'trouvé, appel showAds');
362
- }
363
357
  // Si doCall() réussit, Ezoic est chargé et showAds a été appelé → sortir
364
358
  if (doCall()) {
365
359
  state.pendingById.delete(id); // nettoyage au cas où
@@ -559,8 +553,6 @@
559
553
  }
560
554
 
561
555
  async function runCore() {
562
- const isAjaxify = window.location.pathname !== '/';
563
- if (isAjaxify) console.log('[AJAXIFY] runCore - pageKey:', state.pageKey);
564
556
  patchShowAds();
565
557
 
566
558
  const cfg = await fetchConfig();
@@ -597,9 +589,6 @@
597
589
  }
598
590
  }
599
591
 
600
- if (window.location.pathname !== '/') {
601
- console.log('[AJAXIFY] Inserted:', inserted, 'wrappers. Items count:', count);
602
- }
603
592
 
604
593
  enforceNoAdjacentAds();
605
594
 
@@ -651,38 +640,32 @@
651
640
  $(window).on('action:ajaxify.start.ezoicInfinite', () => cleanup());
652
641
 
653
642
  $(window).on('action:ajaxify.end.ezoicInfinite', () => {
654
- console.log('[AJAXIFY] ajaxify.end - pageKey:', getPageKey());
655
643
  state.pageKey = getPageKey();
656
644
  ensureObserver();
657
-
658
- // Attendre que le DOM soit construit par NodeBB
659
- setTimeout(() => {
660
- console.log('[AJAXIFY] Après 500ms, appel waitForEzoicThenRun');
661
- // Puis attendre que Ezoic soit prêt (comme au chargement initial)
662
- waitForEzoicThenRun();
663
- }, 500);
645
+ // NE RIEN FAIRE d'autre ici
646
+ // Les hooks category.loaded/topics.loaded/etc. vont déclencher scheduleRun
664
647
  });
665
648
 
666
649
  $(window).on('action:category.loaded.ezoicInfinite', () => {
667
650
  ensureObserver();
668
651
  // category.loaded = infinite scroll, Ezoic déjà chargé normalement
669
- setTimeout(scheduleRun, 300);
652
+ setTimeout(scheduleRun, 800);
670
653
  });
671
654
 
672
655
  $(window).on('action:topics.loaded.ezoicInfinite', () => {
673
656
  ensureObserver();
674
- setTimeout(scheduleRun, 300);
657
+ setTimeout(scheduleRun, 800);
675
658
  });
676
659
 
677
660
  $(window).on('action:topic.loaded.ezoicInfinite', () => {
678
661
  ensureObserver();
679
- setTimeout(scheduleRun, 300);
662
+ setTimeout(scheduleRun, 600);
680
663
  });
681
664
 
682
665
  $(window).on('action:posts.loaded.ezoicInfinite', () => {
683
666
  ensureObserver();
684
667
  // posts.loaded = infinite scroll
685
- setTimeout(scheduleRun, 400);
668
+ setTimeout(scheduleRun, 800);
686
669
  });
687
670
  }
688
671
 
@@ -717,7 +700,7 @@
717
700
  if (window.ezstandalone && typeof window.ezstandalone.showAds === 'function') {
718
701
  // Ezoic est prêt → lancer l'insertion
719
702
  scheduleRun();
720
- setTimeout(scheduleRun, 300);
703
+ setTimeout(scheduleRun, 800);
721
704
  return;
722
705
  }
723
706
  // Ezoic pas encore prêt