PageSourceSearch

https://www.ilmessaggero.it/js/common.js?m393766

js ilmessaggero.it collected 2026-09-24 08:32:29 UTC 37,572 bytes, 858 lines download raw bytes

1function EXEC_OAS_AD_DEFERRED() {
2    //console.log("EXEC_OAS_AD_DEFERRED");
3    // controllo che non sia stato bloccato qualcosa da adblock o simili
4    if (typeof (OAS_RICH) != "function") return;
5
6    // qui passo tutte le posizioni ed inietto
7    $('.oas_placeholder').each(function () {
8        var buffer = '';
9        // backup di document.write
10        var doc_write_bak = document.write;
11        // sovrascrivo document.write
12        document.write = function (string) { buffer += string; }
13        // ora eseguo la OAS normale
14        OAS_AD($(this).attr('data-pos'));
15        // ripristino document.write
16        document.write = doc_write_bak;
17        // in buffer ho l'html
18        // "<A HREF="http://oas.ilmessaggero.it/5c/www.ilmessaggero.it/2/PRIMOPIANO_CRONACA/127546934/Position1/default/empty.gif/547976594846506e6c733841447a6462?x" target="_top"><IMG SRC="http://imageceu1.247realmedia.com/0/default/empty.gif"  WIDTH=1 HEIGHT=1 ALT="" BORDER=0 BORDER="0"></A>"
19        if (-1 == buffer.indexOf('<IMG SRC="http://imageceu1.247realmedia.com/0/default/empty.gif"  WIDTH=1 HEIGHT=1 ALT="" BORDER=0 BORDER="0">')) {
20            // banner pieno, non ho trovato empty.gif
21            $(this).addClass('notempty');
22        }
23        //$(this).replaceWith(buffer);
24        postscribe('#' + $(this).attr('id'), buffer);
25    });
26
27    // provo ad essere tempestivo e fixare subito eventuali skin
28    window.setTimeout(repairSkin, 500);
29}
30
31// deferred-styles
32var loadDeferredStyles = function () {
33    try {
34        var addStylesNode = document.getElementById("deferred-styles");
35        var replacement = document.createElement("div");
36        replacement.innerHTML = addStylesNode.textContent;
37        document.body.appendChild(replacement)
38        addStylesNode.parentElement.removeChild(addStylesNode);
39    } catch (e) { }
40};
41var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
42    window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
43if (raf) raf(function () { window.setTimeout(loadDeferredStyles, 0); });
44else window.addEventListener('load', loadDeferredStyles);
45
46
47
48
49/* se ho una skin che mette uno sfondo fixed lo devo sistemare (la barra superiore lo nasconde) */
50function repairSkin() {
51    //console.log("load - controllo skin");
52
53    if ($('body').css('background-attachment') == 'fixed' && $('body').not('.skinned')) {
54        // segno subito come fatto
55        $('body').addClass('skinned');
56
57        var skin_offset = 0;//$('#header-wrapper').outerHeight(true);
58        var body_bg_fixed = true;
59
60        // throttled scroll 
61        _waitFor('scroll', function (e, scrollPos) {
62            // metto sile al body per eventuali eccezioni in grafica in presenza di skin
63            if (scrollPos > skin_offset && !body_bg_fixed) {
64                //$('body').css('background-position-y', '0');
65                //$('body').css('background-attachment', 'fixed');
66                var body = document.body;
67                body.style.setProperty('background-position-y', '0', 'important');
68                body.style.setProperty('background-attachment', 'fixed', 'important');
69                body_bg_fixed = true;
70            } else if (scrollPos <= skin_offset && body_bg_fixed) {
71                //$('body').css('background-position-y', skin_offset+'px');
72                //$('body').css('background-attachment', 'initial');
73                var body = document.body;
74                body.style.setProperty('background-position-y', skin_offset + 'px', 'important');
75                body.style.setProperty('background-attachment', 'initial', 'important');
76                body_bg_fixed = false;
77            }
78        });
79
80        // lancio un trigger per ricalcolare se deve essere fixed ed in che posizione (se la pagina si ricarica gi? scrollata)
81        $(window).scroll();
82    }
83}
84
85// al load controllo la presenza della skin
86/*
87$(function() {
88    repairSkin();
89    setTimeout(repairSkin, 1000);
90    setTimeout(repairSkin, 2000);
91    setTimeout(repairSkin, 3000);
92});
93
94// un secondo dopo il load ricalcolo, la skin potrebbe essere lenta
95$(window).on('load',function () {
96    repairSkin();
97    setTimeout(repairSkin, 1000);
98    setTimeout(repairSkin, 2000);
99    setTimeout(repairSkin, 3000);
100});
101*/
102
103// captcha
104function captchaSubmit(data) {
105    var id = $('.form_captcha').attr('id');
106    document.getElementById(id).submit();
107}
108
109
110$(function () {
111    let elementToBeFixed = null; 
112    let heightElementToBeFixed = null;
113    let headerStartPosition = null;
114    let elementAddStyle = null;
115    let style = null;
116    let bodyClass = '';
117
118    const isListPage = $(".home #header").length || $(".home_sezione #header").length || $(".tag #header").length || $(".argomento #header").length || $(".search #header").length;
119
120    if ((isListPage)) {
121
122        const isRomaPage = $("#roma.home_sezione #header .header-top-slim.zona-quartiere").length || $("#roma.tag #header .header-top-slim.zona-quartiere").length;
123
124        if( isRomaPage){
125        
126            elementToBeFixed = $('#header .header-bottom');
127            bodyClass = 'header-bottom-fixed';
128            heightElementToBeFixed = elementToBeFixed ? elementToBeFixed.height() + 11 : 0;
129            headerStartPosition = elementToBeFixed ? elementToBeFixed.offset().top : 0;
130            elementAddStyle = $('#header .header-top-slim .header-top-slim__content');
131            style = "padding-bottom";
132        }else{
133            elementToBeFixed = $('#header .header-top-slim');
134            bodyClass = 'header-top-slim-fixed';
135            heightElementToBeFixed = elementToBeFixed ? elementToBeFixed.height() : 0;
136
137            const headerBottom = $('#header .header-bottom');
138                if (headerBottom.length > 0) {
139                    headerStartPosition = headerBottom.offset() ? headerBottom.offset().top : 0;
140                }
141            elementAddStyle = $('#header');
142            style = "padding-top";
143    
144        }
145
146    } else {
147        const isArticlePage = $(".articolo #header").length || $(".video #header").length || $(".foto #header").length || $(".audio #header").length;
148
149      
150        if (isArticlePage) { 
151
152            elementToBeFixed = $('#header .header-bottom');
153            bodyClass = 'header-bottom-fixed';
154            if (elementToBeFixed) {
155                heightElementToBeFixed = elementToBeFixed.height() + 11;
156                headerStartPosition = elementToBeFixed.offset() ? elementToBeFixed.offset().top : 0;
157                elementAddStyle = $('#header .header-top-slim .header-top-slim__content');
158                style = "padding-bottom";
159            }
160        }
161
162    } 
163
164    if (!elementToBeFixed || elementToBeFixed.length <= 0) return;
165
166    let header_fixed = false;
167  
168    // gestione sticky/non sticky
169    _waitFor('scroll', function (e, scrollPos) {
170
171        if (scrollPos > headerStartPosition) {
172            // il menu diventa/resta fisso
173            if (!header_fixed) {
174                elementToBeFixed.addClass('fixed');
175                $(document.body).addClass(bodyClass);
176                if (style != null) {
177                    elementAddStyle.css(style, heightElementToBeFixed + 'px');
178                }
179
180                header_fixed = true;
181            }
182        } else {
183            // il menu diventa/resta al suo posto
184            if (header_fixed) {
185                elementToBeFixed.removeClass('fixed');
186                $(document.body).removeClass(bodyClass);
187                if (style != null) {
188                    elementAddStyle.removeAttr("style");
189                }
190                header_fixed = false;
191            }
192        }
193    });
194
195    // ricalcolo la posizione del menu se la skin viene ricaricata
196    _waitFor('adv_render_ended_adv_Skin', function () {
197        // nota: uso l'offset del parent perché se la skin si carica mentre sono già in sticky
198        // l'offset del "elementoToBeFixed" sarà uguale a window.scrollY e quindi sbagliato
199        headerStartPosition = elementToBeFixed.parent().offset().top;
200        // triggero uno scroll per aggiornare
201        $(window).scroll();
202    });
203
204    // al load ricalcolo la posizione del menu.
205    // tenere qui dentro per lo scope su headerStartPosition
206    /*   $(window).on('load',function() {
207           //console.log("load - ricalcolo posizione menu");
208           // al ready resetto le posizioni di alcuni elementi (la skin li sposta)
209           if (!header_fixed) headerStartPosition =  elementToBeFixed.offset().top;
210           // lo ricalcolo pure dopo
211           setTimeout(function() {
212               if (!header_fixed) headerStartPosition =  elementToBeFixed.offset().top;
213           }, 1000);
214       });*/
215
216
217
218
219});
220function sidebarHome() {
221    if ($('body.home').length) {
222        // ci assicuriamo che sia stata caricata per evitare errori JS
223        _waitOnceFor('sidebarSticky.loaded', function () {
224            var rights = [
225                $('body.home #right-content'),
226                $('body.home #right-content-2'),
227                $('body.home #right-content-3'),
228            ];
229
230            for (var i = 0; i < rights.length; i++) {
231                rights[i].sidebarSticky();
232            }
233        });
234    }
235}
236
237
238function testatinaMyplay() {
239
240    var logoMyplay = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"103\" height=\"42\" viewBox=\"0 0 103 42\"> <g fill=\"none\" fill-rule=\"evenodd\"> <g> <g> <path fill=\"#A92A3A\" d=\"M15.326 3l3.321 3.134c0 .012.871-.77 1.742-1.554l.346-.312c.742-.668 1.396-1.26 1.396-1.26l3.526 3.313.844-.755.521.56-1.412 1.268v9.984l.155-.235c.368-.537.756-.97 1.164-1.297l.206-.155c.484-.34.968-.511 1.452-.511.418 0 .776.154 1.073.462.296.308.599.88.907 1.716.264.704.555 1.633.875 2.788.319 1.155.632 2.481.94 3.977l1.122 5.313h.132l.251-.325c.337-.446.676-.937 1.02-1.474.429-.67.819-1.375 1.171-2.111.352-.738.638-1.485.858-2.244.22-.76.33-1.469.33-2.129 0-.22-.011-.5-.033-.841-.022-.341-.05-.688-.082-1.04-.034-.352-.061-.688-.083-1.006-.022-.32-.033-.578-.033-.776 0-.792.198-1.375.594-1.749.396-.374.814-.561 1.254-.561.572 0 .99.242 1.254.726s.396 1.045.396 1.683c0 .902-.242 2.057-.726 3.465s-1.122 2.92-1.914 4.538c-.792 1.617-1.705 3.267-2.739 4.95-1.034 1.682-2.101 3.228-3.201 4.636-1.672 2.178-3.218 3.79-4.636 4.835-1.42 1.044-2.745 1.567-3.977 1.567-.924 0-1.655-.253-2.195-.759-.538-.506-.808-1.122-.808-1.848 0-.55.154-.995.462-1.337.308-.34.715-.511 1.221-.511.44 0 .765.127.974.38.209.252.379.538.511.857.132.32.27.605.413.858.143.254.368.38.676.38.418 0 .946-.231 1.584-.693.638-.462 1.276-1.04 1.914-1.732.638-.694 1.238-1.447 1.799-2.261.56-.814.962-1.573 1.204-2.277l-1.782-9.273-.066-.332c-.33-1.626-.666-2.764-1.006-3.413-.363-.694-.743-1.04-1.139-1.04-.418 0-.797.313-1.139.94-.116.216-.234.474-.352.776l-.001 4.531 1.397 1.49.811-.721.545.584-3.645 3.507-2.589-2.769-.959.909-.527-.562.954-.912V7.899l-1.273-1.218v3.53l-.001.32-.001 4.41V25.632l.001.915v.245l.001.011c.006 0 .127.124.127.124l-2.836 2.755-2.532-2.73-.967.927-.532-.564 1.119-1.077v-7.423h-1.288v6.02l.001.023v.118c-.015.858-.352 4.858-5.371 4.86-2.145 0-1.736-.244-2.804-.244h-.038c-.297.008-2.224.113-2.224 1.535 0 .658.323.926.398.999 0 0-.063.007-.171.01h-.123C2.26 32.126 0 31.82 0 28.789c0-3.286 3.772-3.477 4.612-3.485h.156c.77 0 2.235.317 3.849.902 0 0 .924.341 2.036.341 1.916 0 1.989-.956 1.989-1.739V6.162l-.82.77v14.37c0 3.708-4.591 3.345-4.591 3.345.62-.494.601-1.069.597-1.139l-.001-4.692H6.288c-1.689 0-2.384.829-2.384.829v-2.218c0-2.625 3.51-2.77 3.89-2.778h.033V9.721L15.326 3zm4.216 15.819h-.814v6.266l.814.877v-7.143zm-6.125-12.18v8.016h1.286V7.848l-1.286-1.209zm6.125-.492l-.814.741v7.767h.814V6.147zm-7.94-3.14s.348 1.778-.62 2.948c-1.008 1.217-2.21 2.023-4.247 2.023h-.04c-.27-.005-1.871-.04-2.915-.195l-.074-.003H3.62c-.562.004-2.357.181-1.304 2.342l-.023-.004c-.24-.04-2.287-.461-2.287-3.237 0-1.632 1.366-3.387 3.799-3.387 0 0 1.54.073 3.328.439 0 0 3.601.536 4.469-.926z\" transform=\"translate(-939 -16) translate(939 16)\"/> <path fill=\"#272727\" fill-rule=\"nonzero\" d=\"M44.204 40.25l.198-1.32c-1.144-.022-1.941-.143-2.392-.363-.451-.22-.677-.605-.677-1.155 0-.176.017-.374.05-.594.032-.22.104-.495.214-.825l1.221-4.587c1.628-.22 3.196-.665 4.703-1.336 1.507-.672 2.837-1.513 3.992-2.525 1.156-1.012 2.08-2.162 2.773-3.449.692-1.287 1.039-2.656 1.039-4.108 0-1.826-.517-3.245-1.551-4.257-1.034-1.012-2.486-1.518-4.356-1.518-.352 0-.699.022-1.04.066-.34.044-.687.099-1.039.165l1.155-4.389h-2.508l-1.551 5.28c-1.122.462-2.189 1.061-3.201 1.799-1.012.736-1.925 1.567-2.739 2.491l.891.924c.66-.704 1.375-1.358 2.145-1.963s1.573-1.128 2.409-1.568l-5.973 20.394c-.176.572-.473.968-.891 1.188-.418.22-1.089.33-2.013.33l-.198 1.32h9.339zm-1.023-10.263l3.729-13.992c.264-.044.534-.082.809-.115.274-.034.555-.05.841-.05 1.012 0 1.82.396 2.425 1.188.605.792.908 1.848.908 3.168 0 1.188-.248 2.326-.742 3.416-.495 1.088-1.15 2.073-1.964 2.953-.814.88-1.743 1.617-2.788 2.211-1.046.594-2.118 1.001-3.218 1.221zm16.401 2.343c.506 0 1.062-.16 1.666-.478.605-.32 1.205-.743 1.799-1.271.594-.528 1.155-1.139 1.683-1.831.528-.694.957-1.414 1.287-2.162l-.99-.561c-.132.242-.341.578-.627 1.006-.286.43-.61.848-.974 1.255-.363.407-.742.759-1.138 1.055-.396.297-.77.446-1.122.446-.242 0-.418
240-.077-.528-.231-.11-.154-.165-.33-.165-.528 0-.308.044-.688.132-1.139.088-.45.22-.973.396-1.567l5.907-21.681-6.039.297-.264.99c1.672 0 2.508.385 2.508 1.155 0 .198-.055.5-.165.907-.11.407-.22.809-.33 1.205l-4.389 16.137c-.33 1.298-.561 2.321-.693 3.069-.132.748-.198 1.342-.198 1.782 0 .77.181 1.32.544 1.65.364.33.93.495 1.7.495zm18.81 0c.99 0 2.019-.445 3.086-1.336 1.067-.892 2.062-2.151 2.986-3.779l-.858-.693c-.726 1.012-1.38 1.837-1.963 2.475-.584.638-1.029.957-1.337.957-.418 0-.627-.319-.627-.957 0-.352.066-.891.198-1.617s.314-1.529.544-2.409c.231-.88.495-1.793.792-2.739.297-.946.6-1.837.908-2.673l1.881-5.049h-2.739l-.693 1.848c-.286-.77-.66-1.325-1.122-1.667-.462-.34-1.056-.511-1.782-.511-1.188 0-2.398.412-3.63 1.238-1.232.825-2.354 1.88-3.366 3.168-1.012 1.287-1.837 2.722-2.475 4.306-.638 1.584-.957 3.135-.957 4.653 0 1.496.314 2.667.94 3.514.627.848 1.502 1.271 2.624 1.271.55 0 1.111-.105 1.683-.313.572-.21 1.122-.507 1.65-.892.528-.384 1.017-.835 1.468-1.352.452-.517.842-1.084 1.172-1.7l.132.033c-.044.44-.072.792-.082 1.056-.011.264-.017.495-.017.693 0 .88.137 1.512.412 1.898.276.385.666.577 1.172.577zm-6.171-2.343c-.572 0-1.023-.236-1.353-.71-.33-.473-.495-1.105-.495-1.897 0-1.144.231-2.381.693-3.712.462-1.331 1.056-2.575 1.782-3.73.726-1.154 1.534-2.117 2.425-2.887.892-.77 1.755-1.155 2.591-1.155.418 0 .748.165.99.495.242.33.363.781.363 1.353 0 .704-.099 1.496-.297 2.376-.198.88-.473 1.776-.825 2.69-.352.913-.759 1.798-1.221 2.656-.462.858-.951 1.622-1.468 2.293-.518.671-1.051 1.21-1.601 1.617-.55.407-1.078.611-1.584.611zM84.728 40.58c1.232 0 2.558-.523 3.977-1.567 1.419-1.045 2.964-2.657 4.636-4.835 1.1-1.408 2.167-2.953 3.201-4.636 1.034-1.684 1.947-3.334 2.739-4.95.792-1.617 1.43-3.13 1.914-4.538.484-1.408.726-2.563.726-3.465 0-.638-.132-1.199-.396-1.683s-.682-.726-1.254-.726c-.44 0-.858.187-1.254.561-.396.374-.594.957-.594 1.749 0 .198.011.457.033.776.022.319.05.654.082 1.006.034.352.061.699.083 1.04.022.34.033.621.033.841 0 .66-.11 1.37-.33 2.129-.22.759-.506 1.506-.858 2.244-.352.736-.742 1.44-1.171 2.111-.43.671-.853 1.271-1.271 1.799h-.132l-1.122-5.313c-.308-1.496-.621-2.822-.94-3.977-.32-1.155-.611-2.084-.875-2.788-.308-.836-.61-1.408-.907-1.716-.297-.308-.655-.462-1.073-.462-.484 0-.968.17-1.452.511-.484.341-.94.825-1.37 1.452-.428.627-.825 1.37-1.188 2.228-.362.858-.654 1.793-.874 2.805l1.221.33c.352-1.364.698-2.36 1.04-2.986.34-.628.72-.941 1.138-.941.396 0 .776.346 1.139 1.04.362.692.72 1.941 1.072 3.745l1.782 9.273c-.242.704-.644 1.463-1.205 2.277-.56.814-1.16 1.567-1.798 2.26-.638.694-1.276 1.271-1.914 1.733-.638.462-1.166.693-1.584.693-.308 0-.534-.127-.677-.38-.143-.252-.28-.538-.412-.858-.132-.319-.302-.605-.511-.858-.21-.252-.534-.379-.974-.379-.506 0-.913.17-1.221.511-.308.341-.462.787-.462 1.337 0 .726.27 1.342.809 1.848.538.506 1.27.759 2.194.759z\" transform=\"translate(-939 -16) translate(939 16)\"/> </g> </g> </g></svg>";
241
242    var testatinaMyplay = document.querySelectorAll(".myplay .testatabox h3");
243
244    if (typeof (testatinaMyplay) != 'undefined' && testatinaMyplay != null) {
245
246        for (i = 0; i < testatinaMyplay.length; i++) {
247
248            if (testatinaMyplay[i].querySelectorAll('a').length > 0) {
249
250                testatinaMyplay[i].querySelectorAll('a')[0].innerHTML = logoMyplay;
251            }
252            else {
253                testatinaMyplay[i].innerHTML = logoMyplay;
254            }
255        }
256    }
257}
258
259// throttled scroll notifier
260(function (lastKnownScrollPosition, ticking) {
261    document.addEventListener('scroll', function (e) {
262        lastKnownScrollPosition = window.scrollY;
263
264        if (!ticking) {
265            window.requestAnimationFrame(function () {
266                _trigger('scroll', lastKnownScrollPosition);
267                ticking = false;
268            });
269
270            ticking = true;
271        }
272    });
273})(0, false);
274
275// pushNotifications avvio subito la burocrazia
276loadScript(impostazioni_testata.assets_domain+'/js/webPushNotifications.js', function () {
277    // dobbiamo essere sicuri che il DOM sia ready
278    _waitOnceFor('ready', function () {
279        let bellWrap = document.getElementById('push-notifications-badge');
280
281        if (!bellWrap) {
282            const wrap = document.querySelector('#socialBarDiv #social-link');
283            
284            if (!wrap) {
285                console.warn("WPN - Push element wrapper not found");
286                return;
287            }
288            
289            var bellWrapHMTL = '<span id="push-notifications-badge"></span>';
290            wrap.insertAdjacentHTML("beforeBegin", bellWrapHMTL);
291            bellWrap = wrap.parentElement.querySelector('#push-notifications-badge');
292        }
293
294        document.body.classList.add("has-wpn");
295
296        var config = {
297            appId: impostazioni_testata.oneSignal_appId,
298            siteName: "ilMessaggero",
299            bellHTML: '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m0 0h24v24h-24z"/><path d="M12 3c1.105 0 2 .895 2 2 2.34 1.107 3.879 3.414 4 6v3c.153 1.26.895 2.374 2 3H4c1.105-.626 1.847-1.74 2-3v-3c.121-2.586 1.66-4.893 4-6 0-1.105.895-2 2-2z" stroke="#0E0E0E" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="1.5"/><path d="m9 17v1c0 1.657 1.343 3 3 3s3-1.343 3-3v-1" stroke="#0E0E0E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></g></svg>',
300            bellCSS: `
301                .wps-bell svg { width: 25px; margin-top: -5px; } 
302                body div[class^="strip-"] .wps-bell-wrap.wps-supertag {
303                    margin: 0 0 0 1rem;
304                    vertical-align:baseline;
305                }
306                body div[class^="strip-"] .wps-supertag .wps-bell .bell-icon {
307                    top: -2px;
308                }
309                #wps-count {
310                    top: 2px;
311                    right: 0px;
312                    font-size: 8px;
313                    line-height: 12px;
314                    min-width: 12px;
315                    height: 12px;
316                    font-family: "Libre Baskerville",Helvetica,serif;
317                }
318                .wps-supertag {
319                    margin: 0 0 0 15px;
320                    vertical-align: text-bottom;
321                }
322                .wps-supertag .wps-bell, .wps-supertag .wps-bell.on {
323                    background: none;
324                    color: inherit;
325                    padding: 0;
326                }
327                .wps-supertag .wps-bell .wps-sub {
328                    padding: 3px 12px 3px 9px;
329                    border: 1px solid #b22222;
330                    background: none;
331                    font-size: 10px;
332                    line-height: 16px;
333                }
334                .wps-supertag .wps-bell.on .wps-sub {
335                    color: #fff;
336                    background: #b22222;
337                }
338                .wps-supertag .wps-bell .bell-icon {
339                    background: #b22222;
340                    border-radius: 50px;
341                    width: 21px;
342                    display: inline-block;
343                    height: 21px;
344                    margin: 0 0 0 4px;
345                    position: relative;
346                    text-align: center;
347                }
348
349                .wps-supertag .wps-bell .bell-icon svg {
350                    width: 17px;
351                    margin: 1px 0 0;
352                    animation: drin 2.5s infinite;
353                }
354                .wps-supertag .wps-bell .bell-icon svg path {
355                    stroke: #fff;
356                }
357                .wps-supertag .wps-bell .bell-icon svg path:first-child {
358                    display: none;
359                }
360                .wps-supertag .wps-st-count.extended {
361                    bottom: -30px;
362                    right: 1px;
363                }
364
365                /* HOVER && ACTIVE */
366                body .wps-supertag:hover .wps-bell.on {
367                    background: none;
368                }
369                .wps-supertag:hover .wps-bell .wps-sub, .wps-supertag:hover .wps-bell .bell-icon, .wps-supertag:hover .wps-bell .bell-icon .wps-count {
370                    background: #dc2828;
371                    color: #fff;
372                }
373
374                /* ACTIVE */
375                
376
377                /* ACTIVE HOVER */
378                .wps-supertag:hover .wps-bell.on {
379                    background: #8d1b1b;
380                }
381                .wps-supertag:hover .wps-bell.on .bell-icon svg path:first-child {
382                    stroke: #8d1b1b;
383                }
384
385                .tag .wps-bell-wrap.wps-supertag{
386                    display: block;
387                    margin: 5px auto 0;
388                    text-transform: none;
389                    line-height: 18px;
390                }
391
392                /* HEADER FIXED ARTICOLO */
393                body.articolo.header-bottom-fixed:not(.wpn-enabled) .wps-supertag {
394                    margin-top: 0;
395                }
396                body.articolo.header-bottom-fixed:not(.wpn-enabled) .wps-supertag .wps-bell .bell-icon {
397                    width: 36px;
398                    height: 36px;
399                    margin: 0 0 0 8px;
400                    position: relative;
401                    top: -1px;
402                }
403                body.articolo.header-bottom-fixed:not(.wpn-enabled) .wps-supertag .wps-st-count {
404                    right: 7px;
405                    bottom: -29px;
406                }
407                body.articolo.header-bottom-fixed:not(.wpn-enabled) .wps-supertag .wps-bell svg {
408                    width: 30px;
409                    margin: 3px 0 0;
410                }
411
412                /* WPN ENABLED */
413                body.wpn-enabled:not(.wpn-always-on) .wps-supertag .wps-bell:not(.on) .bell-icon,
414                body.wpn-enabled .wps-supertag[data-subscribed="1"]:not(.wpn-has-unread) .wps-bell .bell-icon {
415                    background: none;
416                }
417                /* animation disabled only when wpn is enabled */
418                body.wpn-enabled:not(.wpn-always-on) .wps-supertag[wps-counter="1"]:not(.wpn-has-unread) .wps-bell .bell-icon svg,
419                body.wpn-enabled .wps-supertag[wps-counter="1"][data-subscribed="1"]:not(.wpn-has-unread) .wps-bell .bell-icon svg,
420                body.wpn-enabled:not(.wpn-always-on) .wps-supertag[wps-counter="0"] .wps-bell .bell-icon svg {
421                    animation: none;
422                }
423                body.wpn-enabled:not(.wpn-always-on) .wps-supertag .wps-bell:not(.on) .bell-icon svg,
424                body.wpn-enabled .wps-supertag[data-subscribed="1"]:not(.wpn-has-unread) .wps-bell .bell-icon svg {
425                    animation: none;
426                    width: 21px;
427                }
428                body.wpn-enabled:not(.wpn-always-on) .wps-supertag .wps-bell:not(.on) .bell-icon svg path,
429                body.wpn-enabled .wps-supertag[data-subscribed="1"]:not(.wpn-has-unread) .wps-bell .bell-icon svg path {
430                    stroke: #000;
431                }
432
433                @media (min-width: 1540px) {
434                    body div[class^="strip-"] .wps-bell-wrap.wps-supertag {
435                        vertical-align: text-bottom;
436                    }
437                }`,
438            supertag_text_follow: 'Segui',
439            supertag_text_subscribed: 'iscritto',
440            superTagsTextPlacement: 'before',
441            superTags: document.body.querySelectorAll('.supertag:not(article), .supertag_item, .supertag_title, .follow-category'),
442            superTagBellPlacement: 'inside'
443        };
444
445        // solo se sono in articolo o tag e ho dei supertag
446        if (
447            (   
448                document.body.classList.contains('articolo') || 
449                document.body.classList.contains('audio') || 
450                document.body.classList.contains('foto') || 
451                document.body.classList.contains('video') || 
452                document.body.classList.contains('tag')
453            )
454            && (config.superTags && config.superTags.length)) {
455
456            // aggiungo una classe che mi indica che qui sto forzando il comportamento "BIG" animation
457            document.body.classList.add("wpn-always-on");
458            
459            config.supertagCounterAllTopics = true;
460
461            // nell'articolo niente campanella
462            config.showMainBell = false;
463
464            // nell'articolo il click sulla campanella non disiscrive ma porta alla pagina /notifiche
465            config.supertagInPlaceUnsubscribe = false;
466
467            // nell'articolo il click sulla campanella ma porta alla pagina /notifiche dove viene iscritto in automatico
468            config.supertagInPlaceSubscribe = false;
469
470            // attivo il contatore di notifiche su tutti i supertag iscrivibili
471            (function (elements) {
472                if (!elements) return;
473                for (var i = 0; i < elements.length; i++) {
474                    elements[i].setAttribute("wps-counter", 1);
475                }
476            })(config.superTags);
477        }
478
479        new WebPushNotification(bellWrap, config);
480    
481    })
482});
483
484$(document).ready(function () {
485
486    testatinaMyplay();
487
488    if ($('body.home').length) {
489        loadScript(impostazioni_testata.assets_domain+'/js/sidebarSticky.js', function () {
490            _trigger('sidebarSticky.loaded');
491        });
492    }
493    
494    sidebarHome();
495    window.onresize = sidebarHome;
496
497    if (document.body.classList.contains('articolo') && document.body.id !== "en" && document.body.id !=="lezioni") {
498        // engageLeavingUsers
499        loadScript(impostazioni_testata.assets_domain+'/js/engageLeavingUsers.js');
500    }
501});
502
503
504$(window).on('load', function () {
505
506    if ($("#donna.mind_the_gap").length) {
507
508        if ($(".logo_mind_the_gap").length) {
509
510            var logo_mind_the_gap = $('.logo_mind_the_gap');
511
512            var log_mind_the_gap_min = $('.logo_mind_the_gap_min');
513
514            var logo_height = logo_mind_the_gap.outerHeight();
515
516            var visible = false;
517
518            var logo_mind_the_gap_position = (logo_mind_the_gap.offset().top + logo_height - 49);
519
520            _waitFor('scroll', function (e, scrollPos) {
521
522                if (scrollPos > logo_mind_the_gap_position) {
523
524                    if (!visible) {
525                        log_mind_the_gap_min.addClass('visible');
526                        visible = true;
527                    }
528                } else {
529                    if (visible) {
530                        log_mind_the_gap_min.removeClass('visible');
531                        visible = false;
532                    }
533                }
534            });
535
536        };
537    };
538
539    // LUDO hack temporaneo
540    /*
541    window.setInterval(function() {
542        try {
543            $('.column_left, .column_right, .head_skin_add').remove();
544            googletag.pubads().refresh([skin_slot]);
545        } catch(e) {
546            
547        }
548    }, 60*1000);
549    */
550});
551
552 (function () {
553    function loadArticleFavorites() {
554        if (!document.body) {
555            return;
556        }
557
558        if (
559            document.body.id === 'riscatta' ||
560            document.body.id === 'myhome'
561        ) {
562            return;
563        }
564
565        if (
566            !window.parameters_testata ||
567            !parameters_testata.add_to_favorite
568        ) {
569            if (window.CED && typeof CED.log === 'function') {
570                CED.log(
571                    '[articleFavorites] Disabilitato per questa testata'
572                );
573            }
574
575            return;
576        }
577
578        if (window.CED && typeof CED.log === 'function') {
579            CED.log(
580                '[articleFavorites] Abilitato per questa testata',
581                parameters_testata.add_to_favorite
582            );
583        }
584
585        if (
586            window.articleFavorites &&
587            window.articleFavorites.initialized
588        ) {
589            return;
590        }
591
592        if (
593            !window.impostazioni_testata ||
594            !impostazioni_testata.assets_domain
595        ) {
596            if (window.CED && typeof CED.warn === 'function') {
597                CED.warn(
598                    '[articleFavorites] assets_domain non disponibile'
599                );
600            }
601
602            return;
603        }
604
605        loadScript(
606            impostazioni_testata.assets_domain + '/js/articleFavorites.js',
607            function () {
608                _waitOnceFor('ready', function () {
609                    _trigger('articleFavorites');
610                });
611            }
612        );
613    }
614
615    function loadArticleGift() {
616    if (!document.body) {
617        return;
618    }
619
620    if (
621        !document.body.classList.contains('articolo') ||
622        document.body.id !== 'premium'
623    ) {
624        return;
625    }
626
627    if (
628        !window.parameters_testata ||
629        !parameters_testata.gift_article
630    ) {
631        if (window.CED && typeof CED.log === 'function') {
632            CED.log('[articleGift] Disabilitato per questa testata');
633        }
634
635        return;
636    }
637
638    if (window.CED && typeof CED.log === 'function') {
639        CED.log(
640            '[articleGift] Abilitato per questa testata',
641            parameters_testata.gift_article
642        );
643    }
644
645    if (
646        window.articleGift &&
647        window.articleGift.initialized
648    ) {
649        return;
650    }
651
652    if (
653        !window.impostazioni_testata ||
654        !impostazioni_testata.assets_domain
655    ) {
656        if (window.CED && typeof CED.warn === 'function') {
657            CED.warn('[articleGift] assets_domain non disponibile');
658        }
659
660        return;
661    }
662
663    loadScript(
664        impostazioni_testata.assets_domain + '/js/articleGift.js',
665        function () {
666            _waitOnceFor('ready', function () {
667                _trigger('articleGift');
668            });
669        }
670    );
671}
672
673    function initArticleFeatures() {
674        loadArticleFavorites();
675        loadArticleGift();
676    }
677
678    if (document.body) {
679        initArticleFeatures();
680    } else {
681        document.addEventListener(
682            'DOMContentLoaded',
683            initArticleFeatures,
684            { once: true }
685        );
686    }
687})();
688
689/**
690 * 
691 */
692(function () {
693
694    function ced_onerror(event) {
695        var imgWidth = Number(event.target.getAttribute('width'));
696        var imgHeight = Number(event.target.getAttribute('height'));
697
698        //evito divisioni per 0, dopo useremo il placeholder di default
699        if (imgWidth == 0 || imgHeight == 0) {
700            var prop = 0;
701        } else {
702            var prop = (imgHeight / imgWidth).toFixed(2);
703        }
704
705        switch (prop) {
706            case "1.00": //quadrata
707                var placeholderImg = "/img/placeholders/THUMB.jpg";
708                break;
709            case "0.55": //med high
710                var placeholderImg = "/img/placeholders/MED.jpg";
711                break;
712            case "0.35": //panorama
713                var placeholderImg = "/img/placeholders/PANORAMA.jpg";
714                break;
715            default: //img grigia senza logo
716                var placeholderImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mPcfBIAAjUBfhd+1wMAAAAASUVORK5CYII=";
717        }
718
719        event.target.src = placeholderImg;
720        event.onerror = null
721    }
722
723    _waitFor('ready', function () {
724        //prendo tutte le img, perchè quando sto cercando potrebbero ancora non avere src valorizzato, solo dopo controllo
725        //che rientrino nelle img che voglio sostituire in caso di 404
726        var imgInpage = document.querySelectorAll('img');
727
728        if (imgInpage) {
729            for (var i = 0; i < imgInpage.length; i++) {
730                if (imgInpage[i].src.indexOf("/photos/") != -1) { //solo se l'img contiene /photos/
731                    var tmp = imgInpage[i].onerror;
732                    imgInpage[i].onerror = function (tmp, evento) {
733                        try {
734                            //debugger;
735                            if (typeof tmp == 'function') {
736                                (tmp.bind(this))(); //eseguo la funzione originale dell'onerror
737                                this.onerror = ced_onerror
738                            } else ced_onerror(evento);
739                        } catch (e) {
740                            CED.log("ced_onerror", e);
741                        }
742                    }.bind(imgInpage[i], tmp);
743                }
744            }
745        }
746    })
747
748
749})();
750
751
752
753/* 
754in attesa ok piemme
755$(document).ready(function () {
756
757    _waitOnceFor('cookielaw_5_accepted', function () {
758        // ad Top LdbMastheadPush sticked x CLS 
759        //script in utils per stickare qualsiasi adv
760        var targetIdSlot = 'adv_LdbMastheadPush';
761
762        var advSticky = document.getElementById(targetIdSlot);
763
764        if (advSticky) {
765
766            loadScript(impostazioni_testata.assets_domain+'/js/sticker.js', function () {
767
768
769                _waitOnceFor('adv_render_ended_' + targetIdSlot, function () {
770
771                    var adv_Ldb = document.querySelector('#' + targetIdSlot);
772
773                    var stick = window.StiCa(
774                        adv_Ldb,
775                        {
776                            top: 45,
777                            time: 10,
778                            zIndex: 9999999
779                        }
780                    )
781
782                    function stopSticky() {
783                        setTimeout(stick.stopSticky, 800);
784                    }
785
786                    _waitOnceFor('adv_impression_viewable_' + targetIdSlot, stopSticky)
787
788                });
789            });
790        }
791
792    });
793});
794 */
795
796(function () {
797
798    _waitOnceFor('cookielaw_5_accepted', function () {
799        // ad Top LdbMastheadPush sticked x CLS 
800        //script in utils per stickare qualsiasi adv
801        var targetIdSlot = 'adv_LdbMastheadPush';
802
803        var advSticky = document.getElementById(targetIdSlot);
804
805        if (advSticky) {
806
807            /* var header = document.querySelector('.header-bottom');
808              var TopStickyPos = (header.offsetHeight - 2.2 );
809               */
810
811            loadScript(impostazioni_testata.assets_domain+'/js/sticker.js', function () {
812
813
814                _waitOnceFor('adv_render_ended_' + targetIdSlot, function () {
815
816                    var adv_Ldb = document.querySelector('#' + targetIdSlot);
817
818                    let altezzaheaderContent = '50';
819
820                    // Ottieni l'elemento con la classe header-bottom__content
821                    var headerContent = document.querySelector('.header-bottom__content');
822
823                    // Verifica se l'elemento è presente nella pagina
824                    if (headerContent) {
825                        // Ottieni l'altezza dell'elemento
826                          altezzaheaderContent = headerContent.clientHeight;
827
828                    } 
829
830                    var stick = window.StiCa(
831                        adv_Ldb,
832                        {
833                            //top: 46.8,
834                            top: altezzaheaderContent,
835                            time: 10,
836                            zIndex: 9999999
837                        }
838                    )
839
840                    function stopSticky() {
841                        setTimeout(stick.stopSticky, 800);
842                    }
843
844                    _waitOnceFor('adv_impression_viewable_' + targetIdSlot, stopSticky)
845
846                });
847            });
848        }
849
850    });
851})();
852
853_waitOnceFor(['socialbar_disabled','cookielaw.accepted'], () => {
854    // login onetap da Google
855    loadScript(impostazioni_testata.assets_domain+'/js/oneTapLogin.js?v20250904.1');
856});
857
858

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.