User:PerfektesChaos/js/markGroupMembers

JavaScript gadget – mark users who are members of arbitrary groups.

The script consists of a project configuration part in top region and a functional part in the guts. While the first is supposed to be maintained by a project, the latter is recommended to keep as-is.

For user nicks matching an entry in list one or more marker letters will be appended to userpage links in content area of any page, and a verbal description will be amended to link tooltip. A user might be member of several groups, which will be mentioned all.

The gadget updates when content area has been updated, e.g. by LivePreview or VisualEditor.

Project configuration
The following variables might be defined for all page builds:


 * Groups
 * Array of markers which are currently in effect for this project.
 * Limitation to active groups accelerates execution.


 * Users
 * Object which maps each marker to an array of user nicks.
 * User nicks are to be provided with single spaces rather than  and upcased first letter.
 * There might be more markers than groups with current members; an empty array or  is to be assigned. Empty groups should not occur in   array. Temporarily unused assignments might be commented out.


 * Tips
 * Object which maps each marker to a verbose explanation string appended to link tooltip.


 * Live
 * – every linked page is required to exist for marking, and only page views willbe marked.
 * – redlinks and relational pages will be marked,too.


 * Lower
 * – include links to subpages
 * – only top level page links will receive a marker


 * Sep
 * Separator string between marker components


 * Spaces
 * RegExp string describing formatted local user namespace name, including gender variants and possibly talk pages


 * Style
 * CSS string for the marker

See codes for examples.

General configuration
Marked links will be equipped with two classes: They might be used by anyone to style the link and marker. The first one is applied to all links which are member ofany group. The second one contains a consecutive digit which might be helpful for groups which are subsets of a basic group, but entirely useless in complex cases with many groups where the meaning depends on links encountered on a particular page.
 * 1)  n
 * 1)  n

Crystal ball
There is no world wide application planned right now.

However, one day the gadget might be implemented by serving the functional part from a unique global core which is fed by a local wiki definition of particular groups and customization like which would be followed by some

Codes

 * /eo.js/ – Esperanto Wikipedia – eo:MediaWiki:Gadget-markadmins.js