FANDOM


This script is for PERSONAL use only!

You are free to install this script for yourself, but it is not allowed to be used wiki-wide (e.g., in MediaWiki:Common.js or MediaWiki:Wikia.js), as it would violate FANDOM's Terms of Use. (See the customization policy)

WHAM is a script that adds a "quick tools" popup to a user's contribution page, allowing for various functions. The tool was originally developed for VSTF/Staff; however, any user is free to use the tool (see comments in /code.js). Staff/VSTF-only functions have been disabled; the original can be found here.

Features

  • Quick block: Easily block a user. Ban duration and reason can be edited. Stock duration is "2 weeks"; stock reason is "Vandalism."
  • Delete all pages: Delete all pages and comments a user has made.
    • Version 2 supports deleting message wall/forum threads.
  • Delete selected: Delete specific pages made by the user (places checkboxes and two buttons next to user's contributions, version 2 only), similar to the Nuke extension.
  • Rollback all edits: Rollback all edits a user has made. In version 2 it will default to 100ms per rollback to improve accuracy, though this can be changed.
  • All of the above: Block a user, delete all pages made by that user, and rollback all edits the user has made.
  • Bot/Remove bot: Toggle bot status on/off for a user (optional in version 2 for users who are not VSTF/staff/helper with parameter, see installation for more info). This will only work if you can locally assign bot flags on your wiki
  • Progress wheel for deletions/rollbacks taking place so you can tell when it's finished (version 2 only).

Usage & Installation

The script will only load if you are a rollbacker or above in regards to user rights. It will also load for VSTF, helpers and staff globally. If you would like to change the default delay between rollbacks/deletions, change the WHAMDelay variable to whatever number you wish as seen in the example below (1000 = 1 second). If you would like to have the bot toggle button available, you can add WHAMBotMe = true above the import below (this isn't needed for VSTF/staff/helpers as it loads by default). An additional optional variable would be WHAMBotReason for the reason of turning your bot flag on/off. If this is not specified, it will default to "Cleanup".

Note: "All of the options" does not include the "Bot/Unbot me" action.

Installation

Add this JavaScript on your wiki:

Global Personal
w:Special:Mypage/global.js Special:Mypage/common.js
WHAMDelay = 1000;
importArticles({
    type: "script",
    articles: [
        'u:dev:WHAM/code.2.js'
    ]
});
importArticles — Best Practices for installing JavaScript on FANDOM
The importArticles statement is designed to combine multiple HTTP requests into a single data transfer, allowing multiple scripts to load and execute faster. If you've been installing several different scripts, your JavaScript file has probably accumulated unnecessary import statements. Click "Expand" to learn how to efficiently batch import scripts to speed up performance and make your code look cleaner. One other approach is by using the MediaWiki:ImportJS.
If your JavaScript file has several lines of code that say importScript, importScriptPage, or importArticles, you may be able to combine them! By batch importing a collection of scripts with a single import, your JavaScript code will load faster and look cleaner. Consider the example below. On the left is an example of what your JavaScript file might currently look like. On the right is how you could improve that code.
Multiple imports — messy and slow One import — clean and efficient
importScriptPage('AjaxRC/code.js','dev');
 
importScript('MediaWiki:localScript.js');
 
importArticle({
  type: 'script',
  article: 'u:dev:FloatingToc/code.js'
});
 
importScriptPage('page1.js', 'wikiname');
 
importScriptPage('page2.js', 'wikiname');
importArticles({
    type: 'script',
    articles: [
        'u:dev:AjaxRC/code.js',
        'MediaWiki:localScript.js',
        'u:dev:FloatingToc/code.js',
        'u:wikiname:page1.js',
        'u:wikiname:page2.js'
    ]
});
Note: In this example, pay close attention to the placement of commas and other punctuation. For people who aren't familiar with programming (and even those who are!), a common mistake when writing code is to accidentally delete, forget, or misplace critical symbols like commas or quotation marks. This can cause a syntax error that breaks the code. Carefully follow the convention shown here when using importArticles.
But there's much more to importArticles than just this! For more examples and advanced usage, see the help page at Help:Including additional JavaScript and CSS.


An example of the optional bot variables in action:

WHAMBotMe = true;
WHAMBotReason = "Cleanup";
WHAMDelay = 100;

If you're already using importArticles(), you can import the script by adding the below to the article list.

'u:dev:WHAM/code.2.js',

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.