ultimate-jekyll-manager 0.0.245 → 0.0.246
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.
|
@@ -11,18 +11,6 @@ const searchParams = new URLSearchParams(window.location.search);
|
|
|
11
11
|
const qsDebug = searchParams.get('debug') === 'true';
|
|
12
12
|
const qsLoud = searchParams.get('loud') === 'true';
|
|
13
13
|
|
|
14
|
-
// DISABLED: Hide/reveal system for vert units. Was causing in-house verts (promo-server fallback)
|
|
15
|
-
// to not display because: (1) vert-unit starts hidden with max-height:0, (2) AdSense "ghost fills"
|
|
16
|
-
// (reports filled but renders nothing) would reveal an empty container, (3) iframe height was set
|
|
17
|
-
// to 0 and relied on promo-server sending dimensions back, but promo-server was sending height:0.
|
|
18
|
-
// Re-enable once promo-server set-dimensions is fixed and ghost fill detection is added.
|
|
19
|
-
// const revealVertUnit = ($vertUnit) => {
|
|
20
|
-
// if ($vertUnit) {
|
|
21
|
-
// $vertUnit.style.removeProperty('overflow');
|
|
22
|
-
// $vertUnit.style.removeProperty('max-height');
|
|
23
|
-
// }
|
|
24
|
-
// };
|
|
25
|
-
|
|
26
14
|
// Protect height-constrained ancestors from AdSense's height: auto !important override.
|
|
27
15
|
// Walks up from the ad's script element and observes any ancestor with a fixed-height class.
|
|
28
16
|
const HEIGHT_CLASSES = ['vh-100', 'h-100', 'min-vh-100'];
|
|
@@ -114,36 +102,8 @@ const setupMessageHandler = () => {
|
|
|
114
102
|
|
|
115
103
|
// Handle commands
|
|
116
104
|
if (command === 'uj-vert-unit:set-dimensions') {
|
|
117
|
-
// Update iframe dimensions dynamically
|
|
118
105
|
const $iframe = document.getElementById(payload.id);
|
|
119
|
-
if ($iframe) {
|
|
120
|
-
// If promo-server reports 0 dimensions, it means the iframe hasn't been laid out yet
|
|
121
|
-
// (e.g., ad blocker cosmetic filters or element not in layout flow on initial load).
|
|
122
|
-
// Skip setting height to 0 and request a re-measurement after a delay.
|
|
123
|
-
if (!payload.height || !payload.width) {
|
|
124
|
-
// Track re-measure attempts per iframe
|
|
125
|
-
const reMeasureCount = ($iframe.__reMeasureCount || 0) + 1;
|
|
126
|
-
$iframe.__reMeasureCount = reMeasureCount;
|
|
127
|
-
|
|
128
|
-
// Give up after 5 attempts (total ~8s of retrying including promo-server's own retries)
|
|
129
|
-
if (reMeasureCount > 5) {
|
|
130
|
-
console.warn('[Vert] Giving up on re-measure after', reMeasureCount, 'attempts');
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
console.warn('[Vert] Received 0 dimensions, requesting re-measure (attempt', reMeasureCount + '):', payload);
|
|
135
|
-
setTimeout(() => {
|
|
136
|
-
// Measure vert-unit width from parent and send it to iframe so it can
|
|
137
|
-
// use it as a fallback if its own self-measurement returns 0.
|
|
138
|
-
const $vertUnit = $iframe.closest('vert-unit');
|
|
139
|
-
const currentParentWidth = $vertUnit ? $vertUnit.offsetWidth : 0;
|
|
140
|
-
$iframe.contentWindow?.postMessage({
|
|
141
|
-
command: 'uj-vert-unit:re-measure',
|
|
142
|
-
payload: { parentWidth: currentParentWidth },
|
|
143
|
-
}, '*');
|
|
144
|
-
}, 500 * reMeasureCount);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
106
|
+
if ($iframe && payload.height) {
|
|
147
107
|
$iframe.style.height = payload.height + 'px';
|
|
148
108
|
}
|
|
149
109
|
} else if (command === 'uj-vert-unit:click') {
|
|
@@ -179,8 +139,6 @@ const monitorAdFillStatus = ($vertUnit, config) => {
|
|
|
179
139
|
// Handle filled status
|
|
180
140
|
if (status === 'filled') {
|
|
181
141
|
console.log('[Vert] Adsense is filled, no fallback needed');
|
|
182
|
-
// DISABLED: See revealVertUnit note above
|
|
183
|
-
// revealVertUnit($vertUnit);
|
|
184
142
|
return;
|
|
185
143
|
}
|
|
186
144
|
|
|
@@ -216,18 +174,10 @@ const createCustomAd = ($vertUnit, config) => {
|
|
|
216
174
|
? `${window.location.protocol}//${window.location.host}/verts/main`
|
|
217
175
|
: 'https://promo-server.itwcreativeworks.com/verts/main';
|
|
218
176
|
|
|
219
|
-
// Measure the vert-unit's width from the parent page so the iframe knows its
|
|
220
|
-
// available width even if Rocket Loader or other deferrals prevent the iframe
|
|
221
|
-
// from self-measuring on initial load.
|
|
222
|
-
const parentWidth = $vertUnit.offsetWidth;
|
|
223
|
-
|
|
224
177
|
// Build full URL with parameters
|
|
225
178
|
const adURL = new URL(baseURL);
|
|
226
179
|
adURL.searchParams.set('parentURL', window.location.href);
|
|
227
180
|
adURL.searchParams.set('frameId', iframeId);
|
|
228
|
-
if (parentWidth) {
|
|
229
|
-
adURL.searchParams.set('parentWidth', parentWidth);
|
|
230
|
-
}
|
|
231
181
|
if (config.size) {
|
|
232
182
|
adURL.searchParams.set('size', config.size);
|
|
233
183
|
}
|
|
@@ -241,7 +191,7 @@ const createCustomAd = ($vertUnit, config) => {
|
|
|
241
191
|
$iframe.style.cssText = config.style;
|
|
242
192
|
$iframe.setAttribute('sandbox', 'allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation');
|
|
243
193
|
$iframe.width = '100%';
|
|
244
|
-
$iframe.height = '100%';
|
|
194
|
+
$iframe.height = '100%';
|
|
245
195
|
$iframe.setAttribute('frameborder', '0');
|
|
246
196
|
$iframe.setAttribute('marginwidth', '0');
|
|
247
197
|
$iframe.setAttribute('marginheight', '0');
|
|
@@ -255,9 +205,6 @@ const createCustomAd = ($vertUnit, config) => {
|
|
|
255
205
|
$vertUnit.innerHTML = '';
|
|
256
206
|
$vertUnit.appendChild($iframe);
|
|
257
207
|
|
|
258
|
-
// DISABLED: See revealVertUnit note above
|
|
259
|
-
// revealVertUnit($vertUnit);
|
|
260
|
-
|
|
261
208
|
// Retrigger bindings to apply plan visibility
|
|
262
209
|
webManager.auth().listen({ once: true }, async () => {
|
|
263
210
|
webManager.bindings().update();
|
|
@@ -279,9 +226,6 @@ const createAdUnit = (config, $currentScript) => {
|
|
|
279
226
|
$vertUnit.className = 'uj-vert-unit';
|
|
280
227
|
$vertUnit.setAttribute('data-wm-bind', '@hide auth.account.subscription.product.id !== basic');
|
|
281
228
|
|
|
282
|
-
// DISABLED: See revealVertUnit note above
|
|
283
|
-
// $vertUnit.style.cssText = 'overflow:hidden; max-height:0;';
|
|
284
|
-
|
|
285
229
|
// Create the ins element for AdSense
|
|
286
230
|
const $ins = document.createElement('ins');
|
|
287
231
|
$ins.className = 'adsbygoogle';
|