nodebb-plugin-ezoic-infinite 1.4.25 → 1.4.26
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 +23 -23
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
}, WRAP_CLASS = 'ezoic-ad';
|
|
11
11
|
const PLACEHOLDER_PREFIX = 'ezoic-pub-ad-placeholder-', MAX_INSERTS_PER_RUN = 3;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
|
|
14
|
+
|
|
15
15
|
// Nécessaire pour savoir si on doit appeler destroyPlaceholders avant recyclage.
|
|
16
16
|
const sessionDefinedIds = new Set();
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
const insertingIds = new Set(), state = {
|
|
20
20
|
pageKey: null,
|
|
21
21
|
cfg: null,
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
try {
|
|
165
165
|
if (!wrap) return;
|
|
166
166
|
try { wrap.removeAttribute('data-ezoic-filled'); } catch (e) {}
|
|
167
|
-
|
|
167
|
+
if (wrap.__ezoicFillObs) { wrap.__ezoicFillObs.disconnect(); wrap.__ezoicFillObs = null; }
|
|
168
168
|
const old = wrap.querySelector && wrap.querySelector(`#${PLACEHOLDER_PREFIX}${id}`);
|
|
169
169
|
if (old) old.remove();
|
|
170
170
|
// Remove any leftover markup inside wrapper
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
try {
|
|
280
280
|
if (!wrap) return;
|
|
281
281
|
// Disconnect the fill observer first (no need to remove+re-add the attribute)
|
|
282
|
-
|
|
282
|
+
if (wrap.__ezoicFillObs) { wrap.__ezoicFillObs.disconnect(); wrap.__ezoicFillObs = null; }
|
|
283
283
|
wrap.setAttribute('data-ezoic-filled', '1');
|
|
284
284
|
} catch (e) {}
|
|
285
285
|
}
|
|
@@ -538,13 +538,15 @@
|
|
|
538
538
|
state.liveMessage = [];
|
|
539
539
|
state.liveCategory = [];
|
|
540
540
|
|
|
541
|
-
state.lastShowById
|
|
542
|
-
state.pendingById
|
|
543
|
-
state.definedIds
|
|
541
|
+
state.lastShowById.clear();
|
|
542
|
+
state.pendingById.clear();
|
|
543
|
+
state.definedIds.clear();
|
|
544
544
|
|
|
545
|
-
|
|
545
|
+
// NE PAS supprimer les wrappers Ezoic ici - ils seront supprimés naturellement
|
|
546
|
+
// quand NodeBB vide le DOM lors de la navigation ajaxify
|
|
547
|
+
// Les supprimer manuellement cause des problèmes avec l'état interne d'Ezoic
|
|
546
548
|
|
|
547
|
-
if (state.obs) {
|
|
549
|
+
if (state.obs) { state.obs.disconnect(); state.obs = null; }
|
|
548
550
|
state.scheduled = false;
|
|
549
551
|
clearTimeout(state.timer);
|
|
550
552
|
state.timer = null;
|
|
@@ -645,19 +647,17 @@
|
|
|
645
647
|
$(window).on('action:ajaxify.end.ezoicInfinite', () => {
|
|
646
648
|
state.pageKey = getPageKey();
|
|
647
649
|
ensureObserver();
|
|
648
|
-
|
|
649
|
-
//
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
setTimeout(scheduleRun, 500);
|
|
660
|
-
setTimeout(scheduleRun, 1000);
|
|
650
|
+
|
|
651
|
+
// Attendre que NodeBB ait fini de construire le DOM
|
|
652
|
+
// (ajaxify.end se déclenche avant que le contenu soit vraiment prêt)
|
|
653
|
+
setTimeout(() => {
|
|
654
|
+
scheduleRun();
|
|
655
|
+
}, 800);
|
|
656
|
+
|
|
657
|
+
// Second pass pour être sûr
|
|
658
|
+
setTimeout(() => {
|
|
659
|
+
scheduleRun();
|
|
660
|
+
}, 1500);
|
|
661
661
|
});
|
|
662
662
|
|
|
663
663
|
$(window).on('action:category.loaded.ezoicInfinite', () => {
|