Utente:Demart81/monobook.js

Da Wikisource.

Nota: dopo aver pubblicato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti.

  • Firefox / Safari: tieni premuto il tasto delle maiuscole Shift e fai clic su Ricarica, oppure premi Ctrl-F5 o Ctrl-R (⌘-R su Mac)
  • Google Chrome: premi Ctrl-Shift-R (⌘-Shift-R su un Mac)
  • Internet Explorer / Edge: tieni premuto il tasto Ctrl e fai clic su Aggiorna, oppure premi Ctrl-F5
  • Opera: premi Ctrl-F5.
// Elenco dei tool da caricare.

var toLoad="purg led ns0 lks orol tabs nav stru unw allp tbar avan nms chat cmd qed since goo rch ver vpop vfol bot";



//Monobook Modulare
//Lancia il vero monobook
// Vedi [[Wikisource:Monobook.js/MonobookCompleto.js]]
// 
document.writeln('<script type="text/javascript" src="/w/index.php?title=Wikisource:Monobook.js/MonobookCompleto.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');


// <pre>
function ModifySidebar(action, section, name, link) {
    try {
        switch (section) {
          case "languages":
            var target = "p-lang";
            break;
          case "toolbox":
            var target = "p-tb";
            break;
          case "navigation":
            var target = "p-navigation";
            break;
          default:
            var target = "p-" + section;
            break;
        }
 
        if (action == "add") {
            var node = document.getElementById(target)
                               .getElementsByTagName('div')[0]
                               .getElementsByTagName('ul')[0];
 
            var aNode = document.createElement('a');
            var liNode = document.createElement('li');
 
            aNode.appendChild(document.createTextNode(name));
            aNode.setAttribute('href', link);
            liNode.appendChild(aNode);
            liNode.className='plainlinks';
            node.appendChild(liNode);
        }
 
        if (action == "remove") {
            var list = document.getElementById(target)
                               .getElementsByTagName('div')[0]
                               .getElementsByTagName('ul')[0];
 
            var listelements = list.getElementsByTagName('li');
 
            for (var i = 0; i < listelements.length; i++) {
                if (listelements[i].getElementsByTagName('a')[0].innerHTML == name ||
                    listelements[i].getElementsByTagName('a')[0].href == link) {
 
                    list.removeChild(listelements[i]);
                }
            }
        }
 
    } catch(e) {
      // lets just ignore what's happened
      return;
    }
}
 
function CustomizeModificationsOfSidebar() {
    ModifySidebar("remove", "toolbox", "Carica un file", "http://it.wikisource.org/wiki/Speciale:Carica");
}
 
$(CustomizeModificationsOfSidebar);
// POPUP DI LUPIN [[User:Lupin/popups.js]]
// document.write('<script type="text/javascript" src="' 
//             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js' 
//             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
// FUNZIONE BASE PER GLI SCRIPT DI IPORK
function inc(file) {
   document.write('<script type="text/javascript" src="/w/index.php?title='+ file +'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
inc("Utente:IPork/controllo versioni.js");
var nomeutente= "Aubrey";

// INDICATORE DI STATO
inc("Utente:IPork/indicatorestato.js");
inc("Utente:Aubrey/statopersonale.js");

// RICERCA AVANZATA
inc("Utente:IPork/ricerca.js");

// MENU A SINISTRA
inc("Utente:IPork/menusinistra.js");
// MENU A SINISTRA - COLLEGAMENTI PERSONALI
$(function(){addToolboxLink('http://it.wikisource.org/wiki/Speciale:TutteLePagine', 'Tutte le pagine');});
$(function(){addToolboxLink('http://it.wikisource.org/wiki/Speciale:Carica', 'Carica un file');});
$(function(){addToolboxLink('http://it.wikisource.org/wiki/Speciale:Statistiche', 'Statistiche');});
$(function(){addToolboxLink('http://it.wikisource.org/wiki/Speciale:Importa', 'Importa');});
$(function(){addToolboxLink('http://it.wikisource.org/wiki/Speciale:Esporta', 'Esporta');});
$(function(){addToolboxLink('http://it.wikisource.org/w/index.php?title=Speciale%3ARegistri&type=newusers&user=&page=&year=&month=-1', 'Nuovi utenti');});
$(function(){addToolboxLink('http://it.wikisource.org/wiki/Utente:Demart81/monobook.js', 'Monobook.js');});
$(function(){addToolboxLink('http://it.wikisource.org/wiki/Utente:Demart81/monobook.css', 'Monobook.css');});
$(function(){addToolboxLink('http://it.wikipedia.org/wiki/Categoria:Icone_per_toolbar', 'Icone per toolbar (I)');});
$(function(){addToolboxLink('http://commons.wikimedia.org/wiki/Category:MediaWiki_edit_toolbar', 'Icone per toolbar (II)');});


var opzPannelliOriginali = 0;
var opzAmministratore = 1;
var opzModificaIntro = 0;
var opzLinksPersonali =0;

//SAL
//inc("Utente:IPork/SAL.js");

// PULSANTI ADDIZIONALI
// REDIRECT
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.png",
     "speedTip": "Redirect",
     "tagOpen": '#REDIRECT[[',
     "tagClose": ']]',
     "sampleText": "Inserisci nome della voce"};
};
 
