User:AKGhetto/speedydelete.js

/* Put some functions in the toolbox for the anti-vandal whack-a-mole game. */ //  // ************** // Warnings // **************

function whackEdit (message, msg2, summary) { var f = document.editform ; var tbox = document.editform.wpTextbox1 ; var a = "" + (window.getSelection ? window.getSelection                                     : document.getSelection ? document.getSelection                                                              : document.selection.createRange.text); if (msg2 != "") { a = prompt ("Article name?\n(Empty or Cancel for a generic message.)", a) ; if (a != null && a != "") { message = message.replace(/\|/,"|"+a) ; summary = summary.replace(/\|/,""+a) ; } else { message = msg2 ; summary = summary }   }

f.wpTextbox1.value = message + "\n\n" + f.wpTextbox1.value ; f.wpSummary.value = summary ; f.wpMinoredit.checked=false; f.wpWatchthis.checked=false; f.wpTextbox1.focus; if (f.wpTextbox1.scrollBottom || true) f.wpTextbox1.scrollBottom = f.wpTextbox1.scrollHeight ; } function whackReason { whackEdit ("", "", "Speedy Delete for |"); } function whackNonsense { whackEdit ("", "", " - CSD G1 - patent nonsense"); } function whackTest { whackEdit ("", "", " : CSD G2 - test page"); } function whackVand { whackEdit ("", "", " : CSD G3 - vandalism"); } function whackRepost { whackEdit ("", "", " : CSD G4 - previously deleted material"); } function whackBan { whackEdit ("",""," : CSD G5 - contributions made by a banned user"); } function whackHistmerge{ whackEdit ("",   "",    " : CSD G6 - history merge"); } function whackAuthor  { whackEdit ("", "",               " : CSD G7 - speedy request by only editor"); } function whackTalk{ whackEdit ("",  "",                " : CSD G8 - talk page of a deleted page"); } function whackMove{ whackEdit ("",   "",    " : CSD G9 - making way for a noncontroversial move"); } function whackEmpty  { whackEdit ("", "",               " : CSD A1 - very short articles without context"); } function whackForeign{ whackEdit ("",  "",                " : CSD A2 - foreign language article duplicated on other Wikimedia project"); } function whackNocontent{ whackEdit ("",   "",    " : CSD A3 - no content other than external links of whatever kind"); } function whackTranswiki  { whackEdit ("", "",               " : CSD A5 - transwikification completed"); } function whackAttack{ whackEdit ("",  "",                " : CSD A6 - insult / attack page"); } function whackBio{ whackEdit ("",   "",    "CSD A7 - non-notable biography / vanity about a person or persons which does not establish the notability of the subject"); } function whackBand  { whackEdit ("", "",               "CSD A7 - non-notable biography / vanity about a person or persons which does not establish the notability of the subject"); } function whackClub{ whackEdit ("",  "",                "CSD A7 - non-notable biography / vanity about a person or persons which does not establish the notability of the subject"); } function whackCopyvio{ whackEdit ("",   "",    " : CSD A8 - blatant copyright violation"); } function whackcsd  { whackEdit ("", "",               " : delete cat per CFD"); }

// ************************************************** // Installation // ************************************************** window.whack_addlilink=function(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) { if(key && title) ta[id] = [key, title]; else if(key)    ta[id] = [key, '']; else if(title)  ta[id] = ['', title]; }   // re-render the title and accesskeys from existing code in wikibits.js    akeytt; return li; } window.whack_addToolboxLink=function(url, name, id){ var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0]; whack_addlilink(tb, url, name, id); } window.playWhackMoles=function { if (document.title.match("Editing") ) { whack_addToolboxLink('javascript:{whackReason;};void(0);', 'Speedy Delete for', 'toolbox_reason'); whack_addToolboxLink('javascript:{whackNonsense;};void(0);', 'CSD G1 - patent nonsense', 'toolbox_nonsense'); whack_addToolboxLink('javascript:{whackTest;};void(0);', 'CSD G2 - test page', 'toolbox_test'); whack_addToolboxLink('javascript:{whackVand;};void(0);', 'CSD G3 - vandalism', 'toolbox_vand'); whack_addToolboxLink('javascript:{whackRepost;};void(0);', 'CSD G4 - previously deleted material', 'toolbox_repost'); whack_addToolboxLink('javascript:{whackBan;};void(0);', 'CSD G5 - contributions made by a banned user', 'toolbox_ban'); whack_addToolboxLink('javascript:{whackHistmerge;};void(0);','CSD G6 - history merge', 'toolbox_histmerge'); whack_addToolboxLink('javascript:{whackAuthor;};void(0);',  'CSD G7 - speedy request by only editor', 'toolbox_author'); whack_addToolboxLink('javascript:{whackTalk;};void(0);','CSD G8 - talk page of a deleted page', 'toolbox_talk'); whack_addToolboxLink('javascript:{whackMove;};void(0);', 'CSD G9 - making way for a noncontroversial move', 'toolbox_move'); whack_addToolboxLink('javascript:{whackEmpty;};void(0);', 'CSD A1 - very short articles without context', 'toolbox_empty'); whack_addToolboxLink('javascript:{whackForeign;};void(0);', 'CSD A2 - foreign language article duplicated on other Wikimedia project', 'toolbox_foreign'); whack_addToolboxLink('javascript:{whackNocontent;};void(0);', 'CSD A3 - no content other than external links of whatever kind', 'toolbox_nocontent'); whack_addToolboxLink('javascript:{whackTranswiki;};void(0);', 'CSD A5 - transwikification completed', 'toolbox_transwiki'); whack_addToolboxLink('javascript:{whackAttack;};void(0);', 'CSD A6 - insult / attack page', 'toolbox_attack'); whack_addToolboxLink('javascript:{whackBio;};void(0);','CSD A7 Bio - non-notable biography / vanity about a person or persons which does not establish the notability of the subject', 'toolbox_bio'); whack_addToolboxLink('javascript:{whackBand;};void(0);',  'CSD A7 Band - non-notable biography / vanity about a person or persons which does not establish the notability of the subject', 'toolbox_band'); whack_addToolboxLink('javascript:{whackClub;};void(0);','CSD A7 Club - non-notable biography / vanity about a person or persons which does not establish the notability of the subject', 'toolbox_club'); whack_addToolboxLink('javascript:{whackCopyvio;};void(0);', 'CSD A8 - blatant copyright violation', 'toolbox_copyvio'); whack_addToolboxLink('javascript:{whackcsd;};void(0);', 'CFD - delete cat per CFD', 'toolbox_empty'); } else { } } // onload window.simpleAddOnload=function(f) { if (window.addEventListener) window.addEventListener("load", f, false); else if (window.attachEvent) window.attachEvent("onload",f); }

simpleAddOnload(playWhackMoles);

//