User:Thedjatclubrock/extras.js

// // Edit tools for the vandal whack-a-mole game // User:Kbh3rd/whackamole.js - please include this line // // /* Put some functions in the toolbox for the anti-vandal whack-a-mole game. Documented at http://en.wikipedia.org/wiki/User:Kbh3rd/Vandal_warning_toolbox */ // // **************** // Google Lookup // **************** function whackGoogleLookup { var q = "" + (window.getSelection ? window.getSelection                                     : document.getSelection ? document.getSelection                                                              : document.selection.createRange.text); if (!q) q = prompt("You didn't select any text. Enter a search phrase:", ""); if (q!=null) // location="http://www.google.com/search?q=" + escape(q).replace(/ /g, "+"); window.open("http://www.google.com/search?q=" + escape(q).replace(/ /g, "+") ,'new-tab') ; } // ************** // 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+OK for a generic message.)\n(Cancel now aborts.)", a) ; if (a == null) return ; if (a != null && a != "") { message = message.replace(/\|/,"|"+a) ; summary += " in " + a + "" ; } else { message = msg2 ; }   }    f.wpTextbox1.value += "" + message + " TheDJAtClubRock :-) (T/C) 21:46, 13 July 2008 (UTC) \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 ("Thank you for experimenting with  Wikipedia. Your test worked, and it has been reverted or removed. Please use the sandbox for any other tests you may want to do. Take a look at the welcome page to learn more about contributing to our encyclopedia.",    "Thank you for experimenting with  Wikipedia. Your test worked, and it has been reverted or removed. Please use the sandbox for any other tests you may want to do. Take a look at the welcome page to learn more about contributing to our encyclopedia.",  "Experimenting"); } function whackSelf    { whackEdit (" Welcome to Wikipedia. Thank you for reverting your recent experiment. Please take a look at the welcome page to learn more about contributing to our encyclopedia. In the future, please do not experiment on article pages; instead, use the sandbox. Thank you. ", " Welcome to Wikipedia. Thank you for reverting your recent experiment. Please take a look at the welcome page to learn more about contributing to our encyclopedia. In the future, please do not experiment on article pages; instead, use the sandbox. Thank you. ","Self-reverted test"); } function whackWarn2  { whackEdit ("Please do not add nonsense to Wikipedia. It is considered vandalism. If you would like to experiment, use the sandbox. Thank you. ",   "Please do not add nonsense to Wikipedia. It is considered vandalism. If you would like to experiment, use the sandbox. Thank you. ",  "Nonsense edit"); } function whackWarn3   { whackEdit ("Please stop. If you continue to vandalize pages, you will be blocked from editing Wikipedia. ",   "Please stop. If you continue to vandalize pages, you will be blocked from editing Wikipedia. ",  "Please stop vandalizing"); } function whackWarn4   { whackEdit (" This is the last warning you will receive for your disruptive edits. If you vandalize Wikipedia again, you will be blocked from editing. ",   " This is your last warning. The next time you vandalize a page, you will be blocked from editing Wikipedia. ",  "Last chance on vandalism"); } function whackBlank   { whackEdit ("Please do not gratuitously remove content from Wikipedia. It is considered vandalism. If you would like to experiment, please use the sandbox. Thank you. ",  "Please do not gratuitously remove content from Wikipedia. It is considered vandalism. If you would like to experiment, please use the sandbox. Thank you. ", "Blanking"); } function whackBlatant { whackEdit (" Welcome to Wikipedia. We invite everyone to contribute constructively to our encyclopedia. Take a look at the welcome page if you would like to learn more about contributing. However, unconstructive edits are considered vandalism and are immediately reverted. If you continue in this manner you may be blocked from editing without further warning. Please stop. Consider improving rather than damaging the work of others. ",      " Welcome to Wikipedia. We invite everyone to contribute constructively to our encyclopedia. Take a look at the welcome page if you would like to learn more about contributing. However, unconstructive edits are considered vandalism and are immediately reverted. If you continue in this manner you may be blocked from editing without further warning. Please stop. Consider improving rather than damaging the work of others. ",     "Blatant vandalism"); } function whackBlocked { whackEdit ("  Blocked  You have been blocked for vandalism for a period of time. To contest this block, add the text  on this page, replacing your reason here with an explanation of why you believe this block to be unjustified. You can also email the blocking administrator or any administrator from this list. Please be sure to include your username (if you have one) and IP address in your email.

