User:WhitePhosphorus/all-in-one

Revert, block, press enter, and ignore. Anti-vandalism has never been this easy. ;P

All-in-one.js is a script which allows admins to rollback, block, mass delete, and/or revision delete in several clicks on the same page.

This documentation is intended for User:WhitePhosphorus/js/all-in-one.js. It is not designed for zh:User:WhitePhosphorus/js/all-in-one.js, which is a legacy script focusing more on some Chinese LTAs and lacks extendability.

How to install edit

Append the following to your common.js:

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:WhitePhosphorus/js/all-in-one.js&action=raw&ctype=text/javascript');

How to use edit

You will see an "All-in-one" link in the "More" menu at the top of any pages, if the script was successfully installed. After clicking it, a form will appear for you to adjust settings. When you use all-in-one on contribution page or log page, the current username (wgRelevantUserName) will be automatically filled in.

Add your own package edit

A package means a series of administrative operations, e.g. block indef with talk page disabled, together with mass delete all pages villain created with reason "Vandalism". Note that these are just default settings for quick access, you can still modify them after select a package.

You can define your package in your common.js as below. The following default package has been included in the code so you don't need to define it twice.

if (typeof(p4js_all_in_one) === 'undefined') p4js_all_in_one = {};
p4js_all_in_one.packages = {
    // This name will appear in the select box. You may want to use the abbreviation of LTA to indicate what it targets.
    "Example": {
        tracingedits: {
            duration: 3600, // Only deal with the edits made no earlier than this time (in seconds) ago. 'inf' for everything.
            indefregistered: true, // If true, the above duration only apply to IP users. When you input a registered username, the duration will be set to indef.
        },
        rollback: {
            enabled: true, // If false, you will not rollback the villain in default settings. Note that you'll be unable to revdel the content without rollbacking.
            bot: false, // If true, your rollbacks will not appear in recent changes, if you have `markbotedits` right.
            showname: true, // If false, the villain's username won't appear in your rollback summary. Only use it when the username needs to be hidden.
        },
        block: {
            enabled: true, // If false, you will not block the villain in default settings.
            duration: "1 day", // You can set it to everything as you do in the block interface.
            indefregistered: true, // If true, the above duration only apply to IP users. When you input a registered username, the duration will be set to indef.
            reason: "Long-term abuse", // The reason you used to fill in the block interface.
            autoblock: true, // Automatically block the last IP address used by this user, and any subsequent IP addresses they try to edit from. Not applicable to IP users.
            hardblock: false, // Prevent logged-in users from editing from this IP address. Not applicable to registered users.
            create: true, // Block account creation.
            talk: false, // Block talk page editing.
            mail: false, // Block email interface access. Not applicable to IP users.
            hidename: false, // If true, hide username from the public logs. Only applicable if you have `hideuser` right, e.g. be an oversighter.
        },
        pagedelete: {
            enabled: true, // If false, you will not delete pages created by the villain in default settings.
            reason: "Vandalism", // The reason you used to fill in the delete interface.
        },
        revisiondelete: {
            enabled: false, // If true, you will delete all the revisions the villain edited.
            content: true, // Whether to hide the revision content or not.
            summary: true, // Whether to hide the summary or not.
            username: false, // Whether to hide the username or not.
            reason: "Blatant offensive materials", // The reason you used to fill in the revision delete interface.
            oversight: false, // If true, suppress the edits instead of revision deletion. Only applicable if you have `suppressrevision` right, e.g. be an oversighter.
        },
    },
    // add another package... (this is a copy of above with comments omitted)
    "Default": {
        tracingedits: {
            duration: 3600,
            indefregistered: true,
        },
        rollback: {
            bot: false,
            showname: true,
        },
        block: {
            enabled: true,
            duration: "1 day",
            indefregistered: true,
            reason: "Long-term abuse",
            autoblock: true,
            hardblock: false,
            create: true,
            talk: false,
            mail: false,
            hidename: false,
        },
        pagedelete: {
            enabled: true,
            reason: "Vandalism",
        },
        revisiondelete: {
            enabled: false,
            content: true,
            summary: true,
            username: false,
            reason: "Blatant offensive materials",
            oversight: false,
        },
    },
    // and so on.
};
p4js_all_in_one.default_package = "Default"; // The default package will get selected upon page is rendered.

Don't be scared of the length; they are just the settings you adjust everyday :)

A live example: User:WhitePhosphorus/global.js and search "all-in-one settings".

Add your reasons in drop down list edit

There are several default rationales for selection. You can override them in your common.js as below:

if (typeof(p4js_all_in_one) === 'undefined') p4js_all_in_one = {};
p4js_all_in_one.reasons = {
    block: ["Long-term abuse", "Vandalism-only account", "Spam-only account", "Open proxy", "Vandalism"],
    pagedelete: ["Vandalism", "Spam"],
    revisiondelete: ["Blatant offensive materials", "Private information"],
}
// You can select these suffixes to append to your block and (revision) delete rationales.
p4js_all_in_one.suffixes = ["", " (global sysop action)", " (stewards action)"];

Disclaimer edit

You are fully responsible for your operations made via this script. Thus you are supposed to check all the settings before action and check if the result is desired, and correct it if needed. If you feel that the actions this script carried out do not correspond to your settings, feel free to contact the author.