Utente:Wurgl/WikiHistory.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.

var authors = {
  loadinganimation : 0,
  execute : function () {
  	if (mw.config.get('wgArticleId') == 0) return; // no deleted articles
  	if (mw.config.get('wgRevisionId') != 0 && mw.config.get('wgCurRevisionId') != mw.config.get('wgRevisionId')) return; // only current revision
  	$("<div id='authors' style='font-size:84%; line-height:1.2em; margin:0 0 0 1em; width:auto;'>di <span id='authorsresult'></span><span id='authorsloading'>...</span></div>").insertBefore(document.getElementById("contentSub") || document.getElementById("mw-content-text"));
  	loadinganimation = window.setInterval( function() { if ($("#authorsloading").html() == ".&nbsp;&nbsp;") $("#authorsloading").html("&nbsp;.&nbsp;"); else if ($("#authorsloading").html() == "&nbsp;.&nbsp;") $("#authorsloading").html("&nbsp;&nbsp;."); else $("#authorsloading").html(".&nbsp;&nbsp;"); }, 300);
  	mw.loader.load("//wikihistory.toolforge.org/wiki/getauthors.php?wiki=" + window.location.hostname.split(".", 1)[0] + "wiki&page_id=" +  mw.config.get('wgArticleId'));
  },
  resultloaded : function( res, old ) {
  	$("#authorsresult").html(res);
  	if (old == 1) mw.loader.load("//wikihistory.toolforge.org/wiki/getauthors.php?wiki=" + window.location.hostname.split(".", 1)[0] + "wiki&page_id=" +  mw.config.get('wgArticleId') + '&onlynew=1');
  },
  stoploading : function() {
  	clearInterval(loadinganimation);
  	$('#authorsloading').remove();
  }
}
if ( mw.config.get('wgNamespaceNumber') == 0 && ((typeof WikiHistory === 'undefined' || WikiHistory == "all" || WikiHistory == "view") && mw.config.get('wgAction') == "view" || (typeof WikiHistory !== 'undefined' && (WikiHistory == "all" || WikiHistory == "info")) && mw.config.get('wgAction') == "info") ) $( authors.execute );