User:Kbh3rd/Vandal warning toolbox

There are various tools that help make it quick and easy to revert instances of vandalism. Here is 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

edit

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 malicious 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 them 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

edit

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:

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. A section heading of "month year" is added before the warning template if one does not already exist.

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

edit

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

edit

When the Wikipedia server builds a page to send to your browser, it includes any JavaScript code stored in your personal javascript page. The code is executed after the page is initially loaded, and it can operate on the appearance and functionality of the page. That's where code for extra customizations like this user warning tool can be put.

Your personal JavaScript page exists at a level below your user page, and it takes the name of the Wikipedia user interface theme, or "skin", that you use. There are multiple themes that can be chosen from on the Preferences page. The new default theme is Vector, and that's probably what you're using if you've never set the theme preference. If you're using Vector, your javascript customizations go in vector.js. The old default Monobook theme uses monobook.js, and that's what you would need to edit if you're using the old theme. If you're unsure, you can see what theme you're using under the Appearance tab of your preferences.

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


 //
 // Edit tools for the vandal whack-a-mole game
 // [[User:Kbh3rd/whackamole.js]] - please include this line
 //
 importScript('User:Kbh3rd/whackamole.js');

You'll need to flush your old javascript page 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 like my messages, you can 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