Utente:Chiavettomane(?)/monobook.js

Vai alla navigazione Vai alla ricerca

Questa pagina definisce alcuni parametri di aspetto e comportamento generale di tutte le pagine. Per personalizzarli vedi Aiuto:Stile utente.


Nota: dopo aver salvato è necessario pulire la cache del proprio browser per vedere i cambiamenti, e comunque qualche minuto di preghiera non guasta. Per Mozilla / Firefox / Safari: fare clic su Ricarica tenendo premuto il tasto delle maiuscole, oppure premere Ctrl-F5 o Ctrl-R (Command-R su Mac); per Chrome premere Ctrl-Shift-R (Command-Shift-R su un Mac); per Konqueror: premere il pulsante Ricarica o il tasto F5; per Opera può essere necessario svuotare completamente la cache dal menu Strumenti → Preferenze; per Internet Explorer: mantenere premuto il tasto Ctrl mentre si preme il pulsante Aggiorna o premere Ctrl-F5.

buttonPurge = 1;
disablealertLoad=1;
disablehideEdit=1;
 
 
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}
function checkCookie(cookie)
{
c=getCookie(cookie);
if (c!=null && c!="")
  {
  return c;
  }
}
 
//Bottoni personalizzati
if (mwCustomEditButtons) {
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCancellazione;

mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteScadenza;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteAccusa;
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/f0/Bouton_Vandale0.png",
     "speedTip": "Vandalo",
     "tagOpen": "{{Vandalo",
     "tagClose": "}}<br />~~"+"~~",
     "sampleText": ""};
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://images3.wikia.nocookie.net/nonciclopedia/images/5/5c/Logo_Avvisi.png",
     "speedTip": "Avvertimento",
     "tagOpen": "{{",
     "tagClose": "}}<br />--~~"+"~~",
     "sampleText": "Avvertimento"};
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteFormattazione1;

mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteFormattazione2;
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://images1.wikia.nocookie.net/nonciclopedia/images/4/48/Button_McGyver.png",
     "speedTip": "No immagini",
     "tagOpen": "{{Restauro|motivo=noimmagini",
     "tagClose": "|firma=--~~" + "~~}" + "}\n\n",
     "sampleText": ""};
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteRiquadro1;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteGallery;
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0c/Button_P_template.png",
     "speedTip": "stub",
     "tagOpen": "{{",
     "tagClose": "}" + "}",
     "sampleText": "stub"};
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteBarrato;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteSottolineato;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteApice;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsantePedice;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteSmall;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteBig;

mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteAllineaSX;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteAllinea;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteAllineaDX;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteColonne;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCit2;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCitnec;
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://images4.wikia.nocookie.net/nonciclopedia/images/4/4a/Bottone_curiosità.png",
     "speedTip": "Curiosità",
     "tagOpen": "{" + "{Curiosità}}",
     "tagClose": "",
     "sampleText": ""};
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteTabella;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCensura;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteColore;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCarattere;

mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteDimensione;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteRedirect;
 
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteReflink;

}

 
//Redirect dal rollback alle ultime modifiche
function rb2um() {
   u = location.href;
   if (u.indexOf("action=rollback")!=-1) {
      location.href = "http://nonciclopedia.wikia.com/wiki/Speciale:UltimeModifiche";
   }
}
 
addOnloadHook(rb2um);
 
//Fine Ultimate Site Control
function getlastchange(lastid) { 
    var xhr; 
    try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  xhr = new XMLHttpRequest();     }
          catch (e3) {  xhr = false;   }
        }
     }
 
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              if(xhr.status  == 200) {
                if(lastid == -1) {
                    lastid = xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value;
                    setCookie('lastid', lastid, 1);
                }
                else {
                    if(lastid != xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value) {
                        lastid = xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value;
                        setCookie('lastid', lastid, 1);
                        location.href = "http://nonciclopedia.wikia.com/wiki/Speciale:UltimeModifiche";
 
                    }
                }
              }
              //else {
                // alert("Error code " + xhr.status); }
         }
    }; 
 
   xhr.open('GET', "http://nonciclopedia.wikia.com/api.php?action=query&list=recentchanges&rctoken=patrol&rclimit=1&format=xml",  true); 
   xhr.send(null); 
} 
 
function dynuminit() {
 if(wgPageName == "Speciale:UltimeModifiche") {
if(checkCookie('alarm') == 'SI') {
  allarm = document.createElement('audio');
  allarm.hidden = 'true';
  allarm.autoplay = 'true';
  allarm.src = 'http://images.wikia.com/runescape/images/7/7f/Level_99_Fireworks.ogg';
  allarm.loop = 'false';
  allarm.volume = checkCookie('volume');
  document.getElementsByTagName('HEAD')[0].appendChild(allarm); }
  if(checkCookie('alert') == 'SI') alert('New edit!');
  setCookie('lastid', -1, 1);
  setInterval("getlastchange(checkCookie('lastid'));", 10000);
 }
}
 
addOnloadHook(dynuminit);
 
function MakeApiRequest(method, parameters, post, callback, imageObj) { 
    var xhr; 
    try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  xhr = new XMLHttpRequest();     }
          catch (e3) {  xhr = false;   }
        }
     }
 
    xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              if(xhr.status  == 200) {
                callback(xhr, imageObj);
              }
              //else {
                // alert("Error code " + xhr.status); }
         }
    }; 
 
   xhr.open(method, "http://nonciclopedia.wikia.com/api.php?" + parameters,  true); 
   xhr.send(post); 
} 
 
imageFoundCallback = function(XML, imageObj) {
  try {
   var ii = XML.responseXML.getElementsByTagName('ii').item(0);
   imageObj.src = ii.attributes['url'].value;
  }
  catch(e) {
    errDiv = document.createElement('div');
    errDiv.innerHTML = "<!-- Errore: " + e + "-->";
    this.parentNode.appendChild(errDiv);
  }
};
 
/**
 * Ignora utente
 *  v. 0.2 beta
 * pistacchio 2010
 */
 
/* jquery da google */
importScriptURI( 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js' );
 
/* configurazione */
var utenti_da_nascondere = [
    'Eeeeee'
];
 
 
// eseguo l'esclusione degli utenti solo dopo il load della pagina
addOnloadHook(function() {
 
  // controllo di essere sulla pagina delle ultime modifiche
  if (document.URL.indexOf('Nonciclopedia.htm') != -1)  {
      // lista degli utenti delle modifiche
      var link_autori_modifiche = $('li.mw-line-even > a.mw-userlink, li.mw-line-odd > a.mw-userlink');
 
      $.each(link_autori_modifiche, function(index, value) {
        // cerco utenti da nascondere fra gli autori delle modifiche
        if ($.inArray($(value).text(), utenti_da_nascondere) > -1) {
          $(value).parent().css('display', 'none');
        }
      });
 
 
  }
 
});