Utente:Robin Hood~itwiki/monobook.js

Da Wikipedia, l'enciclopedia libera.
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 (per le pagine globali è comunque necessario attendere qualche minuto). 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 menù Strumenti → Preferenze; per Internet Explorer: mantenere premuto il tasto Ctrl mentre si preme il pulsante Aggiorna o premere Ctrl-F5.

function $( document ).ready(func) {
  if (window.addEventListener) {
    window.addEventListener("load", func, false);
  }
  else if (window.attachEvent) {
         window.attachEvent("onload", func);
       }
}

// AJOUTE DEUX ONGLETS MONOBOOK

function ajoutOngletJS() {
  var a = document.getElementById("p-cactions");
    if (a) {
      b = a.getElementsByTagName("ul");
      if(b.length > 0) {
        b[0].innerHTML = b[0].innerHTML
        + '<li id="ca-nstab-user">'
        + '<a href="/wiki/Utente:Robin_Hood/monobook.js">'
        + 'js</a></li>';
      }
    }
}

function ajoutOngletCSS() {
  var a = document.getElementById("p-cactions");
    if (a) {
      b = a.getElementsByTagName("ul");
      if(b.length > 0) {
        b[0].innerHTML = b[0].innerHTML
        + '<li id="ca-nstab-user">'
        + '<a href="/wiki/Utente:Robin_Hood/monobook.css">'
        + 'css</a></li>';
      }
    }
}

// AJOUTE UN ONGLET STRUCTURE

function ajoutOngletStructure() {
  var a = document.getElementById("p-cactions");
    if (a) {
      b = a.getElementsByTagName("ul");
      if(b.length > 0) {
        b[0].innerHTML = b[0].innerHTML
        + '<li id="ca-nstab-user">'
        + '<a href="/wiki/Utente:Robin_Hood/Structure">'
        + 'Struttura</a></li>';
      }
    }
}

// AJOUTE LES LIENS DANS LA BOÎTE DE NAVIGATION

function ajoutLiens() {
  var a = document.getElementById("p-navigation");
    if (a) {
      b = a.getElementsByTagName("ul");
      if(b.length > 0) {
        b[0].innerHTML = b[0].innerHTML 
        + '<li><a style="display: inline" title="Wikipedia:Ambasciata" '
        +        'href="/w/index.php?title=Wikipedia:Ambasciata&action=purge">'
        +              'Ambasciata</a></li>'
        + '<li><a style="display: inline" title="Suivis" '
        +        'href="http://it.wikipedia.org/w/wiki.phtml?title=Speciale:Watchlist&days=0">'
        +              'Tutte osservati</a>'
        +     '<a style="display: inline" title="Suivis" '
        +        'href="http://it.wikipedia.org/w/wiki.phtml?title=Speciale:Watchlist&days=3">'
        +              '3 giorni</a>'
        +     '<a style="display: inline" title="Suivis" '
        +        'href="http://it.wikipedia.org/w/wiki.phtml?title=Speciale:Watchlist&days=1">'
        +              '1 giorno</a></li>'
      }
    }
}

$( document ).ready(ajoutLiens);
if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
  $( document ).ready(ajoutOngletJS);
  $( document ).ready(ajoutOngletStructure);
  $( document ).ready(ajoutOngletCSS);
}

// AJOUTE LES LIENS DANS LA BOÎTE À OUTILS

$(function () {
 
  if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
    url = wgServer 
          + "/w/index.php?title=Special:Log&user=" 
          + wgTitle.split("/")[0];
  } 
  else if ( wgCanonicalNamespace == "Special" ) {
               return;
       } 
       else {
         url = wgServer 
               + "/w/index.php?title=Special:Log&page=" 
               + wgPageName;
       }
 
mw.util.addPortletLink("p-tb", "http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=Robin+Hood&dbname=itwiki_p", "Metro di edizioni", "ca-editcount");
mw.util.addPortletLink("p-cactions", url, "Log", "pt-logs");
});