User:Andy M. Wang/pageswap
pageswap is a script that allows a user to
suppressredirect
and move-subpages
rights (on enwiki, these are usually granted via either the page mover permission or as part of the standard administratorTo use this script: Copy the line below, then [[click here]], paste the line, and hit Publish changes.
{{
subst:Iusc|User:Andy M. Wang/pageswap.js|User:Andy M. Wang/pageswap}}- Report any issues to me, Andy M. Wang. I'm not much of a JavaScript guru, and if anyone would like to help improve the script, feedback is always welcome. Feel free to adapt the script as you see fit as well.
Usage
- Go to the page to be swapped (i.e. page A as described at WP:PMVR#rr). At the top of the page, there should be an additional option to "Swap" (right below "Move" or "Purge"). Click "Swap".
- Enter the full page name complete with namespace prefix. (Click cancel to step out.) Proceed through the forms as appropriate. (Press "OK" for "Yes", "Cancel" for "No".)
- (Manually perform step 4of the round-robin move if necessary, including correcting any moved redirects, and creating new redlinked talk pages.)
- (Manually perform any necessary post-move cleanup.)
Description
Because the
Editors can specify a default move reason via moveReasonDefault in
If the move is complicated (i.e. subpages and talk subpages exist for source and destination), there will be a number of screens alerting you of the configuration to help you make the best decision about whether subpages should be moved. Occasionally, a (sub)page may be move-protected or immovable.
The prefix for the intermediate title (C) used for page B (as described at
"Draft:Move/"
per convention.
To cancel out of the swap routine, currently you will need to step through the sequence of menus, but just be sure to click cancel at the last screen that asks if you want to proceed.
Page swapping is enabled for most namespaces that can handle them. The ability to swap a page in a subject space with one in a talk space is currently disabled. Users who are unable to suppressredirect
or move-subpages
have the swap functionality disabled.
Future goals
Ordered by priority:
- Check create protection of swap subpages (very uncommon)
- When sum of subj + talk >100 subpages and subj <= 100 subpages, consider disabling move talk. Allow option to move talk and subpages separately later?
Out of scope
- Checking template/file namespace for incoming links to orig. title
- Correcting redirects unrelated to the source page
- Correcting or retargeting any redirects of moved pages (including subpages)
- Other post-move cleanup (editnotices, lede/dab/hatnote corrections) These actions should be performed post-move manually.
- Create newly red-linked subject / talk / subpages as redirects
Script
The live script is at User:Andy M. Wang/pageswap.js. Latest version published 02:00, 20 September 2018 (UTC).
A beta version of the script is also available at User:Andy M. Wang/pageswapbeta.js (diff), but its use is not recommended, as it may contain untested or breaking code.
Version history
- 1.1, around 25 August 2016.
- 1.2, on 25 August 2016. Adds talk page create protection checks and disallows move talk if detected. Streamlining of outputs when checking subpages.
- 1.3, on 4 October 2016. Allows the swap portlet link to show on Book and Portal namespaces (with a "not supported" reason elaborating why).
- 1.4, on 1–2 November 2016. Post-move message updates.
- 1.5, on 10 September 2017. Declares dependencies on mediawiki.api and mediawiki.util.
- 1.6, on 18 December 2017. (Feature request) Adds support for a default "Move reason" via variable moveReasonDefault.
- 1.6.1, on 20 September 2018. Change redirect suppression criteria shortcut link in edit summary per WP:SHORT.