MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ $.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: 'blockinfo|groups|editcount|registration|emailable|gender',		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('founder')){ $('.hgroup').append(' Founder '); } 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 '); } if(mw.config.get("wgPageName").replace('User_profile:', 'User:') == "User:TheDemon08"){ $('.hgroup').append('Team Lead: Titans '); }else if(mw.config.get("wgPageName").replace('User_profile:', 'User:') == "User:Universal_Omega"){ $('.hgroup').append('Team Lead: Stargirl '); }else if(mw.config.get("wgPageName").replace('User_profile:', 'User:') == "User:Zomlouis"){ $('.hgroup').append('Team Lead: The Flash (1990) '); }else if(mw.config.get("wgPageName").replace('User_profile:', 'User:') == "User:IC228"){ $('.hgroup').append('Team Lead: The Flash (2014) '); }else if(mw.config.get("wgPageName").replace('User_profile:', 'User:') == "User:Rman41"){ $('.hgroup').append('Team Lead: Superman Anthology '); }

$('#profile-right').after( ' ' + users[ u ].editcount + ' edits '); var bioParams = { action: 'parse', page: mw.config.get("wgPageName").replace('User_profile:', 'User:') + '/bio', format: 'json', prop: 'wikitext' }; var BioAPI = new mw.Api;

BioAPI.get(bioParams).done(function ( data ) {	$('.stats').after(' ' + data.parse.wikitext['*'] + ' '); }); } } );

}); }