User:Kbh3rd/Vandal warning toolbox

From Wikipedia, the free encyclopedia

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.

Contents

[edit] 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.

[edit] 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:

  • warn Test1
  • warn Self Test
  • warn Nonsense
  • warn Please stop
  • warn Last chance
  • warn Blanking
  • warn Blatant
  • warn *BLOCKED*
  • warn Spam
  • warn Npov
  • warn Obscene

Clicking on one of those links causes an appropriate message to be automatically pasted at the bottom of the page's edit textbox. Except for "blocked", which is custom (and useful only to admins), these currently are mapped to this list of templates:

All of those except for "NPOV" support naming the vandalized article as a parameter to the template (pasted after the "|"). 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. If an empty response is submitted, then a version of the message without the article name will be pasted into the page: {{subst:test1}} instead of {{subst:test1-n|articlename}}, e.g. No message is added if "Cancel" is clicked, which is a change from the previous version of this tool.

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 tool works on Windows also, but I've not used it enough there to say whether or not Ctrl-C/Ctrl-V is necessary to paste the article name into the pop-up.) This can really speed up the recent changes patrol process.

[edit] Google

When not in edit mode on a talk page, I put up 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.

[edit] 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('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Kbh3rd/whackamole.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

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