Jump to content

User:Hoo man/Scripts/SledgeHammer

From Meta, a Wikimedia project coordination wiki
Sledge Hammer on meta

Sledge Hammer is a tool very similar to the Nuke extension, but with more features. It uses data from my Toolserver API.
Once installed, it can be accessed via Special:Blankpage/SledgeHammer.
In difference to the Nuke extension it allows you to filter pages by namespace and to search pages in different time spans.

If you found a bug in this script or if you have a feature request please leave it here or ping me on IRC (hoo).

Installation and customization

[edit]

Installation

[edit]

To use Sledge Hammer, you just have to paste this code into your common.js (or into your global.js if you want to use it project wide):

// A tool very similar to the Nuke extension, but with more features
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/SledgeHammer>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/sledgeHammer.js&action=raw&ctype=text/javascript');

Please add yourself to the user list at the bottom of this page.

Customization

[edit]

You can customize the tool in many ways (you can eg. completely translate it), here are the most important things you can change. Just append this to your JS file.

To fully disable the script
var disable_sledgeHammer = true;
To show the link to the tool only on wikis where the user got the delete right
if(typeof(sledgeHammerConfig) === 'undefined') sledgeHammerConfig = {};
sledgeHammerConfig.deleteRightOnly = true;
To show the link to the tool only on wikis where the user is an administrator
if(typeof(sledgeHammerConfig) === 'undefined') sledgeHammerConfig = {};
sledgeHammerConfig.sysopOnly = true;
To have the links to the tools at another place
if(typeof(sledgeHammerConfig) === 'undefined') sledgeHammerConfig = {};
sledgeHammerConfig.toolLinkMethod = 'FOO';
Can take all values which are possible in addPortletLink and 'toolbar'

Users

[edit]