UserBadge is a simple script that automatically adds a user group badge after user links. It makes it easier for you to find local administrators or certain global groups.
Installation
Configurations
Using configuration options with Fandom Developers Wiki scripts
The instructions on this page describe how to use configuration options with a script. Here on the Fandom Developers Wiki, many scripts provide optional configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS is used to load the scripts, it will be executed last.
// 1. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;
// 2. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
window.dev.userBadge
- Type: Object
window.dev.userBadge.disabledUsers
- Type: Array
- Array of ignored users. Case Sensitive, no need for
User:prefix, replace_with spaces.
window.dev.userBadge.disabledGroups
- Type: Array
window.dev.userBadge.customBadges
- Type: Object
window.dev.userBadge.customBadges.<groupId>
- Type: String
- Image link of badge
<groupId>
MediaWiki internal ID of the user group.
eg. Administrators → sysop
Sample
window.dev = window.dev || []
window.dev.userBadge = {
disabledUsers: [
'机智的小鱼君' // Do not show user badge for User:机智的小鱼君
],
disabledGroups: [
'helper' // Do not show user badge for Helper group
],
customBadge: {
soap: 'https://your-wiki.fandom.com/path/to/file/Soap-badge.svg' // Use custom badge for SOAP group
}
}
Custom style
Use the class attribute .group-<groupId>
/** Community admin **/
.mw-userlink.group-sysop {
color: #23c6d0 !important;
}