dev

UserBadge это простой скрипт, который добавляет значок группы пользователя после его ника.

Installation

Конфигурация

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.

Configuration options load too late, don't work
// 1. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});

// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
Proper placement of configuration options
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;

// 2. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});

window.dev.userBadge

window.dev.userBadge.disabledUsers

window.dev.userBadge.disabledGroups

window.dev.userBadge.customBadges

window.dev.userBadge.customBadges.<ID группы>

<ID группы>

ID группы пользователей MediaWiki.

Например: Администраторsysop

Пример

window.dev = window.dev || {}
window.dev.userBadge = {
  disabledUsers: [
    '机智的小鱼君' // Не показывать значок для пользователя с ником 机智的小鱼君
  ],
  disabledGroups: [
    'helper' // Не показывать значок для группы Helper (помощник)
  ],
  customBadge: {
    soap: 'https://your-wiki.fandom.com/path/to/file/Soap-badge.svg' // Использование своего значка для группы SOAP
  }
}

Настройка стилей

Используйте класс .group-<ID-группы>

/** Администратор **/
.mw-userlink.group-sysop {
  color: #23c6d0 !important;
}