Eisspeedway

User:Suffusion of Yellow/filter-highlighter

Filter Highlighter
DescriptionAdds highlighting and tooltips to links to edit filters
Author(s)Suffusion of Yellow
First releasedFebruary 10, 2019; 5 years ago (2019-02-10)
UpdatedDecember 14, 2019; 4 years ago (2019-12-14)
BrowsersTested with Firefox and Chromium
SkinsAll
SourceUser:Suffusion of Yellow/filter-highlighter.js

Filter Highlighter saves you the bother of clicking on links to edit filters, by adding styling to the filter link based on some of the filter parameters. Hovering over the link will reveal additional information about the filter in a tooltip.

For example, a link to Filter 384 will be shown as: Filter 384.[1]

Installation

Add the line {{subst:iusc|User:Suffusion of Yellow/filter-highlighter.js}} to your common.js page.

Default highlighting

Enabled Disabled Deleted
Public Private Public Private Public Private
Log-only Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Throttle, log-only Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Tag Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Throttle, tag Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Warn Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Throttle, warn Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Disallow Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Throttle, disallow Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
De-autoconfirm[2] Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123
Throttle, de-autoconfirm Filter 123 Filter 123 Filter 123 Filter 123 Filter 123 Filter 123

Customization

The default configuration is shown below. Copy this text to your common.js page, and modify as needed:

window.filterHighlighterConfig = {
    // If you find the default highlighting ugly, you can substitute your own stylesheet here
    // If you prefer no highlighting at all, use the empty string ("")
    style : "User:Suffusion of Yellow/filter-highlighter.css",

    // Change this to true to highlight the entire [[Special:AbuseFilter/nnn]] page.
    // Mostly intended for EFMs, as this will make it impossible to forget that
    // you're editing a filter that's set to disallow.
    style_editor : false,

    // Show title text (tooltip). Set to false for the default "Special:AbuseFilter/123"
    show_title: true,

    // Allow filter information to be up to this many seconds old.
    // Set to a much larger value for slow connections. Set to 0 if you don't mind
    // downloading an extra 140K every time you visit a page that mentions filters
    cache_seconds : 30 * 60
};

Other options may be found in the source, but are unlikely to need changing.

Notes

  1. ^ But with more up to date information, of course.
  2. ^ This feature is not currently used on enwiki