MediaWiki:UserBadge/code.js

/** * UserBadge * Add user badge after user links * ATTENSION: Do not use it. The script currently has serious performance issues **/ $(function{ $('.mw-userlink').each(function { var $this = $(this), user = $(this).attr('title'); new mw.Api.get({     action: 'query',      list: 'users',      ususers: user,      usprop: 'groups'    }).done(function(data) {      var groups = data.query.users[0].groups;      if (groups.indexOf('staff') > -1) {        $this.addClass('user-staff').after('');      }      if (groups.indexOf('sysop') > -1) {        $this.addClass('user-sysop').after('');      }    }); }); });