Jump to content

User:Ponor/inline-diff-inline-patrol

From Meta, a Wikimedia project coordination wiki

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.

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.

Special:RecentChanges with no user scripts running. Unpatrolled edits are marked with red exclamation marks ()
Special:RecentChanges with inline-diff-inline-patrol script buttons () and twinkle buttons (). Unpatrolled revisions are shown with a reddish background ().
Special:RecentChanges with inline-diff-inline-patrol running. The [diff] button () has been pressed to expand the revision diff table () and the revision marked as patrolled (). The diff table can be collapsed by clicking at () again or by a double click anywhere on the expanded area ().
Article history. The third revision () has previously been marked as patrolled, while the topmost two revisions still need to be examined (patrolled).
Special:Contributions

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.

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 #",
  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 ",
  diff_button: "razlika",
  diff_button_hint: "prikaži razliku uređivanja",

  diff_type: "table", //inline, table
  max_diff_height: "32em",
}