Utente:Cafi96/monobook.js: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
Contenuto aggiunto Contenuto cancellato
Cafi96 (rosica | curriculum) Nessun oggetto della modifica |
Cafi96 (rosica | curriculum) Nessun oggetto della modifica |
||
Riga 41: | Riga 41: | ||
} |
} |
||
); |
); |
||
document.write('<script type="text/javascript" src="http://nonciclopedia.wikia.com/index.php?title=Utente:Genuzzo/LiveRC.js&action=raw&ctype=text/javascript"></script>'); |
|||
addOnloadHook(function() { |
|||
if(!document.getElementById("toolbar")) return; |
|||
if(wgCurRevisionId) |
|||
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|' + wgCurRevisionId + '}' + '}'; |
|||
else |
|||
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|}' + '}'; |
|||
} |
|||
); |
|||
function init() { |
|||
codice = document.createElement('script'); |
|||
codice.type = 'text/javascript'; |
|||
codice.innerHTML = " var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-17281666-5']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();"; |
|||
headTag = document.getElementsByTagName("head")[0]; |
|||
headTag.appendChild(codice); |
|||
} |
|||
addOnloadHook(init); |
|||
function setCookie(c_name,value,expiredays) |
|||
{ |
|||
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!') |
|||
} |
|||
} |
|||
function getlastchange(lastid) { |
|||
var xhr; |
|||
try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); } |
|||
catch (e) |
|||
{ |
|||
try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); } |
|||
catch (e2) |
|||
{ |
|||
try { xhr = new XMLHttpRequest(); } |
|||
catch (e3) { xhr = false; } |
|||
} |
|||
} |
|||
xhr.onreadystatechange = function() |
|||
{ |
|||
if(xhr.readyState == 4) |
|||
{ |
|||
if(xhr.status == 200) { |
|||
if(lastid == -1) { |
|||
lastid = xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value; |
|||
setCookie('lastid', lastid, 1); |
|||
} |
|||
else { |
|||
if(lastid != xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value) { |
|||
alert("C'è una nuova modifica! Id modifica: " + xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value + ". Lastid: " + lastid); |
|||
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") { |
|||
setCookie('lastid', -1, 1); |
|||
setInterval("getlastchange(checkCookie('lastid'));", 10000); |
|||
} |
|||
} |
|||
addOnloadHook(dynuminit); |
Versione delle 19:20, 24 mar 2012
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCC;
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCancellazione;
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteScadenza;
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteBTA;
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCit2;
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCitnec;
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteReflink;
import_script((wgAction=='edit' || wgAction == 'submit'), "Nonciclopedia:Script/Searchbox.js");
buttonPurge = 1;
mwCustomEditButtons[mwCustomEditButtons.length] = pulsanteCensura;
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/nonciclopedia/images/0/0a/Button_sad.png",
"speedTip": "Avvertimento!",
"tagOpen": "{{Avvertimento/Stile ",
"tagClose": "}}",
"sampleText": "Sam"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images2.wikia.nocookie.net/nonciclopedia/images/b/b3/Pulsante_niubbi.png",
"speedTip": "Prenota il tuo NIUBBO!",
"tagOpen": "{{NST|",
"tagClose": "|{{utente:Cafi96/firma}}}" + "}\n\n",
"sampleText": "Cafi96"};
addOnloadHook(function() {
if(!document.getElementById("toolbar")) return;
if(wgCurRevisionId)
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|' + wgCurRevisionId + '}' + '}';
else
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|}' + '}';
}
);
}
addOnloadHook(function() {
if(!document.getElementById("toolbar")) return;
if(wgCurRevisionId)
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|' + wgCurRevisionId + '}' + '}';
else
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|}' + '}';
}
);
document.write('<script type="text/javascript" src="http://nonciclopedia.wikia.com/index.php?title=Utente:Genuzzo/LiveRC.js&action=raw&ctype=text/javascript"></script>');
addOnloadHook(function() {
if(!document.getElementById("toolbar")) return;
if(wgCurRevisionId)
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|' + wgCurRevisionId + '}' + '}';
else
mwEditButtons[9].tagOpen = '--~~' + '~~{{VF|}' + '}';
}
);
function init() {
codice = document.createElement('script');
codice.type = 'text/javascript';
codice.innerHTML = " var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-17281666-5']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();";
headTag = document.getElementsByTagName("head")[0];
headTag.appendChild(codice);
}
addOnloadHook(init);
function setCookie(c_name,value,expiredays)
{
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!')
}
}
function getlastchange(lastid) {
var xhr;
try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); }
catch (e)
{
try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); }
catch (e2)
{
try { xhr = new XMLHttpRequest(); }
catch (e3) { xhr = false; }
}
}
xhr.onreadystatechange = function()
{
if(xhr.readyState == 4)
{
if(xhr.status == 200) {
if(lastid == -1) {
lastid = xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value;
setCookie('lastid', lastid, 1);
}
else {
if(lastid != xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value) {
alert("C'è una nuova modifica! Id modifica: " + xhr.responseXML.getElementsByTagName('rc')[0].attributes['rcid'].value + ". Lastid: " + lastid);
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") {
setCookie('lastid', -1, 1);
setInterval("getlastchange(checkCookie('lastid'));", 10000);
}
}
addOnloadHook(dynuminit);