nodebb-plugin-ezoic-infinite 1.4.66 → 1.4.67
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 +38 -4
- package/public/style.css +5 -13
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -116,6 +116,11 @@
|
|
|
116
116
|
window.ezstandalone.destroyPlaceholders(filtered);
|
|
117
117
|
}
|
|
118
118
|
} catch (e) {}
|
|
119
|
+
|
|
120
|
+
// Recyclage: libérer IDs après 100ms
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
filtered.forEach(id => sessionDefinedIds.delete(id));
|
|
123
|
+
}, 100);
|
|
119
124
|
};
|
|
120
125
|
try {
|
|
121
126
|
window.ezstandalone = window.ezstandalone || {};
|
|
@@ -123,6 +128,35 @@
|
|
|
123
128
|
if (window.ezstandalone && typeof window.ezstandalone.destroyPlaceholders === 'function') call();
|
|
124
129
|
else window.ezstandalone.cmd.push(call);
|
|
125
130
|
} catch (e) {}
|
|
131
|
+
|
|
132
|
+
// Recyclage: libérer IDs après 100ms
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
filtered.forEach(id => sessionDefinedIds.delete(id));
|
|
135
|
+
}, 100);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Nettoyer éléments Ezoic invisibles qui créent espace vertical
|
|
139
|
+
function cleanupInvisibleEzoicElements() {
|
|
140
|
+
try {
|
|
141
|
+
document.querySelectorAll('.ezoic-ad').forEach(wrapper => {
|
|
142
|
+
// Supprimer éléments invisibles après le placeholder
|
|
143
|
+
wrapper.querySelectorAll('*').forEach(el => {
|
|
144
|
+
if (el.id && el.id.startsWith('ezoic-pub-ad-placeholder-')) return;
|
|
145
|
+
|
|
146
|
+
const rect = el.getBoundingClientRect();
|
|
147
|
+
const computed = window.getComputedStyle(el);
|
|
148
|
+
|
|
149
|
+
// Élément invisible mais prend de l'espace
|
|
150
|
+
if (
|
|
151
|
+
(computed.display !== 'none' && computed.visibility !== 'hidden') &&
|
|
152
|
+
(rect.height === 0 || computed.opacity === '0') &&
|
|
153
|
+
el.children.length === 0
|
|
154
|
+
) {
|
|
155
|
+
el.remove();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
} catch (e) {}
|
|
126
160
|
}
|
|
127
161
|
|
|
128
162
|
function cleanupEmptyWrappers() {
|
|
@@ -289,14 +323,14 @@
|
|
|
289
323
|
if (!ph) return;
|
|
290
324
|
// Already filled?
|
|
291
325
|
if (ph.childNodes && ph.childNodes.length > 0) {
|
|
292
|
-
markFilled(wrap);
|
|
293
|
-
|
|
326
|
+
markFilled(wrap); // Afficher wrapper
|
|
327
|
+
sessionDefinedIds.add(id);
|
|
294
328
|
return;
|
|
295
329
|
}
|
|
296
330
|
const obs = new MutationObserver(() => {
|
|
297
331
|
if (ph.childNodes && ph.childNodes.length > 0) {
|
|
298
|
-
markFilled(wrap);
|
|
299
|
-
try {
|
|
332
|
+
markFilled(wrap); // CRITIQUE: Afficher wrapper maintenant
|
|
333
|
+
try { sessionDefinedIds.add(id); } catch (e) {}
|
|
300
334
|
try { obs.disconnect(); } catch (e) {}
|
|
301
335
|
}
|
|
302
336
|
});
|
package/public/style.css
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
.ezoic-ad{
|
|
2
|
-
|
|
3
|
-
.ezoic-ad .ezoic-ad-inner > div{padding:0;margin:0;}
|
|
4
|
-
|
|
5
|
-
/* Cacher placeholder vide pour éviter espace réservé */
|
|
6
|
-
.ezoic-ad [id^="ezoic-pub-ad-placeholder-"]:empty {
|
|
7
|
-
display: none !important;
|
|
8
|
-
height: 0 !important;
|
|
9
|
-
margin: 0 !important;
|
|
1
|
+
.ezoic-ad {
|
|
2
|
+
height: auto !important;
|
|
10
3
|
padding: 0 !important;
|
|
4
|
+
margin: 0 !important;
|
|
11
5
|
}
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
.ezoic-ad:has([id^="ezoic-pub-ad-placeholder-"]:empty) {
|
|
15
|
-
display: none !important;
|
|
16
|
-
height: 0 !important;
|
|
7
|
+
.ezoic-ad * {
|
|
17
8
|
margin: 0 !important;
|
|
9
|
+
padding: 0 !important;
|
|
18
10
|
}
|