// AUTORECITATO
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/6/6d/Button_AC.png",
     "speedTip": "Autore Citato",
     "tagOpen": '{{Ac||',
     "tagClose": '}}',
     "sampleText": "Nome autore"};
};
 
// TESTOCITATO
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/45/Button_TC.png",
     "speedTip": "Testo Citato",
     "tagOpen": '{{Tc||',
     "tagClose": '}}',
     "sampleText": "Nome testo"};
};
 
// ALTRAVERSIONE
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0b/Button_fuente.png",
     "speedTip": "Altra Versione",
     "tagOpen": '{{AltraVersione|PAGINA|',
     "tagClose": '}}',
     "sampleText": "Collegamento"};
};

// §
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/e2/Button_%C2%A7.png",
     "speedTip": "§",
     "tagOpen": '{{§||',
     "tagClose": '}}',
     "sampleText": "citazione"};
};

// R
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/b0/CR_icon.png",
     "speedTip": "R",
     "tagOpen": '{{R|',
     "tagClose": '}}',
     "sampleText": "X"};
};

// R5
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/8c/Button_head_A5.png",
     "speedTip": "R|5",
     "tagOpen": '{{R|5',
     "tagClose": '}}',
     "sampleText": ""};
};

// R10
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/6/6b/Button_lazy.gif",
     "speedTip": "R|10",
     "tagOpen": '{{R|10',
     "tagClose": '}}',
     "sampleText": ""};
};

// SEZIONE
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/44/Button_comillas_latinas.png",
     "speedTip": "Section",
     "tagOpen": '<section begin="1" />',
     "tagClose": '<section end="1" />',
     "sampleText": "Sezione"};
};

// Template TEMPLATE
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/4b/Button_class_text.png",
     "speedTip": "tl",
     "tagOpen": '{{tl|',
     "tagClose": '}}',
     "sampleText": "Nome_template"};
};

// CENTRATO
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/5f/Button_center.png",
     "speedTip": "Testo Citato",
     "tagOpen": '{{Centrato|',
     "tagClose": '}}',
     "sampleText": "Testo"};
};

// CITAZIONE
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/05/Button_Anf%C3%BChrung.png",
     "speedTip": "Cite",
     "tagOpen": '{{Citazione|',
     "tagClose": '}}',
     "sampleText": "Citazione"};
};


// PAGINA BIANCA
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0c/Button_P_template.png",
     "speedTip": "blank",
     "tagOpen": '{{Pagina bianca}}',
     "tagClose": '',
     "sampleText": ""};
};

