//<source lang="javascript">
//Based on original script by ]
//For the new trial at
document.write('<script type="text/javascript"' +
'src="http://en.wikipedia.org/w/index.php?title=User:Henrik/js/automod.js' +
'&action=raw&ctype=text/javascript&dontcountme=s"></script>');
afch_declines = Array();
afch_accepts = Array();
afch_accepts = 'accepted';
afch_accepts = 'accepted';
afch_declines = 'already%20exists';
afch_declines = 'not%20verifiable';
afch_declines = 'not%20a%20notable%20person';
afch_declines = 'not%20a%20notable%20entity';
afch_declines = 'not%20a%20notable%20website';
afch_declines = 'not%20a%20notable%20corporation';
afch_declines = 'not%20a%20notable%20band%20or%20musician';
afch_declines = 'dictionary%20definition';
afch_declines = 'lacks%20context';
afch_declines = 'copyright%20violation';
afch_declines = 'blank%20entry';
afch_declines = 'advertising';
afch_declines = 'neologism';
afch_declines = 'not%20in%20English';
afch_declines = 'appears%20to%20be%20a%20joke';
afch_declines = 'not%20neutrally%20written';
afch_declines = 'defamatory';
afch_declines = 'not%20suitable%20for%20wikipedia';
afch_declines = 'declined';
function afc_helper() {
if (auto_mod())
return;
var anchors = new Array();
{
var oldanchors = document.getElementById('bodyContent').getElementsByTagName('a');
for (var i=0; i < oldanchors.length; i++)
anchors = oldanchors;
}
var url_re = /\?title=Wikipedia talk:Articles_for_creation\/Submissions\/(+)&action=edit&/;
//var url_re = /\?title=User:Henrik\/sandbox\/(+)&action=edit&/;
var url, matches;
for (var i=0; i < anchors.length; i++) {
if (!(matches = anchors.href.match(url_re))
|| (anchors.parentNode.parentNode.tagName != 'H2'))
continue;
bla = "<span id=\"afc-helper-accept\" style=\"background-color: #A0FFA0;\">";
for (var key in afch_accepts) {
if( !afch_accepts.hasOwnProperty(key) ) { // Twinke workaround?
continue;
}
link = "javascript:afc_vote('"+escape(anchors.href)+"','"+key+"','"+afch_accepts+"','accept')";
bla += "";
}
bla += "</span><span id=\"afc-helper-decline\" style=\"background-color: #ffcece;\">";;
for (var key in afch_declines) {
if( !afch_declines.hasOwnProperty(key) ) { // Twinke workaround?
continue;
}
link = "javascript:afc_vote('"+escape(anchors.href)+"','"+key+"','decline - "+afch_declines+"','')";
bla += "";
}
bla += "</span>";
anchors.parentNode.innerHTML += bla;
}
}
function afc_vote(edit_link,type,reason,action) {
var type2 = type;
if (type == "manual")
type2 = "accept";
var url = edit_link +
'&amfind='+escape("==(.*)==")+
'&amreplace='+escape('$0\n{{afc completed|'+action+'}}')+
'&amlocal=1'+
'&amaddafter='+escape("{{subst:afc "+type2+"}} ~~"+"~~\n"+"{{subst:afc b}}") +
'&amsummary='+escape(reason);
if (action == '') {
url += "&amautosave=yes;";
}
window.location.href = url;
if (action == "accept" && type != "manual") {
title = window.prompt("Move page to mainspace?");
url = "http://en.wikipedia.org/w/index.php?title=Special:MovePage/"+encodeURIComponent(mw.config.get('wgPageName'))+"&wpReason=Request%20at%20]&wpNewTitle=" + escape(title);
window.open(url, "afd_helper_vote");
}
}
$(afc_helper);
// </source>