Content deleted Content added
putting template back because i'm about to edit the script a bunch |
custom labels documentation |
||
Line 36:
Note: unlike [[User:Novem Linguae/Scripts/UserHighlighterSimple|Novem Linguae/Scripts/UserHighlighterSimple]], this script adds new inline elements to the DOM (rather than just changing colours to existing DOM elements), and so can make contents of the page jump a small amount when initial loading.
== Custom Labels ==
If you don't like the default emoji labels or tooltip texts, you can customise them to be anything you want, including just regular old text.
To do this, open up your common.js page and add this code:
<syntaxhighlight lang="js">
window.UserRoleIndicatorCustomLabels = {
wmf: ['๐', 'Wikimedia Foundation (WMF)'],
stewards: ['๐ฉบ', 'Steward or Ombud'],
arbcom: ['โ๏ธ', 'Arbitration Committee member'],
bureaucrats: ['๐ผโ', 'Bureaucrat'],
admins: ['wow, an admin, would you look at that', 'Admin'],
formerAdmins: ['๐ฌ', 'Former Admin'],
newPageReviewers: ['๐งบ', 'New page reviewer'],
tenThousandEdits: ['10 thousand edits', 'More than 10,000 edits'],
extendedConfirmed: ['๐', 'Extended confirmed'],
lessThan500: ['๐ฃ', 'Less than 500 edits'],
};
</syntaxhighlight>
Modify any of the text you want in there. The first item of the arrays is the content of the label that will appear next to the username. The second item is the tooltip label.
So for instance, if you wanted to do something different, you could have this setup:
<syntaxhighlight lang="js">window.UserRoleIndicatorCustomLabels = {
wmf: ['this user is a WMF member', 'WMF'],
stewards: ['steward coming through!!', 'Steward'],
arbcom: ['โ arb com ?!', 'arbcom'],
bureaucrats: ['crat', 'Bureaucrat'],
admins: ['๐ฎโโ๏ธ๐ฎโโ๏ธ', 'admin'],
formerAdmins: ['retired ๐ฎโโ๏ธ๐ฎโโ๏ธ', 'old admin'],
newPageReviewers: ['npp', 'New page reviewer'],
tenThousandEdits: ['too many edits', 'More than 10,000 edits'],
extendedConfirmed: ['normal amount of edits', 'Extended confirmed'],
lessThan500: ['not enough edits', 'Less than 500 edits'],
};</syntaxhighlight>
Then save your common.js. This allows you to have custom labels.
== Bugs, feedback and suggestions ==
|