User:Ponor/inline-diff-inline-patrol

The inline-diff-inline-patrol script loads revision diffs inline on the Recent Changes (RC), Watchlist (WL), Page History (PH), and User Contributions (UC) 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 the Community Wishlist Survey 2023. Please vote for it in 2026 HERE.
A [diff↓] button that toggles an inline diff table is added to each revision.
- Double click anywhere on the table to hide the diff.
- Ctrl+click on [diff↓] to fetch and show 10 consecutive diffs for the same page title.
- Alt+click on [diff↓] to fetch and show 10 consecutive diffs regardless of the title.
- Ctrl+click on [diff↑] will hide all shown diffs for the corresponding page.
- Alt+click on any [diff↑] will hide all shown diffs.
On the Watchlist and Page History pages, it is possible to move the last seen timestamp to the revision shown in the expanded diff by pressing the 👁 button. The feature can be disabled by setting watchlist_timestamp_disabled = true in the config. Next to the button, the unseen revision number is shown, followed by the number of unseen revisions currently shown on the Watchlist page.
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. On the other hand, on wikis where user groups other than patroller and sysop can patrol, use patrol_enabled: true to override group membership checks.






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 [[:m:User:Ponor/inline-diff-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 available 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,
patrol_enabled: false,
diff_button: "diff",
diff_button_hint: "show diff",
diff_type: "table", //inline or table
max_diff_height: "40em",
watchlist_timestamp_disabled: false,
newer_older_navigation_disabled: false,
}
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,
patrol_enabled: false,
diff_button: "razlika",
diff_button_hint: "prikaži razliku uređivanja",
diff_type: "table", //inline, table
max_diff_height: "32em",
watchlist_timestamp_disabled: false,
newer_older_navigation_disabled: false,
}