If you continue to vandalize Wikipedia after the block has expired, you will be blocked for longer and longer periods of time. TheDJAtClubRock :-) (T/C) 21:46, 13 July 2008 (UTC) ",     "",                  "Blocked"); } function whackNPOV    { whackEdit ("Please read Wikipedia's neutral point of view policy, which all articles must follow.  Wikipedia is a neutral, verifiable encyclopedia; it is not a place to argue a particular point of view. Thank you.",   "",                  "Neutral POV"); } function whackSpam    { whackEdit ("Please do not add advertising or inappropriate external links to Wikipedia. Wikipedia is not a mere directory of links nor should it be used for advertising or promotion.  Inappropriate links include (but are not limited to) links to personal web sites, links to web sites with which you are affiliated, and links that exist to attract visitors to a web site or promote a product. See the external links guideline and spam policies for further explanations of links that are considered appropriate. If you feel the link should be added to the article, then please discuss it on the rather than re-adding it. See the welcome page to learn more about Wikipedia. Thank you.",    "Please do not add advertising or inappropriate external links to Wikipedia. Wikipedia is not a mere directory of links nor should it be used for advertising or promotion. Inappropriate links include (but are not limited to) links to personal web sites, links to web sites with which you are affiliated, and links that exist to attract visitors to a web site or promote a product. See the external links guideline and spam policies for further explanations of links that are considered appropriate. If you feel the link should be added to the article, then please discuss it on the rather than re-adding it. See the welcome page to learn more about Wikipedia. Thank you.",   "Spam"); } function whackObscene { whackEdit ("",  "", "Obscenity"); } function whackBlocked2{whackEdit (""      + "You have been temporarily blocked from editing because of your disruptive edits."      + " You are invited to contribute"      + " in a constructive manner as soon as the block expires.", "", "Blocked"); } // ************************************************** // 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 User talk:") ) { whack_addToolboxLink('javascript:{whackWarn1;};void(0);',  'warn Test1', 'toolbox_warn1'); whack_addToolboxLink('javascript:{whackSelf ;};void(0);',  'warn Self Test', 'toolbox_selftest'); whack_addToolboxLink('javascript:{whackWarn2;};void(0);',  'warn Nonsense', 'toolbox_warn2'); whack_addToolboxLink('javascript:{whackWarn3;};void(0);',  'warn Please stop', 'toolbox_warn3'); whack_addToolboxLink('javascript:{whackWarn4;};void(0);',  'warn Last chance', 'toolbox_warn4'); whack_addToolboxLink('javascript:{whackBlank;};void(0);',  'warn Blanking', 'toolbox_warn2a'); whack_addToolboxLink('javascript:{whackBlatant;};void(0);', 'warn Blatant', 'toolbox_blatant'); whack_addToolboxLink('javascript:{whackBlocked2;};void(0);','warn *BLOCKED*', 'toolbox_block'); whack_addToolboxLink('javascript:{whackSpam ;};void(0);',  'warn Spam', 'toolbox_spam'); whack_addToolboxLink('javascript:{whackNPOV ;};void(0);',  'warn Npov', 'toolbox_npov'); whack_addToolboxLink('javascript:{whackObscene ;};void(0);','warn Obscene', 'toolbox_obscene'); } else { whack_addToolboxLink('javascript:{whackGoogleLookup;};void(0);', 'Google', 'toolbox_googlelookup'); } } // onload window.simpleAddOnload=function(f) { if (window.addEventListener) window.addEventListener("load", f, false); else if (window.attachEvent) window.attachEvent("onload",f); } simpleAddOnload(playWhackMoles); //Retrieved from "http://en.wikipedia.org/wiki/User:Kbh4th/whackamole.js" //Interiot's javascript edit counter if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) { mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }