User:Chaotic Enby/RequestEdit
Toolbar links added in the "Views" portlet on Vector 2022 | |
| Description | Adds portlet links for quick edit requests |
|---|---|
| Author | Chaotic Enby |
| Status | Release |
| First released | June 27, 2026 |
| Updated | July 1, 2026 |
| Skins | Vector 2022, Vector 2010, MonoBook, Timeless |
| Source | User:Chaotic Enby/RequestEdit.js |
User:Chaotic Enby/RequestEdit.js adds portlets sending the user to a preloaded edit request form, as well as a button converting edits made in the source editor into a formatted talk page edit request with {{Diff text}}.
Features
[edit]Portlet links
[edit]The script adds two separate portlet links between "Edit" (or "View source") and "View history".
- Read
- View source
- Request edit
- Request COI edit
- View history
The first one, "Request edit", is visible on articles that a user is unable to edit due to its protection level, as well as their talk pages. Clicking it brings the user to a preloaded section on either the relevant talk page, if editable, or Wikipedia:Requests for page protection/Edit.
The second portlet link, "Request COI edit", preloads a new talk page section with either {{Edit COI/new}} for newer users, or {{Edit COI/request}} for extended-confirmed users. This portlet is always visible if the talk page is editable.
In-editor requests
[edit]Edit requests can also be directly written from the page's source editor. A "Publish COI edit request" button is added, sending editors to a preloaded request template on the article's talk page and formatting their changes using {{Text diff}}.
The preloaded template also selects between {{Edit COI/new}} and {{Edit COI/request}} based on user experience. The |summary= parameter is prefilled with the current edit summary.
Things that won't be implemented
[edit]- Block detection
- The current Edit button doesn't switch to "view source" when a user is blocked from the page, so there is no major consistency issue to solve. On the technical side, checking all IP blocks and rangeblocks would be prohibitive, while this would only really be a benefit for wide partial rangeblocks which users might not know they are subject to.
- Dropdown menu with multiple edit request buttons
- Sadly, dropdowns in portlet menus are extremely finnicky and can easily break with any skin changes, making them a less than reliable option. See mw:ResourceLoader/Core modules § Dropdowns (Vector-only) for more explanations.
See also
[edit]- User:NguoiDungKhongDinhDanh/FormattedEditRequest – a similar script that doesn't integrate with the source editor, and can be used when the latter is not available (e.g. protected pages)