User:Jarry1250/rfaform.js

//Add easy RFA-form buttons

function rfaform{ var ols = document.getElementsByTagName("ol"); for(var b = ols.length-3; b < ols.length; b++){ var lis = ols[b].getElementsByTagName("li"); for(var i = 0; i < lis.length; i++){ var as = lis[i].getElementsByTagName("a"); for(var a = 0; a < as.length; a++){ if(as[a].href.match("wiki/User") == "wiki/User" && as[a].href.match("/R") != "/R"){ var username = as[a].href.replace("http://en.wikipedia.org/wiki/User:",""); username = username.replace("http://en.wikipedia.org/wiki/User_talk:",""); var link = document.createElement("a"); link.href = "http://toolserver.org/~soxred93/rfap/index.php?name=" + username; link.target = "_blank"; link.appendChild(document.createTextNode("(form)")); lis[i].appendChild(document.createTextNode(" ")); lis[i].appendChild(link); break; } } } } } if(document.location.href.match("http://en.wikipedia.org/wiki/Wikipedia:Requests_for_admin") == "http://en.wikipedia.org/wiki/Wikipedia:Requests_for_admin"){ $(rfaform); }