User:Andy M. Wang/warn.js

// Modified from User:Kbh3rd/Vandal warning toolbox. // Templates have been changed, upgraded, and increased. // Better formatting. // Google is quite useless, and it is removed. // CHANGES MADE IN THIS FILE AFFECTS ME AND EVERYONE ELSE WHO MAY USE IT. Be careful. //  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 ("Enter article or user name implied. Only clicking OK gives generic message.", a) ; if (a == null) return ; if (a != null && a != "") { message = message.replace(/\|/,"|"+a) ; summary += ": " + a + "" ; } else { message = msg2 ; }   }    f.wpTextbox1.value += "\n\n" + message + " ~ \n" ; f.wpSummary.value = summary ; f.wpMinoredit.checked=false; f.wpWatchthis.checked=false; f.wpTextbox1.focus; if (f.wpTextbox1.scrollTop || true) f.wpTextbox1.scrollTop = f.wpTextbox1.scrollHeight ; } function whackWarn1   { whackEdit ("",   "",   "Uw-v1"); } function whackWarn2   { whackEdit ("",   "",   "Uw-v2"); } function whackWarn3   { whackEdit ("",   "",   "Uw-v3"); } function whackWarn4   { whackEdit ("",   "",   "Uw-v4"); } function whackWarn4im { whackEdit ("", "", "Uw-v4im"); } function whackBv      { whackEdit ("",           "",           "Uw-bv"); } function whackDelete1 { whackEdit ("",      "",      "Uw-delete1"); } function whackDelete2 { whackEdit ("",      "",      "Uw-delete2"); } function whackDelete3 { whackEdit ("",      "",      "Uw-delete3"); } function whackDelete4 { whackEdit ("",      "",      "Uw-delete4"); } function whackDelete4im { whackEdit ("",  "",    "Uw-delete4im"); } function whackJoke1   { whackEdit ("",        "",        "Uw-joke1"); } function whackJoke2   { whackEdit ("",        "",        "Uw-joke2"); } function whackJoke3   { whackEdit ("",        "",        "Uw-joke3"); } function whackJoke4   { whackEdit ("",        "",        "Uw-joke4"); } function whackCreate1 { whackEdit ("",      "",      "Uw-create1"); } function whackCreate2 { whackEdit ("",      "",      "Uw-create2"); } function whackCreate3 { whackEdit ("",      "",      "Uw-create3"); } function whackCreate4 { whackEdit ("",      "",      "Uw-create4"); } function whackMove1   { whackEdit ("",        "",        "Uw-move1"); } function whackMove2   { whackEdit ("",        "",        "Uw-move2"); } function whackMove3   { whackEdit ("",        "",        "Uw-move3"); } function whackMove4   { whackEdit ("",        "",        "Uw-move4"); } function whackUpv1    { whackEdit ("",         "",         "Uw-upv1"); } function whackUpv2    { whackEdit ("",         "",         "Uw-upv2"); } function whackUpv3    { whackEdit ("",         "",         "Uw-upv3"); } function whackUpv4    { whackEdit ("",         "",         "Uw-upv4"); } function whackSpam1   { whackEdit ("",        "",        "Uw-spam1"); } function whackSpam2   { whackEdit ("",        "",        "Uw-spam2"); } function whackSpam3   { whackEdit ("",        "",        "Uw-spam3"); } function whackSpam4   { whackEdit ("",        "",        "Uw-spam4"); } function whackSpam4im { whackEdit ("",      "",      "Uw-spam4im"); } function whackNpov1   { whackEdit ("",        "",        "Uw-npov1"); } function whackNpov2   { whackEdit ("",        "",        "Uw-npov2"); } function whackNpov3   { whackEdit ("",        "",        "Uw-npov3"); } function whackNpov4   { whackEdit ("",        "",        "Uw-npov4"); } function whackNpa1   { whackEdit ("",        "",        "Uw-npa1"); } function whackNpa2   { whackEdit ("",        "",        "Uw-npa2"); } function whackNpa3   { whackEdit ("",        "",        "Uw-npa3"); } function whackNpa4   { whackEdit ("",        "",        "Uw-npa4"); } function whackNpa4im { whackEdit ("",      "",      "Uw-npa4im"); } 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 User talk:") ) { whack_addToolboxLink('javascript:{whackWarn1;};void(0);',  'Uw-v1',   'toolbox_warn1'); whack_addToolboxLink('javascript:{whackWarn2;};void(0);',  'Uw-v2',   'toolbox_warn2'); whack_addToolboxLink('javascript:{whackWarn3;};void(0);',  'Uw-v3',   'toolbox_warn3'); whack_addToolboxLink('javascript:{whackWarn4;};void(0);',  'Uw-v4',   'toolbox_warn4'); whack_addToolboxLink('javascript:{whackWarn4im;};void(0);', 'Uw-v4im', 'toolbox_warn4im'); whack_addToolboxLink('javascript:{whackBv;};void(0);',     'Bv',      'toolbox_bv'); whack_addToolboxLink('javascript:{whackDelete1;};void(0);', 'Delete1', 'toolbox_delete1'); whack_addToolboxLink('javascript:{whackDelete2;};void(0);', 'Delete2', 'toolbox_delete2'); whack_addToolboxLink('javascript:{whackDelete3;};void(0);', 'Delete3', 'toolbox_delete3'); whack_addToolboxLink('javascript:{whackDelete4;};void(0);', 'Delete4', 'toolbox_delete4'); whack_addToolboxLink('javascript:{whackDelete4im;};void(0);', 'Delete4im', 'toolbox_delete4im'); whack_addToolboxLink('javascript:{whackJoke1;};void(0);',  'Joke1',   'toolbox_joke1'); whack_addToolboxLink('javascript:{whackJoke2;};void(0);',  'Joke2',   'toolbox_joke2'); whack_addToolboxLink('javascript:{whackJoke3;};void(0);',  'Joke3',   'toolbox_joke3'); whack_addToolboxLink('javascript:{whackJoke4;};void(0);',  'Joke4',   'toolbox_joke4'); whack_addToolboxLink('javascript:{whackCreate1;};void(0);', 'Create1', 'toolbox_create1'); whack_addToolboxLink('javascript:{whackCreate2;};void(0);', 'Create2', 'toolbox_create2'); whack_addToolboxLink('javascript:{whackCreate3;};void(0);', 'Create3', 'toolbox_create3'); whack_addToolboxLink('javascript:{whackCreate4;};void(0);', 'Create4', 'toolbox_create4'); whack_addToolboxLink('javascript:{whackMove1;};void(0);',  'Move1', 'toolbox_move1'); whack_addToolboxLink('javascript:{whackMove2;};void(0);',  'Move2', 'toolbox_move2'); whack_addToolboxLink('javascript:{whackMove3;};void(0);',  'Move3', 'toolbox_move3'); whack_addToolboxLink('javascript:{whackMove4;};void(0);',  'Move4', 'toolbox_move4'); whack_addToolboxLink('javascript:{whackUpv1;};void(0);',   'Upv1',    'toolbox_upv1'); whack_addToolboxLink('javascript:{whackUpv2;};void(0);',   'Upv2',    'toolbox_upv2'); whack_addToolboxLink('javascript:{whackUpv3;};void(0);',   'Upv3',    'toolbox_upv3'); whack_addToolboxLink('javascript:{whackUpv4;};void(0);',   'Upv4',    'toolbox_upv4'); whack_addToolboxLink('javascript:{whackSpam1;};void(0);',  'Spam1',   'toolbox_spam1'); whack_addToolboxLink('javascript:{whackSpam2;};void(0);',  'Spam2',   'toolbox_spam2'); whack_addToolboxLink('javascript:{whackSpam3;};void(0);',  'Spam3',   'toolbox_spam3'); whack_addToolboxLink('javascript:{whackSpam4;};void(0);',  'Spam4',   'toolbox_spam4'); whack_addToolboxLink('javascript:{whackSpam4im;};void(0);', 'Spam4im', 'toolbox_spam4im'); whack_addToolboxLink('javascript:{whackNpov1;};void(0);',  'Npov1',   'toolbox_npov1'); whack_addToolboxLink('javascript:{whackNpov2;};void(0);',  'Npov2',   'toolbox_npov2'); whack_addToolboxLink('javascript:{whackNpov3;};void(0);',  'Npov3',   'toolbox_npov3'); whack_addToolboxLink('javascript:{whackNpov4;};void(0);',  'Npov4',   'toolbox_npov4'); whack_addToolboxLink('javascript:{whackNpa1;};void(0);',  'Npa1',   'toolbox_npa1'); whack_addToolboxLink('javascript:{whackNpa2;};void(0);',  'Npa2',   'toolbox_npa2'); whack_addToolboxLink('javascript:{whackNpa3;};void(0);',  'Npa3',   'toolbox_npa3'); whack_addToolboxLink('javascript:{whackNpa4;};void(0);',  'Npa4',   'toolbox_npa4'); whack_addToolboxLink('javascript:{whackNpa4im;};void(0);',  'Npa4im',   'toolbox_npa4im'); } } // onload window.simpleAddOnload=function(f) { if (window.addEventListener) window.addEventListener("load", f, false); else if (window.attachEvent) window.attachEvent("onload",f); } simpleAddOnload(playWhackMoles); //