Utente:Jalo/monobook.js/test: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 1:
/*
/* <source lang="javascript"><nowiki> */
==LiveWP==
*Documentation : [[:fr:User:EDUCA33E/LiveRC/Documentation]]
*Authors : [[:fr:User:EDUCA33E]], [[:fr:User:TiChou]] & [[:pl:User:Leafnode]]
*Version: 0.3.6 (beta)
 
Version modifiée basée sur la version du 1er avril 2007 a 00:49 :
/**
* Derivato dal monobook.js di [[:en:User:Wayward]], basato su [[:en:User:Alphax/monobook.js]]
* Necessita dell'[[Wikipedia:Monobook.js/monobook.css|apposito monobook.css]]
* Testato su Firefox e IE
* Contiene codice preso dagli script di [[Utente:Salvatore Ingala]], [[Utente:Paulatz]], [[Utente:Helios89]], [[Utente:Timendum]], [[Utente:Senpai]], [[Utente:Kiado]], [[Utente:Pietrodn]]
* Reso modulare ed elaborato da [[Utente:Jalo]]
* Forked from [[User:ABCD/monobook.js]] around April 2005
* Dual licensed under the GFDL and GPL
*/
 
http://fr.wikipedia.org/w/index.php?title=User:EDUCA33E/LiveRC.js&oldid=15525649
/** VARIABILI GLOBALI **/
 
=== Variables globales ===
 
<source lang="javascript"> */
var httpsext = '';
if(window.___location.protocol == 'https:') {
httpsext = '/wikipedia/it';
}
 
if (wgTitle == "Monobook.js/LiveRC") {
// Utilities del monobook<br/>
// Vedi [[Wikipedia:Monobook.js/Utils.js]]
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Utils.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
// Appel des parametres par défaut de LiveRC ;
//script per il conteggio dei wikilink doppi
// ///////////////////////////////////////////
if (document.title.indexOf("Modifica") != -1) //usato solo in modifica
importScript(wgPageName+'/LiveRCparam.js');
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/WikilinkDoppi.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
// Appel des parametres utilisateur ;
// ///////////////////////////////////////////
importScript('Utente:'+wgUserName+'/LiveRCparam.js');
 
//Questa variabile contiene il nome del browser utilizzato. Molto utile per evitare problemi
// di incompatibilita' tra la varie funzioni Javascript
// Si autovalorizza. Le sottovariabili da usare sono "BrowserDetect.browser", "BrowserDetect.version"
// e "BrowserDetect.OS"
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i<data.length;i++) {
var dataString = data[i].string;
var dataProp = data[i].prop;
this.versionSearchString = data[i].versionSearch || data[i].identity;
if (dataString) {
if (dataString.indexOf(data[i].subString) != -1)
return data[i].identity;
}
else if (dataProp)
return data[i].identity;
}
},
searchVersion: function (dataString) {
var index = dataString.indexOf(this.versionSearchString);
if (index == -1) return;
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
},
dataBrowser: [
{ string: navigator.userAgent,
subString: "OmniWeb",
versionSearch: "OmniWeb/",
identity: "OmniWeb"
},
{
string: navigator.vendor,
subString: "Apple",
identity: "Safari"
},
{
prop: window.opera,
identity: "Opera"
},
{
string: navigator.vendor,
subString: "iCab",
identity: "iCab"
},
{
string: navigator.vendor,
subString: "KDE",
identity: "Konqueror"
},
{
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"
},
{
string: navigator.vendor,
subString: "Camino",
identity: "Camino"
},
{ // for newer Netscapes (6+)
string: navigator.userAgent,
subString: "Netscape",
identity: "Netscape"
},
{
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer",
versionSearch: "MSIE"
},
{
string: navigator.userAgent,
subString: "Gecko",
identity: "Mozilla",
versionSearch: "rv"
},
{ // for older Netscapes (4-)
string: navigator.userAgent,
subString: "Mozilla",
identity: "Netscape",
versionSearch: "Mozilla"
}
],
dataOS : [
{
string: navigator.platform,
subString: "Win",
identity: "Windows"
},
{
string: navigator.platform,
subString: "Mac",
identity: "Mac"
},
{
string: navigator.platform,
subString: "Linux",
identity: "Linux"
}
]
 
importStylesheetURI('http://pl.wikipedia.org/skins-1.5/common/diff.css');
};
importScriptURI('http://pl.wikipedia.org/skins-1.5/common/diff.js');
BrowserDetect.init();
 
var lastrevid,lasttimestamp=1; // Timestamp d'initialisation;
/**** Inizializzazione ****/
 
// Découpage de l'URL et de ses parametres;
//Alias di document.getElementById
$ = function(id){
return document.getElementById(id);
};
 
var _GET = new Array();
var _uri = ___location.href;
var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&");
var _temp_get_arr_1 = new Array();
for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){
_temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("=");
_GET[decodeURIComponent(_temp_get_arr_1[0])] = decodeURIComponent(_temp_get_arr_1[1]);
}
delete _uri; delete _temp_get_arr; delete _temp_get_arr_1;
 
// Variables d'état (pour test sur rc.state);
//Ritorna true se la variabile toLoad contiene l'opzione str
mustLoad = (function(){
mustLoadCache = {};
var A = toLoad ? toLoad.split(' ') : [];
for(var i = 0; i < A.length; i++)
if (A[i])
mustLoadCache[A[i]] = true;
return function(str){
return mustLoadCache[str] === true;
};
})();
 
var IP = 1;
var BOT = 2 << 0;
var SYSOP = 2 << 1;
var NEW = 2 << 2;
var MINOR = 2 << 3;
var NEWNS = 2 << 4;
var RENAMED = 2 << 5;
var PATROLLED = 2 << 6;
var REVERT = 2 << 7;
var BLANKING = 2 << 8;
var REPLACED = 2 << 9;
var REDIRECT = 2 << 10;
var CATEGORIZED = 2 << 11;
var LOCK = 2 << 12;
var FULLLOCK = 2 << 13;
var HOMONYMIE = 2 << 14;
var ADQ = 2 << 15;
var COPYRIGHT = 2 << 16;
var PAS = 2 << 17;
var UPLOAD = 2 << 18;
var NEWUSER = 2 << 19;
var BLOCK = 2 << 20;
var DELETE = 2 << 21;
var MOVE = 2 << 22;
var PROTECT = 2 << 23;
var RIGHTS = 2 << 24;
var DELETE_REVISION = 2 << 25; //RevDelete
 
var lstSysop = new Array(); // Sysop list;
/** Codice di compatibilità con WikEd **/
var lstContact = new Array(); // Contact list;
//Copia dal frame di wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) alla wpTextbox1 textarea
var lstIPClass = new Array(); // IPClass list;
function WEUpdateTextarea(){
var lstRevoc = new Array(); // Reverted list;
if (typeof(wikEdUseWikEd) != 'undefined')
var lstHidden = new Array(); // Hidden users list;
if (wikEdUseWikEd == true)
WikEdUpdateTextarea();
}
 
// Is user Sysop;
var lrcAdmin = false; // default value;
if(wgUserGroups.indexOf("sysop") != -1)
lrcAdmin = true;
 
// Watchlist;
//Copia la wpTextbox1 textarea nel frame del wikEd
var lstSuivi = new Array();
function WEUpdateFrame(){
var lstSuiviHH = new Array();
if (typeof(wikEdUseWikEd) != 'undefined')
var lstSuivirevid = new Array();
if (wikEdUseWikEd == true)
var lstSuivioldid = new Array();
WikEdUpdateFrame();
var lstSuivircid = new Array();
}
 
/* </source>
/**** Carica le funzioni personalizzate ****/
 
