MediaWiki:UserTags.js

//UserTags window.UserTagsJS = { modules: {}, tags: { //Creates titles for tags using u:	   wikiberry: {u:'Wiki Berries', order:-1/0}, bureaucrat: {u:'Wiki Head', order:0}, sysop: {u:'Wiki Admin', order:1}, 'content-moderator': {u:'Wiki Mod', order:2} },	extensions: {}, debug: true };

UserTagsJS.modules.mwGroups = ['bureaucrat', 'sysop', 'content-moderator'] UserTagsJS.modules UserTagsJS.modules.explode = { 'wikiberry': ['bureaucrat', 'sysop', 'content-moderator'] //Gives Wiki Berry role to staff members. }

//Figure out how to assign Wiki Berries to Wiki Staff.

window.UserTagsJS.extensions.Ranks = { start: function(config, username) { var promise = $.ajax({			url: mw.util.wikiScript('api'),			data: {				action: 'parse',				format: 'json',				text: ,				prop: 'text',				disablepp: 1			},			dataType: 'json'		}).then(function(json) {			var num = $(json.parse.text['*']).text.replace(/\D/g, );			if (num > 2000) {			   return ['why'];			}			if (num > 100 && num < 150) {			    return ['editor'];			}			if (num > 150 && num < 5000) {				return ['proficient']; //Should give users Proficient Editor tag if over 150 Edits but under 5000 Edits.			}			else if(num > 5000) {			    return ['grand']; //Should give users Grand Master tag if over 5000 Edits.			}			return null;		}); return { tags: { why: { u: 'WHY' }, editor: { u: 'Regular Editor'}, proficient: { u: 'Proficient Editor' }, grand: { u: 'Grand Master' } },			promise: promise };	} }; window.UserTagsJS.modules.Ranks = true;

importArticle({type:'script', article:'u:dev:MediaWiki:UserTags/code.js'});