Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 14 su 14
  1. #11
    Bene!!!!
    “Che le cose siano cosi, non vuol dire che debbano andare così. Solo che quando si tratta di rimboccarsi le maniche e incominciare a cambiare, vi è un prezzo da pagare. Ed è allora che la stragrande maggioranza preferisce lamentarsi più che fare”.

    Giovanni Falcone

  2. #12
    Utente di HTML.it L'avatar di neo1976
    Registrato dal
    Mar 2015
    Messaggi
    379
    c'è una cosa che non capisco, mi esce scritto: "localhost utilizza i cookies per fornirti...." io volevo sostituire la parola localhost ma nello script non appare, ecco lo script:

    codice:
    if (nibirumail_stop_jquery === undefined) {
        var nibirumail_stop_jquery = 0;
    }
    if (cookie_policy_url === undefined) {
        var cookie_policy_url = 'https://nibirumail.com/cookies/policy/?url=' + window.location.hostname;
    }
    if (nibirumail_advice_text === undefined) {
        var nibirumail_advice_text = window.location.hostname + " utilizza i cookies per offrirti un'esperienza di navigazione migliore. Usando il nostro servizio accetti l'impiego di cookie in accordo con la nostra cookie policy. <a target=\"_blank\" href=\"" + cookie_policy_url + "\">Scoprine di pi&ugrave;</a>. <a class=\"nibirumail_agreement\" href=\"javascript:;\">Ho capito.</a>";
    }
    
    
    function _NibirumailGetStyle(el, prop) {
        if (typeof getComputedStyle !== 'undefined') {
            return getComputedStyle(el, null).getPropertyValue(prop);
        } else {
            return el.currentStyle[prop];
        }
    }
    
    
    function _NibirumailFadeOut(elem, ms) {
        if (!elem)
            return;
    
    
        if (ms) {
            var opacity = 1;
            var timer = setInterval(function() {
                opacity -= 50 / ms;
                if (opacity <= 0) {
                    clearInterval(timer);
                    opacity = 0;
                    elem.style.display = "none";
                    elem.style.visibility = "hidden";
                }
                elem.style.opacity = opacity;
                elem.style.filter = "alpha(opacity=" + opacity * 100 + ")";
            }, 50);
        } else {
            elem.style.opacity = 0;
            elem.style.filter = "alpha(opacity=0)";
            elem.style.display = "none";
            elem.style.visibility = "hidden";
        }
    }
    
    
    function _NibirumailAddEventListener(el, eventName, handler) {
        if (!!el.addEventListener) {
            el.addEventListener(eventName, handler);
        } else {
            el.attachEvent('on' + eventName, function() {
                handler.call(el);
            });
        }
    }
    
    
    function NibirumailgetCookie(name) {
        var value = "; " + document.cookie;
        var parts = value.split("; " + name + "=");
        if (parts.length == 2) return parts.pop().split(";").shift();
    }
    
    
    function NibirumailCookieAccept() {
        var now = new Date();
        now.setMonth(now.getMonth() + 3);
        var parts = location.hostname.split('.');
        var subdomain = parts.shift();
        var upperleveldomain = parts.join('.');
        var sndleveldomain = parts.slice(-2).join('.');
        console.log(sndleveldomain);
        document.cookie = 'nibirumail_cookie_advice=1; expires=' + now.toUTCString() + '; path=/;';
        //document.cookie = 'nibirumail_cookie_advice=1; expires='+now.toUTCString()+'; path=/; domain='+sndleveldomain;
    }
    
    
    function init_NibirumailCookieWidget() {
        if (NibirumailgetCookie('nibirumail_cookie_advice') === undefined) {
            var el = document.getElementById('nibirumail_cookie_advice');
    
    
            if (!el) {
                var div = document.createElement('div');
                div.id = 'nibirumail_cookie_advice';
    
    
                document.body.appendChild(div);
    
    
                el = div;
            }
    
    
            el.innerHTML = nibirumail_advice_text;
    
    
            el.style.zIndex = 999;
            el.style.position = 'fixed';
            el.style.bottom = 0;
            el.style.left = 0;
            el.style.width = '100%';
            el.style.background = '#000';
            el.style.color = '#fff';
            el.style.textAlign = 'center';
            el.style.padding = '15px 0';
            el.style.fontSize = '12px';
            var links = el.querySelectorAll('a');
            var i;
    
    
            for (i = 0; i < links.length; i++) {
                links[i].style.color = '#fff';
                links[i].style.textDecoration = 'underline';
            }
    
    
            var height = _NibirumailGetStyle(el, 'height');
            //document.body.style.paddingBottom = height; 
    
    
    
    
            var n = el;
    
    
            var agreementLinks = document.querySelectorAll('.nibirumail_agreement');
    
    
            for (i = 0; i < agreementLinks.length; i++) {
                var agree = agreementLinks[i];
    
    
                _NibirumailAddEventListener(agree, 'click', function() {
                    NibirumailCookieAccept();
    
    
                    var el = document.getElementById('nibirumail_cookie_advice');
    
    
                    if (el) {
                        _NibirumailFadeOut(el, 400);
                        setTimeout(function() {
                            document.body.style.paddingBottom = 'auto';
                        }, 400);
                    }
    
    
                    if (typeof NibirumailCookieBlocker == 'function') {
                        NibirumailCookieBlocker(1);
                    }
                    if (typeof NibirumailCookieAccept_callback == 'function') {
                        NibirumailCookieAccept_callback();
                    }
                });
            }
        }
    
    
        var deleteCookies = document.querySelectorAll('.nibirumail_delete_cookie');
    
    
        for (i = 0; i < deleteCookies.length; i++) {
            var deleteCookie = deleteCookies[i];
    
    
            _NibirumailAddEventListener(deleteCookie, 'click', function() {
                document.cookie = 'nibirumail_cookie_advice=1; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/';
                document.location.reload();
            });
        }
    
    
    }
    init_NibirumailCookieWidget();

  3. #13
    Utente di HTML.it L'avatar di neo1976
    Registrato dal
    Mar 2015
    Messaggi
    379
    ho risolto cancellando hostname...

  4. #14
    Utente di HTML.it L'avatar di neo1976
    Registrato dal
    Mar 2015
    Messaggi
    379
    funziona tutto alla grande, come direbbe hannibal smith "adoro i piani ben riusciti" :-)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.