MediaWiki:Common.js: differenze tra le versioni

Da Wikidonca.
mNessun oggetto della modifica
mNessun oggetto della modifica
Riga 1: Riga 1:
/* QUANTCAST GDPR*/
<!-- Quantcast Choice. Consent Manager Tag v2.0 (for TCF 2.0) -->
     
(function() {
    var elem = document.createElement('script');
  var host = window.location.hostname;
    elem.src = 'https://quantcast.mgr.consensu.org/cmp.js';
  var element = document.createElement('script');
    elem.async = true;
  var firstScript = document.getElementsByTagName('script')[0];
elem.defer = true;  
  var url = 'https://quantcast.mgr.consensu.org'
    elem.type = "text/javascript";
    .concat('/choice/', 'hK2b6w2mQ7J22', '/', host, '/choice.js')
    var scpt = document.getElementsByTagName('script')[0];
  var uspTries = 0;
    scpt.parentNode.insertBefore(elem, scpt);
  var uspTriesLimit = 3;
    (function() {
  element.async = true;
     var gdprAppliesGlobally = true;
  element.type = 'text/javascript';
  element.src = url;
 
  firstScript.parentNode.insertBefore(element, firstScript);
 
  function makeStub() {
     var TCF_LOCATOR_NAME = '__tcfapiLocator';
    var queue = [];
    var win = window;
    var cmpFrame;
 
     function addFrame() {
     function addFrame() {
        if (!window.frames['__cmp.Locator']) {
      var doc = win.document;
         if (document.body) {
      var otherCMP = !!(win.frames[TCF_LOCATOR_NAME]);
            var body = document.body,
 
                iframe = document.createElement('iframe');
      if (!otherCMP) {
            iframe.style = 'display:none';
         if (doc.body) {
            iframe.name = '__cmpLocator';
          var iframe = doc.createElement('iframe');
            body.appendChild(iframe);
 
          iframe.style.cssText = 'display:none';
          iframe.name = TCF_LOCATOR_NAME;
          doc.body.appendChild(iframe);
         } else {
         } else {
            // In the case where this stub is located in the head,
          setTimeout(addFrame, 5);
            // this allows us to inject the iframe more quickly than
            // relying on DOMContentLoaded or other events.
            setTimeout(addFrame, 5);
         }
         }
      }
      return !otherCMP;
    }
    function tcfAPIHandler() {
      var gdprApplies;
      var args = arguments;
      if (!args.length) {
        return queue;
      } else if (args[0] === 'setGdprApplies') {
        if (
          args.length > 3 &&
          args[2] === 2 &&
          typeof args[3] === 'boolean'
        ) {
          gdprApplies = args[3];
          if (typeof args[2] === 'function') {
            args[2]('set', true);
          }
         }
         }
      } else if (args[0] === 'ping') {
        var retr = {
          gdprApplies: gdprApplies,
          cmpLoaded: false,
          cmpStatus: 'stub'
        };
        if (typeof args[2] === 'function') {
          args[2](retr);
        }
      } else {
        queue.push(args);
      }
     }
     }
    addFrame();
 
     function cmpMsgHandler(event) {
     function postMessageEventHandler(event) {
        var msgIsString = typeof event.data === "string";
      var msgIsString = typeof event.data === 'string';
        var json;
      var json = {};
         if(msgIsString) {
 
        json = event.data.indexOf("__cmpCall") != -1 ? JSON.parse(event.data) : {};
      try {
         if (msgIsString) {
          json = JSON.parse(event.data);
         } else {
         } else {
        json = event.data;
          json = event.data;
         }
         }
        if (json.__cmpCall) {
      } catch (ignore) {}
        var i = json.__cmpCall;
 
         window.__cmp(i.command, i.parameter, function(retValue, success) {
      var payload = json.__tcfapiCall;
             var returnMsg = {"__cmpReturn": {
 
            "returnValue": retValue,
      if (payload) {
            "success": success,
         window.__tcfapi(
            "callId": i.callId
          payload.command,
             }};
          payload.version,
             event.source.postMessage(msgIsString ?
          function(retValue, success) {
            JSON.stringify(returnMsg) : returnMsg, '*');
             var returnMsg = {
         });
              __tcfapiReturn: {
                returnValue: retValue,
                success: success,
                callId: payload.callId
              }
             };
             if (msgIsString) {
              returnMsg = JSON.stringify(returnMsg);
            }
            event.source.postMessage(returnMsg, '*');
          },
          payload.parameter
         );
      }
    }
 
    while (win) {
      try {
        if (win.frames[TCF_LOCATOR_NAME]) {
          cmpFrame = win;
          break;
         }
         }
      } catch (ignore) {}
      if (win === window.top) {
        break;
      }
      win = win.parent;
    }
    if (!cmpFrame) {
      addFrame();
      win.__tcfapi = tcfAPIHandler;
      win.addEventListener('message', postMessageEventHandler, false);
     }
     }
    window.__cmp = function (c) {
  };
        var b = arguments;
 
        if (!b.length) {
  makeStub();
        return __cmp.a;
 
        }
  var uspStubFunction = function() {
        else if (b[0] === 'ping') {
    var arg = arguments;
        b[2]({"gdprAppliesGlobally": gdprAppliesGlobally,
    if (typeof window.__uspapi !== uspStubFunction) {
            "cmpLoaded": false}, true);
      setTimeout(function() {
        } else if (c == '__cmp')
         if (typeof window.__uspapi !== 'undefined') {
        return false;
          window.__uspapi.apply(window.__uspapi, arg);
        else {
         if (typeof __cmp.a === 'undefined') {
            __cmp.a = [];
        }
        __cmp.a.push([].slice.apply(b));
         }
         }
    };
      }, 500);
    window.__cmp.gdprAppliesGlobally = gdprAppliesGlobally;
    window.__cmp.msgHandler = cmpMsgHandler;
    if (window.addEventListener) {
        window.addEventListener('message', cmpMsgHandler, false);
     }
     }
     else {
  };
        window.attachEvent('onmessage', cmpMsgHandler);
 
  var checkIfUspIsReady = function() {
     uspTries++;
    if (window.__uspapi === uspStubFunction && uspTries < uspTriesLimit) {
      console.warn('USP is not accessible');
    } else {
      clearInterval(uspInterval);
     }
     }
    })();
  };
    window.__cmp('init', {
 
    'Language': 'it',
  if (typeof window.__uspapi === 'undefined') {
'Initial Screen Title Text': 'Il rispetto della tua privacy è la nostra priorità',
    window.__uspapi = uspStubFunction;
'Initial Screen Reject Button Text': 'NON ACCETTO',
    var uspInterval = setInterval(checkIfUspIsReady, 6000);
'Initial Screen Accept Button Text': 'ACCETTO',
  }
'Initial Screen Purpose Link Text': 'Mostra finalità',
})();
'Purpose Screen Title Text': 'Il rispetto della tua privacy è la nostra priorità',
<!-- End Quantcast Choice. Consent Manager Tag v2.0 (for TCF 2.0) -->
'Purpose Screen Body Text': 'Di seguito puoi impostare le preferenze sul consenso e determinare come desideri utilizzare i dati in base alle finalità. Puoi impostare le tue preferenze per noi indipendentemente da quelle dei partner di terze parti. Ogni finalità ha una descrizione in modo che tu sappia come noi e i nostri partner utilizziamo i tuoi dati.',
'Purpose Screen Vendor Link Text': 'Visualizza i fornitori',
'Purpose Screen Cancel Button Text': 'Annullare',
'Purpose Screen Save and Exit Button Text': 'Salva ed Esci',
'Vendor Screen Title Text': 'Il rispetto della tua privacy è la nostra priorità',
'Vendor Screen Body Text': 'Di seguito puoi impostare le preferenze sul consenso per i singoli partner di terze parti con cui collaboriamo. Per visualizzare le finalità rispetto alle quali i singoli partner di terze parti usano i dati per agevolarti nelle tue scelte, espandi ogni voce dell&#039;elenco di aziende. In alcuni casi, le aziende potrebbero utilizzare i tuoi dati senza chiedere il tuo consenso, in base ai loro legittimi interessi. Per ulteriori informazioni e per opporti a tale elaborazione, puoi fare clic sui rispettivi link alla policy sulla privacy.',
'Vendor Screen Accept All Button Text': 'ACCETTA TUTTO',
'Vendor Screen Reject All Button Text': 'RIFIUTA TUTTO',
'Vendor Screen Purposes Link Text': 'Torna alle finalità',
'Vendor Screen Cancel Button Text': 'Annullare',
'Vendor Screen Save and Exit Button Text': 'Salva ed Esci',
'Initial Screen Body Text': 'Wikidonca utilizza dei cookie tecnici per ricordare le tue preferenze durante la navigazione del sito. Il sito usa anche cookies di memorizzati da Google relativamente ai banner di Google AdSense e al monitoraggio statistico di Google Analytics. Fai clic su Accetta oppure continua la navigazione scorrendo la pagina per acconsentire all&#039; utilizzo dei cookies. Puoi cambiare idea e modificare le tue opzioni sul consenso in qualsiasi momento ritornando su questo sito.',
'Initial Screen Body Text Option': 1,
'Publisher Name': 'Wikidonca',
'Publisher Logo': 'https://wikidonca.it/img/wiki.png',
'Display UI': 'always',
'Publisher Purpose IDs': [1,2],
'Publisher Purpose Legitimate Interest IDs': [1,2],
'Post Consent Page': 'https://www.facebook.com/wikidonca',
'Consent Scope': 'service',
'UI Layout': 'banner',
'Soft Opt-in Enabled': true,
  });
