User:^yamakiri/monobook.js

// originally from User:DerHexer // get URL parameters (used for page type variables) var UrlParameters = new Array ; readparams; function readparams { var asReadInUrlParameters; var asReadInUrlParameter; // Get URL parameters asReadInUrlParameters = location.search.substring(1, location.search.length).split("&"); for (i = 0; i < asReadInUrlParameters.length; i++) { asReadInUrlParameter = asReadInUrlParameters[i].split("="); UrlParameters[decodeURIComponent(asReadInUrlParameter[0])] = decodeURIComponent(asReadInUrlParameter[1]); } }

if(!usersignature) var usersignature = '\~\~\~\~'        //standard signature if(!automaticblock) var automaticblock=false; if(!automaticwarning) var automaticwarning=false; function fillActionPageRevert { if (UrlParameters["blockreason"] > "" && UrlParameters["blockduration"] > "") { document.forms["blockip"].wpBlockReason.value = UrlParameters["blockreason"]; document.forms["blockip"].wpBlockOther.value = UrlParameters["blockduration"]; var blocktime = UrlParameters["blockduration"]; var isBlocked = UrlParameters["title"].replace(/Special:Block\//, ''); if (isBlocked.search(/\d+\.\d+\.\d+\.\d+/) == -1) { if (prompt('Are you sure to block, ' + isBlocked + ' ?','ja')) { var newurl = "http://en.wikipedia.org/w/index.php?title=User:" + isBlocked + "&action=edit&addtemplate=2"; if(automaticblock) { window.setTimeout(function { document.forms["blockip"].wpBlock.click; }, 100); } }    } else { var newurl = "http://en.wikipedia.org/w/index.php?title=User_talk:" + isBlocked + "&action=edit&addtemplate=1&blockduration=" + blocktime; if(automaticblock) { window.setTimeout(function { document.forms["blockip"].wpBlock.click; }, 100);} }    if(automaticblock) { if ((UrlParameters["blockduration"] != 'infinite') || (isBlocked.search(/\d+\.\d+\.\d+\.\d+/) == -1)) { window.setTimeout(function { location.href = newurl; }, 1000); } } }  if (UrlParameters["diff"] > "") { function searchRollbackLink { var tds = document.getElementsByTagName("td"); for (var i=0; i<tds.length; i++) { var td = tds[i]; if (td.className != "diff-ntitle") continue; var as = td.getElementsByTagName("a"); for (var j=0; j<as.length; j++) { var a = as[j]; if (!/.*action=rollback.*/(a.href)) continue; var newlink = document.createElement('a'); a.setAttribute('accesskey', "s"); newlink.setAttribute('href', a.href); var EditTextNode = document.createTextNode("normal rollback"); newlink.appendChild(EditTextNode); as[j].parentNode.insertBefore( newlink, as[j].nextSibling ); as[j].parentNode.insertBefore( document.createTextNode(' | '), as[j].nextSibling ); return a;        } }      return tds; }    function RollAndSpam(rolluri) { location.href = rolluri; var backrolled = rolluri.split("from=")[1].split("&token=")[0]; var vandalizedpage = wgPageName; var uri = "http://en.wikipedia.org/w/index.php?title=User talk:" + backrolled + "&vandalizedpage=" + vandalizedpage + "&action=edit&spam=1"; window.setTimeout(function { location.href = uri; }, 500); }    var revlink = searchRollbackLink; revlink.onclick = function { RollAndSpam(revlink.href); return false; } }  if ( (UrlParameters["spam"] > "") && (UrlParameters["vandalizedpage"] > "") ) { document.editform.wpMinoredit.checked=true; var splitted = document.forms["editform"].wpTextbox1.value.split("<!--"); var lastsplitted = splitted[splitted.length-1]; var jetzt = new Date; var thisyear = jetzt.getFullYear.toString; var thismonth = jetzt.getMonth+1; if (thismonth < 10) { thismonth = "0" + thismonth; } var thisday = jetzt.getDate; if (thisday < 10) { thisday = "0" + thisday; } var thishour = jetzt.getHours; if (thishour < 10) { thishour = "0" + thishour; } var thisminute = jetzt.getMinutes; if (thisminute < 10) { var thisminute2 = "0" + thisminute; } else { var thisminute2 = thisminute; } var thissecond = jetzt.getSeconds; if (thissecond < 10) { thissecond = "0" + thissecond; } var thistime = thisyear + thismonth + thisday + thishour + thisminute + thissecond; var req; if (req = newRequest) { var text = '/w/api.php?format=xml&action=query&prop=revisions&titles=' + wgPageName + '&rvlimit=1&rvprop=timestamp&rvdir=older&rvstart=' + thistime; req.open("GET", text, false); req.send(""); var lasttimestamp = req.responseXML.getElementsByTagName("rev")[0].getAttribute('timestamp'); var lastminute = lasttimestamp.match(/([^\-]*)\-([^\-]*)\-([^T]*)T([^\:]*)\:([^\:]*)\:([^Z]*)Z/); lastyear = RegExp.$1; lastmonth = RegExp.$2; lastday = RegExp.$3; lasthour = parseInt(RegExp.$4)+1; if (lasthour < 10) { lasthour = "0" + lasthour.toString; } else { lasthour = lasthour.toString } lastminute = RegExp.$5; lastsecond = RegExp.$6; var lastdate = Date.parse(lastmonth + ' ' + lastday + ' ' + lastyear + ' ' + lasthour + ':' + lastminute + ':' + lastsecond); var thisdate = Date.parse(thismonth + ' ' + thisday + ' ' + thisyear + ' ' + thishour + ':' + thisminute + ':' + thissecond); }      var matchedtemplate = lastsplitted.match(/uw\-([^\d]*)(\d)/); var matchedtemplatename = RegExp.$1; var matchednumber = RegExp.$2; var matchedtemplate2 = lastsplitted.match(/Template\:Test(\d)/); var matchednumber2 = RegExp.$1; if (lastsplitted.search(/Uw\-Blank(\d)/) != -1) { var matchednumber = RegExp.$1; var matchedtemplatename = 'vandalism'; } else if (lastsplitted.search(/Uw\-Blank[^\d]/) != -1) { var matchednumber = 1; var matchedtemplatename = 'vandalism'; }      if ((lastsplitted.search(/Uw\-bv/) != -1) || (lastsplitted.search(/Blatantvandal/) != -1) || (lastsplitted.search(/longterm/) != -1)) { var matchednumber = 4; var matchedtemplatename = 'vandalism'; }      if ((!matchedtemplatename) || (matchedtemplatename == 'cluebotwarning') || (matchedtemplatename == 'block') || (matchedtemplatename == 'huggle') || (matchedtemplatename == 'huggleblock') || (matchedtemplatename.search(/\d/) != -1)) { var matchedtemplatename = 'vandalism'; }      if (document.forms["editform"].wpTextbox1.value == "") { document.editform.wpSummary.value = "Caution: " + matchedtemplatename + " on \[\[" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\]\]"; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\{\{subst\:uw-" + matchedtemplatename + "2\|" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\}\} " + usersignature; if(automaticwarning) { document.editform.wpSave.click; window.setTimeout(function { window.close; }, 1000); } } else { var confirmcontinue = true; var oldip = false; if ((thisdate-lastdate) < 20000) { confirmcontinue = confirm('This IP was warned less than 20 second ago. There might be an edit conflict. Do you want to continue nevertheless?'); } else if ((thisdate-lastdate) > 86400000) { var oldip = true; }        if (confirmcontinue && oldip) { document.editform.wpSummary.value = "Caution: " + matchedtemplatename + " on \[\[" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\]\]"; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\n\n\{\{subst\:uw-" + matchedtemplatename + "2\|" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\}\} " + usersignature; if(automaticwarning) { document.editform.wpSave.click; window.setTimeout(function { window.close; }, 1000); } } else if (confirmcontinue && !oldip) { if ((matchednumber == 4) || (matchednumber2 == 4)) { if (wgTitle.match(/\d+\.\d+\.\d+\.\d+/)) { function newRequest {                 try { if (window.XMLHttpRequest) { return new XMLHttpRequest; } else { return new ActiveXObject("MSXML2.XMLHTTP"); }                 } catch (e) { return false; }               }                var req; if (req = newRequest) { var text = "/w/api.php?format=xml&action=query&list=logevents&letype=block&letitle=User:" + wgTitle; req.open("GET", text, false); req.send(""); var blocks = req.responseXML.getElementsByTagName("block"); if (blocks.length > 0) { if (blocks[0].getAttribute('duration').search(/\./) == -1) { var duration = blocks[0].getAttribute('duration'); } else { var duration = "12 hours"; }                 } else { var duration = "12 hours"; }               }                if (duration.search(/(\d+) (\w+)/) != -1) { var newblockdurationnumber = 2 * RegExp.$1; var lastblockdurationname = RegExp.$2; if (lastblockdurationname.search(/s\b/) != -1) { var newblockdurationname = lastblockdurationname; } else { var newblockdurationname = lastblockdurationname + "s"; }                 var blockurl = "http://en.wikipedia.org/w/index.php?title=Special:Block/" + wgTitle + "&blockduration=" + newblockdurationnumber + "%20" + newblockdurationname + "&blockreason=vandalism"; } else { var blockurl = "http://en.wikipedia.org/w/index.php?title=Special:Block/" + wgTitle; }              } else { var blockurl = "http://en.wikipedia.org/w/index.php?title=Special:Block/" + wgTitle + "&blockduration=infinite&blockreason=vandalism-only%20account"; }              if(automaticwarning) { window.setTimeout(function { location.href = blockurl; }, 1000); } } else { document.editform.wpSummary.value = "Final warning: " + matchedtemplatename + " on \[\[" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\]\]"; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\n\n\{\{subst\:uw-" + matchedtemplatename + "4\|" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\}\} " + usersignature; if(automaticwarning) { document.editform.wpSave.click; window.setTimeout(function { window.close; }, 1000); } }        }       }   }   if (UrlParameters["addtemplate"] > '') { document.editform.wpMinoredit.checked=true; if (UrlParameters["addtemplate"] == 1) { document.editform.wpSummary.value = "You have been temporarily blocked."; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\n\n\{\{subst\:uw-block1\|time=" + UrlParameters["blockduration"] + "\|reason\=vandalism\|subst\=subst\:\}\}"; } else if (UrlParameters["addtemplate"] == 2) { document.editform.wpSummary.value = "\{\{indefblockeduser\}\}"; document.forms["editform"].wpTextbox1.value = "\{\{indefblockeduser\}\}"; }    document.editform.wpSave.click; window.setTimeout(function { window.close; }, 1000); } }