/* Maiuscoletto */
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/a2/SmallcapsButton.png",
     "speedTip": "Maiuscoletto",
     "tagOpen": '{{Sc|',
     "tagClose": '}}',
     "sampleText": "Maiuscoletto"};
};

/* A DESTRA */
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/a5/Button_align_right.png",
     "speedTip": "A destra",
     "tagOpen": '{{A_destra|',
     "tagClose": '}}',
     "sampleText": "A destra"};
};

/* BR */
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/bf/Br.png",
     "speedTip": "A capo",
     "tagOpen": '<br/>',
     "tagClose": '',
     "sampleText": "A capo"};
};

/* Capolettera */
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/58/Button_C.png",
     "speedTip": "Capolettera",
     "tagOpen": '{{Capolettera|',
     "tagClose": '}}',
     "sampleText": "Capolettera"};
};

/* Capolettera bis*/
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/5a/Button_category_alt.png",
     "speedTip": "Altro capolettera",
     "tagOpen": '<span style="font-size:2em">',
     "tagClose": '</span>',
     "sampleText": "Altro capolettera"};
};

/* Spazi bianchi*/
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/16/Nbsp-button-bg.png",
     "speedTip": "Spazi bianchi",
     "tagOpen": '{{Nbsp|',
     "tagClose": '}}',
     "sampleText": ""};
};

/* Dot*/
if (mwCustomEditButtons) {
 mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/57/Dotpng-button-bg.png",
     "speedTip": "Spazi bianchi",
     "tagOpen": '{{Dot',
     "tagClose": '}}',
     "sampleText": ""};
};


document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// <source lang="javascript">
 
/**********************
*** Automatically generate page footer from values in {{header}}
*** by [[user:GrafZahl]]
**********************/
 
/*
 * Proposed algorithm:
 * 1. find the Capitolo tables using a class.
 * 2. if there are two Capitolo tables, the page already has a header and footer, and we should not add another.
 *    if there is only one Capitolo table, we will assume it is at the top and there is no footer
 * 3. duplicate the header table and place the duplicate at the bottom.
 * 4. profit.
 */
 
function DisplayFooter() {
	if(document.getElementById && wgNamespaceNumber==0) {
		nofooter = document.getElementById('nofooter');
		hp = document.getElementById('headerprevious');
		hn = document.getElementById('headernext');
		content = document.getElementById('bodyContent');
		catlinks = document.getElementById('catlinks');
		footer = document.createElement('table');
                //header_template = document.getElementById('headertemplate');		
 
                if( (!((content) && (footer))) || (!(hp || hn)) ||
		(nofooter))
		return;
 
		footer.setAttribute('class', 'headertemplate');
		footer.setAttribute('id', 'footertemplate');
		footer.setAttribute('style', 'margin-top:1em; clear:both;');
 
		/* Begin footer HTML code */
		tr = document.createElement('tr');
		td = document.createElement('td');
		td.setAttribute('align', 'left');
		td.setAttribute('width', '33%');
 
                if (hp) {
		  fp = hp.cloneNode(true);
		  fp.setAttribute('id', 'footerprevious');
		  td.appendChild(fp);
		}
		tr.appendChild(td);
 
		td = document.createElement('td');
		td.setAttribute('align', 'center');
		td.setAttribute('width', '34%');
		a = document.createElement('a');
		a.setAttribute('href', '#top');
		text = document.createTextNode('Return to the top of the page.');
		a.appendChild(text);
		td.appendChild(a);
		tr.appendChild(td);
 
		td = document.createElement('td');
		td.setAttribute('align', 'right');
		td.setAttribute('width', '33%');
 
                if (hn) {
		  fn = hn.cloneNode(true);
		  fn.setAttribute('id', 'footernext');
		  td.appendChild(fn);
		}
 
		tr.appendChild(td);
 
		footer.appendChild(tr);
 
		/* End footer HTML code */
 
		if(catlinks) // place footer before category box
		content.insertBefore(footer, catlinks);
		else
		content.appendChild(footer);
	}
}
 
$(DisplayFooter);
 
// </source>

//</pre>