User:Wegates/MoveToDraft

MoveToDraft (source) – A script to move undersourced articles to draft space, including cleanup and author notification.

Script steps:
 * 1) Move to draftspace and, if not an admin or page mover, tag the redirect left behind for R2 speedy deletion
 * 2) Check if any files used are non-free
 * 3) Edit page to comment out non-free files, turn categories into links, add afc draft template
 * 4) Add notification message on author talk page
 * 5) Update talk page banners
 * 6) Log the move to the /Draftify log subpage of your userspace, if it exists

Installation
Add the following to Special:MyPage/common.js (or your skin-specific js, if you prefer): importScript( 'User:Evad37/MoveToDraft.js' ); // Backlink: User:Evad37/MoveToDraft

Usage
On articles, there will be an additional "Move to draft" menu option next to the regular "Move" option. In Vector skin, this is within the "More" dropdown menu.

Selecting "Move to draft" will bring up a dialogue box for the new draft title, the username of the author to notify, and the notification message/heading to be left for the author. The default values, in most cases, will not need to be changed.

When the "Continue" button is clicked, the script will undertake the steps listed above sequentially. If there are any errors encountered with a step, you generally have the option to retry or skip it.

Note: for those without the page mover user-right, the redirect left behind from moving the article to draftspace will be tagged for CSD R2 deletion automatically.

Customisation

 * "Move to draft" link placement
 * Add the line  to your common.js, replacing  with one of the portlet id values from Help:Customizing toolbars (the script's default location is  )


 * Author notification message
 * Add the line  to your common.js
 * Important: within your message:
 * You need to use  instead of the page title
 * You need to prevent wikitext transformations on the common.js page itself (i.e.  instead of ,   instead of   for any template substitution)
 * You need to escape any quotation marks ( characters) as   to avoid syntax errors.
 * Any actual backslashes ( characters) need to be escaped as.
 * Any actual backslashes ( characters) need to be escaped as.


 * Move log rationale
 * Add the line  to your common.js, replacing  with custom text. The default rationale is Undersourced, incubate in draftspace


 * Edit summary for preparing article for draftspace
 * Add the line  to your common.js, replacing  with custom text. The default rationale is AFC draft