AFDsort is a user script for Wikipedia editors, and is intended to simplify the process of sorting debates on Articles for Deletion. The script is in two parts, for simplicity and ease of installation (and creation).
The primary script adds a "sort" button to the top of any edit page where the article being edited is an Article for Deletion. When clicked, the script prompts for a single-letter category code, found here. The script then removes any existing AfD sorting templates with nonstandard or unsorted input, and adds a template that sorts the debate per your input. The script then adds an edit summary and saves the edit.
The debate will now be added to the category that matches your input, or to the "Unsorted" category if you did not input a correct category code. The edit summary will read "Sorting per CAT:AFD using AFDsort". If you watch pages you edit by default, the page will also be added to your watchlist. As always, you are responsible for the edits made using this script.
A second function, using the "afdsort2" script, adds an "Unsort" button to the top of any edit page where the article being edited is an Article for Deletion. Clicking this button will remove the sort template from any sorted AfD, add the edit summary "Removing sort template from closed debate using AFDsort", and submit the edit. This function is intended only for use on closed debates, where the closing admin or user inadvertantly left the sort template in place, and using this function will remove the debate from all sorting categories. Again, you are responsible for the edits made using this script.
Copy the following code onto your Monobook.js page.
"afdsort.js" adds the sort feature to the editing page, while "afdsort2.js" adds the "Unsort" function. The scripts may be used together or separately.
I've seen no data to suggest that this script does not work beautifully with most modern browsers. However, your mileage may vary. Please notify me at my talk page if you encounter any problems.
- Extra line bug - Corrected 19 December 2007
Last updated 21:07, 28 December 2007 (UTC)