if ( (UrlParameters["blockreason"] > "") || (UrlParameters["diff"] > "") || ( (UrlParameters["spam"] > "") && (UrlParameters["vandalizedpage"] > "") ) || (UrlParameters["addtemplate"] > '') ) { addOnloadHook(fillActionPageRevert); }

/** function QueryString(qString) { this.string = qString; this.params = {};
 * Maps the querystring to an object
 * Functions:
 * QueryString.exists(key)
 * returns true if the particular key is set
 * QueryString.get(key)
 * returns the value associated to the key
 * QueryString.equals(key, value)
 * returns true if the value associated with given key equals given value
 * QueryString.toString
 * returns the query string as a string
 * QueryString.create( hash )
 * creates an querystring and encodes strings via encodeURIComponent and joins arrays with |
 * In static context, the value of location.search.substring(1), else the value given to the constructor is going to be used. The mapped hash is saved in the object.
 * Example:
 * var value = QueryString.get('key');
 * var obj = new QueryString('foo=bar&baz=quux');
 * value = obj.get('foo');
 * Example:
 * var value = QueryString.get('key');
 * var obj = new QueryString('foo=bar&baz=quux');
 * value = obj.get('foo');
 * value = obj.get('foo');

if( qString.length == 0 ) { return; }

qString.replace(/\+/, ' '); var args = qString.split('&');

for( var i in args ) { if( typeof( args[i] ) != 'string' ) { continue; } var pair = args[i].split( '=' ); var key = decodeURIComponent( pair[0] ), value = key;

if( pair.length == 2 ) { value = decodeURIComponent( pair[1] ); }

this.params[key] = value; } }

QueryString.static = null;

QueryString.staticInit = function { if( QueryString.static == null ) { QueryString.static = new QueryString(location.search.substring(1)); } }

QueryString.get = function(key) { QueryString.staticInit; return QueryString.static.get(key); };

QueryString.prototype.get = function(key) { return this.params[key] ? this.params[key] : null; };

QueryString.exists = function(key) { QueryString.staticInit; return QueryString.static.exists(key); }

QueryString.prototype.exists = function(key) { return this.params[key] ? true : false; }

QueryString.equals = function(key, value) { QueryString.staticInit; return QueryString.static.equals(key, value); }

QueryString.prototype.equals = function(key, value) { return this.params[key] == value ? true : false; }

QueryString.toString = function { QueryString.staticInit; return QueryString.static.toString; }

QueryString.prototype.toString = function { return this.string ? this.string : null; }

QueryString.create = function( arr ) { var resarr = Array; for( var i in arr ) { if( typeof arr[i] == 'object' ){ var v = Array; for(var j in arr[i] ) { v[j] = encodeURIComponent( arr[i][j] ); } resarr.push( encodeURIComponent( i ) + '=' + v.join('|')  ); } else { resarr.push( encodeURIComponent( i ) + '=' + encodeURIComponent( arr[i] ) ); } }

return resarr.join('&'); } QueryString.prototype.create = QueryString.create;

addOnloadHook(doAddQuickPreview); function doAddQuickPreview { if ((wgAction != "edit") && (wgAction != "submit")) return; var qbutton = document.getElementById("wpPreview").cloneNode(false); qbutton.value = "Quick preview"; qbutton.type="button"; qbutton.tabindex="6"; qbutton.accessKey="g"; qbutton.id="dlQuickPreview"; qbutton.title="Preview your changes"; qbutton.addEventListener("click", doQuickPreview, false); document.getElementById("wpPreview").parentNode.insertBefore(qbutton,document.getElementById("wpDiff")); }

function doQuickPreview { var bt = document.getElementById("dlQuickPreview"); document.getElementById("contentSub").innerHTML = "Getting preview"; bt.value="Getting preview"; bt.disabled=true; var form = document.editform; var postData = { 'wpMinoredit': form.wpMinoredit.checked, 'wpWatchthis': form.wpWatchthis.checked, 'wpStarttime': form.wpStarttime.value, 'wpEdittime': form.wpEdittime.value, 'wpAutoSummary': form.wpAutoSummary.value, 'wpEditToken': form.wpEditToken.value, 'wpSummary': "Quick preview", 'wpTextbox1': document.editform.wpTextbox1.value }; var addr = document.URL; addr = addr.replace("&action=edit", "&action=submit"); addr += "&wpPreview=true&live=true"; var qwxmlhttp = sajax_init_object(null); qwxmlhttp.overrideMimeType('text/xml'); qwxmlhttp.open( 'POST', addr, true); qwxmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); qwxmlhttp.onload = function { document.getElementById("wikiPreview").innerHTML =  unescape(qwxmlhttp.responseText.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&").replace(/&quot;/g,'"'));  bt.disabled=false;  bt.value = "Quick preview";  document.getElementById("contentSub").innerHTML = "";  }  qwxmlhttp.send(QueryString.create(postData)); } function addForceSummary {    if(!/&action=edit/.test(window.location.href) && !/&action=submit/.test(window.location.href)) return;    if(/&section=new/.test(window.location.href)) return;    if(!document.forms.editform) return;    document.forms.editform.wpSave.onclick = forceSummary;    // The second invocation of this will cause extra annoyance if there is no edit summary present. If there *is* an edit summary, the dialog box will not appear.    document.forms.editform.wpSave.onfocus = forceSummary; } function forceSummary {    if(!document.forms.editform.wpSummary.value.replace(/^(?:\/\\*.*\\*\/)? *(.*) *$/,'$1'))   {        var r = prompt('Are you sure you want to submit without adding a summary?\nTo add a summary, type it in the box below:',document.forms.editform.wpSummary.value); if(r == null) { return false; } document.forms.editform.wpSummary.value = r;   } return true; } addOnloadHook(addForceSummary); /* */ // addPurge addOnloadHook(function {    var hist; var url;    if (!(hist = document.getElementById('ca-history') )) return;    if (!(url = hist.getElementsByTagName('a')[0] )) return;    if (!(url = url.href )) return;    addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'), 'purge', 'ca-purge', 'Purge server cache for this page', '0'); }); //

