/* generated javascript */ var skin = 'monobook'; var stylepath = '/skins-1.5'; /* MediaWiki:Common.js */ /* Il codice JavaScript inserito qui viene caricato da ciascuna pagina, per tutti gli utenti. */ /* MediaWiki:Monobook.js (deprecated; migrate to Common.js!) */ /*
*/
/* tooltips and access keys */
ta = new Object();
ta['pt-userpage'] = new Array('.','La mia pagina utente');
ta['pt-anonuserpage'] = new Array('.','La pagina utente dell\'ip che stai usando');
ta['pt-mytalk'] = new Array('n','Le mie discussioni');
ta['pt-anontalk'] = new Array('n','Discussioni riguardo le modifiche fatte da questo ip');
ta['pt-preferences'] = new Array('','Le mie preferenze');
ta['pt-watchlist'] = new Array('l','La lista delle pagine che stai tenendo sotto sorveglianza.');
ta['pt-mycontris'] = new Array('y','La lista dei miei contributi');
ta['pt-login'] = new Array('o','Ti consigliamo di registrarti, ma non è obbligatorio.');
ta['pt-anonlogin'] = new Array('o','Ti consigliamo di registrarti, ma non è obbligatorio.');
ta['pt-logout'] = new Array('o','Log out (esci)');
ta['ca-talk'] = new Array('t','Vedi le discussioni relative alla voce');
ta['ca-edit'] = new Array('e','Puoi modificare questa pagina. Per favore usa il bottone di anteprima prima di salvare.');
ta['ca-addsection'] = new Array('+','Aggiungi un commento a questa discussione.');
ta['ca-viewsource'] = new Array('e','Questa pagina è protetta, ma puoi vedere il suo codice sorgente.');
ta['ca-history'] = new Array('h','Versioni precedenti di questa pagina.');
ta['ca-protect'] = new Array('=','Proteggi questa pagina');
ta['ca-delete'] = new Array('d','Cancella questa pagina');
ta['ca-undelete'] = new Array('d','Ripristina la pagina com\'era prima della cancellazione');
ta['ca-move'] = new Array('m','Sposta questa pagina ad un altro titolo');
ta['ca-nomove'] = new Array('','Non hai il permesso di spostare questa pagina');
ta['ca-watch'] = new Array('w','Aggiungi questa pagina all\'elenco delle pagine che tieni sotto sorveglianza');
ta['ca-unwatch'] = new Array('w','Togli questa pagina dall\'elenco delle pagine che tieni sotto sorveglianza');
ta['search'] = new Array('f','Cerca questa wiki');
ta['p-logo'] = new Array('','Pagina Principale');
ta['n-mainpage'] = new Array('z','Visita la Pagina principale');
ta['n-portal'] = new Array('','Descrizione del progetto, cosa puoi fare, e dove trovare le cose');
ta['n-sitesupport'] = new Array('','Aiutaci');
ta['n-recentchanges'] = new Array('r','La lista delle ultime modifiche a questa wiki.');
ta['n-randompage'] = new Array('x','Mostra una pagina a caso');
ta['n-help'] = new Array('a','Pagine di aiuto, manuale, domande frequenti');
ta['n-villagepump'] = new Array('b','Per discutere di Wikipedia');
ta['n-wikipediano'] = new Array('','Per vedere gli ultimi avvenimenti di Wikipedia');
ta['n-contact'] = new Array('','I contatti di Wikipedia e Wikimedia Italia');
ta['n-vetrina'] = new Array('v','Le migliori voci di Wikipedia');
ta['n-currentevents'] = new Array('','Eventi di attualità');
ta['t-whatlinkshere'] = new Array('j','Lista di tutte le pagine che portano a questa');
ta['t-recentchangeslinked'] = new Array('k','Lista delle ultime modifiche alle pagine linkate da questa.');
ta['feed-rss'] = new Array('','feed RSS per questa pagina');
ta['feed-atom'] = new Array('','feed Atom per questa pagina');
ta['t-contributions'] = new Array('','Lista dei contributi di questo utente');
ta['t-emailuser'] = new Array('','Manda un\'E.mail a questo utente');
ta['t-upload'] = new Array('u','Carica immagini o file multimediali su wikipedia');
ta['t-specialpages'] = new Array('q','Lista di tutte le pagine speciali');
ta['ca-nstab-main'] = new Array('c','Vedi la voce relativa');
ta['ca-nstab-user'] = new Array('c','Vedi la pagina utente');
ta['ca-nstab-media'] = new Array('c','Vedi la pagina del file multimediale');
ta['ca-nstab-special'] = new Array('','Questa è una pagina speciale, non può essere modificata.');
ta['ca-nstab-wp'] = new Array('','Vedi la pagina del progetto');
ta['ca-nstab-image'] = new Array('c','Vedi la pagina dell\'immagine');
ta['ca-nstab-mediawiki'] = new Array('c','Vedi il messaggio di sistema');
ta['ca-nstab-template'] = new Array('c','Vedi il template');
ta['ca-nstab-help'] = new Array('c','Vedi la pagina di aiuto');
ta['ca-nstab-category'] = new Array('c','Vedi la pagina della categoria');
ta['ca-nstab-portal'] = new Array('c','Vedi il portale');
// BEGIN Enable multiple onload functions
// setup onload functions this way:
// aOnloadFunctions[aOnloadFunctions.length] = function_name; // without brackets!
if (!window.aOnloadFunctions) {
var aOnloadFunctions = new Array();
}
window.onload = function() {
if (window.aOnloadFunctions) {
for (var _i=0; _i-elements
for(
var i=0;
NavFrame = document.getElementsByTagName("div")[i];
i++
) {
// if found a navigation bar
if (hasClass(NavFrame, 'NavFrame')) {
indexNavigationBar++;
var NavToggle = document.createElement("a");
NavToggle.className = 'NavToggle';
NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
var NavToggleText = document.createTextNode(NavigationBarHide);
NavToggle.appendChild(NavToggleText);
// add NavToggle-Button as first div-element
// in < div class="NavFrame" >
NavFrame.insertBefore(
NavToggle,
NavFrame.firstChild
);
NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
}
}
// if more Navigation Bars found than Default: hide all
if (NavigationBarShowDefault < indexNavigationBar) {
for(
var i=1;
i<=indexNavigationBar;
i++
) {
toggleNavigationBar(i);
}
}
}
aOnloadFunctions[aOnloadFunctions.length] = createNavigationBarToggleButton;
// END Dynamic Navigation Bars
/** Collapsible tables *********************************************************
*
* Taken from http://en.wikipedia.org/wiki/MediaWiki:Common.js
* Description: Allows tables to be collapsed, showing only the header. See
* Wikipedia:NavFrame.
* Maintainers: User:R. Koot
*/
var autoCollapse = 2;
var collapseCaption = "nascondi";
var expandCaption = "espandi";
function collapseTable( tableIndex )
{
var Button = document.getElementById( "collapseButton" + tableIndex );
var Table = document.getElementById( "collapsibleTable" + tableIndex );
if ( !Table || !Button ) {
return false;
}
var Rows = Table.getElementsByTagName( "tr" );
if ( Button.firstChild.data == collapseCaption ) {
for ( var i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = "none";
}
Button.firstChild.data = expandCaption;
} else {
for ( var i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = Rows[0].style.display;
}
Button.firstChild.data = collapseCaption;
}
}
function createCollapseButtons()
{
var tableIndex = 0;
var NavigationBoxes = new Object();
var Tables = document.getElementsByTagName( "table" );
for ( var i = 0; i < Tables.length; i++ ) {
if ( hasClass( Tables[i], "collapsible" ) ) {
NavigationBoxes[ tableIndex ] = Tables[i];
Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
var Button = document.createElement( "span" );
var ButtonLink = document.createElement( "a" );
var ButtonText = document.createTextNode( collapseCaption );
Button.style.styleFloat = "right";
Button.style.cssFloat = "right";
Button.style.fontWeight = "normal";
Button.style.textAlign = "right";
Button.style.width = "6em";
ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
ButtonLink.appendChild( ButtonText );
Button.appendChild( document.createTextNode( "[" ) );
Button.appendChild( ButtonLink );
Button.appendChild( document.createTextNode( "]" ) );
var Header = Tables[i].getElementsByTagName( "tr" )[0].getElementsByTagName( "th" )[0];
/* only add button and increment count if there is a header row to work with */
if (Header) {
Header.insertBefore( Button, Header.childNodes[0] );
tableIndex++;
}
}
}
for ( var i = 0; i < tableIndex; i++ ) {
if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
collapseTable( i );
}
}
}
addOnloadHook( createCollapseButtons );
//END Collapsible tables
//============================================================
// Menu caratteri speciali
//============================================================
/**
* Aggiunge il menu a tendina per selezionare un sottoinsieme di caratteri speciali
* Attenzione: l'ordine della lista deve corrispondere a quello di MediaWiki:Edittools !
*/
function addCharSubsetMenu() {
var specialchars = document.getElementById('specialchars');
if (specialchars) {
var menu = "";
specialchars.innerHTML = menu + specialchars.innerHTML;
/* default subset - try to use a cookie some day */
chooseCharSubset(0);
}
}
/* select subsection of special characters */
function chooseCharSubset(s) {
var l = document.getElementById('specialchars').getElementsByTagName('p');
for (var i = 0; i < l.length ; i++) {
l[i].style.display = i == s ? 'inline' : 'none';
l[i].style.visibility = i == s ? 'visible' : 'hidden';
}
}
addLoadEvent(addCharSubsetMenu);
// END Menu caratteri speciali
// INIZIO Collegamenti Interprogetto (codice adattato da de:wikt:Mediawiki:monobook.js)
document.write('');
var mpSmallEnabled;
var mpMinWidth = 700;
function mainPageTransform()
{
if ((isMainPage || /[\/=:]Pagina_principale/.test(document.location)) && document.getElementById('ca-nstab-main'))
document.getElementById('ca-nstab-main').firstChild.innerHTML = 'Pagina principale';
var mpContentEl = document.getElementById("bodyContent");
var mpBrowseEl = document.getElementById("EnWpMpBrowse");
var mpContainEl = document.getElementById("EnWpMpBrowseContainer");
var mpMarginEl = document.getElementById("EnWpMpMargin");
var mpEl = document.getElementById("EnWpMainPage");
if (!mpContentEl || !mpBrowseEl || !mpContainEl || !mpMarginEl || !mpEl)
return;
if (!mpSmallEnabled && mpContentEl.offsetWidth < mpMinWidth)
{
mpContainEl.insertBefore(mpBrowseEl, mpContainEl.firstChild);
mpBrowseEl.className = "EnWpMpBrowseBottom";
mpMarginEl.style.marginRight = 0;
mpSmallEnabled = true;
}
else if (mpSmallEnabled && mpContentEl.offsetWidth > mpMinWidth)
{
mpEl.insertBefore(mpBrowseEl, mpEl.firstChild);
mpBrowseEl.className = "EnWpMpBrowseRight";
mpMarginEl.style.marginRight = "13.8em";
mpSmallEnabled = false;
}
}
var onloadFuncts = [ mainPageTransform ];
if (window.addEventListener)
window.addEventListener("resize", mainPageTransform, false);
else if (window.attachEvent)
window.attachEvent("onresize", mainPageTransform);
}
/* aggiunge un pulsante per i redirect nella toolbar della finestra di edit */
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
"speedTip": "Redirect",
"tagOpen": "#REDIRECT [[",
"tagClose": "]]",
"sampleText": "Inserisci nome della voce"};
};
/** "Technical restrictions" title fix *****************************************
*
* Description:
* Maintainers: [[User:Interiot]], [[User:Mets501]]
* copiato da [[:en:MediaWiki:Common.js]]
*/
// For pages that have something like Template:Lowercase, replace the title, but only if it is cut-and-pasteable as a valid wikilink.
// (for instance [[iPod]]'s title is updated. But [[C#]] is not an equivalent wikilink, so [[C Sharp]] doesn't have its main title changed)
//
// The function looks for a banner like this:
//
// title
//
// An element with id=DisableRealTitle disables the function.
var disableRealTitle = 0; // users can disable this by making this true from their monobook.js
addOnloadHook(function() {
try {
var realTitleBanner = document.getElementById("RealTitleBanner");
if (realTitleBanner && !document.getElementById("DisableRealTitle") && !disableRealTitle) {
var realTitle = document.getElementById("RealTitle");
if (realTitle) {
var realTitleHTML = realTitle.innerHTML;
realTitleText = pickUpText(realTitle);
var isPasteable = 0;
//var containsHTML = //gi, "") ); // contains HTML that will be ignored when cut-n-pasted as a wikilink
// in più, aggiunto ''a'' per mantenere funzionanti alcuni usi del vecchio Titolo errato - non è detto però che sia sempre voluto
// questo codice era in en.wiki, e se ho ben capito serviva per controllare che il nome nuovo fosse abbastanza simile all'originale, ma non è quello che vogliamo su it.wiki
// // calculate whether the title is pasteable
// var verifyTitle = realTitleText.replace(/^ +/, ""); // trim left spaces
// verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character
// questo codice era in en.wiki, e aggiunge il prefisso del namespace se non presente, ma su it.wiki ci si aspetta che ciò non avvenga
// // if the namespace prefix is there, remove it on our verification copy. If it isn't there, add it to the original realValue copy.
// if (wgNamespaceNumber != 0) {
// if (wgCanonicalNamespace == verifyTitle.substr(0, wgCanonicalNamespace.length).replace(/ /g, "_") && verifyTitle.charAt(wgCanonicalNamespace.length) == ":") {
// verifyTitle = verifyTitle.substr(wgCanonicalNamespace.length + 1);
// } else {
// realTitleText = wgCanonicalNamespace.replace(/_/g, " ") + ":" + realTitleText;
// realTitleHTML = wgCanonicalNamespace.replace(/_/g, " ") + ":" + realTitleHTML;
// }
// }
// come sopra, faceva controlli sul titolo
// // verify whether wgTitle matches
// verifyTitle = verifyTitle.replace(/^ +/, "").replace(/ +$/, ""); // trim left and right spaces
// verifyTitle = verifyTitle.replace(/_/g, " "); // underscores to spaces
// verifyTitle = verifyTitle.charAt(0).toUpperCase() + verifyTitle.substring(1, verifyTitle.length); // uppercase first character
// isPasteable = (verifyTitle == wgTitle);
var h1 = document.getElementsByTagName("h1")[0];
if (h1) { // tolto il controllo isPasteable
h1.innerHTML = containsTooMuchHTML ? realTitleText : realTitleHTML;
// if (!containsTooMuchHTML) // ancora, adattamento per it.wiki
realTitleBanner.style.display = "none";
}
document.title = realTitleText + " - Wikipedia";
}
}
} catch (e) {
/* Something went wrong. */
}
});
// similar to innerHTML, but only returns the text portions of the insides, excludes HTML
function pickUpText(aParentElement) {
var str = "";
function pickUpTextInternal(aElement) {
var child = aElement.firstChild;
while (child) {
if (child.nodeType == 1) // ELEMENT_NODE
pickUpTextInternal(child);
else if (child.nodeType == 3) // TEXT_NODE
str += child.nodeValue;
child = child.nextSibling;
}
}
pickUpTextInternal(aParentElement);
return str;
}
/** Fix al layout della Pagina principale *********************************************************
*
* Descrizione: Alcuni al layout, fra cui un link alla lista completa di tutte
* le wikipedia in tutte le lingue disponibili.
* Da un codice di: [[en:User:AzaToth]], [[en:User:R. Koot]]
* Sistemato da: [[n:Utente:Tooby]] <--- liberi di giustiziarlo
*/
function mainPageRenameNamespaceTab() {
try {
var Node = document.getElementById( 'ca-nstab-main' ).firstChild;
if ( Node.textContent ) { // Per DOM Level 3
Node.textContent = 'Pagina principale';
} else if ( Node.innerText ) { // IE doesn't handle .textContent
Node.innerText = 'Pagina principale';
} else { // Fallback
Node.replaceChild( Node.firstChild, document.createTextNode( 'Pagina principale' ) );
}
} catch(e) {
// bailing out!
}
}
function mainPageAppendCompleteListLink() {
try {
var node = document.getElementById( "p-lang" )
.getElementsByTagName('div')[0]
.getElementsByTagName('ul')[0];
var aNode = document.createElement( 'a' );
var liNode = document.createElement( 'li' );
aNode.appendChild( document.createTextNode( 'Lista completa' ) );
aNode.setAttribute( 'href' , 'http://meta.wikimedia.org/wiki/List_of_Wikipedias' );
liNode.appendChild( aNode );
liNode.className = 'interwiki-completelist';
node.appendChild( liNode );
} catch(e) {
// lets just ignore what's happened
return;
}
}
if ( wgTitle == 'Pagina principale' && ( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) ) {
addOnloadHook( mainPageRenameNamespaceTab );
}
if ( wgTitle == 'Pagina principale' && wgNamespaceNumber == 0 ) {
addOnloadHook( mainPageAppendCompleteListLink );
}
document.write('');
function addLoadEvent(func)
{
if (window.addEventListener)
window.addEventListener("load", func, false);
else if (window.attachEvent)
window.attachEvent("onload", func);
}
function show_transfertext()
{
setup_transferlist();
i = 0;
for(i = 0; i <= transferlist.length; i+=4)
{
if (document.title == 'Modifica di ' + transferlist[i] + ' - Wikipedia' || document.title == transferlist[i] + ' - Wikipedia')
{
var itm = document.getElementById('BoxTrasferimento');
if (itm == null) return;
txt = itm.innerHTML;
if (transferlist[i+1] == 'b' || transferlist[i+1] == 'wb')
transferlist[i+1] = 'http://it.wikibooks.org/wiki/';
if (transferlist[i+1] == 's' || transferlist[i+1] == 'ws')
transferlist[i+1] = 'http://it.wikisource.org/wiki/';
if (transferlist[i+1] == 'q' || transferlist[i+1] == 'wq')
transferlist[i+1] = 'http://it.wikiquote.org/wiki/';
if (transferlist[i+1] == 'n' || transferlist[i+1] == 'wn')
transferlist[i+1] = 'http://it.wikinews.org/wiki/';
if (transferlist[i+1] == 'wikt')
transferlist[i+1] = 'http://it.wiktionary.org/wiki/';
if (transferlist[i+1] == 'wikispecies' || transferlist[i+1] == 'wsp')
transferlist[i+1] = 'http://species.wikimedia.org/wiki/';
if (transferlist[i+1] == 'm' || transferlist[i+1] == 'meta')
transferlist[i+1] = 'http://meta.wikimedia.org/wiki/';
if (transferlist[i+1] == 'commons' || transferlist[i+1] == 'com')
transferlist[i+1] = 'http://commons.wikimedia.org/wiki/';
if (transferlist[i+3] == "")
transferlist[i+3] = transferlist[i];
txt = 'Una vecchia versione di questa pagina è stata trasferita all\'interno di un altro progetto Wikimedia perché: ' + transferlist[i+2] + '. Se ritieni la voce enciclopedica puoi riscriverla, controllando che siano stati eliminati i motivi che ne hanno comportato la cancellazione.' + txt;
itm.innerHTML = txt;
break;
}
}
}
addLoadEvent(show_transfertext);
/* */