MediaWiki:Evelution.js

/* All JavaScript here will be loaded for users of the Evelution skin */ if((mw.config.get("wgNamespaceNumber") == 2 || mw.config.get("wgNamespaceNumber") == 202) && $('#profile-top').length > 0 && mw.config.get("wgAction") == "view") { $('#profile-title-container').replaceWith(' ' + mw.config.get("wgPageName").replace('User:', ).replace('User_profile:', ).replace('_', ' ') +' '); } $.when(mw.loader.using(["mediawiki.api"])).then(function  { var userStatsparams = {		action: 'query',		list: 'users',		ususers: mw.config.get("wgPageName").replace('User:', ).replace('User_profile:',),		usprop: 'groups',		format: 'json'	}, userStatsAPI = new mw.Api; userStatsAPI.get( userStatsparams ).done( function ( data ) { var users = data.query.users, u; for ( u in users ) { if(users[ u ].groups.includes('bureaucrat') && users[ u ].groups.includes('sysop')){ $('.hgroup').append(' Bureaucrat '); $('.hgroup').append(' Administrator '); }else if(users[ u ].groups.includes('bureaucrat')){ $('.hgroup').append(' Bureaucrat '); }else if(users[ u ].groups.includes('bot') && users[ u ].groups.includes('flow-bot')){ $('.hgroup').append(' Bot '); $('.hgroup').append('Structured Discussions bot '); }else if(users[ u ].groups.includes('bot')){ $('.hgroup').append(' Bot '); }else if(users[ u ].groups.includes('moderator') && users[ u ].groups.includes('sysop')){ $('.hgroup').append(' Administrator '); $('.hgroup').append(' Moderator '); }else if(users[ u ].groups.includes('sysop')){ $('.hgroup').append(' Administrator '); }else if(users[ u ].groups.includes('rollbacker') && users[ u ].groups.includes('moderator')){ $('.hgroup').append(' Moderator '); $('.hgroup').append(' Rollbacker '); }else if(users[ u ].groups.includes('moderator')){ $('.hgroup').append(' Moderator '); }else if(users[ u ].groups.includes('rollbacker')){ $('.hgroup').append(' Rollbacker '); }   } }); });