/* Edits a page according to parameters passed in the URL. e.g. http://en.wikipedia.org/w/index.php?title=Foo&action=edit&amaddbefore=My+text&amsummary=Adding+My+text will add the words "My text" at the start of the Foo article (on a new line), with the given edit summary. Other parameters include: - amaddafter - adds text at the end of the article - amatstring - makes amaddafter/before add after/before the first occurrence of the given string - amclear   - clears the article before adding text - amfind and amreplace - replaces all occurrences of the find string by the replace string

if ((typeof auto_mod_loaded == 'undefined')   || !auto_mod_loaded) { auto_mod_loaded = true; auto_mod_exectd = false;

function am_make_url(title, before, after, summary) { return 'http://en.wikipedia.org/w/index.php?title='+escape(title)+ '&action=edit'+ '&amaddbefore='+escape(before)+'&amaddafter='+escape(after)+ '&amsummary='+escape(summary); }

function am_get_title { //Avoids problems with &amp; etc, but will also include ' - edit this page', etc return document.title.substr(0, document.title.lastIndexOf(' - Wikipedia, the free')); }

function am_tidy_title { var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href; editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit')); return unescape(editlk); }

function am_get_query_vars{ var res = new Array; var pairs = location.search.substring(1).split("&"); for(var i=0; i < pairs.length; i++){ var pair = pairs[i].split("="); res[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' '); }     return  res; }

function am_add_li(portlet, url, text, id, title) { var tabs = document.getElementById('p-'+portlet).getElementsByTagName('ul')[0] var na = document.createElement('a'); na.href = url; na.id = id; na.appendChild(document.createTextNode(text)); if (title) na.title = title; var li = document.createElement('li'); if (id) li.id = id; li.appendChild(na); tabs.appendChild(li); return li; }

function am_guess_date { var monthnames = new Array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var today = new Date; return today.getUTCFullYear + ' ' + monthnames[today.getUTCMonth] + ' ' + today.getUTCDate; }

function am_edit_string(s, insertion, loc) { return s.substring(0, loc) + insertion + s.substring(loc); }

function auto_mod { if (auto_mod_exectd) return false; auto_mod_exectd = true; qvars = am_get_query_vars; if (qvars['action']=='edit') { if (qvars['amnull']) { document.getElementById('editform').submit; return true; }     if (qvars['amaddafter'] || qvars['amaddbefore'] || qvars['amreplace']) { var summ_el = document.getElementById('wpSummary'); if (summ_el.value != '' && summ_el.value.substr(summ_el.value.length - 3, 3) != '*/ ') { // have already added summary return true; }       var text = document.getElementById('wpTextbox1'); if (qvars['amclear']) text.value = ''; if (qvars['amfind'] && qvars['amreplace']) text.value = text.value.replace(new RegExp(qvars['amfind'], "g"), qvars['amreplace']); if (qvars['amaddafter']) { var loc = text.value.length; if (qvars['amatstring']) { var newloc = text.value.indexOf(qvars['amatstring']); if (newloc > -1) { loc = newloc + qvars['amatstring'].length; }           }

