nodebb-plugin-ezoic-infinite 1.7.10 → 1.7.11
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 +15 -14
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NodeBB Ezoic Infinite Ads — client.js
|
|
2
|
+
* NodeBB Ezoic Infinite Ads — client.js v22
|
|
3
3
|
*
|
|
4
4
|
* Correctifs critiques vs v19
|
|
5
5
|
* ───────────────────────────
|
|
@@ -293,13 +293,17 @@
|
|
|
293
293
|
const meta = KIND[klass];
|
|
294
294
|
if (!meta) return;
|
|
295
295
|
|
|
296
|
-
|
|
296
|
+
// baseTag déduit du sélecteur : 'li' pour topics/catégories, '' pour posts.
|
|
297
|
+
// Pour les posts (baseTag=''), on cherche juste [data-pid="X"] sans préfixe
|
|
298
|
+
// — c'est correct car data-pid est unique dans le DOM.
|
|
299
|
+
const baseTag = meta.sel.split('[')[0];
|
|
297
300
|
|
|
298
301
|
document.querySelectorAll(`.${WRAP_CLASS}.${klass}`).forEach(w => {
|
|
299
302
|
if (ts() - parseInt(w.getAttribute(A_CREATED) || '0', 10) < MIN_PRUNE_AGE_MS) return;
|
|
303
|
+
if (isFilled(w)) return; // jamais supprimer un wrap rempli
|
|
300
304
|
|
|
301
305
|
const key = w.getAttribute(A_ANCHOR) ?? '';
|
|
302
|
-
const sid = key.slice(klass.length + 1);
|
|
306
|
+
const sid = key.slice(klass.length + 1);
|
|
303
307
|
if (!sid) { mutate(() => dropWrap(w)); return; }
|
|
304
308
|
|
|
305
309
|
const anchorEl = document.querySelector(
|
|
@@ -346,17 +350,14 @@
|
|
|
346
350
|
function ordinal(klass, el) {
|
|
347
351
|
const di = el.getAttribute('data-index');
|
|
348
352
|
if (di !== null && di !== '' && !isNaN(di)) return parseInt(di, 10);
|
|
349
|
-
// Fallback positionnel
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
} catch (_) {}
|
|
353
|
+
// Fallback positionnel — filtre par sélecteur complet pour éviter le bug
|
|
354
|
+
// baseTag='' (posts) où `:scope > ` sans tag ne fonctionne pas.
|
|
355
|
+
const fullSel = KIND[klass]?.sel ?? '';
|
|
356
|
+
let i = 0;
|
|
357
|
+
for (const s of el.parentElement?.children ?? []) {
|
|
358
|
+
if (s === el) return i;
|
|
359
|
+
if (!fullSel || s.matches?.(fullSel)) i++;
|
|
360
|
+
}
|
|
360
361
|
return 0;
|
|
361
362
|
}
|
|
362
363
|
|