User:Cryptic/suffrage.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.

//<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>