===Utilities===
//Codice adattato da Prototype 1.6.0, http://www.prototypejs.org/
//Distribuito con licenza MIT-style
(function() {
/* Support for the DOMContentLoaded event is based on work by Dan Webb,
Matthias Miller, Dean Edwards and John Resig. */
 
<source lang="javascript"> */
var timer, fired = false;
var wpajax = {
http: function(bundle) {
// mandatory: bundle.url
// optional: bundle.async
// optional: bundle.method
// optional: bundle.headers
// optional: bundle.data
// optional: bundle.onSuccess (xmlhttprequest, bundle)
// optional: bundle.onFailure (xmlhttprequest, bundle)
// optional: bundle.otherStuff OK too, passed to onSuccess and onFailure
var xmlhttp;
try {
xmlhttp = new XMLHttpRequest();
} catch(e) {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
xmlhttp = false
}
}
}
 
if (xmlhttp) {
function fireContentLoadedEvent() {
xmlhttp.onreadystatechange = function() {
if (fired) return;
if (timer) windowxmlhttp.clearInterval(timerreadyState == 4);
wpajax.httpComplete(xmlhttp,bundle);
contentLoaded();
fired = true};
xmlhttp.open(bundle.method ? bundle.method : "GET",bundle.url,bundle.async == false ? false : true);
}
if (bundle.headers) {
 
for (var field in bundle.headers)
if (document.addEventListener) {
xmlhttp.setRequestHeader(field,bundle.headers[field]);
if (navigator.userAgent.indexOf('AppleWebKit/') > -1) {
}
timer = window.setInterval(function() {
xmlhttp.send(bundle.data ? bundle.data : null);
if (/loaded|complete/.test(document.readyState))
}
fireContentLoadedEvent();
return }, 0)xmlhttp;
},
 
window.addEventListener('load', fireContentLoadedEvent, false);
 
httpComplete: function(xmlhttp,bundle) {
if (xmlhttp.status == 200 || xmlhttp.status == 302) {
if (bundle.onSuccess)
bundle.onSuccess(xmlhttp,bundle);
} else if (bundle.onFailure) {
bundle.onFailure(xmlhttp,bundle);
} else {
// A activer en debug mode ?
document.addEventListener("DOMContentLoaded",
// fireContentLoadedEvent, falsealert(xmlhttp.statusText);
}
 
} else {
document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
$("__onDOMContentLoaded").onreadystatechange = function() {
if (this.readyState == "complete") {
this.onreadystatechange = null;
fireContentLoadedEvent();
}
};
}
})();
 
// Parser
function contentLoaded(){
if (document.implementation.createDocument) {
saveHistoryToCookie(); //memorizza le pagine visitate in un cookie
var gml_xmlparser = new DOMParser();
changeLinks();
}
addNavBarLinks();
addToolBoxLinks();
 
function gml_XMLParse(string) {
if(wgNamespaceNumber != -1){ //non nelle pagine speciali
if (document.implementation.createDocument) {
if (mustLoad("ns0")) addEditSection0();
return gml_xmlparser.parseFromString(string, "text/xml");
if (mustLoad("led")) lastEdit();
} else if (mustLoad("purg")window.ActiveXObject) addPurge();{
var gml_xmldoc = new ActiveXObject("Microsoft.XMLDOM");
if (mustLoad("tabs")) add_tabs();
gml_xmldoc.async = "false";
}
ret = gml_xmldoc.loadXML(string);
if (!ret)
return null;
return gml_xmldoc.documentElement;
}
return null;
}
 
// HTMLize
if (mustLoad("chat")) addChat();
String.prototype.htmlize = function() {
if (mustLoad("since")) addSince();
var chars = new Array('&','<','>','"');
if (mustLoad("allp")) setup_allpages_button();
var entities = new Array('amp','lt','gt','quot');
 
var regex = new RegExp();
ta['pt-logout'] = ['x', 'Logout (esci)']; //cambia l'accesskey per "logout"
var string akeytt()= this;
for (var i=0; i<chars.length; i++) {
regex = new RegExp(chars[i], "g");
string = string.replace(regex, '&' + entities[i] + ';');
}
return string;
}
 
/* </source>
 
=== LiveDiff ===
 
<source lang="javascript"> */
//Modifica la sezione 0 della pagina
 
function addEditSection0(){
function liveDiff(page, id, oldid, rcid) {
if(!$('ca-history'))
var el = document.getElementById( 'livePreviewTitle' );
return;
el.innerHTML="<b style='text-decoration: blink;'>Diff : <span style='color:red'>"+page+"</span>...</b>";
var newLink = wgServer + wgScript + '?title=' + wgPageName + '&action=edit&section=0';
wpajax.http({ url: wgServer + wgScriptPath + '/index.php?title='+encodeURIComponent(page)+'&diffonly=1&diff='+id+'&oldid='+oldid,
addPortletLink('p-cactions', newLink, '0', 'ca-edit-0', 'Modifica la sezione 0');
onSuccess: getDiff, mpage: page, mid: id, moldid:oldid, mrcid:rcid});
}
 
function getDiff(xmlreq, data) {
/** AutoComplete: Based on http://www.webreference.com/programming/javascript/gr/column5/ **/
//var doc = gml_XMLParse(xmlreq.responseText);
function AutoComplete(db, oText, /* optional */ nMaxSize){
//workaround per bug nella pagina del diff (solo per i sysop). TODO: rimuovere appena possibile.
this.oText = oText;
var doc = gml_XMLParse(xmlreq.responseText.replace(/&nbsp</g, "&nbsp;<"));
this.nMaxSize = nMaxSize || 20;
 
var page=data.mpage;
var oDiv = document.createElement('div');
var oldid=data.moldid;
oDiv.style.border = '2px solid green';
var id=data.mid;
oDiv.style.position = 'absolute';
var rcid=data.mrcid;
oDiv.style.visibility = 'hidden';
var bC = doc.getElementById('bodyContent');
oDiv.style.backgroundColor = 'white';
if (bC == null) bC = doc.getElementById('article')
this.oDiv = oDiv;
var LP = document.getElementById( 'livePreview' );
oText.parentNode.insertBefore(oDiv, oText.nextSibling);
var dLP = document.getElementById( 'divLivePreview' );
var lD = getElementsByClass('diff',bC,null);
 
var upage=page.replace(new RegExp(/\'/g), "\\'");
this.db = db.sort();
oText.AutoComplete = this;
oText.onkeyup = AutoComplete.prototype.onTextChange;
oText.onblur = AutoComplete.prototype.onTextBlur;
};
 
if (lD[0] == null)
AutoComplete.prototype.onTextBlur = function(){ this.AutoComplete.onblur(); };
LP.innerHTML = bC.innerHTML;
AutoComplete.prototype.onblur = function(){ this.oDiv.style.visibility = "hidden"; };
else {
AutoComplete.prototype.onTextChange = function(){ this.AutoComplete.onchange(); };
if (document.getElementById('showDiffR').checked) {
AutoComplete.prototype.onDivMouseDown = function(){ this.AutoComplete.oText.value = this.innerHTML; };
var avantEl = getElementsByClass('diff-deletedline',bC,null);
AutoComplete.prototype.onDivMouseOver = function(){ this.style.backgroundColor = 'lime'; };
var apresEl = getElementsByClass('diff-addedline',bC,null);
AutoComplete.prototype.onDivMouseOut = function(){ this.style.backgroundColor = 'white'; };
var avant = "";
AutoComplete.prototype.onchange = function(){
var txtapres = this.oText.value"";
var lav = avantEl.length;
var aStrlap = []apresEl.length;
for(var i n= 0; in < this.db.lengthlav ; in++)
avant = avant + avantEl[n].innerHTML + "<br />";
if(this.db[i].toLowerCase().indexOf(txt.toLowerCase()) == 0)
for(var n=0; n < lap ; aStr.push(this.db[i]n++);
apres = apres + apresEl[n].innerHTML + "<br />";
LP.innerHTML = "<table width='100%'><tr><td width='50%' class='diff-deletedline'>"+avant+"</td><td class='diff-addedline'>"+apres+"</td></tr></table>";
var nCount = aStr.length;
if ((this.nMaxSize == -1) || ((nCount < this.nMaxSize) && (nCount > 0))){
while (this.oDiv.hasChildNodes())
this.oDiv.removeChild(this.oDiv.firstChild);
var i, n = aStr.length;
for (i = 0; i < n; i++){
var d = document.createElement('div');
this.oDiv.appendChild(d);
d.appendChild(document.createTextNode(aStr[i]));
d.onmousedown = AutoComplete.prototype.onDivMouseDown;
d.onmouseover = AutoComplete.prototype.onDivMouseOver;
d.onmouseout = AutoComplete.prototype.onDivMouseOut;
d.AutoComplete = this;
}
this.oDiv.style.left = this.oText.offsetLeft+'px'; //NON-STANDARD! offsetLeft
this.oDiv.style.top = (this.oText.offsetTop+this.oText.clientHeight)+'px'; //NON-STANDARD! offsetTop e clientHeight
this.oDiv.style.visibility = "visible";
}
else {
LP.innerHTML = "<table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>"+lD[0].innerHTML+"</table>";
this.oDiv.innerHTML = "";
this.oDiv.style.visibility = "hidden";
}
};
if (dLP.style.display == "none") {
var elcb = document.getElementById( 'shidPrev' );
elcb.checked="true";
dLP.style.display = "inline";
}
 
var entete = document.getElementById( 'livePreviewTitle' );
/** AutoComplete END **/
entete.innerHTML='<b><a href="'+wgServer + '/wiki/' + escape(page) + '" target="_new">' + page + '</a></b> • ' +
'(<a href="javascript:;" onClick="liveHist(\''+upage+'\');" style="color:darkorange">Cron</a>)';
 
var asNextDiff = doc.getElementById("differences-nextlink");
// Recupera il valore di un cookie
if(asNextDiff == null) {
function GetCookie(name)
var optAvert = "";
{
var cookieoptl = ' ' + documentlstAvert.cookielength;
var search for (j=0; ' 'j<optl; j+ name +) '=';{
optAvert += '<option value="'+lstAvert[j].template;
var setStr = '';
if (lstAvert[j].template == "Loggati")
var offset = 0;
var end = 0; {
if(lstAvert[j].hasPage) optAvert += '|'+upage.substr(7);
offset = cookie.indexOf(search);
if (offset != -1) }
else
{
offset += search.length;{
if(lstAvert[j].hasPage) optAvert += '|'+upage;
end = cookie.indexOf(';', offset)
if (end == -1)}
 
end = cookie.length;
optAvert += '">'+lstAvert[j].string+'</option>';
setStr = cookie.substring(offset, end);
}
setStr = setStr.replace(/\\+/g, ' ');
 
setStr = decodeURIComponent(setStr);
// Get username of submitter
var user1 = doc.getElementById( 'mw-diff-otitle2' );
if (user1 != null) {
var usertmp=user1.innerHTML;
var daDove = usertmp.indexOf('tente:')+6;
var daDove2 = usertmp.indexOf('/wiki/Speciale:Contributi/')+26;
if ((daDove2 != -1) && (daDove2 < daDove)) // e' un anonimo
daDove3 = daDove2;
else
daDove3 = daDove;
var finoA = usertmp.indexOf('" title="');
var finoA2 = usertmp.indexOf('&amp;action=edit');
if ((finoA2 != -1) && (finoA2 < finoA)) // non esiste la pagina utente
finoA3 = finoA2;
else
finoA3 = finoA;
user1 = usertmp.substr(daDove3, finoA3-daDove3);
}
var user2 = doc.getElementById( 'mw-diff-ntitle2' );
if (user2 != null) {
var usertmp=user2.innerHTML;
var daDove = usertmp.indexOf('tente:')+6;
var daDove2 = usertmp.indexOf('/wiki/Speciale:Contributi/')+26;
if ((daDove2 != -1) && (daDove2 < daDove)) // e' un anonimo
daDove3 = daDove2;
else
daDove3 = daDove;
var finoA = usertmp.indexOf('" title="');
var finoA2 = usertmp.indexOf('&amp;action=edit');
if ((finoA2 != -1) && (finoA2 < finoA)) // non esiste la pagina utente
finoA3 = finoA2;
else
finoA3 = finoA;
user2 = usertmp.substr(daDove3, finoA3-daDove3);
}
user1=user1.replace(new RegExp(/\'/g), "\\'");
user2=user2.replace(new RegExp(/\'/g), "\\'");
 
entete.innerHTML = '<table width="100%" class="creator"><tr><td>' + entete.innerHTML +
'</td><td align="right"><small>' +
// Verifier avant si le patrouilleur peut modifier cette page ? (query.php?what=permissions&titles=page)
'[<a id="LiveRevertLink" href="javascript:getLiveMessage(\'liverevert\',\''+user1+'\',\''+user2+'\',\''+upage+'\',\''+oldid+'\');" >' + lang_menu[0].UNDORC+'</a>] • ' +
lang_menu[0].REASON+' : <input id="LiveRevertMessage" /> ••• ' +
'[<a id="LiveAvertoLink" href="javascript:getLiveAverto(\''+user2+'\');">'+lang_menu[0].AVERTS+'</a>] : ' +
'<select id="averto">' + optAvert + '</select>' +
'</td></tr><tr><td /></tr></table>';
document.getElementById('LiveRevertMessage').focus();
}
return(setStr);
}
 
function getLiveDelete(page,type) {
// Setta il valore di un cookie
page = encodeURIComponent(page);
function SetCookie(name, value, expires, path, ___domain, secure)
var link = document.getElementById('LiveCancImmLink');
{
link.href = "javascript:;";
var cookie = name + '=' + encodeURIComponent(value);
link.style.color = "silver";
if (expires != null)
link.style.cursor = "default";
cookie += '; expires=' + expires
link.style.textDecoration = "none";
if (path != null)
document.getElementById('LiveRevertMessage').disabled = true;
cookie += '; path=' + path;
var message = document.getElementById('LiveRevertMessage').value;
if (___domain != null)
cookie += '; ___domain=' + ___domain;
var testo = getpagecontent(page);
if (secure != null)
cookie += '; secure';
if (type == "copyviol")
document.cookie = cookie;
testo = '{{Cancelcopy|' + message + '}}\n\n' + testo;
else
testo = '{{Cancella subito|' + document.getElementById('cancimmAvert').value + '}}\n\n' + testo;
 
setpagecontent(page,testo,"LiveRC : Cancella subito");
}
 
function getLiveAverto(user) {
/** WikiHistory **/
var link = document.getElementById('LiveAvertoLink');
function getHistoryFromCookie(){
link.href = "javascript:;";
var c = GetCookie("wikiHistory");
link.style.color = "silver";
var hist = c ? c.split('#') : [];
link.style.cursor = "default";
for(var i = 0; i < hist.length; i++)
link.style.textDecoration = "none";
hist[i] = decodeURIComponent(hist[i]);
document.getElementById('averto').disabled = true;
return hist;
var message = document.getElementById('averto').value;
var fixMessage=message.replace(new RegExp(/\\'/g), "'");
var page = 'Discussioni utente:' + encodeURIComponent(user);
 
var testo = getpagecontent(page);
 
if (message == "Grazie")
testo += '\n==Grazie==\n{{' + fixMessage + '}}~~~~\n';
else
testo += '\n==Avviso==\n{{' + fixMessage + '}}~~~~\n';
if (message.indexOf('|') != -1)
template = message.substr(0,message.indexOf('|'));
else
template = message;
 
var optl = lstAvert.length;
var object = "LiveRC: Avviso";
for (j=0; j<optl; j++)
if(lstAvert[j].template == template)
object = "LiveRC: "+lstAvert[j].string;
setpagecontent(page,testo,object);
}
 
function getLiveMessage(where, user1, user2, page, oldid) {
function saveHistoryToCookie(){
var links = [ document.getElementById('LiveRevertLink') ];
if(wgNamespaceNumber < 0) return;
var i,len=links.length;
var c = GetCookie("wikiHistory"), i;
for (i=0; i<len; i++) {
var h = c ? c.split('#') : [];
links[i].href = "javascript:;";
var current = encodeURIComponent(wgPageName.replace(/_/g, ' ')), found = -1;
links[i].style.color = "silver";
for(i = 0; i < h.length; i++)
if(hlinks[i].style.cursor == current){"default";
links[i].style.textDecoration = "none";
found = i; break;
}
document.getElementById('LiveRevertMessage').disabled = true;
if(found == -1)
var message = document.getElementById('LiveRevertMessage').value;
h.push(current);
wpajax.http({ url: wgServer + wgScriptPath + '/index.php?title=' + encodeURI(page) + '&action=edit&oldid=' + oldid,
else
onSuccess: postLiveRevert,
h[found] = null;
where: where, page: page, user1: user1, user2: user2, message: message });
var newh = [];
for(i = Math.max(0, h.length - 100); i < h.length; i++)
if(h[i] != null)
newh.push(h[i]);
var expire = new Date(); // scadenza del cookie
expire.setTime(expire.getTime() + (60 * 60 * 1000)); //scadenza di un'ora
SetCookie('wikiHistory', newh.join('#'), expire.toGMTString(), '/');
}
 
function postLiveRevert(xmlreq, data) {
/** WikiHistory END **/
var parser = new DOMParser();
var doc = parser.parseFromString(xmlreq.responseText, 'application/xhtml+xml');
 
var where = data.where;
var page = data.page;
var user1 = data.user1;
var user2 = data.user2;
var message = data.message;
 
var wpTextbox1 = encodeURIComponent(doc.getElementById('wpTextbox1').value);
 
var inputs = doc.getElementById('editform').getElementsByTagName('input');
/**** Personalizza i link della barra personale ****/
var editform = new Array();
function changeLinks()
for (i=0; i<inputs.length; i++) {
{
editform[inputs[i].name] = inputs[i].value;
if (mustLoad("lks"))
{}
var wpStarttime = encodeURIComponent(editform['wpStarttime']);
// Modifica i link
var wpEdittime = encodeURIComponent(editform['wpEdittime']);
$('pt-mytalk').firstChild.innerHTML = 'discussioni';
var wpEditToken = encodeURIComponent(editform['wpEditToken']);
$('pt-preferences').firstChild.innerHTML = 'preferenze';
var suivipos = lstSuivi.indexOf(page);
$('pt-watchlist').firstChild.innerHTML = 'osservati speciali';
if (suivipos == -1)
$('pt-mycontris').firstChild.innerHTML = 'contributi';
var wpWatchthis = "";
}
else
if (mustLoad("orol"))
var wpWatchthis = "&wpWatchthis=1";
{
// Aggiunge l'orologio
addPortletLink('p-personal', wgServer + wgScriptPath + '/index.php?title=' + wgPageName + '&action=purge', '', 'utcdate');
showtime();
}
}
 
switch(where) {
/**** Aggiunge il tab "purge" ****/
case 'liverevert':
function addPurge(){
var wpSummary = lang_menu[0].RVMES1 + ' [[Speciale:Contributi/' + user2 + '|' + user2
if(!$('ca-history'))
+ ']]; '+lang_menu[0].RVMES2+' [[Utente:' + user1 + '|' + user1 + ']]';
return;
break;
var newLink = wgServer + wgScript + '?title=' + wgPageName + '&action=purge';
/* case 'livevandalism':
addPortletLink('p-cactions', newLink, 'purge', 'ca-purge', 'Pulisci la cache', 'g');
var wpSummary = 'LiveRC : Révocation de vandalisme par [[Special:Contributions/' + user2 + '|' + user2
}
+ ']]; retour a la version de [[User:' + user1 + '|' + user1 + ']]';
break; */
}
if (message)
wpSummary = wpSummary + ' ; ' + message;
wpSummary = encodeURIComponent(wpSummary);
 
var headers = new Array();
/**** Aggiunge il tab "ultima modifica" ****/
headers['Content-Type'] = 'application/x-www-form-urlencoded';
function lastEdit(){
wpajax.http({ url: wgServer + wgScriptPath + '/index.php?title=' + encodeURIComponent(page) + '&action=submit',
if(!$('ca-history'))
method: "POST", headers: headers,
return;
data: 'wpSave=1&wpTextbox1=' + wpTextbox1 + '&wpStarttime=' + wpStarttime + '&wpEdittime=' + wpEdittime
var newLink = wgServer + wgScript + '?title=' + wgPageName + '&diff=0';
+ '&wpEditToken=' + wpEditToken + '&wpSummary=' + wpSummary + wpWatchthis});
addPortletLink('p-cactions', newLink, 'ultima modifica', 'ca-ledit', 'Ultima modifica', 'u');
}
 
/* </source>
/**** Menu "strumenti vari" ****/
//Sostituzioni automatiche
function fixformat(){
WEUpdateTextarea();
 
=== LiveHist ===
var txt = $('wpTextbox1');
txt.value = txt.value
.replace(/\’/g, "'")
.replace(/ '([\w\ ]+)' /g, ' "$1" ')
.replace(/“/g,'"')
.replace(/”/g,'"')
.replace(/–/g, '-')
.replace(/,,/g, ',')
.replace(/ m2 /g, ' m² ')
.replace(/a' /g, "à ")
.replace(/([^p])o' /g, "$1ò ")
.replace(/u' /g, "ù ")
.replace(/i' /g, "ì ")
.replace(/ anzich(è|e')/g, " anziché")
.replace(/ affinch(è|e')/g, " affinché")
.replace(/ bench(è|e')/g, " benché")
.replace(/ cioé/g, " cioè")
.replace(/ Dè /g, " De' ")
.replace(/ dè /g, " de' ")
.replace(/ dò/g, " do")
.replace(/E' /g, "È ")
.replace(/É /g, "È ")
.replace(/ e' /g, " è ")
.replace(/ é/g, " è")
.replace(/ fà /g, " fa ")
.replace(/ fè /g, " fe' ")
.replace(/ Frà /g, " Fra' ")
.replace(/ fù /g, " fu ")
.replace(/ mò /g, " mo' ")
.replace(/ nè /g, " né ")
.replace(/ ne' /g, " né ")
.replace(/ nonch(è|e')/g, " nonché")
.replace(/ pè /g, " pe' ")
.replace(/ perch(è|e')/g, " perché")
.replace(/ per(ó|o') /g,' però ')
.replace(/ piu' /g, " più ")
.replace(/ pò/g, " po'")
.replace(/ poich(è|e') /g, " poiché ")
.replace(/ propio/g, " proprio")
.replace(/ (puo|puo') /gi,' può ')
.replace(/ quì /gi, " qui ")
.replace(/ quà /gi, " qua ")
.replace(/ qual'è/gi, " qual è")
.replace(/ sà /gi, " sa ")
.replace(/ sè /gi, " sé ")
.replace(/si' /g, "sì")
.replace(/ sò /g, " so ")
.replace(/ sù /g, " su ")
.replace(/ tr(è|e'|é) /g, " tre ")
.replace(/ sucessivo /gi, " successivo ")
.replace(/&lt;/g,'<')
.replace(/&gt;/g,'>')
.replace(/&amp;/g,'&')
.replace(/&quot;/g,'"')
.replace(/&agrave;/g,'à')
.replace(/&egrave;/g,'è')
.replace(/&eacute;/g,'é')
.replace(/&igrave;/g,'ì')
.replace(/&iexcl;/g,'¡')
.replace(/&cent;/g,'¢')
.replace(/&pound;/g,'£')
.replace(/&yen;/g,'¥')
.replace(/&acute;/g,"'")
.replace(/&plusmn;/g,'±')
.replace(/&times;/g,'×')
.replace(/&divide;/g,'÷')
.replace(/&micro;/g,'µ')
.replace(/&deg;/g,'°')
.replace(/&frac14;/g,'¼')
.replace(/&frac12;/g,'½')
.replace(/&frac34;/g,'¾')
.replace(/&sup1;/g,'¹')
.replace(/&sup2;/g,'²')
.replace(/&sup3;/g,'³')
.replace(/&sect;/g,'§')
.replace(/<\/?(b|strong)>/gi, "'''")
.replace(/<\/?(i|em|var)>/gi, "''")
.replace(/<br>\n\n/g,'\n\n')
.replace(/<br>/gi,'<br />')
.replace(/\n<hr[ \/]*>\n/gi, '\n----\n')
.replace(/ +<hr[ \/]*> +/gi, '\n----\n')
.replace(/<hr ([^>\/]+?)>/gi,'<hr $1 />')
.replace(/\n *<h1> *([^<]+?) *<\/h1> *\n/gi, "\n= $1 =\n")
.replace(/\n *<h2> *([^<]+?) *<\/h2> *\n/gi, "\n== $1 ==\n")
.replace(/\n *<h3> *([^<]+?) *<\/h3> *\n/gi, "\n=== $1 ===\n")
.replace(/\n *<h4> *([^<]+?) *<\/h4> *\n/gi, "\n==== $1 ====\n")
.replace(/\n *<h5> *([^<]+?) *<\/h5> *\n/gi, "\n===== $1 =====\n")
.replace(/\n *<h6> *([^<]+?) *<\/h6> *\n/gi, "\n====== $1 =======\n")
;
$('wpSummary').value += "+formattazione ";
 
<source lang="javascript"> */
WEUpdateFrame();
}
 
function liveHist(page) {
//Cerca e sostituisci
// uso delle " (soluzione di merda, ma se funziona...)
function replace(){
var page = page.replace(new RegExp(/\%22/g), '"');
WEUpdateTextarea();
 
var el = document.getElementById( 'livePreviewTitle' );
var s = prompt("Search regexp?");
el.innerHTML="<b style='text-decoration: blink;'>Cron : <span style='color:red'>"+page+"</span>...</b>";
if(s){
wpajax.http({url:wgServer + wgScriptPath + '/index.php?title=' + encodeURIComponent(page) + '&action=history', onSuccess: getHist, message: page });
var r = prompt("Replace regexp?");
}
if(!r && r != '') return;
var txt = $('wpTextbox1');
txt.value = txt.value.replace(new RegExp(s, "g"), r);
}
 
function getHist(xmlreq, data) {
WEUpdateFrame();
doc = gml_XMLParse(xmlreq.responseText);
bC = doc.getElementById('bodyContent')
if (bC == null) bC = doc.getElementById('article')
var c=data.message;
var LP = document.getElementById( 'livePreview' );
var dLP = document.getElementById( 'divLivePreview' );
LP.innerHTML = bC.innerHTML;
if (dLP.style.display == "none") {
var elcb = document.getElementById( 'shidPrev' );
elcb.checked="true";
dLP.style.display = "inline";
}
var elt = document.getElementById( 'livePreviewTitle' );
elt.innerHTML='<b><a href="'+wgServer+'/wiki/'+encodeURIComponent(c)+'" target="_new">'+c+'</a></b>';
}
 
/* </source>
/**** Funzioni per le pagine di discussione ****/
 
// Aggiunge il messaggio "msg" alla pagina editata, scrive "summ" nell'oggetto,
=== LiveArticle ===
// segna o meno "segui questa pagina" a seconda dell'impostazione precedente
 
// e spunta "modifica minore"
<source lang="javascript"> */
function edit_summary_watch(msg, summ, watch, minor)
{
WEUpdateTextarea();
 
function liveArticle(page,user) {
var f = document.editform, t = f.wpTextbox1;
// uso delle " (soluzione di merda, ma se funziona...)
if (t.value.length > 0)
var page = page.replace(new RegExp(/\%22/g), '"');
t.value += '\n';
t.value += msg;
f.wpSummary.value = summ;
f.wpWatchthis.checked = watch;
f.wpMinoredit.checked = minor;
 
var el = document.getElementById( 'livePreviewTitle' );
WEUpdateFrame();
el.innerHTML="<b style='text-decoration: blink;'><span style='color:red'>"+page+"</span>...</b>";
wpajax.http({url:wgServer + wgScriptPath + '/index.php?title=' + encodeURIComponent(page) + '&redirect=no', onSuccess: getArticle, message: page, user: user });
}
 
function getArticle(xmlreq, data) {
// Come il precedente, ma aggiunge "msg" all'inizio della pagina
doc = gml_XMLParse(xmlreq.responseText);
function edit_summary_watch2(msg, summ, watch, minor)
bC = doc.getElementById('bodyContent')
{
if (bC == null) bC = doc.getElementById('article')
WEUpdateTextarea();
var c=data.message;
var user=data.user;
var LP = document.getElementById( 'livePreview' );
var dLP = document.getElementById( 'divLivePreview' );
LP.innerHTML = bC.innerHTML;
if (dLP.style.display == "none") {
var elcb = document.getElementById( 'shidPrev' );
elcb.checked="true";
dLP.style.display = "inline";
}
 
var upage=c.replace(new RegExp(/\'/g), "\\'");
var f = document.editform, t = f.wpTextbox1;
var optAvert = "";
t.value = msg + '\n' + t.value;
var optl = lstAvert.length;
f.wpSummary.value = summ;
for (j=0; j<optl; j++) {
f.wpWatchthis.checked = watch;
optAvert += '<option value="'+lstAvert[j].template;
f.wpMinoredit.checked = minor;
if(lstAvert[j].hasPage) optAvert += '|'+upage;
optAvert += '">'+lstAvert[j].string+'</option>';
}
 
var elt = document.getElementById( 'livePreviewTitle' );
elt.innerHTML='<b><a href="'+wgServer+'/wiki/'+encodeURI(c)+'" target="_new">'+c+'</a></b>';
var cancimmAvert = "";
cancimmAvert += '<option value="1">1. pagine vuote, di prova</option>';
cancimmAvert += '<option value="2">2. solo frasi offensive</option>';
cancimmAvert += '<option value="3">3. solo lingua straniera</option>';
cancimmAvert += '<option value="4">4. promozionali o CV</option>';
cancimmAvert += '<option value="5">5. pagine doppie</option>';
cancimmAvert += '<option value="6">6. categorie vuote</option>';
cancimmAvert += '<option value="7">7. pagine già cancellate</option>';
cancimmAvert += '<option value="8">8. pagine create per l\'inversione</option>';
cancimmAvert += '<option value="9">9. redirect errati</option>';
cancimmAvert += '<option value="10">10. talk e sottopag. di pagine già canc.</option>';
cancimmAvert += '<option value="11">11. immagini doppie ed orfane</option>';
cancimmAvert += '<option value="12">12. immagini in evidente copyviol</option>';
cancimmAvert += '<option value="13">13. pagine copiate senza licenza libera</option>';
cancimmAvert += '<option value="14">14. immagini da verificare da tanto</option>';
cancimmAvert += '<option value="15">15. pagine \"Utente:\" di nessuno</option>';
cancimmAvert += '<option value="16">16. pagine già trasferite</option>';
cancimmAvert += '<option value="17">17. sottopag. "Utente:" richieste da lui</option>';
 
elt.innerHTML = '<table width="100%" class="creator"><tr><td>' + elt.innerHTML +
WEUpdateFrame();
'</td><td align="right"><small>'+
// Verifier avant si le patrouilleur peut modifier cette page ? (query.php?what=permissions&titles=page)
// canc imm
'[<a id="LiveCancImmLink" href="javascript:getLiveDelete(\''+encodeURIComponent(c)+'\');" >' + lang_menu[0].CANCIMM+'</a>] '+
'<select id="cancimmAvert">' + cancimmAvert + '</select> • ' +
lang_menu[0].REASON2+' : <input id="LiveRevertMessage" /> • ' +
// canc x copyviol
'[<a id="LiveCancImmLink" href="javascript:getLiveDelete(\''+encodeURIComponent(c)+'\',\'copyviol\');" >' + lang_menu[0].CANCCV+'</a>] ••• ' +
'[<a id="LiveAvertoLink" href="javascript:getLiveAverto(\''+user+'\');">'+lang_menu[0].AVERTS+'</a>] : ' +
'<select id="averto">' + optAvert + '</select>' +
'</td></tr></table>';
document.getElementById('LiveRevertMessage').focus();
}
 
/* </source>
 
=== LiveLog ===
/**** Aggiunge i tab e i menu ****/
// aggiunge vari tabs e menu-tabs
function add_tabs()
{
var tabs = $('p-cactions').getElementsByTagName('ul')[0];
 
<source lang="javascript"> */
//Solo per le pagine di discussioni degli utenti
 
if((document.title.indexOf("Modifica") != -1) && (document.title.indexOf("Discussioni utente") != -1))
function liveLog(action,page) {
{
var titolo = '';
addlimenu(tabs, 'Messaggi talk', 'talkm');
switch(action) {
var talkm = $('talkm').getElementsByTagName('ul')[0];
case 'upload':
addlilink(talkm,'javascript:edit_summary_watch("{{subst:benve|~~~~}}", "Benvenuto", false, true)','welcome', 'pb-welcome');
ta['pb-welcome'] = newtitolo Array('b',= 'DaLog ildei benvenutocaricamenti');
break;
addlilink(talkm,'javascript:edit_summary_watch("{{test}} ~~~~", "test", false, true)','Test', '');
case 'newuser':
addlilink(talkm,'javascript:edit_summary_watch("{{vandalismo}} ~~~~", "Avviso vandalismo", false, true)','Vandal', '');
titolo = 'Log dei nuovi utenti';
addlilink(talkm,'javascript:edit_summary_watch("{{spam}}", "spam", false, true)','Spam', '');
break;
addlilink(talkm,'javascript:edit_summary_watch("{{Avvisocopyviol|articolo=|url=}} ~~~~","avviso possibile violazione di copyright",false,true)','avviso cv','');
case 'block':
addlilink(talkm,'javascript:edit_summary_watch("{{cancellazione|Titolo_pagina}} ~~~~","avviso proposta di cancellazione",false,true)','avviso canc','');
titolo = 'Log dei blocchi utente';
break;
case 'delete':
titolo = 'Log delle cancellazioni';
break;
case 'move':
titolo = 'Log degli spostamenti';
break;
case 'protect':
titolo = 'Log delle protezioni';
break;
case 'rights':
titolo = 'Log dei cambi di permessi';
break;
case '':
titolo = 'Log';
break;
default:
break;
}
 
else if (document.title.indexOf("Modifica") != -1) // Solo durante le modifiche
var el = document.getElementById( 'livePreviewTitle' );
{
el.innerHTML="<b style='text-decoration: blink;'><span style='color:red'>"+titolo+"</span>...</b>";
addlimenu(tabs, 'strumenti vari', 'tools');
wpajax.http({url:wgServer + wgScriptPath + '/index.php?title=Speciale:Registri&type=' + action + "&user=&page=" + encodeURIComponent(page), onSuccess: getLog, message: page });
var tools = $('tools').getElementsByTagName('ul')[0];
}
addlilink(tools,'javascript:fixformat()','format', '');
 
addlilink(tools,'javascript:replace()','replace', '');
function getLog(xmlreq, data) {
addlilink(tools,'javascript:edit_summary_watch2("{{cancella subito|motivo=}}", "cancimm", false, true)','cancimm', '');
doc = gml_XMLParse(xmlreq.responseText);
addlilink(tools,'javascript:edit_summary_watch2("{{cancelcopy|firma=~~~|fonte=}}", "cancelcopy", false, true)','cancelcopy', '');
bC = doc.getElementById('bodyContent')
addlilink(tools,'javascript:edit_summary_watch2("{{cancellazione}}", "cancellare", false, true)','da cancellare', '');
if (bC == null) bC = doc.getElementById('article')
addlilink(tools,'javascript:WikilinkDoppi()', 'Wikilink doppi', '');
var c=data.message;
var LP = document.getElementById( 'livePreview' );
var dLP = document.getElementById( 'divLivePreview' );
LP.innerHTML = bC.innerHTML;
if (dLP.style.display == "none") {
var elcb = document.getElementById( 'shidPrev' );
elcb.checked="true";
dLP.style.display = "inline";
}
var elt = document.getElementById( 'livePreviewTitle' );
elt.innerHTML='<b><a href="'+wgServer+'/wiki/'+encodeURI(c)+'" target="_new">'+c+'</a></b>';
}
 
/* </source>
/**** Aggiunge i link nel portlet "navigazione" ****/
function addNavBarLinks()
{
var navbar = 'p-navigation';
if (mustLoad("nav") || mustLoad("aut"))
addPortletLink(navbar, httpsext + '/wiki/Wikipedia:Autorizzazioni_ottenute', 'Autorizzazioni ottenute', '');
if (mustLoad("nav") || mustLoad("csu"))
addPortletLink(navbar, httpsext + '/wiki/Categoria:Da_cancellare_subito', 'Cancella subito', '');
if (mustLoad("nav") || mustLoad("blk"))
addPortletLink(navbar, httpsext + '/wiki/Speciale:Ipblocklist', 'Block Log', '');
if (mustLoad("nav") || mustLoad("log"))
addPortletLink(navbar, httpsext + '/wiki/Speciale:Log', 'Log', '');
if (mustLoad("nav") || mustLoad("mcss"))
addPortletLink(navbar, httpsext + '/w/index.php?title=Utente:' + wgUserName + '/monobook.css&action=edit', 'monobook.css', '');
if (mustLoad("nav") || mustLoad("mjs"))
addPortletLink(navbar, httpsext + '/w/index.php?title=Utente:' + wgUserName + '/monobook.js&action=edit', 'monobook.js', '');
if (mustLoad("nav") || mustLoad("pca"))
addPortletLink(navbar, httpsext + '/wiki/Wikipedia:Pagine_da_cancellare', 'Pagine da cancellare', '');
if (mustLoad("nav") || mustLoad("newp"))
addPortletLink(navbar, httpsext + '/wiki/Speciale:Newpages', 'Pagine nuove', '');
if (mustLoad("nav") || mustLoad("rich"))
addPortletLink(navbar, httpsext + '/wiki/Wikipedia:Richieste_agli_amministratori', 'Richieste agli amministratori', '');
if (mustLoad("nav") || mustLoad("sand"))
addPortletLink(navbar, httpsext + '/wiki/Utente:' + wgUserName + '/Sandbox', 'Sandbox', '');
if (mustLoad("nav") || mustLoad("admin"))
addPortletLink(navbar, httpsext + '/wiki/Utente:' + wgUserName + '/strumenti admin', 'Strumenti Admin', '');
if (mustLoad("nav") || mustLoad("stub"))
addPortletLink(navbar, httpsext + '/wiki/Categoria:Stub', 'Stub', '');
if (mustLoad("nav") || mustLoad("prob"))
addPortletLink(navbar, httpsext + '/wiki/Wikipedia:Utenti problematici', 'Utenti problematici', '');
if (mustLoad("nav") || mustLoad("vand"))
addPortletLink(navbar, httpsext + '/wiki/Wikipedia:Vandalismi_in_corso', 'Vandalismi in corso', '');
if (mustLoad("nav") || mustLoad("bot")) {
if (typeof(nomeBot) != "undefined")
{
addPortletLink(navbar, '/wiki/Speciale:Contributi/' + nomeBot, 'Contributi ' + nomeBot, '');
}
}
 
=== LiveContrib ===
// Se sono stati stati installati alcuni collegamenti personali
if (typeof(myLinks) != 'undefined')
for (var i = 0; i < myLinks.length; i++)
{
nome = myLinks[i][0];
link = myLinks[i][1];
 
<source lang="javascript"> */
// Sostituisco %TITOLO% con il titolo della voce
var link = link.replace(/%TITOLO%/, wgPageName);
 
function liveContrib(user) {
// Sostituisco %TITOLO2% con il titolo della voce senza namespace
var el = document.getElementById( 'livePreviewTitle' );
var link = link.replace(/%TITOLO2%/, wgTitle);
el.innerHTML="<b style='text-decoration: blink;'><span style='color:red'>"+user+"</span>...</b>";
 
wpajax.http({url:wgServer + '/wiki/Speciale:Contributi/'+encodeURIComponent(user),
//Aggiungo il link
addPortletLink(navbar, link, nome onSuccess: getContrib, ''message: user });
}
}
 
function getContrib(xmlreq, data) {
/**** Aggiunge i link nel portlet "strumenti" ****/
doc = gml_XMLParse(xmlreq.responseText);
function addToolBoxLinks()
bC = doc.getElementById('bodyContent')
{
if (bC == null) bC = doc.getElementById('article')
var tb = 'p-tb';
var user=data.message;
var LP = document.getElementById( 'livePreview' );
var dLP = document.getElementById( 'divLivePreview' );
LP.innerHTML = bC.innerHTML;
if (dLP.style.display == "none") {
var elcb = document.getElementById( 'shidPrev' );
elcb.checked="true";
dLP.style.display = "inline";
}
var utilde=user.replace(new RegExp(/\'/g), "\\'");
 
var optAvert = "";
//Edit count
var optl = lstAvert.length;
if (mustLoad("stru") || mustLoad("uec"))
for (j=0; j<optl; j++) {
{
if(lstAvert[j].hasPage) continue;
addPortletLink(tb, 'http://toolserver.org/~soxred93/count/index.php?name=' + wgUserName + '&lang=it&wiki=wikipedia', 'Edit count (' + wgUserName + ')', '');
optAvert += '<option value="'+lstAvert[j].template+'">'+lstAvert[j].string+'</option>';
}
 
var entete = document.getElementById( 'livePreviewTitle' );
var cur_user = "";
entete.innerHTML='<b><a href="'+wgServer+'/wiki/User:'+encodeURIComponent(user)+'" target="_new">'+user+'</a></b>';
if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk"){
entete.innerHTML = '<table width="100%" class="creator"><tr><td>'+entete.innerHTML +
var slashpos = wgTitle.indexOf('/');
'</td><td align="right"><small>' +
cur_user = slashpos != -1 ? wgTitle.substr(0, slashpos) : wgTitle;
'[<a id="LiveAvertoLink" href="javascript:var message=getLiveAverto(\''+utilde+'\');">'+lang_menu[0].AVERTS+'</a>] : ' +
}
'<select id="averto">' + optAvert + '</select>' + '</td></tr></table>';
}
 
/* </source>
if (cur_user != "") //Se siamo in una pagina/sottopagina della pagina utente/discussione
{
addPortletLink(tb, 'http://toolserver.org/~soxred93/count/index.php?name=' + cur_user + '&lang=it&wiki=wikipedia', 'Edit count (' + cur_user + ')', '');
 
=== LiveSysop ===
addPortletLink(tb, 'http://tools.wikimedia.de/~luxo/contributions/contributions.php?user=' + cur_user + '&lang=it', 'Contributi interprogetto (' + cur_user + ')', '');
}
}
 
<source lang="javascript"> */
if (mustLoad("stru") || mustLoad("vpop"))
addPortletLink(tb, 'http://tools.wikimedia.de/~henna/VPopSpeed/index.php?projlang=it', 'VPopSpeed', '');
 
function liveSysop(){
username_a = document.___URL.match(/([0-9]+\.){3}[0-9]+/);
jQuery.getJSON(
if (username_a!=null)
mw.config.get('wgScriptPath') + '/api.php?callback=?',
{
{ action: 'query',
username = username_a[0];
list: 'allusers',
if (mustLoad("stru") || mustLoad("whois"))
augroup: 'sysop',
addPortletLink(tb, 'http://whois.domaintools.com/'+username,'User\'s Whois', 'Whois', '');
aulimit: '500',
format: 'json'
},
function( obj ) {
jQuery.each(obj.query.allusers, function(k, val){
lstSysop.push(val.name);
});
liveNS();
}
);
}
 
function liveWatch() {
addPortletLink(tb, 'javascript:var code = getpagecontent("Wikipedia:Monobook.js/Setup.js"); if(code) eval(code);', 'Setup', '');
jQuery.getJSON(
addPortletLink(tb, 'javascript:var code1 = getpagecontent("Wikipedia:Monobook.js/Pulsanti_personali.js"); if(code1) eval(code1);', 'Pulsanti personali', '');
mw.config.get('wgScriptPath') + '/api.php?callback=?',
addPortletLink(tb, 'javascript:var code1 = getpagecontent("Wikipedia:Monobook.js/Collegamenti_personali.js"); if(code1) eval(code1);', 'Collegamenti personali', '');
{ action: 'query',
list: 'watchlistraw',
wrlimit: '500',
wrowner: mw.config.get('wgUserName'),
wrtoken: mw.user.options.get('watchlisttoken'),
format: 'json'
},
function( obj ) {
jQuery.each(obj.watchlistraw, function(k, val){
var info = val.title;
 
lstSuivi.push(info);
if (mustLoad("stru") || mustLoad("vfol"))
lstSuiviHH.push("--:--");
if (BrowserDetect.browser=="Firefox" || BrowserDetect.browser=="Mozilla" || BrowserDetect.browser=="Netscape")
{
// Abilita/Disabilita il VFonLine
var scritta = GetCookie('wikiVFOL');
if (scritta == '') // Se il cookie non esiste
scritta = "disabilitato"; // per default e' disabilitato
addPortletLink(tb, 'javascript:enableVFOL()', 'VFonLine '+scritta, 'vfol');
// Pulsanti di gestione delle liste (solo nelle pagine di modifica e solo se e' abilitato il VFOL)
if (GetCookie('wikiVFOL') == "abilitato")
{
addPortletLink(tb, 'javascript:ModificaListaVFOL("White")', 'Modifica la White List', 'vfol1');
$('vfol1').firstChild.accessKey = '1';
$('vfol1').title = 'Alt-Shift-1';
addPortletLink(tb, 'javascript:ModificaListaVFOL("Black")', 'Modifica la Black List', 'vfol2');
$('vfol2').firstChild.accessKey = '2';
$('vfol2').title = 'Alt-Shift-2';
}
}
 
// watch the talk too
if (mustLoad("stru") || mustLoad("lrc"))
if (info.indexOf("Utente:") == 0)
addPortletLink(tb, 'http://it.wikipedia.org/wiki/Wikipedia:Monobook.js/LiveRC', 'LiveRC', '');
lstSuivi.push("Discussioni utente:"+info.substr(7));
else if (info.indexOf("Wikipedia:") == 0)
lstSuivi.push("Discussioni Wikipedia:"+info.substr(10));
else if (info.indexOf("Immagine:") == 0)
lstSuivi.push("Discussioni immagine:"+info.substr(9));
else if (info.indexOf("MediaWiki:") == 0)
lstSuivi.push("Discussioni MediaWiki:"+info.substr(10));
else if (info.indexOf("Template:") == 0)
lstSuivi.push("Discussioni template:"+info.substr(9));
else if (info.indexOf("Aiuto:") == 0)
lstSuivi.push("Discussioni aiuto:"+info.substr(6));
else if (info.indexOf("Categoria:") == 0)
lstSuivi.push("Discussioni categoria:"+info.substr(10));
else if (info.indexOf("Portale:") == 0)
lstSuivi.push("Discussioni portale:"+info.substr(8));
else if (info.indexOf("Progetto:") == 0)
lstSuivi.push("Discussioni progetto:"+info.substr(9));
else // ns0
lstSuivi.push("Discussione:"+info);
 
lstSuiviHH.push("--:--");
});
liveRC();
}
);
}
 
 
/**** L'orologio che si aggiorna automaticamente ****/
function showtimeliveNS() {
wpajax.http({url: wgServer + wgScriptPath + '/api.php?action=query&meta=siteinfo&siprop=namespaces&format=xml',
{
onSuccess: getNS, message: "Pobieranie nazw przestrzeni" });
var now = new Date();
$('utcdate').firstChild.innerHTML = now.toLocaleString().replace(/GMT/, "CET");
setTimeout('showtime()', 300);
}
 
function getNS(xmlreq, data) {
//Aggiunge qualcosa ad un portlet.
var api = xmlreq.responseXML;
//PARAMS:
//* id: id del portlet.
//* obj: L'oggetto da aggiungere
function addToPortlet(id, obj)
{
var f = document.getElementById(id);
 
if (api.firstChild.nodeName == "error") return;
f = f.getElementsByTagName("div")[0];
f.appendChild(obj);
}
 
var nss = api.getElementsByTagName('query')[0].getElementsByTagName('namespaces')[0].getElementsByTagName('ns');
/**** Aggiunge il pulsante "Allpages" nel portlet "ricerca" ****/
var len = nss.length;
function setup_allpages_button(){
var i;
//Non funziona correttamente con simpleSearch (Usability Initiative)
var id,ns;
if (document.getElementById("simpleSearch"))
var options = return"";
var lstNs = new Array();
for (i=0; i<len; i++) {
id = nss[i].getAttribute('id');
ns = nss[i].textContent;
 
if (id < 0) continue;
//Ex "Article"
if (id == 0) ns = "(Principale)";
 
//Select namespace (default = *)
if (typeof(checkNamespace)!="undefined" && checkNamespace == id)
options += '<option value="' + id + '" SELECTED >' + ns + '</option>';
else
options += '<option value="' + id + '">' + ns + '</option>';
lstNs.push(id);
}
options = '<option value="' + lstNs.join('|') + '">*</option>' + options;
document.getElementById('selectNS').innerHTML = '<label for="showNS0">'+lang_menu[0].NAMESP+' </label><select id="showNS0">' + options + '</select>';
 
liveWatch();
var b = document.createElement('input');
b.type = "button";
b.value = "Allpages";
b.onclick = function(){
top.___location.href = 'http://it.wikipedia.org/wiki/Speciale:Allpages/' + $('searchInput').value;
};
addToPortlet("p-search", document.createElement("hr"));
addToPortlet("p-search", b);
}
 
/* </source>
 
=== LiveRC ===
 
<source lang="javascript"> */
// Aggiunge indirizzi nella toolbar personale
// code stolen from [[wikt:en:User:Hippietrail]]
function addChat() {
var myprefs = $('pt-mycontris');
var newpt, newa;
 
function supprLigne(quelLigne) {
newpt = document.createElement('li');
var i,len;
newpt.id = 'id_chat';
newavar tab = document.createElementgetElementById('atabRC');
var els = new Array();
newa.href='irc://calvino.freenode.net/wikipedia-it' ;
if (quelLigne == '*')
newa.appendChild(document.createTextNode('chat'));
els = tab.getElementsByTagName('tr');
newpt.appendChild(newa);
else if (quelLigne == 'd') {
myprefs.parentNode.insertBefore(newpt, myprefs);
var _els = tab.getElementsByTagName('tr');
len = _els.length;
for (i=len-1; i>=0; i--)
if (_els[i].firstChild.style.backgroundColor == 'rgb(255, 250, 205)')
els.push(_els[i]);
} else if (quelLigne == 'r') {
var _els = tab.getElementsByTagName('tr');
len = _els.length;
for (i=len-1; i>=0; i--)
if (_els[i].firstChild.style.backgroundColor == 'rgb(255, 228, 225)')
els.push(_els[i]);
} else if (quelLigne == 'n') {
var _els = tab.getElementsByTagName('tr');
len = _els.length;
for (i=len-1; i>=0; i--)
if (_els[i].firstChild.style.backgroundColor == 'rgb(226, 242, 210)')
els.push(_els[i]);
} else
els.push(document.getElementById(quelLigne));
len = els.length;
for (i=len-1; i>=0; i--)
if (els[i] != null)
tab.removeChild(els[i]);
}
 
function changeLigne(quelLigne) {
// Aggiunge il link "Novita'" nella barra superiore
var el = document.getElementById(quelLigne);
// Apre gli "Osservati Speciali" mostrando solo le modifiche avvenute dopo l'ultima volta che ci sei passato
var els1 = el.getElementsByTagName('th');
if (mustLoad("since"))
var els2 = el.getElementsByTagName('td');
function addSince(){
var watchlistlen = $('pt-watchlist')els1.length;
for (var i=len-1; i>=0; i--)
var newpt = document.createElement('li');
if (els1[i] != null)
var link = document.createElement('a');
els1[i].style.backgroundColor = "#FFFACD";
link.id = 'listSince';
var len = els2.length;
link.href = '#modifiche da...';
for (var i=len-1; i>=0; i--)
if (els2[i] != null)
els2[i].style.backgroundColor = "#FFFFE0";
}
 
function getElementsByClass(searchClass,node,tag) {
var fixLinkHref = function () {
var classElements = new Array();
// Leggi il cookie
if ( node == null )
var then = GetCookie('wikiSince');
node = document;
if (then == '') // Se il cookie non esiste
if ( tag == null )
then = +(new Date()) - (1000 * 60 * 60 * 24 * 3); // visualizza gli ultimi tre giorni
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
for (i = 0, j = 0; i < elsLen; i++) {
if (pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
 
function tsToHhMm(timestamp) {
var url = 'http://it.wikipedia.org/wiki/Speciale:OsservatiSpeciali';
var tz;
var days = ( +(new Date()) - then )/(1000 * 60 * 60 * 24); // trasforma i millisecondi in giorni
var match, regex = new RegExp();
this.href = url + '?days=' + days;
if (lrcTZ) {
return true;
regex = /^([-+])?(\d?\d):?(\d\d)$/;
};
link.onclickmatch = fixLinkHrefregex.exec(lrcTZ);
if (!match) {
link.onmousedown = fixLinkHref;
//livercError(lang_error.TZ);
return 'xx:xx';
}
tz = match[2]*60 + match[3]*1;
tz = match[1] == '-' ? -tz : tz;
} else {
var now = new Date();
tz = -now.getTimezoneOffset();
}
regex = /^\d\d\d\d-\d\d-\d\dT(\d\d):(\d\d):\d\dZ$/;
match = regex.exec(timestamp);
if (!match) {
//livercError(lang_error.timestamp);
return 'xx:xx';
}
var tt = (match[1]*60 + match[2]*1 + tz + 1440) % 1440;
var mm = tt % 60;
var hh = (tt - mm) / 60 % 24;
return hh + ':' + (mm < 10 ? '0' : '') + mm;
}
 
function updateHidden() {
// Crea la stringa mostrata a video
var tempAr = new Array();
link.appendChild(document.createTextNode("Novità"));
for (var user in lstHidden) {
var utilde = user.replace(new RegExp(/\'/g), "\\'");
var uremove = '<a href="javascript:;" onClick="unhideUser(\''+utilde+'\');" style="color:grey">-</a>';
var udiscut = '<a href="'+wgServer+'/wiki/Discussioni utente:'+encodeURIComponent(user)+'" style="color:seagreen" target="_new">D</a>';
var ucontrib = '<a href="javascript:;" onClick="liveContrib(\''+utilde+'\');" style="color:#43CD80">C</a>';
var uadmin = '';
if (lrcAdmin == true) {
uadmin = ' • <a href="'+wgServer+'/wiki/Speciale:Blocca/'+encodeURI(user)+'" target="_new" style="color:seagreen">B</a>';
}
var ueditor = '<a href="'+wgServer+'/wiki/Utente:'+encodeURIComponent(user)+'" target="_new">'+user+'</a>';
var ligne = '<span id="hidden-' + user + '"><small>' + uremove + ' • ' + udiscut + ' • ' + ucontrib + uadmin + ' • </small>' + ueditor + '</span><br />';
tempAr.push(ligne);
}
tempAr.sort();
var lvHidden = document.getElementById('liveHidden');
lvHidden.innerHTML = "";
var len = tempAr.length;
for (var n=len-1; n>=0; n--)
lvHidden.innerHTML += tempAr[n];
}
 
function updateFollowContact() {
// Se siamo sugli Osservati Speciali
var tempAr = new Array();
if (wgCanonicalSpecialPageName && wgCanonicalSpecialPageName == "Watchlist")
for (var user in lstContact) {
{
var timestamp = lstContact[user].ts;
// Aggiorna il cookie
if (timestamp == 0) continue;
var cookieExpire = new Date(); // scadenza del cookie
var utilde = user.replace(new RegExp(/\'/g), "\\'");
cookieExpire.setTime(cookieExpire.getTime() + (30 * 24 * 60 * 60 * 1000)); // il cookie scade dopo un mese
var udiscut = '<a href="'+wgServer+'/wiki/Discussioni utente:'+encodeURIComponent(user)+'" style="color:seagreen" target="_new">D</a>';
SetCookie('wikiSince', +(new Date()), cookieExpire.toGMTString(), '/');
var ucontrib = '<a href="javascript:;" onClick="liveContrib(\''+utilde+'\');" style="color:#43CD80">C</a>';
var uadmin = '';
if (lrcAdmin == true) {
uadmin = ' • <a href="'+wgServer+'/wiki/Speciale:Blocca/'+encodeURI(user)+'" target="_new" style="color:seagreen">B</a>';
}
var ueditor = '<a href="'+wgServer+'/wiki/Utente:'+encodeURIComponent(user)+'" target="_new">'+user+'</a>';
var ligne = '<span id="contact-' + timestamp + '"><small>' + tsToHhMm(timestamp) + ' • ' + udiscut + ' • ' + ucontrib + uadmin + ' • </small>' + ueditor + '</span><br />';
tempAr.push(ligne);
}
tempAr.sort();
var lvContact = document.getElementById('liveContact');
lvContact.innerHTML = "";
var len = tempAr.length;
for (var n=len-1; n>=0; n--)
lvContact.innerHTML += tempAr[n];
}
 
function updateFollowRevoc() {
// just one little ID attribute would be _so_ nice...
var tempAr = new Array();
newpt.appendChild(link);
for (var user in lstRevoc) {
watchlist.parentNode.insertBefore(newpt, watchlist.nextSibling);
var timestamp = lstRevoc[user].ts;
var utilde = user.replace(new RegExp(/\'/g), "\\'");
var udiscut = '<a href="'+wgServer+'/wiki/Discussioni utente:'+encodeURIComponent(user)+'" style="color:seagreen" target="_new">D</a>';
var ucontrib = '<a href="javascript:;" onClick="liveContrib(\''+utilde+'\');" style="color:#43CD80">C</a>';
var uadmin = '';
if (lrcAdmin == true) {
uadmin = ' • <a href="'+wgServer+'/wiki/Speciale:Blocca/'+encodeURI(user)+'" target="_new" style="color:seagreen">B</a>';
}
var ueditor = '<a href="'+wgServer+'/wiki/Utente:'+encodeURIComponent(user)+'" target="_new">'+user+'</a>';
var ligne = '<span id="revoc-' + timestamp + '"><small>' + tsToHhMm(timestamp) + ' • ' + udiscut + ' • ' + ucontrib + uadmin + ' • </small>' + ueditor + ' (' + lstRevoc[user].nb + ' '+lang_menu[0].XTIMES+')</span><br />';
tempAr.push(ligne);
}
tempAr.sort();
var lvRevoc = document.getElementById('liveRevoc');
lvRevoc.innerHTML = "";
var len = tempAr.length;
for (var n=len-1; n>=0; n--)
lvRevoc.innerHTML += tempAr[n];
}
 
//function getRevision(xmlreq, data) {
/** Rende il titolo editabile, in modo da usarlo come casella di ricerca **/
function getRevision(rc) {
if (mustLoad("edt"))
if (document.getElementById('stopLive').checked) return;
if (BrowserDetect.browser!="Explorer") //non va con IE
addOnloadHook(function () {
if((document.title.indexOf("Modifica ") == -1) &&
(document.title.indexOf("Utente:Senpai/Filtra le ultime modifiche") == -1) &&
(document.title.indexOf("Utente:Senpai/Tutte le ultime modifiche") == -1) &&
(document.title.indexOf("Utente:Senpai/Ultime modifiche anonime") == -1) &&
(document.title.indexOf("Utente:Senpai/Segui gli osservati speciali") == -1) &&
(document.title.indexOf("Utente:Senpai/Controllo ortografico") == -1))
{
var staticTitle = document.getElementsByTagName("h1")[0];
var editableTitle = document.createElement("input");
editableTitle.type = "text";
 
// var api = xmlreq.responseXML.getElementsByTagName('api')[0];
editableTitle.id = "editable-title";
//
editableTitle.style.width = "100%";
// if (api.firstChild.nodeName == "error") return;
editableTitle.style.fontSize = "x-large";
editableTitle.style.backgroundColor = "transparent";
editableTitle.style.borderStyle = "none";
editableTitle.style.borderBottomStyle = "solid";
editableTitle.style.borderBottomWidth = "1px";
 
var match, regex = new RegExp(), regex2 = new RegExp();
editableTitle.value = staticTitle.childNodes[0].nodeValue;
 
// var rc = data.rc
editableTitle.addEventListener("change", function() {
var title = rc.title;
document.___location.href="http://it.wikipedia.org/wiki/" + $("editable-title").value;
var pageid = }, false)rc.pageid;
var revid = rc.revid;
var oldid = rc.old_revid;
var rcid = rc.rcid;
var user = rc.user;
var comment = (rc.comment ? rc.comment : "");
var timestamp = rc.timestamp;
var ns = rc.ns;
var state = rc.state;
// ONLY LOG
var type = rc.type;
var new_title = rc.new_title;
var duration = duration;
 
regex = /\'/g;
editableTitle.addEventListener("focus", function() {
regex2 = /\"/g;
$("editable-title").style.backgroundColor = "#ddf";
var escTitle = title.replace(regex, "\\'");
}, false);
var diffEscTitle = escTitle.replace(regex2, '\%22');
var escUser = user.replace(regex, "\\'");
 
// var revisions = api.getElementsByTagName('query')[0].getElementsByTagName('pages')[0].getElementsByTagName('page')[0].getElementsByTagName('revisions')[0].getElementsByTagName('rev');
editableTitle.addEventListener("blur", function() {
//
$("editable-title").style.backgroundColor = "transparent";
// var oldsize = (state & NEW ? 0 : revisions[1].textContent.length);
}, false);
// var newsize = revisions[0].textContent.length
var oldsize = rc.oldlen
var newsize = rc.newlen
var sizediff = newsize - oldsize;
 
editableTitle.addEventListener("keypress", function(evt) {
if (evt.keyCode == 13) {
$("editable-title").blur();
}
}, false);
 
// INITIALISATION LIGNE RC //
staticTitle.parentNode.replaceChild(editableTitle, staticTitle);
}
});
 
var tr1 = document.createElement('tr');
 
var th0 = document.createElement('th');
/* INIZIO Segna come verificata */
var th1 = document.createElement('th');
var td2 = document.createElement('td');
var td3 = document.createElement('td');
var td4 = document.createElement('td');
 
mphkLinkTitle = "Segna come verificata la revisione corrente";
mphkLinkTitle2 = "Segna come verificata l'ultima revisione analizzata";
mphkLinkText = "Segna come verificata";
mphkLinkText2 = "Segna come verificata";
mphkShortLinkText = "ver"
 
// SUPPR. LIGNE //
function setMarkPatrolledHotKey(){
ta['p-verified'] = ['v', 'Segna come verificato'];
akeytt();
}
 
th0.innerHTML = '<a href="javascript:;" onClick="supprLigne(\''+pageid+'_'+revid+'\');" style="color:red">X</a>';
function mphkAddMarkpatrolledLink(){
//100 alla volta, comunque non più 2000 links
for(var i = mphkCounter; (i < mphkCounter + 100) && (i < mphkLinks.length) && i < 2000; i++){
var rcidpos = mphkLinks[i].href.indexOf('&rcid=');
if ((rcidpos == -1) || (mphkLinks[i].href.indexOf('&action=') != -1)) continue;
var rcid = mphkLinks[i].href.substring(rcidpos);
var mp = document.createElement('a');
mp.href = "/w/index.php?title=" + encodeURIComponent(mphkLinks[i].title) + "&action=markpatrolled"+rcid;
mp.title = mphkLinkTitle;
mp.appendChild(document.createTextNode(mphkShortLinkText));
mphkLinks[i].parentNode.insertBefore(mp, mphkLinks[i+mphkOffset].nextSibling);
mphkLinks[i].parentNode.insertBefore(document.createTextNode("; "), mp);
}
 
mphkCounter = i;
 
// ARTICLE //
if (mphkCounter < mphkLinks.length && mphkCounter < 2000)
setTimeout("mphkAddMarkpatrolledLink()", 100);
else{
mphkLinks = null;
mphkCount = null;
}
}
 
var arti = "", artiStyle = "";
//Aggiunge l'hotkey shift-alt-v per il link "Segna come verificato", se presente
var preArti = "", postArti = "";
if (window.___location.href.indexOf("rcid=") != -1)
if (mustLoad("ver"))
addOnloadHook(function (){
var rcidpos = window.___location.href.indexOf("rcid=");
if (rcidpos == -1) return;
if (document.title.indexOf("Modifica verificata") != -1) return;
var x = document.getElementsByTagName('a');
for(var i=0;i<x.length;i++)
if (x[i].href.indexOf('markpatrolled') != -1){
x[i].id = 'p-verified';
setMarkPatrolledHotKey();
 
var diff = "";
//Crea il link anche sopra il titolo
var diffClose = "";
var mp = document.createElement('a');
if (lrcAutoCloseDiff == 1)
mp.href = "/w/index.php?title=" + wgPageName + "&action=markpatrolled&rcid="+window.___location.href.substring(rcidpos+5);
diffClose='supprLigne(\''+pageid+'_'+revid+'\');';
mp.title = mphkLinkTitle;
if (state & NEW)
mp.appendChild(document.createTextNode(mphkLinkText));
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveArticle(\''+diffEscTitle+'\',\''+user+'\');'+diffClose+'" style="color:green">New</a>';
var t = $('content');
else if (state & UPLOAD)
t.insertBefore(mp, t.firstChild);
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'upload\',\''+escTitle+'\');'+diffClose+'" style="color:darkslateblue">Log</a>';
else if (state & NEWUSER)
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'newusers\',\''+escTitle+'\');'+diffClose+'" style="color:lime">Log</a>';
else if (state & BLOCK)
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'block\',\''+escTitle+'\');'+diffClose+'" style="color:darkgoldenrod">Log</a>';
else if (state & RIGHTS)
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'block\',\''+escTitle+'\');'+diffClose+'" style="color:darkgoldenrod">Log</a>';
else if (state & DELETE)
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'delete\',\''+escTitle+'\');'+diffClose+'" style="color: saddlebrown">Log</a>';
else if (state & DELETE_REVISION)
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'delete\',\''+escTitle+'\');'+diffClose+'" style="color: chocolate">Log</a>';
else if (state & MOVE)
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'move\',\''+escTitle+'\');'+diffClose+'" style="color:black">Log</a>';
else if (state & PROTECT)
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveLog(\'protect\',\''+escTitle+'\');'+diffClose+'" style="color: darkslategray">Log</a>';
else // simple edit
diff = '<a href="javascript:;" onClick="changeLigne(\''+pageid+'_'+revid+'\');liveDiff(\''+diffEscTitle+'\','+revid+','+oldid+','+rcid+');'+diffClose+'" style="color:orange">Diff</a>';
 
var hist = break'';
var livelogs = '';
var edit = '';
var admin = '';
// Don't show link for log rows
if (!(state & UPLOAD) &&
!(state & NEWUSER) &&
!(state & BLOCK) &&
!(state & RIGHTS) &&
!(state & DELETE) &&
!(state & DELETE_REVISION) &&
!(state & PROTECT) &&
!(state & MOVE))
{
hist = '<a href="javascript:;" onClick="liveHist(\''+diffEscTitle+'\');" style="color:darkorange">C</a>';
edit = '<a href="' + wgServer + wgScriptPath + '/index.php?title='+encodeURI(title)+'&action=edit" target="_new" style="color:tomato">M</a>';
livelogs = '<a href="javascript:;" onClick="liveLog(\'\',\''+escTitle+'\');" style="color:hotpink">L</a>';
 
if (lrcAdmin == true) {
admin = ' • <a href="' + wgServer + wgScriptPath + '/index.php?title='+encodeURI(title)+'&action=delete" target="_new" style="color:orangered">S</a>';
 
admin += ' • <a href="' + wgServer + wgScriptPath + '/index.php?title='+encodeURI(title)+'&action=protect" target="_new" style="color: coral">P</a>';
}
}
});
 
// Disambig / Homonymie ? ;
//Aggiungi links "verificata" in Newpages, Recentchanges e Watchlist.
///////////////////////////
if (wgCanonicalNamespace == "Special")
if (ns == 0 && state & HOMONYMIE) {
if (mustLoad("ver"))
artiStyle = 'color: darkorange; font-weight: bold; font-style: italic;';
addOnloadHook(function (){
preArti += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/72/Disambig.svg/16px-Disambig.svg.png" width="16px" alt="Disambigua" title="Disambigua" /> '
switch (wgCanonicalSpecialPageName){
case "Newpages": mphkOffset = 1; break;
case "Recentchanges": mphkOffset = 1; break;
case "Watchlist": mphkOffset = 0; break;
default: return;
}
mphkLinks = $('content').getElementsByTagName('a');
mphkCounter = 0;
mphkAddMarkpatrolledLink();
});
 
// Page protégée ? ;
//Propagazione tramite cookie
////////////////////
if (mustLoad("ver"))
if (state & FULLLOCK)
addOnloadHook(function (){
preArti += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Padlock-red.svg/16px-Padlock-red.svg.png" width="16px" alt="Voce protetta" title="Voce protetta"/> ';
if (($("wpTextbox1") != null) || //mai durante la modifica
if (state & LOCK)
(window.___location.href.indexOf("&action=history") != -1)) //né nella history
preArti += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Padlock-gold.svg/16px-Padlock-gold.svg.png" width="16px" alt="Voce semiprotetta" title="Voce semiprotetta"/> ';
return;
 
// Copyright ? ;
var c = GetCookie('wikiMarkpatrolled');
//////////
var rcidpos = window.___location.href.indexOf("rcid=");
if (state & COPYRIGHT)
//Salva pagina nel cookie;
preArti += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Copyright.svg/16px-Copyright.svg.png" width="16px" alt="Copyright" title="Copyright" /> ';
var expire = new Date(); // scadenza del cookie
expire.setTime(expire.getTime() + (60 * 60 * 1000)); // scadenza di un'ora
var A = c.split('#');
 
// PaS ? ;
var justVerified = document.title.indexOf("Modifica verificata") != -1;
//////////////////
if (state & PAS)
preArti += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Cestino_pieno_architetto_01.svg/11px-Cestino_pieno_architetto_01.svg.png" height="11px" alt="Voci da cancellare" title="Voci da cancellare" /> ';
 
// Adq ? ;
if ((rcidpos != -1) && (!justVerified)){
//////////
var n = wgPageName + "&" + window.___location.href.substring(rcidpos+5);
if (state & ADQ)
//Salva fino a 19 pagine precedenti
postArti += '<sup><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Fairytale_bookmark_gold.png/10px-Fairytale_bookmark_gold.png" width="10px" alt="Voci in vetrina" title="Voci in vetrina" /></sup>';
for(var i = 0; (i < 20-1) && (i < A.length); i++)
if ((A[i] != '') && (A[i].indexOf(wgPageName) == -1))
n += '#' + A[i];
SetCookie('wikiMarkpatrolled', n, expire.toGMTString(), '/');
} else if ((c.indexOf(wgPageName) != -1) && ((rcidpos == -1) || justVerified)){
//Rimuove la pagina corrente dal cookie
var n = '';
var index = -1;
for(var i = 0; i < A.length; i++)
if (A[i].indexOf(wgPageName) != -1)
var index = i; //ricorda l'indice della pagina da non risalvare nel cookie
for(var i = 0; i < A.length; i++)
if ((i != index) && (A[i] != ''))
n += '#' + A[i];
SetCookie('wikiMarkpatrolled', n.substring(1), expire.toGMTString(), '/');
 
// Article catégorisé ? ;
if (!justVerified){
/////////////////////////
//Crea il link sopra il titolo
var isCategorized = "";
var mp = document.createElement('a');
if (!(state & REDIRECT)
mp.href = "/w/index.php?title=" + wgPageName + "&action=markpatrolled&rcid="+A[index].substring(A[index].lastIndexOf('&') + 1);
&& !(state & HOMONYMIE)
mp.title = mphkLinkTitle2;
&& ns == 0
mp.appendChild(document.createTextNode(mphkLinkText2));
&& !(state & CATEGORIZED))
mp.id = 'p-verified';
postArti += '<sup style="color:crimson">(cat ?)</sup>';
var t = $('content');
 
t.insertBefore(mp, t.firstChild);
// Redirect, Log, or simple edit ? ;
setMarkPatrolledHotKey();
//////////////////
}
if (state & MOVE) {
// artiStyle = 'color: magenta; font-weight: bold; font-style: italic;';
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/0/0e/Forward.png" width="20px" alt="Sposta" title="Sposta" />';
var diffnew_title = rc.new_title.replace(new RegExp(/\"/g), '\%22');
postArti += ' <a href="javascript:;" onClick="liveArticle(\''+diffnew_title+'\',\''+user+'\');">'+rc.new_title+'</a>';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');">'+title+'</a>';
}
else if (state & REDIRECT) {
artiStyle = 'color: green; font-weight: bold; font-style: italic;';
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Redirectltr.png/20px-Redirectltr.png" width="20px" alt="Redirect" title="Redirect" />';
var diffredirect =rc.redirect.replace(new RegExp(/\"/g), '\%22');
postArti += ' <a href="javascript:;" onClick="liveArticle(\''+diffredirect+'\',\''+user+'\');">'+rc.redirect+'</a>';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');">'+title+'</a>';
}
else if (state & UPLOAD) {
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/4/47/Gartoon-Gnome-dev-floppy.png" width="20px" alt="Carica" title="Carica" />';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');" onDblClick="window.open(\''+wgServer+'/wiki/'+encodeURI(title)+'\');">'+title+'</a>';
}
else if (state & NEWUSER) {
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/c/c1/Crystal_personal.png" width="20px" alt="Nuovo utente" title="Nuovo utente" />';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');" onDblClick="window.open(\''+wgServer+'/wiki/'+encodeURI(title)+'\');">'+title+'</a>';
}
else if (state & BLOCK) {
// artiStyle = 'color: magenta; font-weight: bold; font-style: italic;';
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/6/64/Crystal_Clear_action_lock3.png" width="20px" alt="Blocca" title="Blocca" />';
postArti += ' <a href="javascript:;" onClick="liveLog("block",\''+rc.title+'\');">('+rc.duration+')</a>';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');">'+title+'</a>';
}
else if (state & RIGHTS) {
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/it/1/10/Stub_universit%C3%A0.png" width="20px" alt="Permessi" title="Permessi" />';
postArti += ' <a href="javascript:;" onClick="liveLog("rights",\''+rc.title+'\');">(da \''+rc.rightsOld+'\' a \''+rc.rightsNew+'\')</a>';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');">'+title+'</a>';
}
else if (state & DELETE) {
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/e/ef/Editcut.png" width="20px" alt="Cancella" title="Cancella" />';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');" onDblClick="window.open(\''+wgServer+'/wiki/'+encodeURI(title)+'\');">'+title+'</a>';
}
else if (state & DELETE_REVISION) {
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/a/a7/Kgpg_info.png" width="20px" alt="Cambia visibilità" title="Cambia visibilità" />';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');" onDblClick="window.open(\''+wgServer+'/wiki/'+encodeURI(title)+'\');">'+title+'</a>';
}
else if (state & PROTECT) {
postArti += ' <img src="http://upload.wikimedia.org/wikipedia/commons/7/72/Crystal_Clear_app_agent.png" width="20px" alt="Proteggi" title="Proteggi" />';
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');" onDblClick="window.open(\''+wgServer+'/wiki/'+encodeURI(title)+'\');">'+title+'</a>';
}
else {
arti = '<a style="'+artiStyle+'" href="javascript:;" onClick="liveArticle(\''+diffEscTitle+'\',\''+user+'\');" onDblClick="window.open(\''+wgServer+'/wiki/'+encodeURI(title)+'\');">'+title+'</a>';
}
});
 
th1.innerHTML = '<small>' + tsToHhMm(timestamp) + ' • ' + diff + ' • ' + hist + ' • ' + edit + ' • ' + livelogs + admin + ' • </small>'
/* FINE Segna come verificata */
+ preArti + arti + postArti;
th1.className="creator-title";
th1.style.textAlign="left";
th1.style.border="1px";
th1.style.width="40%";
 
 
// EDITOR //
/* INIZIO Dynamic pages */
////////////
var discut = '<a href="'+wgServer+'/wiki/Discussioni utente:'+encodeURIComponent(user)+'" style="color:seagreen" target="_new">D</a>';
var contrib = '<a href="javascript:;" onClick="liveContrib(\''+escUser+'\');" style="color:#43CD80">C</a>';
var editor = "", preEditor = "";
 
// Bot ? ;
function mbAddTrustedPages(/* params */){
//////////
if (typeof mbTrustedPages == 'undefined') mbTrustedPages = {};
if (state & BOT)
for(var i = 0; i < arguments.length; i++)
preEditor += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Nuvola_apps_kservices.png/16px-Nuvola_apps_kservices.png" width="16px" alt+"bot" title="bot"/>&nbsp;';
mbTrustedPages[arguments[i]] = true;
}
 
// Sysop ? ;
addOnloadHook(function (){
////////////
if(!wgIsArticle) return; //non in modifica
if (state & SYSOP)
if(typeof mbTrustedPages == 'undefined') return;
preEditor += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Broom_icon.svg/16px-Broom_icon.svg.png" width="16px" alt="sysop" title="sysop" />&nbsp;';
if (mbTrustedPages[wgPageName] == true){
var pre = $('javascriptCode');
if (!pre) return;
var code = pre.innerHTML.replace(/&amp;/g, "&").replace(/&gt;/g, ">").replace(/&lt;/g, "<");
//eval(code);
var script = document.createElement('script');
script.appendChild(document.createTextNode(code));
document.body.appendChild(script);
}
});
 
// Reverted ? ;
/* FINE Dynamic pages */
/////////////////
if (state & REVERT)
preEditor += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Nuvola_actions_undo.png/16px-Nuvola_actions_undo.png" width="16px" alt="rollback" title="rollback" />&nbsp;';
 
// TOR potentiel / AOL
function HelpHotkeys ()
var isTOR = regex = /172\.\d+\.\d+\.\d+/;
{
if (isTOR.test(user))
var text = "";
preEditor += '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Dialog-warning.svg/16px-Dialog-warning.svg.png" width="16px" alt="forse TOR" title="forse TOR" />&nbsp;';
var counter = 0;
 
editor = '<a href="'+wgServer+'/wiki/Utente:'+encodeURIComponent(user)+'" target="_new">'+user+'</a>';
var uadmin = '';
if (lrcAdmin == true) {
uadmin = ' • <a href="'+wgServer+'/wiki/Speciale:Blocca/'+encodeURI(user)+'" target="_new" style="color:seagreen">B</a>';
}
var uhide = '<a href="javascript:;" onClick="supprLigne(\''+pageid+'_'+revid+'\'); hideUser(\''+ user +'\');" style="color:grey">N</a>'
for (codice in pulsantiHotkey)
if (pulsantiHotkey[codice] != '')
text += pulsantiDescr[codice] + " = Alt+" + pulsantiHotkey[codice] + '\n';
td2.innerHTML = '<small>' + discut + ' • ' + contrib + ' • ' + uhide + uadmin + ' • </small>'
alert (text);
+ preEditor + editor;
}
td2.className="creator-name";
td2.style.border = "1px";
td2.style.width = "20%";
 
if (lstRevoc[user]) {
td2.style.border = "2px solid red";
td2.innerHTML += '<sup style="color:red">(' + lstRevoc[user].nb + ' rollback)</sup>'
}
 
// COMMENT //
// Remplace lien [[xxx]] par <a> ;
var wcomment = comment.htmlize();
regex = /\[\[(([^\]\|]*)(.*?))\]\]/g;
wcomment = wcomment.replace(regex, "<a href='"+wgServer+wgScriptPath+"/index.php?title=$2&redirect=no' target='_new'>$1</a>");
regex = /\>[^\]\|<]*\|([^\]\|<]*)</g;
wcomment = wcomment.replace(regex, ">$1<");
 
td3.innerHTML = "<small>" + wcomment + "</small>";
td3.style.border = "1px";
td3.style.width = "40%";
 
if (state & UPLOAD) {
th0.style.backgroundColor = "#D1CAFA";
th1.style.backgroundColor = "#D1CAFA";
td2.style.backgroundColor = "#D1CAFA";
td3.style.backgroundColor = "#D1CAFA";
td4.style.backgroundColor = "#D1CAFA";
tr1.style.border = "1px solid darkslateblue";
}
 
if (state & NEWUSER) {
th0.style.backgroundColor = "#C6FF6D";
th1.style.backgroundColor = "#C6FF6D";
td2.style.backgroundColor = "#C6FF6D";
td3.style.backgroundColor = "#C6FF6D";
td4.style.backgroundColor = "#C6FF6D";
tr1.style.border = "1px solid lime";
}
 
if (state & BLOCK) {
th0.style.backgroundColor = "#EECC84";
th1.style.backgroundColor = "#EECC84";
td2.style.backgroundColor = "#EECC84";
td3.style.backgroundColor = "#EECC84";
td4.style.backgroundColor = "#EECC84";
tr1.style.border = "1px solid darkgoldenrod";
}
 
if (state & RIGHTS) {
th0.style.backgroundColor = "#EECC84";
th1.style.backgroundColor = "#EECC84";
td2.style.backgroundColor = "#EECC84";
td3.style.backgroundColor = "#EECC84";
td4.style.backgroundColor = "#EECC84";
tr1.style.border = "1px solid darkgoldenrod";
}
 
if (state & DELETE) {
th0.style.backgroundColor = "#E7CAA7";
th1.style.backgroundColor = "#E7CAA7";
td2.style.backgroundColor = "#E7CAA7";
td3.style.backgroundColor = "#E7CAA7";
td4.style.backgroundColor = "#E7CAA7";
tr1.style.border = "1px solid saddlebrown";
}
if (state & DELETE_REVISION) {
th0.style.backgroundColor = "#D89A6D";
th1.style.backgroundColor = "#D89A6D";
td2.style.backgroundColor = "#D89A6D";
td3.style.backgroundColor = "#D89A6D";
td4.style.backgroundColor = "#D89A6D";
tr1.style.border = "1px solid chocolate";
}
 
if (state & MOVE) {
th0.style.backgroundColor = "#FDC5FF";
th1.style.backgroundColor = "#FDC5FF";
td2.style.backgroundColor = "#FDC5FF";
td3.style.backgroundColor = "#FDC5FF";
td4.style.backgroundColor = "#FDC5FF";
tr1.style.border = "1px solid magenta";
}
 
if (state & PROTECT) {
th0.style.backgroundColor = "#B2BCC6";
th1.style.backgroundColor = "#B2BCC6";
td2.style.backgroundColor = "#B2BCC6";
td3.style.backgroundColor = "#B2BCC6";
td4.style.backgroundColor = "#B2BCC6";
tr1.style.border = "1px solid darkslategray";
}
 
if (state & REVERT) {
th0.style.backgroundColor = "#FFBAB3";
th1.style.backgroundColor = "#FFBAB3";
td2.style.backgroundColor = "#FFBAB3";
td3.style.backgroundColor = "#FFBAB3";
td4.style.backgroundColor = "#FFBAB3";
tr1.style.border = "1px solid crimson";
}
 
if (state & BLANKING || newsize == 0) {
th0.style.backgroundColor = "white";
th1.style.backgroundColor = "white";
td2.style.backgroundColor = "white";
td3.style.backgroundColor = "white";
td4.style.backgroundColor = "white";
tr1.style.border = "2px double crimson";
}
if (state & NEW) {
th0.style.backgroundColor = "#BDE397";
th1.style.backgroundColor = "#BDE397";
td2.style.backgroundColor = "#BDE397";
td3.style.backgroundColor = "#BDE397";
td4.style.backgroundColor = "#BDE397";
tr1.style.border = "1px solid green";
 
// check if the page has been already deleted
/* Aggiorna la lista degli hotkeys */
myXmlReq = wpajax.http({url: wgServer + wgScriptPath + '/api.php?action=query&list=deletedrevs&titles='+ title + '&drprop=user&format=xml'});
if (wgAction=="edit")
var api = myXmlReq.responseXML;
addOnloadHook(function(){
if (api)
// modifica gli hotkeys di default in base a quanto scelto dall'utente
if (typeof(tastiHotkeys) != "undefined")
for (tasto in tastiHotkeys)
{
if (api.firstChild.nodeName == "error") return;
// vietato usare lo stesso codice per 2 pulsanti diversi
deletedRevs = api.getElementsByTagName('rev');
for (tasto2 in pulsantiHotkey)
if (pulsantiHotkey[tasto2]deletedRevs.length =!= tastiHotkeys[tasto]0)
{
pulsantiHotkey[tasto2] = '';
th1.style.border = "1px solid red";
th1.style.backgroundColor = "#FFDDDD";
th1.innerHTML += '<img src="http://upload.wikimedia.org/wikipedia/commons/f/f7/Gartoon-Emblem-trash.png" width="15px" alt="Voce cancellata in precedenza" title="Nuova voce già cancellata in precedenza" />'
}
}
}
 
if (state & IP) {
// assegna il valore scelto dall'utente
td2.style.backgroundColor = "#B9F8FF";
pulsantiHotkey[tasto] = tastiHotkeys[tasto];
td3.style.backgroundColor = "#B9F8FF";
td4.style.backgroundColor = "#B9F8FF";
}
 
if (isTOR.test(user))
td2.style.backgroundColor = "pink";
 
if (state & REPLACED) {
th0.style.backgroundColor = "pink";
th1.style.backgroundColor = "pink";
td2.style.backgroundColor = "pink";
td3.style.backgroundColor = "pink";
td4.style.backgroundColor = "pink";
td4.innerHTML = '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/95/Categorie_III.svg/10px-Categorie_III.svg.png" width="10px" alt="Avviso" title="Avviso"/>';
tr1.style.border = "2px solid crimson";
}
 
// CONTACT LIST //
//////////////////
if (lstContact[user]) {
td2.style.border = "2px solid gold";
td2.style.backgroundColor = "yellow";
}
 
// IPCLASS LIST //
//////////////////
for (var IPclass in lstIPClass) {
if (user.indexOf(IPclass)==0) {
td2.style.border = "2px solid gold";
td2.style.backgroundColor = "yellow";
IPclassMitigating = true;
}
}
 
// Aggiungi gli hotkeys creati dall'utente
if (typeof(pulsantiHotkeyPers)user == "undefined"wgUserName) {
td2.style.border = "2px solid #A0B0E0";
return;
td2.style.backgroundColor = "#F0F8FF";
}
 
// DELTA SIZE //
 
// delta de modif ;
///////////////////
var txtdiff = "";
if (sizediff < 0)
txtdiff = '<sub style="color:red">'+sizediff+'</sub>';
else if (sizediff == 0)
txtdiff = '<small style="color:purple">='+sizediff+'</small>';
else
txtdiff = '<sup style="color:blue">+'+sizediff+'</sup>';
for (pulsante in pulsantiHotkeyPers)
td4.innerHTML += txtdiff;
{
td4.style.border = "1px";
// vietato usare lo stesso codice per 2 pulsanti diversi
td4.style.textAlign = "right";
for (pulsante2 in pulsantiHotkey)
if (pulsantiHotkey[pulsante2] == pulsantiHotkeyPers[pulsante])
pulsantiHotkey[pulsante2] = '';
 
 
// assegna il valore scelto dall'utente
// ASSEMBLAGE LIGNE //
pulsantiHotkey[pulsante] = pulsantiHotkeyPers[pulsante];
 
pulsantiComando[pulsante] = pulsantiComandoPers[pulsante];
tr1.appendChild(th0);
if (typeof(pulsantiDescrPers) != "undefined")
tr1.appendChild(th1);
pulsantiDescr[pulsante] = pulsantiDescrPers[pulsante];
tr1.appendChild(td2);
tr1.appendChild(td3);
tr1.appendChild(td4);
tr1.id = pageid+"_"+revid;
 
var tab = document.getElementById( 'tabRC' );
var elold = document.getElementById(pageid+"_"+oldid);
 
if (tab.firstChild != null)
tab.insertBefore(tr1, tab.firstChild);
else
tab.appendChild(tr1);
if (elold == null || typeof(oldid) == "undefined") {
if (tab.childNodes.length > lrcRCLimit) {
var idt = tab.lastChild.id;
supprLigne(idt);
}
} else {
});
supprLigne(pageid+"_"+oldid);
}
 
// Don't show RC if checkbox is not checked
/* Catch di hotkeys + speedy google search*/
if ((!document.getElementById('showRC').checked) &&
function catchHotkeys (){
(!(state & UPLOAD) &&
if (BrowserDetect.browser=="Firefox" || BrowserDetect.browser=="Mozilla" || BrowserDetect.browser=="Netscape")
!(state & NEWUSER) &&
{
!(state & BLOCK) &&
var listenerKeyPress = function(e){
!(state & RIGHTS) &&
e = (e) ? e : ((window.event) ? window.event : null);
if!(estate && e.altKeyDELETE) && !e.shiftKey && !e.ctrlKey){
!(state & DELETE_REVISION) &&
var toCheckNum = (e.which) ? e.which : e.keyCode;
!(state & PROTECT) &&
var toCheck = String.fromCharCode(toCheckNum);
!(state & MOVE)))
supprLigne(pageid+"_"+revid);
// Don't show Log if checkbox is not checked
if ((!document.getElementById('showLog').checked) &&
((state & UPLOAD) ||
(state & NEWUSER) ||
(state & BLOCK) ||
(state & RIGHTS) ||
(state & DELETE) ||
(state & DELETE_REVISION) ||
(state & PROTECT) ||
(state & MOVE)))
supprLigne(pageid+"_"+revid);
// Don't show "non-Log" with +NaN diffsize (fake edits)
if (isNaN(sizediff) &&
!(state & UPLOAD) &&
!(state & NEWUSER) &&
!(state & BLOCK) &&
!(state & RIGHTS) &&
!(state & DELETE) &&
!(state & DELETE_REVISION) &&
!(state & PROTECT) &&
!(state & MOVE))
supprLigne(pageid+"_"+revid);
// MISE A JOUR LISTES //
 
var spos = lstSuivi.indexOf(title);
if(spos != -1) {
th0.style.border = "2px solid gold";
th0.style.backgroundColor = "yellow";
th1.style.border = "2px solid gold";
th1.style.backgroundColor = "yellow";
lstSuiviHH[spos] = tsToHhMm(timestamp);
var tempsAr = new Array();
var len = lstSuivi.length;
for (var n = 0; n < len; n++) {
if(lstSuiviHH[n] == "--:--") continue;
var cstilde = lstSuivi[n].replace(new RegExp(/\'/g), "\\'");
var diffcstilde = cstilde.replace(new RegExp(/\"/g), '\%22');
forif (xlstSuivi[n] in== pulsantiHotkeytitle)
{
lstSuivirevid[n] = revid;
if (pulsantiHotkey[x].toUpperCase() == toCheck.toUpperCase())
lstSuivioldid[n] = eval(pulsantiComando[x])oldid;
}lstSuivircid[n] = rcid;
//Fermo il propagarsi degli eventi
e.stopPropagation();
//Cancello l'azione di default
e.preventDefault();
return false;
}
 
var myrevid = lstSuivirevid[n];
var myoldid = lstSuivioldid[n];
var myrcid = lstSuivircid[n];
var sdiff = '<a href="javascript:;" onClick="liveDiff(\''+diffcstilde+'\','+myrevid+','+myoldid+','+myrcid+');" style="color:orange">Diff</a>';
var shist = '<a href="javascript:;" onClick="liveHist(\''+diffcstilde+'\');" style="color:darkorange">C</a>';
var sarti = '<a href="javascript:;" onClick="liveArticle(\''+diffcstilde+'\',\''+user+'\');">'+lstSuivi[n]+'</a>';
var ligne='<small>' + lstSuiviHH[n] + ' • ' + sdiff + ' • ' + shist + ' • </small>' + sarti +'<br />';
tempsAr.push(ligne);
}
tempsAr.sort();
len = tempsAr.length;
var lvSuivi = document.getElementById( 'liveSuivi' );
lvSuivi.innerHTML = "";
for (var n=len-1; n >= 0; n--)
lvSuivi.innerHTML = lvSuivi.innerHTML + tempsAr[n];
}
 
 
wpTextbox1 = $("wpTextbox1");
if (wpTextbox1lstContact[user]) != null){
lstContact[user].ts = timestamp;
{
updateFollowContact();
if (wpTextbox1.addEventListener)
}
wpTextbox1.addEventListener('keypress', listenerKeyPress, true); //Non-IE
 
else
if (state & REVERT) {
wpTextbox1.onkeypress = listenerKeyPress;
regex = /\[\[Special:Contributi\/([^\]\|]+)/;
match = regex.exec(comment);
 
if (!match) {
regex = /\[\[Speciale:Contributi\/([^\]\|]+)/;
match = regex.exec(comment);
}
wpUploadDescription = $("wpUploadDescription");
if (wpUploadDescription!= nullmatch) {
var userR = match[1];
{
if (wpUploadDescription.addEventListeneruserR != user && userR != wgUserName) {
if (!lstRevoc[userR]) lstRevoc[userR] = { ts: 0, nb: 0 };
wpUploadDescription.addEventListener('keypress', listenerKeyPress, true); //Non-IE
lstRevoc[userR].ts = timestamp;
else
wpUploadDescriptionlstRevoc[userR].onkeypressnb += listenerKeyPress1;
updateFollowRevoc();
}
}
}
}
var listenerMouseUp = function(e){
 
e = (e) ? e : ((window.event) ? window.event : null);
function getRedirCat(xmlreq, data) {
if(e && e.ctrlKey){
if (document.getElementById('stopLive').checked) return;
if(navigator.appName=='Microsoft Internet Explorer' && navigator.userAgent.indexOf("Opera")==-1) //IE
 
var t = document.selection.createRange().text;
var yurik = xmlreq.responseXML.getElementsByTagName('api')[0];
else //Non-IE
 
var t = document.getSelection ? document.getSelection().toString() : window.getSelection().toString();
if (yurik.firstChild.nodeName == "error") return;
t = t.replace(/^\s+/, '').replace(/\s+$/, ''); //trim
 
var q = t.indexOf('"') == -1 ? '"' : '';
var rc = if(t)data.rc;
var pageid = rc.pageid;
window.open("http://www.google.com/search?q=" + q + encodeURIComponent(t) + q);
var revid = rc.revid;
}
var state = rc.state;
 
var page = yurik.getElementsByTagName('pages')[0].getElementsByTagName('page')[0];
 
if (yurik.getElementsByTagName('redirects').length) {
state += REDIRECT;
if (yurik.getElementsByTagName('redirects')[0].getElementsByTagName('r').length)
rc.redirect = yurik.getElementsByTagName('redirects')[0].getElementsByTagName('r')[0].attributes[1].nodeValue;
}
 
if (page.getElementsByTagName('categories').length) {
if (window.addEventListener)
state += CATEGORIZED;
window.addEventListener('mouseup', listenerMouseUp, false); //Non-IE
else
document.onmouseup = listenerMouseUp; //IE
}
if (wgAction=="edit")
addOnloadHook(catchHotkeys);
 
var categories = page.getElementsByTagName('categories')[0].getElementsByTagName('cl');
var i,j;
var leni = categories.length;
var lenj = categoriestests.length;
for (i=0; i<leni; i++)
for (j=0; j<lenj; j++)
if (new RegExp(lang_category+categoriestests[j].regex, "i").test(categories[i].attributes[1].textContent))
state += categoriestests[j].state;
}
 
rc.state = state;
/**** Fine ****/
// </nowiki></pre>
 
getRevision(rc);
// wpajax.http({ url: wgServer + wgScriptPath + '/api.php?action=query&prop=revisions&pageids=' + pageid + '&rvstartid=' + revid + '&rvlimit=1&rvprop=content&format=xml',
// onSuccess: getRevision, rc: rc });
}
 
function getRedirCat2(xmlreq, data) {
//Importa la toolbar
if (document.getElementById('stopLive').checked) return;
if (wgAction=="edit")
importScript("Utente:Jalo/Sandbox");
 
var yurik = xmlreq.responseXML.getElementsByTagName('api')[0];
 
if (yurik.firstChild.nodeName == "error") return;
// script "recent Senpaio" ver. 1.0<br/>
// Vedi [[Utente:Senpai/monobook/recent2.js]], derivato dall'[[:en:User:Lupin/Anti-vandal_tool|Anti-vandal tool]] di [[:en:user:Lupin]]; tradotto ed adattato da [[Utente:Senpai]] e [[Utente:Valepert]]
// <pre><nowiki>
if (mustLoad("avan"))
document.writeln('<script type="text/javascript" src="/w/index.php?title=Utente:Senpai/monobook/recent2.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
var log = data.log;
// script "Catwatch" ver. 1.0<br/>
var pageid = log.pageid;
// Tradotto da [[Utente:Jalo|Jalo]]
var revid = log.revid;
// Vedi [[Wikipedia:Monobook.js/Catwatch.js]]
var state = log.state;
// <pre><nowiki>
if (wgPageName=="Speciale:OsservatiSpeciali")
if (mustLoad("cwtch"))
document.writeln('<script type="text/javascript" src="/w/index.php?title=Wikipedia:Monobook.js/Catwatch.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
var page = yurik.getElementsByTagName('pages')[0].getElementsByTagName('page')[0];
// script "ricerca in Namespace"<br/>
// Vedi [[Wikipedia:Monobook.js/namespaceSearch.js]], derivato dal tool di [[:en:User:Ilmari Karonen|Ilmari Karonen]]; tradotto ed adattato da [[Utente:Jalo|Jalo]]
// <pre><nowiki>
if (mustLoad("nms"))
document.writeln('<script type="text/javascript" src="/w/index.php?title=Wikipedia:Monobook.js/namespaceSearch.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
if (page.getElementsByTagName('redirect').length) {
// script "Quick Edit"<br/>
state += REDIRECT;
// Vedi [[Wikipedia:Monobook.js/QuickEdit.js]] di [[:de:Benutzer:ASM]]
if (page.getElementsByTagName('redirect')[0].getElementsByTagName('to').length)
// <pre><nowiki>
log.redirect = page.getElementsByTagName('redirect')[0].getElementsByTagName('to')[0].textContent;
if (mustLoad("qed"))
}
document.writeln('<script type="text/javascript" src="'
 
+ 'http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js'
if (page.getElementsByTagName('categories').length) {
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
state += CATEGORIZED;
// </nowiki></pre>
 
var categories = page.getElementsByTagName('categories')[0].getElementsByTagName('cl');
var i,j;
var leni = categories.length;
var lenj = categoriestests.length;
for (i=0; i<leni; i++)
for (j=0; j<lenj; j++)
if (new RegExp(lang_category+categoriestests[j].regex, "i").test(categories[i].textContent))
state += categoriestests[j].state;
}
 
log.state = state;
if (mustLoad("wed"))
if (BrowserDetect.browser!="Explorer") //non va con IE
{
// installa la traduzione del wikEd
// <pre><nowiki>
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Jalo/wikEd_international_it.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
getRevision(log);
// installa il [[Wikipedia:Monobook.js/WikEd|wikEd]], editor di testo
// wpajax.http({ url: wgServer + wgScriptPath + '/api.php?action=query&prop=revisions&pageids=' + pageid + '&rvstartid=' + revid + '&rvlimit=1&rvprop=content&format=xml',
// <pre><nowiki>
// onSuccess: getRevision, rc: rc });
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
}
 
// Get RC and Log
// script Cronologia della pagina"<br/>
function getRC(xmlreq, data) {
// Vedi [[Wikipedia:Monobook.js/MostraModifiche.js]] di [[:nl:User:JePe]]
if (document.getElementById('stopLive').checked) return;
// <pre><nowiki>
if (mustLoad("rch"))
if (BrowserDetect.browser!="Explorer") //non va con IE
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/MostraModifiche.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
var api = xmlreq.responseXML.getElementsByTagName('api')[0];
// script "Command line"<br/>
// Vedi [[Utente:Salvatore_Ingala/commandline.js]] di [[Utente:Salvatore_Ingala]]
// NOTA: deve rimanere DOPO wikEd per motivi di compatibilità!
// <pre><nowiki>
if (mustLoad("cmd"))
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Utente:Salvatore_Ingala/commandline.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
if (api.firstChild.nodeName == "error") return;
// script Notiziario del Monobook"<br/>
// Vedi [[Wikipedia:Monobook.js/Notiziario.js]]
// Questo script viene eseguito sempre, non ha bisogno del controllo 'mustLoad'
// <pre><nowiki>
if (wgCanonicalNamespace == 'User_talk' && wgTitle == wgUserName && typeof(disabilitaNotiziario)=="undefined")
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Notiziario.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
// RC
// script del retropatrolling<br/>
// Vedi [[Wikipedia:VPopSpeed]]
var rcs = api.getElementsByTagName('query')[0].getElementsByTagName('recentchanges')[0].getElementsByTagName('rc');
// <pre><nowiki>
var i,j,leni,lenj,rc;
if (mustLoad("vpop"))
if (BrowserDetect.browser!="Explorer") //non va con IE
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Utente:Henna/VPopSpeed.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// </nowiki></pre>
 
leni=rcs.length;
// script del Vandal Fighter on Line<br/>
for (i=leni-1; i>=0; i--) {
// Vedi [[Wikipedia:Monobook.js/VFonLine]]
if (rcs[i].getAttribute('revid') <= lastrevid) continue;
// Scritto da [[Utente:Jalo|Jalo]]
// <pre><nowiki>
if (mustLoad("vfol"))
{
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/VFonLine.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
rc = new Object();
// script "Popup di navigazione"<br/>
rc.state = 0;
// Vedi [[:en:User:Lupin/popups.js]] di [[:en:User:Lupin|Lupin]]
// <pre><nowiki>
if (mustLoad("popup"))
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/strings-it.js'
+ '&action=raw&ctype=text/javascript"></script>');
 
lenj = rcs[i].attributes.length;
if (mustLoad("popup"))
for (j=0; j<lenj; j++) {
document.write('<script type="text/javascript" src="'
switch(rcs[i].attributes[j].name) {
+ 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
case 'anon':
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
rc.state += IP;
// </nowiki></pre>
break;
case 'bot':
rc.state += BOT;
break;
case 'new':
rc.state += NEW;
break;
case 'minor':
rc.state += MINOR;
break;
case 'new_ns':
rc.state += NEWNS;
break;
case 'new_title':
rc.state += RENAMED;
break;
case 'patrolled':
rc.state += PATROLLED;
break;
case 'type':
break;
default:
rc[rcs[i].attributes[j].name] = rcs[i].attributes[j].value;
break;
}
}
 
if (typeof(rc.comment) != "undefined") {
// Script di Link Complete
lenj = commenttests.length;
// Scritto da [[:en:Utente:Zocky]]
for (j=0; j<lenj; j++)
// [[:en:User:Zocky/LinkComplete.js]]
if (new RegExp(commenttests[j].regex).test(rc.comment))
// Vedi [[:en:User:Zocky/Link_Complete]]
rc.state += commenttests[j].state;
if (mustLoad("linkcomplete"))
}
{
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Zocky/LinkComplete.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
if (lstSysop.indexOf(rc.user) != -1)
// Script di Quick-Delete
rc.state += SYSOP;
// Vedi [[:m:MediaWiki talk:Quick-delete.js]]
if (mustLoad("qdel"))
{
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Quick-delete.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
var IPclassMitigating = false;
// Script di LiveRC
for (var IPclass in lstIPClass)
// Vedi [[Wikipedia:Monobook.js/LiveRC/Documentazione]]
if (rc.user.indexOf(IPclass)==0)
if (wgTitle == 'Monobook.js/LiveRC' && mustLoad("lrc"))
IPclassMitigating = true;
{
document.write('<script type="text/javascript" src="' +
'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/LiveRC.js' +
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
var mitigating = (rc.state & REVERT)
// Unwatch. Aggiunge "non seguire" nella pagina degli osservati speciali
|| (rc.state & BLANKING)
// Vedi [[Wikipedia:Monobook.js/Unwatch.js]]
|| (rc.state & REPLACED)
if (mustLoad("unw"))
|| (lstContact[rc.user])
{
|| (lstRevoc[rc.user])
document.write('<script type="text/javascript" src="' +
|| (rc.user == wgUserName)
'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Unwatch.js' +
|| (IPclassMitigating == true);
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
if (document.getElementById('showIP').checked
// Ripristina. Aggiunge la "selezione automatica" nella pagina di ripristino della cronologia
&& !(rc.state & IP)
// Vedi [[Wikipedia:Monobook.js/Ripristina]]
&& !mitigating ) continue;
if (typeof(disableRipristina)=="undefined")
if (((wgAction == "history") && (wgUserGroups.indexOf("sysop") != -1)) ||
(wgPageName == "Speciale:Ripristina"))
{
document.write('<script type="text/javascript" src="' +
'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Ripristina.js' +
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
if (lstHidden[rc.user] && !mitigating) continue;
// Cancella sezione. Aggiunge i link "cancella" da parte ad ogni sezione
if (mustLoad("dels"))
{
document.write('<script type="text/javascript" src="' +
'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/deledesection.js' +
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
wpajax.http({url: wgServer + wgScriptPath + '/api.php?titles=' + encodeURIComponent(rc.title) + '&action=query&prop=categories&redirects&format=xml',
// Trasforma le cronologie incollate in versioni con wikilink
onSuccess: getRedirCat, rc: rc });
if(document.title.indexOf("Discussione") != -1 )
}
{
 
document.write('<script type="text/javascript" src="' +
// Log
'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Cronologia.js' +
var logs = api.getElementsByTagName('query')[0].getElementsByTagName('logevents')[0].getElementsByTagName('item');
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
var i,j,leni,lenj,log;
 
leni=logs.length;
for (i=leni-1; i>=0; i--) {
if (logs[i].getAttribute('timestamp').replace(new RegExp(/\D/g), "") <= lasttimestamp) continue;
 
log = new Object();
log.state = 0;
 
lenj = logs[i].attributes.length;
 
//Cerca il campo 'action'
var action = null;
for (j=0; j<lenj; j++)
if (logs[i].attributes[j].name == 'action')
action = logs[i].attributes[j].value;
 
for (j=0; j<lenj; j++) {
if (logs[i].attributes[j].name == 'type')
{
switch(logs[i].attributes[j].value) {
case 'patrol':
// I "Segna come verificata" non li cago
// rc.state += PATROL;
break;
case 'newusers':
log.state += NEWUSER;
break;
case 'upload':
log.state += UPLOAD;
break;
case 'block':
log.state += BLOCK;
if (logs[i].firstChild)
log.duration = logs[i].firstChild.attributes[1].value;
break;
case 'delete':
if (action == 'delete')
log.state += DELETE;
else if (action == 'revision')
log.state += DELETE_REVISION;
break;
case 'move':
log.state += MOVE;
if (logs[i].firstChild)
log.new_title = logs[i].firstChild.attributes[1].value;
case 'rights':
log.state += RIGHTS;
if (logs[i].firstChild)
{
log.rightsOld = logs[i].firstChild.attributes[1].value;
log.rightsNew = logs[i].firstChild.attributes[0].value;
}
case 'protect':
log.state += PROTECT;
break;
default:
break;
}
}
else
log[logs[i].attributes[j].name] = logs[i].attributes[j].value;
}
 
if (typeof(log.comment) != "undefined") {
lenj = commenttests.length;
for (j=0; j<lenj; j++)
if (new RegExp(commenttests[j].regex).test(log.comment))
log.state += commenttests[j].state;
}
 
if (lstSysop.indexOf(log.user) != -1)
log.state += SYSOP;
 
wpajax.http({url: wgServer + wgScriptPath + '/api.php?titles=' + encodeURIComponent(log.title) + '&action=query&prop=categories&redirects&format=xml',
onSuccess: getRedirCat2, log: log });
}
lastrevid = rcs[0].getAttribute('revid');
lasttimestamp = rcs[0].getAttribute('timestamp').replace(new RegExp(/\D/g), "");
document.getElementById('tsInit').innerHTML = "Ultima versione : " + lasttimestamp;
}
 
function liveRC() {
// Verifica requisiti di voto di un utente
var refresh = 10;
if (mustLoad("nav")||mustLoad("requi"))
timer= setTimeout("liveRC()",refresh*1000);
{
 
document.write('<script type="text/javascript" src="' +
if (document.getElementById('stopLive').checked) return;
'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Requisiti.js' +
 
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
var rcns = document.getElementById('showNS0').value;
if (rcns == null) return;
var rcshow = "";
if (document.getElementById('showBot').checked) rcshow = '&rcshow=!bot';
 
wpajax.http({url:wgServer + wgScriptPath
+ '/api.php?action=query&list=recentchanges|logevents&rcnamespace=' + rcns
+ '&rcprop=user|comment|flags|timestamp|title|ids|sizes' + rcshow
+ '&rcend=' + lasttimestamp + '&rclimit=' + lrcRCLimit
+ '&leend=' + lasttimestamp + '&lelimit=' + lrcRCLimit
+ '&format=xml',
onSuccess: getRC, message: "Elaborazione in corso...\n\n" });
}
 
function hideUser(name) {
lstHidden[name] = true;
updateHidden();
}
 
function unhideUser(name) {
// EnhancedLiveRC
delete lstHidden[name];
if (wgTitle == 'Monobook.js/E-LiveRC' && mustLoad("elrc"))
updateHidden();
{
document.write('<script type="text/javascript" src="' +
'http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/E-LiveRC.js' +
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
 
function showHideObj(parent, fils) {
// Link cliccabili in crono
var ofils = document.getElementById( fils );
if (mustLoad("clink"))
if (parent.checked)
{
ofils.style.display="inline";
var autolinkParseLink = false; // se si usa il wikEd
else
document.write('<script type="text/javascript" src="' +
ofils.style.display="none";
'http://en.wikipedia.org/w/index.php?title=User:Lenore/autolink.js' +
'&action=raw&ctype=text/javascript"></script>');
}
 
addOnloadHook(function () {
// </nowiki></source>
if (wgTitle == "Monobook.js/LiveRC") {
 
//HACK: Se il file delle impostazioni non è ancora stato caricato, riprova più tardi
if (typeof lang_menu == 'undefined'){
setTimeout(arguments.callee, 250);
return;
}
 
var top = document.getElementById( 'top' );
if (top != null) {
top.innerHTML = "";
top.style.display = "none";
}
var siteSub = document.getElementById( 'siteSub' );
var contentSub = document.getElementById( 'contentSub' );
var rtb = document.getElementById( 'RealTitleBanner' );
var rt = document.getElementById( 'RealTitle' );
var pca = document.getElementById( 'p-cactions' );
 
if (siteSub != null) siteSub.style.display = "none";
if (contentSub != null) contentSub.style.display = "none";
if (rtb != null) rtb.style.display = "none";
if (rt != null) rt.style.display = "none";
if (pca != null) pca.style.display = "none";
 
var lvPreviewFoot = document.getElementById( 'livePreviewFoot' );
lvPreviewFoot.innerHTML = '<a href="javascript:;" onClick="supprLigne(\'*\');" style="color: red; font-weight: bold;">X</a>' +
'<a href="javascript:;" onClick="supprLigne(\'d\');" style="color: rgb(255, 235, 71); font-weight: bold;">X</a>' +
'<a href="javascript:;" onClick="supprLigne(\'r\');" style="color: rgb(255, 99, 83); font-weight: bold;">X</a>' +
'<a href="javascript:;" onClick="supprLigne(\'n\');" style="color: rgb(178, 243, 113); font-weight: bold;">X</a>' +
'<input id="stopLive" type="checkbox" value="true" />' +
'<label for="stopLive">' + lang_menu[0].PAUSE + '</label>';
//Anteprima (default = not checked)
if (typeof(checkAnteprima)!="undefined" && checkAnteprima == "1")
lvPreviewFoot.innerHTML += '<input id="shidPrev" type="checkbox" checked onclick="showHideObj(this, \'divLivePreview\');" />';
else
lvPreviewFoot.innerHTML += '<input id="shidPrev" type="checkbox" onclick="showHideObj(this, \'divLivePreview\');" />';
showHideObj(document.getElementById("shidPrev"), 'divLivePreview');
lvPreviewFoot.innerHTML += '<label for="shidPrev">' + lang_menu[0].PREVIEW + '</label>';
//Liste (default = not checked)
if (typeof(checkListe)!="undefined" && checkListe == "1")
lvPreviewFoot.innerHTML += '<input id="shidList" type="checkbox" checked onclick="showHideObj(this, \'liveFollow\');" />';
else
lvPreviewFoot.innerHTML += '<input id="shidList" type="checkbox" onclick="showHideObj(this, \'liveFollow\');" />';
showHideObj(document.getElementById("shidList"), 'liveFollow');
lvPreviewFoot.innerHTML += '<label for="shidList">' + lang_menu[0].LISTS + '</label>';
//Modifiche minori (default = not checked)
if (typeof(checkModificheMinori)!="undefined" && checkModificheMinori == "1")
lvPreviewFoot.innerHTML += '<input id="showDiffR" type="checkbox" checked />';
else
lvPreviewFoot.innerHTML += '<input id="showDiffR" type="checkbox" />';
lvPreviewFoot.innerHTML += '<label for="showDiffR">'+ lang_menu[0].LOWDIFF + '</label>';
//Pannello (default = checked)
if (typeof(checkPannello)!="undefined" && checkPannello == "0")
lvPreviewFoot.innerHTML += '<input id="shidRC" type="checkbox" onclick="showHideObj(this, \'divTabRC\');" />';
else
lvPreviewFoot.innerHTML += '<input id="shidRC" type="checkbox" checked onclick="showHideObj(this, \'divTabRC\');" />';
showHideObj(document.getElementById("shidRC"), 'divTabRC');
lvPreviewFoot.innerHTML += '<label for="shidRC">' + lang_menu[0].RCLABEL + '</label>';
//Show Bot (default = checked)
if (typeof(checkNienteBot)!="undefined" && checkNienteBot == "0")
lvPreviewFoot.innerHTML += '<input id="showBot" type="checkbox" />';
else
lvPreviewFoot.innerHTML += '<input id="showBot" type="checkbox" checked />';
lvPreviewFoot.innerHTML += '<label for="showBot">' + lang_menu[0].NOBOTS + '</label>';
//Solo IP (default = not checked)
if (typeof(checkSoloIP)!="undefined" && checkSoloIP == "1")
lvPreviewFoot.innerHTML += '<input id="showIP" type="checkbox" checked />';
else
lvPreviewFoot.innerHTML += '<input id="showIP" type="checkbox" />';
lvPreviewFoot.innerHTML += '<label for="showIP">' + lang_menu[0].IPONLY + ' • </label>';
 
//RC (default = checked)
if (typeof(checkRC)!="undefined" && checkRC == "0")
lvPreviewFoot.innerHTML += '<input id="showRC" type="checkbox" />';
else
lvPreviewFoot.innerHTML += '<input id="showRC" type="checkbox" checked />';
lvPreviewFoot.innerHTML += '<label for="showRC">' + lang_menu[0].RCSHOW + ' • </label>';
//Log (default = checked)
if (typeof(checkLog)!="undefined" && checkLog == "0")
lvPreviewFoot.innerHTML += '<input id="showLog" type="checkbox" />';
else
lvPreviewFoot.innerHTML += '<input id="showLog" type="checkbox" checked />';
lvPreviewFoot.innerHTML += '<label for="showLog">' + lang_menu[0].LOGSHOW + ' • </label>';
 
lvPreviewFoot.innerHTML += '<span id="selectNS" />';
if (lrcPreviewHeight) document.getElementById('livePreview').style.height = lrcPreviewHeight;
 
//Get contact list from property file
var _lstContact = lstContact;
var _len = lstContact.length;
lstContact = new Array();
for (var _i=0; _i<_len; _i++)
lstContact[_lstContact[_i]] = { ts: 0 };
 
//Get IPclass list from property file
var _lstIPClass = lstIPClass;
var _len = lstIPClass.length;
lstIPClass = new Array();
for (var _i=0; _i<_len; _i++)
lstIPClass[_lstIPClass[_i]] = { ts: 0 };
 
//Get trusted list from property file
var _lstHidden = lstHidden;
var _len = lstHidden.length;
lstHidden = new Array();
for (var _i=0; _i<_len; _i++)
lstHidden[_lstHidden[_i]] = { ts: 0 };
updateHidden();
// Main
liveSysop();
}
});
 
/* </source> */