User:X!/topcontrib.js

// User:Ais523/topcontrib.js // This script color-codes lines according to who has the top contribution for a page. // addOnloadHook(function  {  if((location.href.indexOf("Special:Contributions")!=-1||      location.href.indexOf("Special%3AContributions")!=-1) &&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?ais523")==-1)    // the ais523 in the line above is meant to be ais523, not your username; it's     // to avoid a clash with a couple of other scripts I've written. Feel free to     // expand it to avoid clashes with other contribs-manipulating scripts, though.  {    var i,li,a;    li=document.getElementById("bodyContent");    li=li.getElementsByTagName("li");    i=-1;    a=new Array;    while(++i0) s="#CCCCFF"; else s="#FFCCCC"; if(a[t]!=undefined) s=(a[t]=="#CCCCFF"?"#CCFFFF":"#FFFFCC"); else a[t]=s; li[i].innerHTML=""+li[i].innerHTML+""; } } }); //  //