Utilisateur:Dake/monobook.js/deluxehistory noajax.js
Apparence
Note : après avoir enregistré la page, vous devrez forcer le rechargement complet du cache de votre navigateur pour voir les changements.
Mozilla / Firefox / Konqueror / Safari : maintenez la touche Majuscule (Shift) en cliquant sur le bouton Actualiser (Reload) ou pressez Maj-Ctrl-R (Cmd-R sur Apple Mac) ;
Firefox (sur GNU/Linux) / Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5./* <pre><nowiki> */
function deluxeHistoryLoader() {
if (document.URL.indexOf("&action=history")==-1) return;
botsDeluxeHistory = "AlphaBot||Badmood||Chlewbot||Chobot||CyeZBot||DasBot||Diderobot||Eskimbot||Fabbot||FlaBot||Gpvosbot||HasharBot||Hexabot||KocjoBot||Koyuki||Loveless||MMBot||MagnetiK-BoT||MedBot||MisterMatt Bot||MoriBot||Orthogaffe||PieRRoBoT||Probot||Robbot||RobotE||RobotQuistnix||SashatoBot||Solbot||StéBot||Ugur Basak Bot||YurikBot||Zwobot||"
sysopsDeluxeHistory = "ADM||Alex lbh||Alno||Alvaro||Anthere||Aoineko||Archeos||Aurevilly||Brion VIBBER||Caton||Colocho||Céréales Killer||Dake||Darkoneko||David Berardan||David.Monniaux||Didier||Eskimo||EyOne||Fabien1309||Fred.th||FvdP||GL||Greatpatton||Guillom||GôTô||Hashar||Hemmer||Inisheer||Iznogoud||Jastrow||Jd||Jean-no||Jeffdelonge||Jloriaux||Jyp||Kassus||Korg||Le gorille||Liquid 2003||Manchot||Markadet||Med||Mr Patate||Nataraja||Nojhan||Notafish||Pabix||Padawane||Papillus||Pe.nataf||Petrusbarbygere||Phe||Plyd||Poleta33||Pontauxchats||Popo le Chien||Poppy||Pseudomoi||RamaR||Roby||Ryo||Sam Hocevar||Seb35||Sebcaen||Sebjarod||Semnoz||Shaihulud||Ske||Solensean||Solveig||Sébastien Savard||Tarquin||Tieno||Tipiac||Traeb||Traroth||Turb Paris||Valérie75||Vargenau||Vincent Ramos||Wart Dark||Weft||Woww||Xfigpower||Xmlizer||Yann||Youssefsan||Yug||~Pyb||"
sysopsList = sysopsDeluxeHistory.split("||")
botsList = botsDeluxeHistory.split("||")
var pageHistory = document.getElementById("pagehistory");
if(!pageHistory) return;
var lis = 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)
}
}
}
}
$(deluxeHistoryLoader);
/* </nowiki></pre> */