User:Sisyph/ContribColors.js

/** * Présentation : Discussion Projet:JavaScript * Auteur : Chphe * */ function contribColors { var list = document.getElementById('bodyContent').getElementsByTagName('li'); for(var i=0; i<list.length; i++) {   var ind = list[i].childNodes.length-2; if(ind<=0) continue; var elem = list[i].childNodes[ind]; if(elem.nodeName=='SPAN' && elem.className != "mw-uctop") {       ind -= 2; if(ind<=0) continue; elem = list[i].childNodes[ind]; }   if(elem.nodeName=='SPAN' && elem.className == "mw-uctop") list[i].className = 'contrib-last'; else list[i].className = 'contrib-normal'; } } if(wgPageName == "Spécial:Contributions") addOnloadHook(contribColors);