nodebb-plugin-ezoic-infinite 1.5.87 → 1.5.88

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 -45
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.5.87",
3
+ "version": "1.5.88",
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
@@ -1,28 +1,7 @@
1
1
  (function () {
2
2
  'use strict';
3
3
 
4
- // ===== V4 stateless anti-remontée =====
5
- function purgeAllEzoicWraps(root) {
6
- var scope = root || document;
7
- try {
8
- scope.querySelectorAll('.nodebb-ezoic-wrap').forEach(function (n) {
9
- try { n.remove(); } catch (e) {}
10
- });
11
- } catch (e) {}
12
- }
13
-
14
- function resetEzoicState() {
15
- try { if (typeof shownAdsSet !== 'undefined' && shownAdsSet && shownAdsSet.clear) shownAdsSet.clear(); } catch (e) {}
16
- try { if (typeof pendingShowSet !== 'undefined' && pendingShowSet && pendingShowSet.clear) pendingShowSet.clear(); } catch (e) {}
17
- try { if (typeof showQueue !== 'undefined') showQueue = []; } catch (e) {}
18
- }
19
-
20
- function hardResetAndReinject() {
21
- purgeAllEzoicWraps(document);
22
- resetEzoicState();
23
- try { if (typeof scheduleInject === 'function') scheduleInject(); } catch (e) {}
24
- }
25
- // ===== /V4 =====
4
+ var EZOIC_SAFE_MODE = true;
26
5
 
27
6
 
28
7
  // Track scroll direction to avoid aggressive recycling when the user scrolls upward.
@@ -728,11 +707,12 @@ function globalGapFixInit() {
728
707
  }
729
708
 
730
709
  function pruneOrphanWraps(kindClass, items) {
731
- return;
710
+ // V4.1 safe mode: no DOM removals here to avoid breaking infinite-scroll internals.
711
+ return;
732
712
  }
733
713
 
734
714
  function decluster(kindClass) {
735
- return;
715
+ return;
736
716
  }
737
717
 
738
718
  // ---------------- show (preload / fast fill) ----------------
@@ -972,8 +952,6 @@ function buildOrdinalMap(items) {
972
952
  }
973
953
 
974
954
  function injectBetween(kindClass, items, interval, showFirst, allIds, cursorKey) {
975
- try { if (containerEl) purgeAllEzoicWraps(containerEl); } catch (e) {}
976
-
977
955
  if (!items.length) return 0;
978
956
 
979
957
  const { map: ordinalMap, max: maxOrdinal } = buildOrdinalMap(items);
@@ -999,7 +977,7 @@ function buildOrdinalMap(items) {
999
977
  if (!id) {
1000
978
  // Only recycle while scrolling down. Recycling while scrolling up tends to
1001
979
  // cause perceived instability (ads bunching/disappearing).
1002
- recycledWrap = scrollDir > 0 ? pickRecyclableWrap(kindClass) : null;
980
+ recycledWrap = null;
1003
981
  if (recycledWrap) {
1004
982
  id = recycledWrap.getAttribute('data-ezoic-wrapid') || '';
1005
983
  }
@@ -1022,11 +1000,11 @@ function buildOrdinalMap(items) {
1022
1000
  }
1023
1001
 
1024
1002
  function pickRecyclableWrap(kindClass) {
1025
- return null;
1003
+ return null;
1026
1004
  }
1027
1005
 
1028
1006
  function moveWrapAfter(anchorEl, wrap, kindClass, afterPos) {
1029
- return;
1007
+ return;
1030
1008
  }
1031
1009
 
1032
1010
  async function runCore() {
@@ -1366,19 +1344,3 @@ return;
1366
1344
  insertHeroAdEarly().catch(() => {});
1367
1345
  requestBurst();
1368
1346
  })();
1369
-
1370
-
1371
-
1372
- // V4 stateless hooks
1373
- try {
1374
- if (typeof window !== 'undefined' && window.jQuery) {
1375
- window.jQuery(window).off('action:ajaxify.start.ezoicv4 action:infiniteScroll.start.ezoicv4 action:ajaxify.end.ezoicv4 action:infiniteScroll.loaded.ezoicv4');
1376
- window.jQuery(window).on('action:ajaxify.start.ezoicv4 action:infiniteScroll.start.ezoicv4', function () {
1377
- hardResetAndReinject();
1378
- });
1379
- window.jQuery(window).on('action:ajaxify.end.ezoicv4 action:infiniteScroll.loaded.ezoicv4', function () {
1380
- hardResetAndReinject();
1381
- });
1382
- }
1383
- } catch (e) {}
1384
-