Utente:El Pampa/monobook.js: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
Contenuto aggiunto Contenuto cancellato
El Pampa (rosica | curriculum) Nessun oggetto della modifica |
El Pampa (rosica | curriculum) Nessun oggetto della modifica |
||
Riga 1: | Riga 1: | ||
if (mwCustomEditButtons) {mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
annullaMorphCommon = 1; |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/0/0c/Button_Chuck.png", |
|||
"speedTip": "Cancellazione immediata (USARE CON CAUTELA!)", |
|||
/* Hook that enables collapsing objects. |
|||
"tagOpen": "{{Cancellazione|motivo=", |
|||
* Added 11/5/2007 by WhiteMystery (misterioblanco@gmail.com) |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
* on Encyclopedia Dramatica, stolen by Sua Zanzità Zazy |
|||
"sampleText": "Inserire qui il motivo"}; |
|||
* Uses publicly available code in one function, where noted. */ |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/a/a5/Button_Samara.png", |
|||
addOnloadHook(createToggleLinks); |
|||
"speedTip": "Articolo in scadenza", |
|||
"tagOpen": "{{scadenza|scadenza=" + "{{subst:7g}" + "}|note=", |
|||
/* Function that toggles collapsing objects. |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
* Added 11/5/2007 by WhiteMystery (misterioblanco@gmail.com) |
|||
"sampleText": "Note"}; |
|||
* on Encyclopedia Dramatica, stolen by Sua Zanzità Zazy |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
* Uses publicly available code in one function, where noted. */ |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/9/93/Button_Jessica.png", |
|||
"speedTip": "Articolo in dubbio", |
|||
function toggleCollapse(objToToggle, collapseText, expandText) { |
|||
"tagOpen": "{{Accusa|accusa=", |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
var linkText = ""; |
|||
"sampleText": "Inserire qui l'accusa"}; |
|||
var targetObject = returnObjById(objToToggle); |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images2.wikia.nocookie.net/nonciclopedia/images/5/5b/Button_inrestauro.png", |
|||
if ( targetObject ) { |
|||
"speedTip": "Articolo da sistemare", |
|||
"tagOpen": "{{Restauro|motivo=", |
|||
if ( targetObject.style.display == "none" ) { |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
"sampleText": "Inserire qui la descrizione"}; |
|||
targetObject.style.display = "block"; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
linkText = collapseText; |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/0/0a/Button_sad.png", |
|||
} |
|||
"speedTip": "Poco umoristico", |
|||
"tagOpen": "{{Accusa|accusa=" + "APU" + "|firma=~~" + "~~}" + "}\n\n", |
|||
else { |
|||
"tagClose": "", |
|||
"sampleText": ""}; |
|||
targetObject.style.display = "none"; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
linkText = expandText; |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/d/d6/E%27fiamme.png", |
|||
} |
|||
"speedTip": "Formattazione", |
|||
"tagOpen": "{{Formattazione|note=", |
|||
var toggleLink = document.createElement("span"); |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
toggleLink.appendChild(document.createTextNode(linkText)); |
|||
"sampleText": "Inserire qui cosa fare"}; |
|||
toggleLink.setAttribute("onclick", "javascript:toggleCollapse('" + objToToggle + "','" + collapseText + "','" + expandText + "')"); |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
toggleLink.setAttribute('onmouseover', 'style.textDecoration="underline"'); |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/e/e1/E%27mat.png", |
|||
toggleLink.setAttribute('onmouseout', 'style.textDecoration="none"'); |
|||
"speedTip": "Formattazione", |
|||
toggleLink.setAttribute("style", "color:blue;"); |
|||
"tagOpen": "{{Formattazione|note=", |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
"sampleText": "Inserire qui cosa fare"}; |
|||
returnObjById(objToToggle + "Link").appendChild(toggleLink); |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
} |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/3/34/Button_MrX.png", |
|||
} |
|||
"speedTip": "Battute tra amici", |
|||
"tagOpen": "{{Cancellazione|motivo=" + "BTA|firma=~~" + "~~}" + "}\n\n", |
|||
/* Functions that performs the morph operation. |
|||
"tagClose": "", |
|||
* Added 11/5/2007 by WhiteMystery (misterioblanco@gmail.com) |
|||
"sampleText": ""}; |
|||
* on Encyclopedia Dramatica, stolen by Sua Zanzità Zazy |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
* Uses publicly available code in one function, where noted. */ |
|||
"imageFile": "http://images4.wikia.nocookie.net/nonciclopedia/images/3/33/Sguardone.png", |
|||
"speedTip": "Immagine da rinominare ", |
|||
function performMorph(targetID, targetNumber) { |
|||
"tagOpen": "{{Nomedimmerda|scadenza=" + "{{subst:7g}" + "}|motivo=", |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
var counter = 1; |
|||
"sampleText": ""}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
while ( returnObjById(targetID + "Content" + counter) ) { |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/f/f9/Button_box.png", |
|||
"speedTip": "Box", |
|||
if ( counter == targetNumber ) |
|||
"tagOpen": '{| class="expansion" width="100%" align="center" style="background: #FFFFFF; color: #000000; border: 1px solid #000000; text-align: left; margin-bottom: 0px; margin-top: 0px;"\n| style="padding-right: 4px; padding-left: 4px;" |\n', |
|||
returnObjById(targetID + "Content" + counter).style.display = "block"; |
|||
"tagClose": "\n|}\n", |
|||
"sampleText": "Inserire qui il testo interno"}; |
|||
returnObjById(targetID + "Content" + counter).style.display = "none"; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images.wikia.com/central/images/1/12/Button_gallery.png", |
|||
counter++; |
|||
"speedTip": "Galleria di immagini", |
|||
} |
|||
"tagOpen": "\n<gallery>\n", |
|||
"tagClose": "\n</gallery>", |
|||
returnObjById(targetID + "Master").innerHTML = targetNumber; |
|||
"sampleText": "Immagine:Example.jpg|Caption1\nImmagine:Example.jpg|Caption2"}; |
|||
} |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0c/Button_P_template.png", |
|||
function morphForward(targetID) { |
|||
"speedTip": "Template", |
|||
"tagOpen": "{{", |
|||
var nextPane = parseInt(returnObjById(targetID + "Master").innerHTML) + 1; |
|||
"tagClose": "}" + "}", |
|||
"sampleText": "Template"}; |
|||
if ( returnObjById(targetID + "Content" + nextPane) ) |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
performMorph(targetID, nextPane); |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png", |
|||
"speedTip": "Barrato", |
|||
else |
|||
"tagOpen": "<s>", |
|||
"tagClose": "</s>", |
|||
} |
|||
"sampleText": "Barrato"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
function morphBackward(targetID) { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png", |
|||
"speedTip": "Apice", |
|||
var prevPane = parseInt(returnObjById(targetID + "Master").innerHTML) - 1; |
|||
"tagOpen": "<sup>", |
|||
"tagClose": "</sup>", |
|||
"sampleText": "Apice"}; |
|||
performMorph(targetID, prevPane); |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png", |
|||
else { |
|||
"speedTip": "Pedice", |
|||
"tagOpen": "<sub>", |
|||
var maxIndex = 1; |
|||
"tagClose": "</sub>", |
|||
"sampleText": "Pedice"}; |
|||
while ( returnObjById(targetID + "Content" + maxIndex) ) |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
maxIndex++; |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/5/58/Button_small.png", |
|||
"speedTip": "Piccolo", |
|||
performMorph(targetID, maxIndex - 1); |
|||
"tagOpen": "<small>", |
|||
} |
|||
"tagClose": "</small>", |
|||
} |
|||
"sampleText": "Piccolo"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
/* Function that creates ED's collapsing objects and toggle links. |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/5/56/Button_big.png", |
|||
* Added 11/5/2007 by WhiteMystery (misterioblanco@gmail.com) |
|||
"speedTip": "Grande", |
|||
* on Encyclopedia Dramatica, stolen by Sua Zanzità Zazy |
|||
"tagOpen": "<big>", |
|||
* Uses publicly available code in one function, where noted. |
|||
"tagClose": "</big>", |
|||
* |
|||
"sampleText": "Grande"}; |
|||
* Updated: 1/11/2008 by WhiteMystery to add new Morphing Objects |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
* functionality. */ |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png", |
|||
"speedTip": "Tabella", |
|||
function createToggleLinks() { |
|||
"tagOpen": '{| class="wikitable"\n|-\n', |
|||
"tagClose": "\n|}", |
|||
var spanCollection = document.getElementsByTagName("span"); |
|||
"sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"};} |
|||
for ( i = 0; i < spanCollection.length; i++ ) { |
|||
if ( spanCollection[i].className == "toggleLink" ) { |
|||
var spanID = spanCollection[i].getAttribute("id"); |
|||
var targetID = spanID.substr(0, spanID.length - 4); |
|||
var collapseText = returnObjById(targetID + "CollapseText").innerHTML; |
|||
var expandText = returnObjById(targetID + "ExpandText").innerHTML; |
|||
var initialState = returnObjById(targetID + "InitialState").innerHTML; |
|||
var toggleLink = document.createElement("span"); |
|||
if ( initialState == "0" ) { |
|||
returnObjById(targetID).style.display = "none"; |
|||
toggleLink.appendChild(document.createTextNode(expandText)); |
|||
} |
|||
else { |
|||
returnObjById(targetID).style.display = "block"; |
|||
toggleLink.appendChild(document.createTextNode(collapseText)); |
|||
} |
|||
toggleLink.setAttribute("onclick", "javascript:toggleCollapse('" + targetID + "','" + collapseText + "','" + expandText + "')"); |
|||
toggleLink.setAttribute('onmouseover', 'style.textDecoration="underline"'); |
|||
toggleLink.setAttribute('onmouseout', 'style.textDecoration="none"'); |
|||
toggleLink.setAttribute("style", "color:blue;"); |
|||
spanCollection[i].appendChild(toggleLink); |
|||
} |
|||
else if ( spanCollection[i].className == "morphMaster" ) { |
|||
var spanID = spanCollection[i].getAttribute("id"); |
|||
var targetID = spanID.substr(0, spanID.length - 6); |
|||
var counter = 1; |
|||
// Create forward and backward paging if the paging elements exist |
|||
if ( returnObjById(targetID + "LinkNext") && returnObjById(targetID + "LinkPrev") && returnObjById(targetID + "Content1") ) { |
|||
// Create the forward link |
|||
var nextLink = document.createElement("span"); |
|||
nextLink.innerHTML = returnObjById(targetID + "LinkNext").innerHTML; |
|||
nextLink.setAttribute("onclick", "javascript:morphForward('" + targetID + "')"); |
|||
nextLink.setAttribute('onmouseover', 'style.textDecoration="underline"'); |
|||
nextLink.setAttribute('onmouseout', 'style.textDecoration="none"'); |
|||
nextLink.setAttribute("style", "color:blue;"); |
|||
returnObjById(targetID + "LinkNext").innerHTML = ""; |
|||
returnObjById(targetID + "LinkNext").appendChild(nextLink, 0); |
|||
// Create the backward link |
|||
var prevLink = document.createElement("span"); |
|||
prevLink.innerHTML = returnObjById(targetID + "LinkPrev").innerHTML; |
|||
prevLink.setAttribute("onclick", "javascript:morphBackward('" + targetID + "')"); |
|||
prevLink.setAttribute('onmouseover', 'style.textDecoration="underline"'); |
|||
prevLink.setAttribute('onmouseout', 'style.textDecoration="none"'); |
|||
prevLink.setAttribute("style", "color:blue;"); |
|||
returnObjById(targetID + "LinkPrev").innerHTML = ""; |
|||
returnObjById(targetID + "LinkPrev").appendChild(prevLink, 0); |
|||
// Initialize content panes |
|||
while ( returnObjById(targetID + "Content" + counter) ) { |
|||
if ( counter == 1 ) |
|||
returnObjById(targetID + "Content" + counter).style.display = "block"; |
|||
else |
|||
returnObjById(targetID + "Content" + counter).style.display = "none"; |
|||
counter++; |
|||
} |
|||
} |
|||
counter = 1; |
|||
// Whether or not there is paging, generate normal links |
|||
while ( returnObjById(targetID + "Link" + counter) && returnObjById(targetID + "Content" + counter) ) { |
|||
var morphLink = document.createElement("span"); |
|||
morphLink.innerHTML = returnObjById(targetID + "Link" + counter).innerHTML; |
|||
morphLink.setAttribute("onclick", "javascript:performMorph('" + targetID + "','" + counter + "')"); |
|||
morphLink.setAttribute('onmouseover', 'style.textDecoration="underline"'); |
|||
morphLink.setAttribute('onmouseout', 'style.textDecoration="none"'); |
|||
morphLink.setAttribute("style", "color:blue;"); |
|||
returnObjById(targetID + "Link" + counter).innerHTML = ""; |
|||
returnObjById(targetID + "Link" + counter).appendChild(morphLink, 0); |
|||
// Initialize content panes |
|||
if ( counter == 1 ) |
|||
returnObjById(targetID + "Content" + counter).style.display = "block"; |
|||
else |
|||
returnObjById(targetID + "Content" + counter).style.display = "none"; |
|||
counter++; |
|||
} |
|||
spanCollection[i].innerHTML = "1"; |
|||
spanCollection[i].style.display = "none"; |
|||
} |
|||
} |
|||
} |
|||
/* Function that toggles ED's collapsing objects. |
|||
* Added 11/5/2007 by WhiteMystery (misterioblanco@gmail.com) |
|||
* on Encyclopedia Dramatica, stolen by Sua Zanzità Zazy |
|||
* Taken from http://www.netlobo.com/javascript_get_element_id.html */ |
|||
function returnObjById( id ) { |
|||
if (document.getElementById) |
|||
var returnVar = document.getElementById(id); |
|||
else if (document.all) |
|||
var returnVar = document.all[id]; |
|||
else if (document.layers) |
|||
var returnVar = document.layers[id]; |
|||
return returnVar; |
|||
} |
Versione delle 01:11, 7 mag 2009
if (mwCustomEditButtons) {mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/0/0c/Button_Chuck.png",
"speedTip": "Cancellazione immediata (USARE CON CAUTELA!)",
"tagOpen": "{{Cancellazione|motivo=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": "Inserire qui il motivo"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/a/a5/Button_Samara.png",
"speedTip": "Articolo in scadenza",
"tagOpen": "{{scadenza|scadenza=" + "{{subst:7g}" + "}|note=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": "Note"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/9/93/Button_Jessica.png",
"speedTip": "Articolo in dubbio",
"tagOpen": "{{Accusa|accusa=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": "Inserire qui l'accusa"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images2.wikia.nocookie.net/nonciclopedia/images/5/5b/Button_inrestauro.png",
"speedTip": "Articolo da sistemare",
"tagOpen": "{{Restauro|motivo=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": "Inserire qui la descrizione"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/0/0a/Button_sad.png",
"speedTip": "Poco umoristico",
"tagOpen": "{{Accusa|accusa=" + "APU" + "|firma=~~" + "~~}" + "}\n\n",
"tagClose": "",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/d/d6/E%27fiamme.png",
"speedTip": "Formattazione",
"tagOpen": "{{Formattazione|note=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": "Inserire qui cosa fare"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/e/e1/E%27mat.png",
"speedTip": "Formattazione",
"tagOpen": "{{Formattazione|note=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": "Inserire qui cosa fare"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/3/34/Button_MrX.png",
"speedTip": "Battute tra amici",
"tagOpen": "{{Cancellazione|motivo=" + "BTA|firma=~~" + "~~}" + "}\n\n",
"tagClose": "",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images4.wikia.nocookie.net/nonciclopedia/images/3/33/Sguardone.png",
"speedTip": "Immagine da rinominare ",
"tagOpen": "{{Nomedimmerda|scadenza=" + "{{subst:7g}" + "}|motivo=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/f/f9/Button_box.png",
"speedTip": "Box",
"tagOpen": '{| class="expansion" width="100%" align="center" style="background: #FFFFFF; color: #000000; border: 1px solid #000000; text-align: left; margin-bottom: 0px; margin-top: 0px;"\n| style="padding-right: 4px; padding-left: 4px;" |\n',
"tagClose": "\n|}\n",
"sampleText": "Inserire qui il testo interno"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/central/images/1/12/Button_gallery.png",
"speedTip": "Galleria di immagini",
"tagOpen": "\n<gallery>\n",
"tagClose": "\n</gallery>",
"sampleText": "Immagine:Example.jpg|Caption1\nImmagine:Example.jpg|Caption2"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0c/Button_P_template.png",
"speedTip": "Template",
"tagOpen": "{{",
"tagClose": "}" + "}",
"sampleText": "Template"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png",
"speedTip": "Barrato",
"tagOpen": "<s>",
"tagClose": "</s>",
"sampleText": "Barrato"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png",
"speedTip": "Apice",
"tagOpen": "<sup>",
"tagClose": "</sup>",
"sampleText": "Apice"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png",
"speedTip": "Pedice",
"tagOpen": "<sub>",
"tagClose": "</sub>",
"sampleText": "Pedice"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/5/58/Button_small.png",
"speedTip": "Piccolo",
"tagOpen": "<small>",
"tagClose": "</small>",
"sampleText": "Piccolo"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/5/56/Button_big.png",
"speedTip": "Grande",
"tagOpen": "<big>",
"tagClose": "</big>",
"sampleText": "Grande"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/6/60/Button_insert_table.png",
"speedTip": "Tabella",
"tagOpen": '{| class="wikitable"\n|-\n',
"tagClose": "\n|}",
"sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"};}