User:DerHexer/accounteligibility.js

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
 function checkaccounteligibility() {
   var as = document.getElementsByTagName('a');
   for(i=0;i<as.length;i++){
     if(as[i].getAttribute('title')){
       if(as[i].getAttribute('title').search(/^User:/) != -1){
             var newurl = "http://tools.wmflabs.org/meta/accounteligibility/?user="+as[i].getAttribute('title').replace(/User:/,'').replace(/\s\(page.does.not.exist\)/,'')+"&wiki=&event=19";
             var newlink = document.createElement('a');
             newlink.setAttribute('href', newurl);
             var EditTextNode = document.createTextNode(" |CEA| ");
             newlink.appendChild(EditTextNode);
             as[i].parentNode.insertBefore( newlink, as[i].nextSibling );
       }
     }
   }
 }

 if(location.href.search(/Stewards\/elections.2011-2\/votes/) != -1) addOnloadHook(checkaccounteligibility);