User:Daniel Quinlan/Scripts/FilterDiff

{{Infobox user script

| name = FilterDiff

| author = {{u|Daniel Quinlan}}

| updated = {{#time:j F Y|{{REVISIONTIMESTAMP|User:Daniel Quinlan/Scripts/FilterDiff.js}}}}

| status = Beta

| source = FilterDiff.js

}}

The FilterDiff script improves the readability of Special:AbuseFilter version diffs.

Features

  • Collapses unmodified lines that are far from changes, similar to the context or unified diff formats.
  • Provides toggle buttons to expand and collapse individual diff sections.
  • Removes unnecessary item labels to reduce clutter and maximize diff space.
  • Adds line numbers for clarity when some unmodified lines are hidden.

Usage

When a diff section is collapsible, a toggle button is displayed on the right side of its header to expand or collapse the section.

Installation

To install the FilterDiff.js script, follow these steps: {{Ordered list|In your preferences, go to {{myprefs|Gadgets}}. At the bottom of the "Advanced" section, click the "{{delink|{{int:Gadget-script-installer}}}}" checkbox, then click the "Save" button.|Return to this page and click the blue "Install" button.}}

Alternatively, you can manually install it by adding the following code to your common.js file:

{{subst:iusc|User:Daniel Quinlan/Scripts/FilterDiff.js}}

Configuration

None.