User:Amorymeltzer/crathighlighter
Crat Highlighter (source code) adds a highlighted background to links leading to a user, user talk, or contribs page for: sysops, interface admins, checkusers, oversighters, bureaucrats, or ArbCom members.[1] To install it, add {{subst:iusc|User:Amorymeltzer/crathighlighter.js}}
to your common.js or skin-specific javascript page and clear your cache.
Customization options
[edit]There are lots of options!
Changing order preference
[edit]You can customize the hierarchy in which groups are displayed. That is, by putting something like
window.highlight_order = ['arbcom', 'bureaucrat', 'oversight', 'checkuser', 'interface-admin', 'sysop', 'steward'];
in your custom javascript page, you can change which highlighters will show when a user has more than one group. The first groups (on the left) will be favored; in the example above (the default), someone who is a bureaucrat and a checkuser will have the bureaucrat color.
If you don't want certain groups highlighted at all, just leave them out!
Background color customization
[edit]You can also customize the chosen highlight color for each group! The default colors are:
- Arbitrator: (
#888
) - Bureaucrat: (
#58F
) - Oversight: (
#D6D
) - Checkuser: (
#FF0
) - Interface admin: (
#6D6
) - Sysop: (
#0FF
) - Steward: (
#F93
)
If you want to change a highlight color, simply place the relevant lines from below in your custom css and change the color hexcode (the six characters after #
) to something you prefer.
.userhighlighter_steward {background-color: #FF9933 !important}
.userhighlighter_sysop {background-color: #00FFFF !important}
.userhighlighter_interface-admin {background-color: #66DD66 !important}
.userhighlighter_checkuser {background-color: #FFFF00 !important}
.userhighlighter_oversight {background-color: #DD66DD !important}
.userhighlighter_bureaucrat {background-color: #5588FF !important}
.userhighlighter_arbcom {background-color: #888888 !important}
You can also do fun stuff like
.userhighlighter_arbcom:after {content:" ⚖" !important;}
.userhighlighter_checkuser:before {content:" 🕵" !important;}
.userhighlighter_steward:after {content:" Stew" !important;}
Show all groups
[edit]There are a lot of users with more than one role, so if you'd like to do something different for those folks, you can add
window.all_groups = true;
to wherever this script was added. That will mean someone who is a sysop, interface-admin, and oversighter can have something for each of those. This means something like
.userhighlighter_checkuser:before {content:" 🕵";}
.userhighlighter_sysop:after {content: " SYS"}
Would show User:Jimbo Wales as 🕵User:Jimbo Wales SYS.
You can also chain rules to create new colors for pairings. So, for example, if you wanted everyone who was an oversight and checkuser but NOT on ArbCom to be red, you could do
.userhighlighter_checkuser.userhighlighter_oversight:not(.userhighlighter_arbcom) { background-color: #FF0000; }
NOTE: Because of the rules of CSS, when using this option whatever the last color you define will be the one preferred, regardless of your stated highlight_order. That is, if your order specifies arbcom should take precedence over checkuser, but in your custom CSS, you listed a checkuser color below an arbcom color, using all_groups = true;
will mean the checkuser color takes precedence. Basically, you should list any custom colors in the reverse order of precedence with this option.
Custom cache length
[edit]The script caches its data[2] so you aren't constantly re-requesting it every page load. You can customize how long the cache is saved (default is one hour) by specifying a number with window.cache_hours
, e.g.:
window.cache_hours = 12;
The lists typically don't change too frequently, but are nonetheless maintained by User:AmoryBot via a script run regularly on Toolforge, although any sysop is free to update them as well.
- ^ Originally based off User:Amalthea/userhighlighter.js, it now uses code from User:Bellezzasolo/Scripts/adminhighlighter.js
- ^ Caching code courtesy of Galobtter and L235