FANDOM


This is a script that is only made for the Unified Community Platform.

This script is designed for only working on the Unified Community Platform. Importing this script on legacy wikis may cause the script to not run, or cause other issues.

Reason: Legacy JS parser will not accept this script for some reason.

Note: This applies only to the newer version

AjaxRename allows users to ajax rename a page with out having to go to Special:MovePage every time. This script also includes an extra feature to delete the target pages (Available only to content moderators or higher).

Installation

Legacy Version

This version is the original version of the script, and is kept for backwards compatibility reasons.

UCP Version

This version is the newer version of the script, with the modal instead of the button.


Usage

Note: All the information below from here is for the UCP version. To see the legacy usage guide, click here. The rename modal will show up when you click on any Special:MovePage link with a target. Using it is pretty self-explanatory. The modal will show you the page's move log and any warnings and any subpages of the page. Select one of the common rename reasons or type your own on the input. You can specify the reason further if you choose a common reason and input your own at the same time, which would result in: <common reason>: <further ellaboration>. Check the options you'd like to be applied to the rename and finally click the "Rename" button, or "Cancel" to close the modal. You can also press the "M" to open the modal.


Custom Rename reasons

To set custom rename reasons, you just need to add to the window.AjaxRename.renameReasons object using the syntax: 'reason to submit': 'reason to display',. Note you can use an object in the rename reasons to create reason groups. For example:

window.AjaxBlock = {
    renameReasons: {
        'Error': 'Error',
        'Misnamed Page': 'Misnamed Page',
        'Better Name': 'Better Name',
        'Page does not belong in mainspace': 'Page does not belong in mainspace',
        'Move request on talk page': 'Move request on talk page',
    }
};

Note you can use an object in the rename reasons to create reason groups. To do this, you replace your reason to display with an object. The child object works exactly the same as the normal one, for example:

window.AjaxBlock = {
    renameReasons: {
        'Normal': {
            'Error': 'Error',
            'Misnamed Page': 'Misnamed Page',
            'Better Name': 'Better Name',
        },
        'Other': {
            'Page does not belong in mainspace': 'Page does not belong in mainspace',
            'Move request on talk page': 'Move request on talk page',
        }
    }
};

Auto-check options

Automatically checked checkboxes on the block modal. leaveredirect specifies whether to leave a redirect behind in renaming. watch specifies whether to add the moved pages to your watchlist. movetalk specifies whether to rename the page's talk page, if it exists. movesubpages specifies whether to move the pages along with its subpages, if any exist. deletetargets specifies whether to attempt to delete the destination pages before renaming the page. And ignorewarnings specifies whether to ignore any warnings in the rename.

Note that to use leaveredirect and deletetargets you must be a content moderator or higher on most wikis. They will not show up without those rights.

window.AjaxBlock = {
    check: {
        leaveredirect: true,
        watch: true,
        movetalk: true,
        movesubpages: true,
        deletetargets: true,
        ignorewarnings: true,
    }
};

Language configuration

Normally this script uses the user's language for the modal text. You can also set this to your own langauge through the lang parameter. Example:

window.AjaxRename = {
    lang: 'en',
};

Keybindings

The script normally will add a keybinding to open the modal to the page for the key "M". You can disable this setting the doKeybind parameter to false. Example:

window.AjaxRename = {
    doKeybind: false,
};

Example configuration

window.AjaxRename = {
    renameReasons: {
        'Error': 'Error',
        'Misnamed Page': 'Misnamed Page',
        'Better Name': 'Better Name',
        'Page does not belong in mainspace': 'Page does not belong in mainspace',
        'Move request on talk page': 'Move request on talk page',
    }
    check: {
        leaveredirect: true,
        watch: true,
        movetalk: true,
    }
};

Example configuration with all parameters

window.AjaxRename = {
    renameReasons: {
        'Normal': {
            'Error': 'Error',
            'Misnamed Page': 'Misnamed Page',
            'Better Name': 'Better Name',
        },
        'Other': {
            'Page does not belong in mainspace': 'Page does not belong in mainspace',
            'Move request on talk page': 'Move request on talk page',
        }
    }
    check: {
        leaveredirect: true,
        watch: true,
        movetalk: true,
        movesubpages: true,
        deletetargets: true,
        ignorewarnings: true,
    }

    lang: 'en',
    doKeybind: true,
};


File notices

Take note when moving files, they cannot be moved out of the file namespace. The new extension must also match the old one. If any of these conditions fail, the page will not be moved

Future updates

  • Make the rename prompt a modal and give the user more moving options (move talk page, leave a redirect, etc.) - Done in the v0.6 release.
  • Protect root pages feature?


Text above can be found here (edit)
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+