var toadd = qvars['amaddafter']; if ((loc == text.value.length && text.value.charAt(loc - 1) != '\n') || '\n\r'.indexOf(text.value.charAt(loc)) > -1) toadd = '\n' + toadd; text.value = am_edit_string(text.value, toadd, loc); }       if (qvars['amaddbefore']) { var loc = 0; if (qvars['amatstring']) { var newloc = text.value.indexOf(qvars['amatstring']); if (newloc > -1) { loc = newloc; }           }

var toadd = qvars['amaddbefore']; if ((loc == 0 && text.value.charAt(loc) != '\n') || '\n\r'.indexOf(text.value.charAt(loc - 1)) > -1) toadd += '\n'; text.value = am_edit_string(text.value, toadd, loc); }       summ_el.value += (qvars['amsummary'] || ' '); document.getElementById('editform').submit; }     return true; }   return false; }

function am_add_onload(f) { // borrowed from WP:US if (window.addEventListener) window.addEventListener("load",f,false); else if (window.attachEvent) window.attachEvent("onload",f); }

} // end if auto_mod_loaded

// //

/************* afd Helper ************/ // see User:Jnothman/afd_helper

importScript("User:Jnothman/automod.js");

afdh_signature = ''+'~'; afdh_summaryprompt = true; afdh_useicons = false;