/* FINE QUANTCAST GDPR*/

Versione delle 15:47, 1 set 2020

<!-- Quantcast Choice. Consent Manager Tag v2.0 (for TCF 2.0) -->
(function() {
  var host = window.location.hostname;
  var element = document.createElement('script');
  var firstScript = document.getElementsByTagName('script')[0];
  var url = 'https://quantcast.mgr.consensu.org'
    .concat('/choice/', 'hK2b6w2mQ7J22', '/', host, '/choice.js')
  var uspTries = 0;
  var uspTriesLimit = 3;
  element.async = true;
  element.type = 'text/javascript';
  element.src = url;

  firstScript.parentNode.insertBefore(element, firstScript);

  function makeStub() {
    var TCF_LOCATOR_NAME = '__tcfapiLocator';
    var queue = [];
    var win = window;
    var cmpFrame;

    function addFrame() {
      var doc = win.document;
      var otherCMP = !!(win.frames[TCF_LOCATOR_NAME]);

      if (!otherCMP) {
        if (doc.body) {
          var iframe = doc.createElement('iframe');

          iframe.style.cssText = 'display:none';
          iframe.name = TCF_LOCATOR_NAME;
          doc.body.appendChild(iframe);
        } else {
          setTimeout(addFrame, 5);
        }
      }
      return !otherCMP;
    }

    function tcfAPIHandler() {
      var gdprApplies;
      var args = arguments;

      if (!args.length) {
        return queue;
      } else if (args[0] === 'setGdprApplies') {
        if (
          args.length > 3 &&
          args[2] === 2 &&
          typeof args[3] === 'boolean'
        ) {
          gdprApplies = args[3];
          if (typeof args[2] === 'function') {
            args[2]('set', true);
          }
        }
      } else if (args[0] === 'ping') {
        var retr = {
          gdprApplies: gdprApplies,
          cmpLoaded: false,
          cmpStatus: 'stub'
        };

        if (typeof args[2] === 'function') {
          args[2](retr);
        }
      } else {
        queue.push(args);
      }
    }

    function postMessageEventHandler(event) {
      var msgIsString = typeof event.data === 'string';
      var json = {};

      try {
        if (msgIsString) {
          json = JSON.parse(event.data);
        } else {
          json = event.data;
        }
      } catch (ignore) {}

      var payload = json.__tcfapiCall;

      if (payload) {
        window.__tcfapi(
          payload.command,
          payload.version,
          function(retValue, success) {
            var returnMsg = {
              __tcfapiReturn: {
                returnValue: retValue,
                success: success,
                callId: payload.callId
              }
            };
            if (msgIsString) {
              returnMsg = JSON.stringify(returnMsg);
            }
            event.source.postMessage(returnMsg, '*');
          },
          payload.parameter
        );
      }
    }

    while (win) {
      try {
        if (win.frames[TCF_LOCATOR_NAME]) {
          cmpFrame = win;
          break;
        }
      } catch (ignore) {}

      if (win === window.top) {
        break;
      }
      win = win.parent;
    }
    if (!cmpFrame) {
      addFrame();
      win.__tcfapi = tcfAPIHandler;
      win.addEventListener('message', postMessageEventHandler, false);
    }
  };

  makeStub();

  var uspStubFunction = function() {
    var arg = arguments;
    if (typeof window.__uspapi !== uspStubFunction) {
      setTimeout(function() {
        if (typeof window.__uspapi !== 'undefined') {
          window.__uspapi.apply(window.__uspapi, arg);
        }
      }, 500);
    }
  };

  var checkIfUspIsReady = function() {
    uspTries++;
    if (window.__uspapi === uspStubFunction && uspTries < uspTriesLimit) {
      console.warn('USP is not accessible');
    } else {
      clearInterval(uspInterval);
    }
  };

  if (typeof window.__uspapi === 'undefined') {
    window.__uspapi = uspStubFunction;
    var uspInterval = setInterval(checkIfUspIsReady, 6000);
  }
})();
<!-- End Quantcast Choice. Consent Manager Tag v2.0 (for TCF 2.0) -->