Utente:Sanjilops/monobook.js: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
Contenuto aggiunto Contenuto cancellato
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
Riga 68: | Riga 68: | ||
"sampleText": "Note"}; |
"sampleText": "Note"}; |
||
} |
} |
||
disableAssignSubTitle=1; |
|||
function sottotitolo() { |
|||
var subTitleTextElement = document.getElementById("SubTitleText"); |
|||
if (subTitleTextElement) { |
|||
var subTitleTextHTML = subTitleTextElement.innerHTML; |
|||
subTitleText = pickUpText(subTitleTextElement); |
|||
// assegno il testo completo di HTML come sottotitolo della pagina: |
|||
var h3 = document.getElementsByTagName("h3")[0]; |
|||
if (h3) { |
|||
h3.innerHTML = subTitleTextHTML; |
|||
} |
|||
// nascondo l'elemento "SubTitleText" perché serve solo per il javascript: |
|||
subTitleTextElement.style.display = "none"; |
|||
} else { |
|||
sottotitolorandom(); |
|||
}}; |
|||
addOnloadHook(sottotitolo); |
|||
function sottotitolorandom() { |
|||
var sottotitoli = new Array(); |
|||
sottotitoli[0] = "Titolo prova 1"; |
|||
sottotitoli[1] = "Titolo prova 2"; |
|||
sottotitoli[2] = "Titolo prova 3"; |
|||
sottotitoli[3] = "Titolo prova 4"; |
|||
sottotitoli[4] = "Titolo prova 5"; |
|||
var n = Math.round(Math.random() * (sottotitoli.length - 1)); //scelta random |
|||
// assegno il testo come sottotitolo della pagina: |
|||
for(var i=0; subtitle = document.getElementsByTagName("h3")[i]; i++) { |
|||
if ((subtitle.getAttribute('id') == "siteSub")) { |
|||
subtitle.innerHTML = sottotitoli[n]; |
|||
} |
|||
} |
|||
}; |
Versione delle 02:59, 10 mar 2008
// Live Preview customization,
// edit this to your own liking.
wpUserName = 'Sanjilops'; // User name to display in signatures
wpShowImages = true; // Enable downloading and displaying of images
// Include Live Preview...
document.write('<script type="text/javascript" src="index.php?title=Live_Preview/Javascript.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// Now set everything up
window.onload = Main;
function Main()
{
LivePreviewInstall();
// You may include here other "extensions"
}
/* This is to keep track of who is using the Live Preview: [[Live Preview/Install]] */
if (mwCustomEditButtons) {
mwCustomEditButtons[0] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png",
"speedTip": "A capo",
"tagOpen": "<br />\n",
"tagClose": "",
"sampleText": ""};
mwCustomEditButtons[1] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/05/Button_Anf%C3%BChrung.png",
"speedTip": "Citazione",
"tagOpen": "{{Citazione|",
"tagClose": "}" + "}",
"sampleText": "..."};
mwCustomEditButtons[2] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0c/Button_P_template.png",
"speedTip": "Template",
"tagOpen": "{{",
"tagClose": "}" + "}",
"sampleText": "Template"};
mwCustomEditButtons[3] = {
"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; padding-right: 4px; padding-left: 4px;"\n|',
"tagClose": "\n|}\n",
"sampleText": ""};
mwCustomEditButtons[4] = {
"imageFile": "http://images2.wikia.nocookie.net/nonciclopedia/images/a/a5/Button_Samara.png",
"speedTip": "Articolo in scadenza",
"tagOpen": "{{scadenza|{{subst:7g}" + "}|note=",
"tagClose": "|firma=~~" + "~~}" + "}\n\n",
"sampleText": "Note"};
}