afdh_shortcuts = Object; afdh_shortcuts['d'] = 'Delete'; afdh_shortcuts['k'] = 'Keep'; afdh_shortcuts['m'] = 'Merge'; afdh_shortcuts['mv'] = 'Move'; afdh_shortcuts['rd'] = 'Redirect'; afdh_shortcuts['rw'] = 'Rewrite'; afdh_shortcuts['t'] = 'Transwiki'; afdh_shortcuts['wd'] = 'Weak delete'; afdh_shortcuts['sd'] = 'Strong delete'; afdh_shortcuts['sp'] = 'Speedy delete'; afdh_shortcuts['sk'] = 'Strong keep'; afdh_shortcuts['wk'] = 'Weak keep'; afdh_shortcuts['spk'] = 'Speedy keep'; afdh_shortcuts['c'] = 'Comment';

afdh_icons = Object; afdh_icons['d'] = afdh_icons['wd'] = afdh_icons['sd'] = afdh_icons['sp'] = 'Symbol delete vote.svg'; afdh_icons['k'] = afdh_icons['sk'] = afdh_icons['wk'] = 'Symbol keep vote.svg'; afdh_icons['m'] = 'Symbol merge vote.svg'; afdh_icons['c'] = 'Symbol comment vote.svg';

afdh_commscs = Object; afdh_commscs['pn'] = 'per nom.';

