Jump to content

User:Cryptic/suffrage.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//<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>