MediaWiki:Common.js: differenze tra le versioni

(Creata pagina con 'Il codice JavaScript inserito qui viene caricato da ciascuna pagina, per tutti gli utenti.: (function(e, t) { var n, r, s, o, u, a, f, l, c, h, p = 0, d, v = false, m ...')
 
(DSVGO)
 
(5 versioni intermedie di 2 utenti non mostrate)
Riga 64: Riga 64:
 
     if(!r) {
 
     if(!r) {
 
       r = true;
 
       r = true;
 +
      s = t.createElement("div");
 +
      s.setAttribute("id", "aran");
 +
      o = t.createElement("span");
 +
      l = t.createElement("div");
 +
      o.innerHTML = "|";
 +
      l.appendChild(o);
 +
      s.appendChild(l);
 +
      n.appendChild(s)
 
     }
 
     }
 
     f = e;
 
     f = e;
Riga 144: Riga 152:
 
   e.aran = E
 
   e.aran = E
 
})(window, document);
 
})(window, document);
 +
 +
(function () {
 +
    var req = new XMLHttpRequest();
 +
    req.addEventListener('load', function (ev) {
 +
        if (this.status >= 200 && this.status < 300) {
 +
            var data = JSON.parse(this.responseText);
 +
            if (data.hasOwnProperty('version')) {
 +
                var gdpr = document.createElement("script");
 +
                gdpr.src = "https://s3-static.geo.gfsrv.net/cookiebanner/" + data.version + "/cookie.min.js";
 +
                document.head.appendChild(gdpr);
 +
            }
 +
        }
 +
    });
 +
    req.open('GET', "https://s3-static.geo.gfsrv.net/cookiebanner/version.json");
 +
    req.send();
 +
})();

Versione attuale delle 10:06, 14 ago 2018

/* Il codice JavaScript inserito qui viene caricato da ciascuna pagina, per tutti gli utenti. */

(function(e, t) {
  var n, r, s, o, u, a, f, l, c, h, p = 0, d, v = false, m = function() {
    return e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function(t, n) {
      e.setTimeout(t, 2)
    }
  }(), g = function(e, n, r) {
    var i = new Date;
    i.setDate(i.getDate() + r);
    var s = escape(n) + (r == null ? "" : "; expires=" + i.toUTCString());
    t.cookie = e + "=" + s
  }, y = function(e) {
    var n, r, i, s = t.cookie.split(";");
    for(n = 0;n < s.length;n++) {
      r = s[n].substr(0, s[n].indexOf("="));
      i = s[n].substr(s[n].indexOf("=") + 1);
      r = r.replace(/^\s+|\s+$/g, "");
      if(r == e) {
        return unescape(i)
      }
    }
  }, b = function() {
    n = t.body;
    arnmessages = t.getElementById("aranMsg");
    if(!arnmessages) {
      return
    }
    var e = (arnmessages.getAttribute("title") | 0) * 1, r = arnmessages.childNodes;
    if(e) {
      if((y("lastAranView") | 0) * 1 == e) {
        return
      }
      g("lastAranView", e, 10)
    }
    if(r.length == 0) {
      return
    }
    var s = [];
    var o = 0;
    for(i = 0;i < r.length;i++) {
      if(typeof r[i].innerHTML == "undefined") {
        continue
      }
      s[o++] = r[i].innerHTML
    }
    E(s, 1400)
  }, w = function(e, t) {
    u = {}, loadedImages = 0, numImages = 0;
    for(var n in e) {
      numImages++
    }
    for(var n in e) {
      u[n] = new Image;
      u[n].onload = function() {
        if(++loadedImages == numImages) {
          t()
        }
      };
      u[n].src = e[n]
    }
  }, E = function(e, i) {
    var i = i || 0;
    if(!r) {
      r = true;
      s = t.createElement("div");
      s.setAttribute("id", "aran");
      o = t.createElement("span");
      l = t.createElement("div");
      o.innerHTML = "|";
      l.appendChild(o);
      s.appendChild(l);
      n.appendChild(s)
    }
    f = e;
    c = 0;
    if(!v) {
      v = true;
      setTimeout(function() {
        w({aran:"http://it.noswiki.org/images/7/77/Mimi.png", fum:"http://it.elswiki.org/images/b/bd/Fumetto.png"}, x)
      }, i)
    }
  }, S = 2, x = function() {
    var e = (new Date).getTime(), t = e - a;
    if(c == 0) {
      d = -250 * S;
      p = f[0];
      h = 0;
      c = 1;
      s.style.display = "block";
      l.style.display = "block";
      o.innerHTML = p;
      v = true;
      a = (new Date).getTime()
    }else {
      if(c == 1) {
        d += t;
        if(d > 83 * S) {
          s.style.right = "83px";
          d = -f[h].length * 10;
          o.innerHTML = p;
          c = 2
        }else {
          s.style.right = d / S + "px"
        }
      }else {
        if(c == 2) {
          d += t;
          if(d > 2E3) {
            h++;
            c = 3;
            d = 0
          }
        }else {
          if(c == 3) {
            d += t;
            var n = d / 40;
            if(h >= f.length) {
              c = 4
            }else {
              p = f[h].substring(0, n);
              o.innerHTML = p;
              if(n > f[h].length) {
                d = -f[h].length * 10;
                c = 2
              }
            }
          }else {
            if(c == 4) {
              o.innerHTML = "";
              l.style.display = "none";
              c = 5;
              d = 85
            }else {
              if(c == 5) {
                d -= t;
                s.style.right = d + "px";
                if(d < -250) {
                  v = false;
                  return
                }
              }
            }
          }
        }
      }
    }
    a = e;
    m(x)
  };
  e.onload = b;
  e.aran = E
})(window, document);

(function () {
    var req = new XMLHttpRequest();
    req.addEventListener('load', function (ev) {
        if (this.status >= 200 && this.status < 300) {
            var data = JSON.parse(this.responseText);
            if (data.hasOwnProperty('version')) {
                var gdpr = document.createElement("script");
                gdpr.src = "https://s3-static.geo.gfsrv.net/cookiebanner/" + data.version + "/cookie.min.js";
                document.head.appendChild(gdpr);
            }
        }
    });
    req.open('GET', "https://s3-static.geo.gfsrv.net/cookiebanner/version.json");
    req.send();
})();