function afd_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[i] = oldanchors[i]; }   var url_re = /\?title=Wikipedia:Articles_for_deletion\/([^&]+)&action=edit&/; var url, matches; for (var i=0; i < anchors.length; i++) { if (!(matches = anchors[i].href.match(url_re))        || (matches[1].substr(0, 4) == 'Log/')) continue; var na = document.createElement('a'); na.href = "javascript:afd_vote('"+escape(anchors[i].href)+"')"; na.title = "Vote on deletion of "+unescape(matches[1]); var inlink = document.createElement('sup'); inlink.appendChild(document.createTextNode('vote')); na.appendChild(inlink); anchors[i].parentNode.insertBefore(na, anchors[i].nextSibling); }

if (am_get_title.indexOf(':') == -1) am_add_li('tb', 'javascript:afd_nominate', 'Nominate AFD', '', 'Nominate this article for deletion'); }

function afd_vote(edit_link) { var shortcuts_list = ''; for (var key in afdh_shortcuts) shortcuts_list += key + ': ' + afdh_shortcuts[key] + '; '; var vote = window.prompt("Enter your vote.  (Shortcuts available are: "+shortcuts_list+")"); if (!vote) return; var icon_link = ''; if (afdh_useicons && afdh_icons[vote.toLowerCase]) icon_link = ' '; if (afdh_shortcuts[vote.toLowerCase]) vote = afdh_shortcuts[vote.toLowerCase];

shortcuts_list = ''; for (var key in afdh_commscs) shortcuts_list += key + ': ' + afdh_commscs[key] + '; '; var comment = window.prompt("Enter your comment. (Shortcuts available are: "+shortcuts_list+")"); if (typeof comment != 'string') return; if (afdh_commscs[comment.toLowerCase]) comment = afdh_commscs[comment.toLowerCase];

var summary = vote; if (afdh_summaryprompt) if (!(summary = window.prompt("Enter the edit summary:", summary))) summary = vote; var url = edit_link + '&amaddafter='+escape("* "+icon_link+vote+" "+comment+" "+afdh_signature+" "+""+"~") + '&amsummary='+escape(summary);

if (window.location.href.indexOf("/Log/") == -1) window.location.href = url; else window.open(url, "afd_helper_vote"); }

function afd_nominate { var title = am_get_title; var log_date = window.prompt("This should be the date of the latest AFD log. Change it if necessary.", am_guess_date); if (!log_date) return; var reason = window.prompt("Please justify your AFD nomination of "+title+":"); if (!reason) return; var cat = window.prompt("Please categorize your nomination: M: Media and music; O: Organisation, company, or product; B: Biographical; S: Society; W: Web/Internet; G: Games/Sport; T: Science/Technology; F: Fiction and the arts; P: Places or transportation; I: Unclassifiable; ?: Unsure"); if (!cat) cat="U"; window.open(am_make_url(title, , , 'nomination for deletion'), 'afdhn1'); window.open(am_make_url('Wikipedia:Articles for deletion/Log/'+log_date, , , 'Nominating '+title+' for deletion') + "&amatstring=TOP+of+the+following+list+-->", 'afdhn3'); window.location.href = am_make_url('Wikipedia:Articles for deletion/'+title, , , 'nominated for deletion'); }

addOnloadHook(afd_helper);

//