User:Kbh3rd/Vandal warning toolbox

There are various tools that help make it quick and easy to revert instances of vandalism. I've written some JavaScript to make it almost as quick and easy to leave warning messages on users' talk pages by adding some tools to the Wikipedia toolbox (over there on the left). This can be useful to anyone, not just admins. I'm interested in the opinions of anyone who stumbles upon this.

Feedback is welcome.

Importance of leaving messages when reverting
It's important for a number of reasons to leave messages on users' talk pages when reverting vandalism or random testing:


 * 1) Good-faith beginners who are just testing things can get pointed to the sandbox, so real articles won't get messed up, as well as directed to documentation on how to become useful editors.
 * 2) Vandals who are more mischievous than serious may stop after their first trick if they immediately get a polite message that lets them know they're being watched.
 * 3) Serious vandals are usually only blocked by admins after they've been warned a few times.  It is quite frustrating after reverting a page to find that the vandal has a long history of destructive edits that have been reverted, but no one has bothered to ask him to stop!

Another more subtle reason to leave warnings for even seemingly insignificant mischief has to with perceptions of Wikipedia's reliability and worth. If I make a single small edit that reduces the accuracy or value of an article, and I think I "got away with it", then my estimation of Wikipedia's worth must suffer – it cannot be a valuable resource because anyone can edit it in any way. If instead I quickly receive a polite request to behave along with links to help on being a productive contributor and to Wikipedia's policies, then my estimation of Wikipedia's worth must be greater than otherwise. That argues for leaving first-level warnings for even the most insignificant counter-productive edits.

Using this tool
When a user's talk page is in edit mode, after installing the tool, the following list of links automatically appears in the Wikipedia toolbox menu:


 * Warning Templates:
 * Test 1 2 3
 * Self Test 1
 * Vandal 1 2 3 4
 * Blank 1 2 3 4
 * Errors 1 2 3
 * NPOV 1 2 3 4
 * Spam 1 2 3 4
 * Ads 1 2 3 4
 * BLOCK 1 2 3

The first link takes you to the page that describes the array of user warning templates. You should be familiar with these messages before using this tool.

The numbered links cause the template for the the warning message of that severity level from the indicated category to be pasted at the bottom of the page's edit textbox. The links above take you to the description page for the templates; when using the tool, the template reference is inserted into the users' talk page.

All of those except for "BLOCK" support naming the vandalized article as a parameter to the template. When selecting one of the messages that support an article name, a JavaScript pop-up will prompt for the name of the article, which can be pasted or typed. The message will be properly formatted whether or not you enter an article name. You don't have to enter an article name if circumstances warrant a more general message. No message is added if "Cancel" is clicked.

By selecting the name of the article with the mouse before clicking on the message link, the entire process of investigating and reverting the edit, examining past edits, and leaving an appropriate user message can all be done with the mouse alone. There is seldom a need to move a hand to the keyboard. (This is at least true on Linux, Unix, and other X-based systems that automatically copy selected text to the clipboard.) This can really speed up the recent changes patrol process.

Google
When not in edit mode on a talk page, you'll get a link to Google that will execute a search, in a separate window, on whatever term is highlighted on the current page. That makes it quick and easy to query that other font of knowledge when the BS meter starts to go off.

The script does not always seem to see the selected text. I don't know why this happens sometimes. Maybe it's specific to the browser version or configuration. When there is no selected text, or when the script doesn't see the selected text, a pop-up diaglog box will prompt for the search term. Simply type or paste the term into the dialog to perform the search. So even when this extra step is necessary, it's still a convenient tool to have in the toolbox.

Installation
When the Wikipedia server builds a page to send to your browser, it includes any javascript code stored in your personal monobook.js page, if it exists (and if you're using the default "Monobook" skin.) The code is executed after the page is initially loaded, and it can operate on the appearance and functionality of the page. So that's where extra customizations like this can be put.

The toolbox links are added to the toolbar by adding this text to your monobook.js page. (Create it if you don't have one, yet.)

// // Edit tools for the vandal whack-a-mole game // User:Kbh3rd/whackamole.js - please include this line // document.write(' '); You'll need to flush your old monobook.js from your cache. Pressing Ctrl+F5 on some browsers might work, or Ctrl-R on some others. When you get the proper version into your browser, that Google link will show up in your toolbox. The warning links should only appear when you're in edit mode on a user talk page.

If you don't use the MonoBook skin, don't edit monobook.js; the file is named after the skin you do use. I sometimes use the Simple skin, so I have installed this in User:Kbh3rd/simple.js also.

If you don't like my messages, you'll have to copy User:Kbh3rd/whackamole.js to your own space and customize it there. A cool enhancement would be to make it read a list of messages from your user space regardless of where the .js file is loaded from.

Many thanks to User:Lupin who provided the info I needed to figure out how to get my script into the Wikipedia toolbox. His much more sophisticated anti-vandal monitoring tool is what made me realize that this could be done.

If you use this tool you might want to put this page on your watchlist to be notified of any changes to its functionality. Changes will also be noted in the change log.

--Kbh3rdtalk