Utente:Genuzzo/monobook.js: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
Contenuto aggiunto Contenuto cancellato
Genuzzo (rosica | curriculum) Nessun oggetto della modifica |
Genuzzo (rosica | curriculum) Nessun oggetto della modifica |
||
(710 versioni intermedie di 3 utenti non mostrate) | |||
Riga 1: | Riga 1: | ||
/* |
|||
disablealertLoad=1; |
|||
function updateNoncigioco() { |
|||
disablehideEdit=1; |
|||
time -= 1; |
|||
updateNoncigiocoBar(); |
|||
function setCookie(c_name,value,expiredays) |
|||
if(time <= 0) { |
|||
{ |
|||
youlost(); |
|||
var exdate=new Date(); |
|||
exdate.setDate(exdate.getDate()+expiredays); |
|||
document.cookie=c_name+ "=" +escape(value)+ |
|||
((expiredays==null) ? "" : ";expires="+exdate.toUTCString()); |
|||
} |
|||
function getCookie(c_name) |
|||
{ |
|||
if (document.cookie.length>0) |
|||
{ |
|||
c_start=document.cookie.indexOf(c_name + "="); |
|||
if (c_start!=-1) |
|||
{ |
|||
c_start=c_start + c_name.length+1; |
|||
c_end=document.cookie.indexOf(";",c_start); |
|||
if (c_end==-1) c_end=document.cookie.length; |
|||
return unescape(document.cookie.substring(c_start,c_end)); |
|||
} |
} |
||
} |
|||
return ""; |
|||
} |
|||
function checkCookie() |
|||
{ |
|||
lastid=getCookie('lastid'); |
|||
if (lastid!=null && lastid!="") |
|||
{ |
|||
return lastid; |
|||
} |
|||
else |
|||
{ |
|||
alert('Cookie not set!') |
|||
} |
|||
} |
} |
||
if (mwCustomEditButtons) { |
|||
function youlost() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
$('#noncigiocoyoulost').html($('#noncigiocoyoulost').html() + '<br>Comunque la risposta esatta era "' + rightAnswers[Math.floor(Math.random() * rightAnswers.length)] + '".'); |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/0/0c/Button_Chuck.png", |
|||
clearInterval(updateNoncigiocoInterval); |
|||
"speedTip": "Cancellazione immediata (USARE CON CAUTELA!)", |
|||
$('#noncigiococontainer').remove(); |
|||
"tagOpen": "{{Cancellazione|motivo=", |
|||
$('#noncigiocoyoulost').css('display', 'block').remove().appendTo('body'); |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
resizeNoncigiococontainer(); |
|||
"sampleText": "Inserire qui il motivo"}; |
|||
} |
|||
function noncigiocoYesNo(yesNo) { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
if(currentQuestion.r == -1) youlost(); |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/a/a5/Button_Samara.png", |
|||
else if(yesNo == 'yes' && currentQuestion.r == 0) youlost(); |
|||
"speedTip": "Articolo in scadenza", |
|||
else if(yesNo == 'no' && currentQuestion.r == 1) youlost(); |
|||
"tagOpen": "{{scadenza|{{subst:7g}" + "}|note=", |
|||
else createNoncigiocoQuestion(); |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
} |
|||
"sampleText": "Note"}; |
|||
function createNoncigiocoQuestion() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
var questions = [ |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/9/93/Button_Jessica.png", |
|||
{question: "2+2 = 3?", r: 0}, |
|||
{question: "13 ore equivalgono ad un giorno?", r: 0}, |
|||
"tagOpen": "{{Accusa|accusa=", |
|||
{question: "Il cammello ha una gobba e mezzo?", r: 0}, |
|||
"tagClose": "|firma=~~" + "~~}" + "}\n\n", |
|||
{question: "Il cane è il migliore amico dell'uomo?", r: 1}, |
|||
"sampleText": "Inserire qui l'accusa"}; |
|||
{question: "Gli esseri umani hanno sette occhi?", r: 0}, |
|||
{question: "Dio esiste?", r: -1}, |
|||
{question: "La matita è un tipo di penna?", r: 0}, |
|||
{question: "Il freddo è il contrario del caldo?", r: 1}, |
|||
{question: "Dopo la 'm' viene la 'n'?", r: 1}, |
|||
{question: "Il sole è una stella?", r: 1} |
|||
]; |
|||
time = lastTime * 0.85; |
|||
lastTime = time; |
|||
window.currentQuestion = questions[Math.floor(Math.random() * questions.length)]; |
|||
$('#noncigiocoquestionrow').html(currentQuestion.question); |
|||
updateNoncigiocoBar(); |
|||
} |
|||
function updateNoncigiocoBar() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
var bar = time / (lastTime + 10); |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/f0/Bouton_Vandale0.png", |
|||
$('#noncigiocobarrow').css('width', Math.round(bar * 100) + "%").css('background-color', 'rgb(' + (Math.round(bar * 255) + ',') + (Math.round(255 - bar * 255) + ',') + '0)'); |
|||
"speedTip": "Vandalo", |
|||
} |
|||
"tagOpen": "{{Vandalo", |
|||
"tagClose": "}}<br>~~"+"~~{{VF|}}", |
|||
"sampleText": ""}; |
|||
function resizeNoncigiococontainer() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
$('.noncigiococenter').each(function() { |
|||
"imageFile": "http://images3.wikia.nocookie.net/nonciclopedia/images/5/5c/Logo_Avvisi.png", |
|||
var b = $(window); |
|||
"speedTip": "Avvertimento", |
|||
var w = b.width(); |
|||
"tagOpen": "{{", |
|||
var h = b.height(); |
|||
"tagClose": "}}<br>--~~"+"~~{{VF|}}", |
|||
var cw = $(this).width(); |
|||
"sampleText": "Avvertimento"}; |
|||
var ch = $(this).height(); |
|||
var l = (w - cw) / 2; |
|||
var t = (h - ch) / 2; |
|||
$(this).css('top', t).css('left', l); |
|||
}); |
|||
} |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/d/d6/E'fiamme.png", |
|||
"speedTip": "Formattazione", |
|||
"tagOpen": "{{Restauro|motivo=formattazione", |
|||
"tagClose": "|firma=--~~" + "~~}" + "}\n\n", |
|||
"sampleText": ""}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images1.wikia.nocookie.net/nonciclopedia/images/4/48/Button_McGyver.png", |
|||
"speedTip": "No immagini", |
|||
"tagOpen": "{{restauro|motivo=noimmagini", |
|||
"tagClose": "|firma=--~~" + "~~}" + "}\n\n", |
|||
"sampleText": ""}; |
|||
$(document).ready(function() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
if(wgPageName == 'Utente:Genuzzo/noncigioco' && wgAction == 'view') { |
|||
"imageFile": "http://images.wikia.com/nonciclopedia/images/f/f9/Button_box.png", |
|||
window.rightAnswers = ["tua madre", "tua sorella", "1.8928374E17", "due elevato alla dodicesima", "sticazzi", "eeeeeeeeh"]; |
|||
"speedTip": "Box", |
|||
$('#globalWrapper').css('display', 'none'); |
|||
"tagOpen": '{| 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', |
|||
$('#noncigiocopreview').remove().appendTo($('body').css('background-color', '#fff')).css('width', 100).css('height', 100).css('position', 'fixed').css('background-color', '#AAA').html('Quando sei pronto, cliccami e ti dimostrerò che sei un idiota con una serie di domande.').addClass('noncigiococenter').click(function() { |
|||
"tagClose": "\n|}\n", |
|||
$(this).remove(); |
|||
"sampleText": "Inserire qui il testo interno"}; |
|||
$('#noncigiococontainer').css('display', 'block').remove().appendTo('body'); |
|||
$('#noncigiocoyes').click(function() { |
|||
noncigiocoYesNo('yes'); |
|||
}); |
|||
$('#noncigiocono').click(function() { |
|||
noncigiocoYesNo('no'); |
|||
}); |
|||
window.lastTime = 110; |
|||
window.currentQuestion = {}; |
|||
createNoncigiocoQuestion(); |
|||
window.updateNoncigiocoInterval = setInterval(updateNoncigioco, 50); |
|||
}); |
|||
resizeNoncigiococontainer(); |
|||
$(window).resize(function() { |
|||
resizeNoncigiococontainer(); |
|||
}); |
|||
} |
|||
}); |
|||
//CATINSERT |
|||
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"}; |
|||
function catInsertUpdate() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
$('.catinsert a').each(function() { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/0/0c/Button_P_template.png", |
|||
if(!$(this).data('c')) { |
|||
"speedTip": "stub", |
|||
$(this).click(function(e) { |
|||
"tagOpen": "{{", |
|||
e.preventDefault(); |
|||
"tagClose": "}" + "}", |
|||
$('textarea:nth(0)').val($('textarea:nth(0)').val() + '[[Categoria:' + $(this).text() + ']]'); |
|||
"sampleText": "stub"}; |
|||
}); |
|||
$(this).data('c', 'a'); |
|||
} |
|||
}); |
|||
} |
|||
$(document).ready(function() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
if($('.catinsert').length > 0) { |
|||
"imageFile": "http://images2.wikia.nocookie.net/nonciclopedia/images/5/5b/Button_inrestauro.png", |
|||
catInsertUpdate(); |
|||
"speedTip": "Fotomontaggio in Restauro", |
|||
setInterval(catInsertUpdate, 30); |
|||
"tagOpen": "{{inrestauro", |
|||
} |
|||
"tagClose": "|utente=" + "Nonciclopediologo}" + "}\n\n", |
|||
}); |
|||
"sampleText": ""}; |
|||
$(document).ready(function() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
if(wgPageName == 'Utente:Genuzzo/catinsert') { |
|||
"imageFile": "http://img13.imageshack.us/img13/6416/purge.png", |
|||
$('#bodyContent').prepend('<textarea />'); |
|||
"speedTip": "Purge", |
|||
} |
|||
"tagOpen": "[{{fullurl:{{FULLPAGENAME}}", |
|||
}); |
|||
"tagClose": "|action=purge" + "}" + "} Aggiorna all'ultima versione!]\n\n", |
|||
"sampleText": ""}; |
|||
//NO NIUBBY PLOX |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png", |
|||
"speedTip": "Barrato", |
|||
"tagOpen": "<s>", |
|||
"tagClose": "</s>", |
|||
"sampleText": "Barrato"}; |
|||
$(document).ready(function() { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
if(wgPageName == 'Speciale:CategorieRichieste') { |
|||
"imageFile": "http://images4.wikia.nocookie.net/nonciclopedia/images/f/fd/Button_underline.png", |
|||
$('a:contains("Niubby di ")').parent().hide(); |
|||
"speedTip": "Sottolineato", |
|||
} |
|||
"tagOpen": "<u>", |
|||
}); |
|||
"tagClose": "</u>", |
|||
"sampleText": "Sottolineato"}; |
|||
import_script((wgAction=='edit' || wgAction == 'submit'), "Nonciclopedia:Script/Searchbox.js"); |
|||
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"}; |
|||
//USER LINKS |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images4.wikia.nocookie.net/__cb20100806112820/nonciclopedia/images/e/ea/Button_align_left.png", |
|||
"speedTip": "Align left", |
|||
"tagOpen": '<span style="align:left;">', |
|||
"tagClose": "</span>", |
|||
"sampleText": "Testo allineato a sinistra"}; |
|||
var toAddUserLink = []; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images1.wikia.nocookie.net/__cb20100806112819/nonciclopedia/images/f/f7/Button_align_center.png", |
|||
"speedTip": "Align center", |
|||
"tagOpen": "<center>", |
|||
"tagClose": "</center>", |
|||
"sampleText": "Testo centrato"}; |
|||
toAddUserLink.push('[[Categoria:'); |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
toAddUserLink.push('[[File:'); |
|||
"imageFile": "http://images1.wikia.nocookie.net/__cb20100806112825/nonciclopedia/images/a/a5/Button_align_right.png", |
|||
"speedTip": "Align right", |
|||
"tagOpen": '<span style="align:right;">', |
|||
"tagClose": "</span>", |
|||
"sampleText": "Testo allineato a destra"}; |
|||
if(wgAction == 'edit' || wgAction == 'submit') { |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
$(document).ready(function() { |
|||
"imageFile": "http://images3.wikia.nocookie.net/__cb20100806112827/nonciclopedia/images/1/15/Button_colonne.png", |
|||
$.each(toAddUserLink, function(i, v) { |
|||
"speedTip": "Testo in colonne", |
|||
$('#editform').before($('<a></a>').attr('href', '#').text(v).click(function(e) { |
|||
"tagOpen": "{{Colonne|col=2|", |
|||
e.preventDefault(); |
|||
"tagClose": "}}\n", |
|||
$('textarea:eq(0)').val($('textarea:eq(0)').val() + $(this).text()); |
|||
"sampleText": "Inserire qui il testo per le colonne"}; |
|||
})).before(' | '); |
|||
}); |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
}); |
|||
"imageFile": "http://img829.imageshack.us/img829/5043/buttonnoninclude.png", |
|||
"speedTip": "<noinclude>", |
|||
"tagOpen": "<noinclude>", |
|||
"tagClose": "</noinclude>", |
|||
"sampleText": "Non includere"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://img9.imageshack.us/img9/7229/buttonincludeonly.png", |
|||
"speedTip": "<includeonly>", |
|||
"tagOpen": "<includeonly>", |
|||
"tagClose": "</includeonly>", |
|||
"sampleText": "Includi solo qui"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images4.wikia.nocookie.net/nonciclopedia/images/6/6f/Button_cit2.png", |
|||
"speedTip": "Citazione 2", |
|||
"tagOpen": "{{Cit2|", |
|||
"tagClose": "}}\n", |
|||
"sampleText": "Inserire qui la citazione"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images1.wikia.nocookie.net/nonciclopedia/images/f/f6/Button_Citnec.png", |
|||
"speedTip": "Citazione necessaria", |
|||
"tagOpen": "{{Citnec|", |
|||
"tagClose": "}}", |
|||
"sampleText": "Inserire qui la citazione"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images4.wikia.nocookie.net/nonciclopedia/images/4/4a/Bottone_curiosità.png", |
|||
"speedTip": "Curiosità", |
|||
"tagOpen": "{" + "{Curiosità}}", |
|||
"tagClose": "", |
|||
"sampleText": ""}; |
|||
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"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images4.wikia.nocookie.net/nonciclopedia/images/2/20/Button_censura2.png", |
|||
"speedTip": "Censura", |
|||
"tagOpen": "{{Censura|", |
|||
"tagClose": "}}", |
|||
"sampleText": ""}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/e8/Pulsante_unverified.png", |
|||
"speedTip": "Colore", |
|||
"tagOpen": "{{Colore|#Codice esadecimale|", |
|||
"tagClose": "}}", |
|||
"sampleText": ""}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/aa/Button_question.png", |
|||
"speedTip": "Carattere", |
|||
"tagOpen": "{{Carattere|Tipo di carattere|dim%|", |
|||
"tagClose": "}}", |
|||
"sampleText": ""}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/5/56/Button_big.png", |
|||
"speedTip": "Dimensione", |
|||
"tagOpen": "{{Dimensione|dim%|", |
|||
"tagClose": "}}", |
|||
"sampleText": "Testo"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", |
|||
"speedTip": "Redirect", |
|||
"tagOpen": "#REDIRECT [[", |
|||
"tagClose": "]]", |
|||
"sampleText": "Nome pagina"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/74/Button_comment.png", |
|||
"speedTip": "Commento", |
|||
"tagOpen": "<!-- ", |
|||
"tagClose": " -->", |
|||
"sampleText": "Inserisci qui il testo"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://images4.wikia.nocookie.net/__cb20100806112826/nonciclopedia/images/2/23/Button_code.png", |
|||
"speedTip": "Inserisci il codice", |
|||
"tagOpen": "<code>", |
|||
"tagClose": "</code>", |
|||
"sampleText": "Inserisci qui il codice"}; |
|||
mwCustomEditButtons[mwCustomEditButtons.length] = { |
|||
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/7/79/Button_reflink.png", |
|||
"speedTip": "Inserisci la nota nel testo", |
|||
"tagOpen": "<ref>", |
|||
"tagClose": "</ref>", |
|||
"sampleText": "Inserisci qui il testo della nota"}; |
|||
} |
} |
||
function rb2um() { |
|||
u = location.href; |
|||
if (u.indexOf("action=rollback")!=-1) { |
|||
location.href = "http://nonciclopedia.wikia.com/wiki/Speciale:UltimeModifiche"; |
|||
} |
|||
} |
|||
import_script((wgPageName == "Nonciclopedia:LiveRC"), "Nonciclopedia:LiveRC/LiveRC.js"); */ |
|||
addOnloadHook(rb2um); |
|||
function |
addOnloadHook(function() { |
||
if(wgAction == 'edit') { |
|||
var xhr; |
|||
$('#p-cactions').css({ |
|||
try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); } |
|||
'width': '100%', |
|||
catch (e) |
|||
'left': '0px', |
|||
{ |
|||
'padding-left': '0px', |
|||
try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); } |
|||
'top': '0px' |
|||
}); |
|||
$('#p-cactions .pBody').css({ |
|||
try { xhr = new XMLHttpRequest(); } |
|||
'margin': '41px 222px 0 160px' |
|||
catch (e3) { xhr = false; } |
|||
}); |
|||
$('#p-personal .pBody').css({ |
|||
} |
|||
'background': '-moz-linear-gradient(center top , #FFFFFF 30%, #EAF5FD 150%) repeat scroll 0 0 transparent', |
|||
'padding': '0px 10px 0px 0px' |
|||
xhr.onreadystatechange = function() |
|||
}); |
|||
$('#p-personal li').css({ |
|||
if(xhr.readyState == 4) |
|||
'background': 'none repeat scroll 0 0 transparent', |
|||
{ |
|||
'margin-left': '0px', |
|||
if(xhr.status == 200) { |
|||
if(lastid == -1) { |
|||
}); |
|||
lastid = xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value; |
|||
$('li#pt-userpage').css({ |
|||
setCookie('lastid', lastid, 1); |
|||
'padding-left': '0px' |
|||
}); |
|||
else { |
|||
} |
|||
if(lastid != xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value) { |
|||
}); |
|||
lastid = xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value; |
|||
setCookie('lastid', lastid, 1); |
|||
location.href = "http://nonciclopedia.wikia.com/wiki/Speciale:UltimeModifiche"; |
|||
} |
|||
} |
|||
} |
|||
else { |
|||
alert("Error code " + xhr.status); } |
|||
} |
|||
}; |
|||
xhr.open('GET', "http://nonciclopedia.wikia.com/api.php?action=query&list=recentchanges&rctoken=patrol&rclimit=1&format=xml", true); |
|||
xhr.send(null); |
|||
} |
|||
function dynuminit() { |
|||
if(wgPageName == "Speciale:UltimeModifiche") { |
|||
allarm = document.createElement('audio'); |
|||
allarm.hidden = 'true'; |
|||
allarm.autoplay = 'true'; |
|||
allarm.src = 'http://images.wikia.com/runescape/images/7/7f/Level_99_Fireworks.ogg'; |
|||
allarm.loop = 'false'; |
|||
allarm.volume = 0.3; |
|||
document.getElementsByTagName('HEAD')[0].appendChild(allarm); |
|||
setCookie('lastid', -1, 1); |
|||
setInterval("getlastchange(checkCookie('lastid'));", 10000); |
|||
} |
|||
} |
|||
addOnloadHook(dynuminit); |
Versione attuale delle 13:34, 30 set 2012
/*
function updateNoncigioco() {
time -= 1;
updateNoncigiocoBar();
if(time <= 0) {
youlost();
}
}
function youlost() {
$('#noncigiocoyoulost').html($('#noncigiocoyoulost').html() + '<br>Comunque la risposta esatta era "' + rightAnswers[Math.floor(Math.random() * rightAnswers.length)] + '".');
clearInterval(updateNoncigiocoInterval);
$('#noncigiococontainer').remove();
$('#noncigiocoyoulost').css('display', 'block').remove().appendTo('body');
resizeNoncigiococontainer();
}
function noncigiocoYesNo(yesNo) {
if(currentQuestion.r == -1) youlost();
else if(yesNo == 'yes' && currentQuestion.r == 0) youlost();
else if(yesNo == 'no' && currentQuestion.r == 1) youlost();
else createNoncigiocoQuestion();
}
function createNoncigiocoQuestion() {
var questions = [
{question: "2+2 = 3?", r: 0},
{question: "13 ore equivalgono ad un giorno?", r: 0},
{question: "Il cammello ha una gobba e mezzo?", r: 0},
{question: "Il cane è il migliore amico dell'uomo?", r: 1},
{question: "Gli esseri umani hanno sette occhi?", r: 0},
{question: "Dio esiste?", r: -1},
{question: "La matita è un tipo di penna?", r: 0},
{question: "Il freddo è il contrario del caldo?", r: 1},
{question: "Dopo la 'm' viene la 'n'?", r: 1},
{question: "Il sole è una stella?", r: 1}
];
time = lastTime * 0.85;
lastTime = time;
window.currentQuestion = questions[Math.floor(Math.random() * questions.length)];
$('#noncigiocoquestionrow').html(currentQuestion.question);
updateNoncigiocoBar();
}
function updateNoncigiocoBar() {
var bar = time / (lastTime + 10);
$('#noncigiocobarrow').css('width', Math.round(bar * 100) + "%").css('background-color', 'rgb(' + (Math.round(bar * 255) + ',') + (Math.round(255 - bar * 255) + ',') + '0)');
}
function resizeNoncigiococontainer() {
$('.noncigiococenter').each(function() {
var b = $(window);
var w = b.width();
var h = b.height();
var cw = $(this).width();
var ch = $(this).height();
var l = (w - cw) / 2;
var t = (h - ch) / 2;
$(this).css('top', t).css('left', l);
});
}
$(document).ready(function() {
if(wgPageName == 'Utente:Genuzzo/noncigioco' && wgAction == 'view') {
window.rightAnswers = ["tua madre", "tua sorella", "1.8928374E17", "due elevato alla dodicesima", "sticazzi", "eeeeeeeeh"];
$('#globalWrapper').css('display', 'none');
$('#noncigiocopreview').remove().appendTo($('body').css('background-color', '#fff')).css('width', 100).css('height', 100).css('position', 'fixed').css('background-color', '#AAA').html('Quando sei pronto, cliccami e ti dimostrerò che sei un idiota con una serie di domande.').addClass('noncigiococenter').click(function() {
$(this).remove();
$('#noncigiococontainer').css('display', 'block').remove().appendTo('body');
$('#noncigiocoyes').click(function() {
noncigiocoYesNo('yes');
});
$('#noncigiocono').click(function() {
noncigiocoYesNo('no');
});
window.lastTime = 110;
window.currentQuestion = {};
createNoncigiocoQuestion();
window.updateNoncigiocoInterval = setInterval(updateNoncigioco, 50);
});
resizeNoncigiococontainer();
$(window).resize(function() {
resizeNoncigiococontainer();
});
}
});
//CATINSERT
function catInsertUpdate() {
$('.catinsert a').each(function() {
if(!$(this).data('c')) {
$(this).click(function(e) {
e.preventDefault();
$('textarea:nth(0)').val($('textarea:nth(0)').val() + '[[Categoria:' + $(this).text() + ']]');
});
$(this).data('c', 'a');
}
});
}
$(document).ready(function() {
if($('.catinsert').length > 0) {
catInsertUpdate();
setInterval(catInsertUpdate, 30);
}
});
$(document).ready(function() {
if(wgPageName == 'Utente:Genuzzo/catinsert') {
$('#bodyContent').prepend('<textarea />');
}
});
//NO NIUBBY PLOX
$(document).ready(function() {
if(wgPageName == 'Speciale:CategorieRichieste') {
$('a:contains("Niubby di ")').parent().hide();
}
});
import_script((wgAction=='edit' || wgAction == 'submit'), "Nonciclopedia:Script/Searchbox.js");
//USER LINKS
var toAddUserLink = [];
toAddUserLink.push('[[Categoria:');
toAddUserLink.push('[[File:');
if(wgAction == 'edit' || wgAction == 'submit') {
$(document).ready(function() {
$.each(toAddUserLink, function(i, v) {
$('#editform').before($('<a></a>').attr('href', '#').text(v).click(function(e) {
e.preventDefault();
$('textarea:eq(0)').val($('textarea:eq(0)').val() + $(this).text());
})).before(' | ');
});
});
}
import_script((wgPageName == "Nonciclopedia:LiveRC"), "Nonciclopedia:LiveRC/LiveRC.js"); */
addOnloadHook(function() {
if(wgAction == 'edit') {
$('#p-cactions').css({
'width': '100%',
'left': '0px',
'padding-left': '0px',
'top': '0px'
});
$('#p-cactions .pBody').css({
'margin': '41px 222px 0 160px'
});
$('#p-personal .pBody').css({
'background': '-moz-linear-gradient(center top , #FFFFFF 30%, #EAF5FD 150%) repeat scroll 0 0 transparent',
'padding': '0px 10px 0px 0px'
});
$('#p-personal li').css({
'background': 'none repeat scroll 0 0 transparent',
'margin-left': '0px',
});
$('li#pt-userpage').css({
'padding-left': '0px'
});
}
});