User:Ahecht/Scripts/draft-sorter
{{Infobox user script
| name = draft-sorter
| desc = Sorts AfC drafts.
| author = Ahecht, based on User:Enterprisey/draft-sorter.js by Enterprisey
| updated = {{start date and age|2024|1|22}}
| status = Stable
| source = User:Ahecht/Scripts/draft-sorter.js
| beta = User:Ahecht/sandbox/Scripts/draft-sorter.js
| skins = Vector
| screenshot = File:Draft-sorter.png
| screenshotupright = 1.25
}}
A userscript to sort AfC drafts by adding WikiProject banners to their talk pages. This script adds the following features to User:Enterprisey/draft-sorter.js:
- Fixes "Next Draft" button not being random (see :phab:T200703)
- Reads WikiProjects already tagged on talk page to avoid duplicates
- Wraps WikiProject banners in {{tl|WikiProject banner shell}} if three or more are added, and can add templates within an existing banner shell template
- Automatically suggests WikiProjects based on ORES Topic Routing (for enwiki) and Language agnostic link-based article topic (for other wikis).
{{User:Enterprisey/USinstall}}
Usage
- While on any draft page, go to the "Tools 12px" menu at the top of your screen and click on "Sort draft".
- The interface for adding WikiProject tags is displayed. You can click the "(add)" link next to any of the suggested WikiProjects or search for a WikiProject in the text box. WikiProjects already on the talk page are displayed in the text box but cannot be removed by this script.
- Click {{button|Submit}} to add the WikiProject banners to the draft's talk page. When the edit is saved successfully, you are given the option to reload or proceed to a randomly selected {{button|12px Next draft}}. You can also click {{button|12px Skip}} to continue to the next draft without making any changes.
- The draft-sorter interface is automatically opened on the next draft page.
- Add submit and save, or skip.
- Repeat, or close the script by hitting {{button|Cancel}}.