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.
The following variables might be defined for all page builds:
_
and upcased first letter.false
is to be assigned. Empty groups should not occur in Groups
array. Temporarily unused assignments might be commented out.true
– every linked page is required to exist for marking, and only page views willbe marked.false
– redlinks and relational pages will be marked,too.true
– include links to subpagesfalse
– only top level page links will receive a markerSee codes for examples.
Marked links will be equipped with two classes:
markGroupMembers
markGroupMembers-
nThey 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.
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
mw.libs.markGroupMembers = { groups: [ "A", "B" ],
users: { "A": [ "Alaŭdo",
"Alaudo",
"Andy",
...
style: "color:#0645AD;" +
"font-size:small;" +
"font-weight:bold;" +
"margin-left:0.2em;" +
"vertical-align:super;"
};
which would be followed by some
mw.loader.load("https://.....functionality.delivered.by.central.maintenance......&ctype=text/javascript");