Utente:Wim b/cambiastato.js
Nota: dopo aver pubblicato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti.
- Firefox / Safari: tieni premuto il tasto delle maiuscole Shift e fai clic su Ricarica, oppure premi Ctrl-F5 o Ctrl-R (⌘-R su Mac)
- Google Chrome: premi Ctrl-Shift-R (⌘-Shift-R su un Mac)
- Internet Explorer / Edge: tieni premuto il tasto Ctrl e fai clic su Aggiorna, oppure premi Ctrl-F5
- Opera: premi Ctrl-F5.
/* <pre><nowiki> */
function deluxeHistoryLoader() {
if (document.URL.indexOf("&action=history")==-1) return;
botsDeluxeHistory = "BimBot||RamaccoloBot||OlandoBot||"
sysopsDeluxeHistory = "Daniele||Diablo||The Doc||Pietrodn||Snowdog||Wim b||"
sysopsList = sysopsDeluxeHistory.split("||")
botsList = botsDeluxeHistory.split("||")
var lis = document.getElementById("pagehistory").getElementsByTagName("li");
for (i=0; i<lis.length; i++) {
spanNode = lis[i].getElementsByTagName("span");
username = spanNode[0].childNodes[0].childNodes[0].nodeValue;
// check le statut du contributeur
var className = "history-user";
// bot ?
for (j=0;j<botsList.length;j++) {
if (botsList[j].indexOf(username)==0) {
className = "history-user-bot"
break;
}
}
// sysop ?
for (j=0;j<sysopsList.length;j++) {
if (sysopsList[j].indexOf(username)==0) {
className = "history-user-sysop"
break;
}
}
// ip ?
var ip = /\d{1,3}\.\d{1,3}.\d{1,3}.\d{1,3}/;
if (ip.exec(username)) {
className = "history-user-ip"
}
//lis[i].setAttribute("class", className);
lis[i].innerHTML = "<div class=\"" + className + "\">" + lis[i].innerHTML + "</div>"
// bug causé par le script par défaut de Mediawiki, à court-circuiter malheureusement..
inputNodes = lis[i].getElementsByTagName("input");
for (j=0;j<inputNodes.length;j++) {
inputNodes[j].style.visibility='visible';
}
for (j=0;j<spanNode.length;j++) {
if(spanNode[j].getAttribute("class")=="history-user") {
spanNode[j].setAttribute("class", className)
}
}
}
}
addLoadEvent(deluxeHistoryLoader)
/* </nowiki></pre> */