User:Bugghost/Scripts/UserRoleIndicator: Difference between revisions

Content deleted Content added
โ†’Roles and default labels: no longer working on it, going to stay this way now
typos (cool script!)
ย 
(4 intermediate revisions by 2 users not shown)
Line 7:
}}
 
This script adds customisable little labels next to username links based on the user's user roles on the English Wikipedia. Works in signatures, mentions, in page histories/contribs, and elsewhere.
 
Forked from [[User:Novem Linguae]]'s [[User:Novem Linguae/Scripts/UserHighlighterSimple|UserHighlighterSimple]], and uses 90% of the same code. This fork just adds a little div with an emoji in it next to the link, rather than setting custom CSS on the link itself - signatures are (in most cases) left in-tact.
Line 21:
* ๐Ÿ“˜ โ†’ [[WP:Extended confirmed|Extended confirmed]] (more than 500 edits and older than a month)
* ๐Ÿ“š โ†’ More than 10,000 edits
* ๐Ÿงบ โ†’ [[WP:NPR|New pagePage reviewerReviewer]]
* ๐Ÿ•ต๏ธ โ†’ [[WP:CheckUser|CheckUser]]
* ๐Ÿงน โ†’ [[WP:Admin|Admin]]
* ๐Ÿšฌ โ†’ Former Admin
Line 38 โŸถ 39:
'''Note''': unlike [[User:Novem Linguae/Scripts/UserHighlighterSimple|Novem Linguae/Scripts/UserHighlighterSimple]], this script adds new inline elements to the DOM (rather than changing styles of existing DOM elements), and so can make contents of the page jump a small amount when initially loading.
 
== Custom Labels / Placement ==
 
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.
Line 50 โŸถ 51:
arbcom: ['โš–๏ธ', 'Arbitration Committee member'],
bureaucrats: ['๐Ÿ’ผโ€', 'Bureaucrat'],
checkUsers: ['๐Ÿ•ต๏ธ', 'Check User'],
admins: ['๐Ÿงน', 'Admin'],
formerAdmins: ['๐Ÿšฌ', 'Former Admin'],
Line 78 โŸถ 80:
 
[[File:UserRoleIndicator custom examples.png|UserRoleIndicator custom examples.png]]
 
'''If you want the labels to appear ''before'' the user name''', open up your common.js file and add this line:
 
<syntaxhighlight lang="js" line="1">
this.window.UserRoleIndicatorCustomPlacement = "before";
</syntaxhighlight>
 
Thanks to [[User:Penultimate_supper]] for the feature suggestion!
 
== Bugs, feedback and suggestions ==
Line 88 โŸถ 98:
 
Either way - let me know if you have any issues and I'll take a look and see if I can get to the bottom of it.
 
== Updates ==
Now that other people are using this script I don't want to make many big changes, but I will occasionally when it's a safe, small non-controversial change.
 
* Nov 5 2024 - [[User talk:Bugghost/Scripts/UserRoleIndicator#Indicator before signature?|As requested]], added an option to enable the icons to appear ''before'' a user name, not just afterwards
* Jan 22 2025 - Added [[CheckUser]] as a supported role. The icon is the gender-neutral detective ๐Ÿ•ต๏ธ (unicode U+1F575). See above for how to customise.
 
== Todo ==
 
* <s>Add method of custom emoji choices</s>
* <s>More thorough testing</s>
* <s>Add installation instructions</s>
* <s>Add image of custom labels in use</s>