User:Ponor/inline-diff-inline-patrol
The inline-diff-inline-patrol script loads revision diffs inline on Recent Changes, Watchlist, Page History, and User Contributions pages. Patrollers and administrators can mark the revisions as patrolled from any of the pages, without leaving the page. This functionality was voted #41 in Community Wishlist Survey 2023.
A [diff↓] button that toggles an inline diff table is added to each revision. Double click anywhere on the table to hide the diff.
A [patrol] button for unpatrolled revisions is provided to administrators and patrollers. Pressing the button marks the revision as patrolled. There is an option to not show this button (patrol_disabled: true
) for wikis where having it does not make sense.
Installation
[edit]Load the script either from your wiki's Special:MyPage/common.js page, or globally at MetaWiki from m:Special:MyPage/global.js as
// Inline diffs and inline patrol
mw.loader.load("//meta.wikimedia.org/w/index.php?title=User:Ponor/inline-diff-inline-patrol.js&action=raw&ctype=text/javascript");
On mobile devices, the script buttons may not be accessible on some of the four pages unless the advanced mode is enabled in mobile user preferences.
Please make sure that "Group results by page" is unchecked in Recent Changes; this is currently not supported because of a completely different layout of the lists in the software.
Translation and configuration
[edit]Add the following lines to either of the above pages to translate the user interface messages and adjust the type and the max height of the diff table. The script can be invoked from m:Special:MyPage/global.js for all wikis, while keeping the wiki-specific customizations and translations in your personal local Special:MyPage/common.js.
window.ip_configuration = {
//English default
patrol_button: "patrol",
patrol_button_hint: "mark as patrolled: revision #",
patrol_successful: "Patrolling revision #",
patrol_error: "Error patrolling revision #",
patrol_disabled: false,
diff_button: "diff",
diff_button_hint: "show diff",
diff_type: "table", //inline or table
max_diff_height: "40em",
}
In Croatian, for example, this could be:
//Croatian translation
window.ip_configuration = {
patrol_button: "ophodi",
patrol_button_hint: "označi ophođenom promjenu ",
patrol_successful: "Ophodim promjenu ",
patrol_error: "Pogreška u ophodnji promjene ",
patrol_disabled: false,
diff_button: "razlika",
diff_button_hint: "prikaži razliku uređivanja",
diff_type: "table", //inline, table
max_diff_height: "32em",
}