User:Cryptic/suffrage.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

//<pre>
function suffrage()
{
  if (document.title.indexOf("Wikipedia:Arbitration Committee Elections January 2006/Vote/") == 0)
    {
      var ols = document.getElementsByTagName('ol');
      var ol;
      for (ol = 0; ol < ols.length; ++ol)
        {
          var lis = ols[ol].getElementsByTagName('li');
          var li;
          for (li = 0; li < lis.length; ++li)
            {
              var as = lis[li].getElementsByTagName('a');
              var a;
              for (a = 0; a < as.length; ++a)
                {
                  if (as[a].getAttribute('href').indexOf("http://en.wikipedia.org/wiki/User:") == 0)
                    {
                      //Uncomment following line to make username links Really Big. =)
                      //as[a].setAttribute('style', 'font-size:200%');
                      as[a].setAttribute('href', "http://en.wikipedia.org/w/index.php?title=Special:Contributions&limit=150&go=first&target=" + as[a].getAttribute('href').substring(34));
                      as[a].setAttribute('class', as[a].getAttribute('class') + " modified");
                    }
                }
            }
        }
    }
}

addOnloadHook(suffrage);
//</pre>