MediaWiki:Common.js/usertags.js

/* Any JavaScript here will be loaded for all users on every page load. */ function customusertags { var usertags = {}, userstars = {}; userstars["Gold"] = {}; userstars["Trophy"] = {}; userstars["Medal"] = {}; userstars["Shame"] = {}; userstars["Negative"] = {}; userstars["APG"] = {}; //variables

/* Adding tags */ usertags["Wildoneshelper"] = ["Any currency will do"];

/* Adding stars */ userstars["Gold"]["Lefty7788"] = ["This is a medal given to you. I'm Wildoneshelper. If not you, the wiki would not be here, and every user would not be here too."];

/* Star definitions */ var stars = {}; stars = ["Gold", "Trophy", "Medal", "Shame", "Negative", "APG"]; //Defining available stars, for later.

var starname = {};  //Set display name for each star starname["Gold"] = "Gold Star"; starname["Trophy"] = "Trophy Award"; starname["Medal"] = "Medal Award"; starname["Shame"] = "Star of Shame"; starname["Negative"] = "Negative Star"; starname["APG"] = "Anti-Playdom Group";

var starfile = {};  //Set filename for each star starfile["Gold"] = "http://images.wikia.com/wildonesgame/images/7/7b/Star_gold1.png"; starfile["Trophy"] = "http://images.wikia.com/wildonesgame/images/4/44/Trophy_Award.png"; starfile["Medal"] = "http://images.wikia.com/wildonesgame/images/b/b4/Medal_Award.png"; starfile["Shame"] = "http://images.wikia.com/wildonesgame/images/a/a3/Star_shame.png"; starfile["Negative"] = "http://images.wikia.com/wildonesgame/images/3/34/Star_negative.png"; starfile["APG"] = "http://images.wikia.com/wildonesgame/images/0/0f/Usergroup01.png";

var currentuser = $('.UserProfileMasthead .masthead-info h1').html; if (typeof currentuser != "undefined") { //Only proceed if it's a user page

if (typeof usertags[currentuser] != "undefined") { $('.UserProfileMasthead .masthead-info span.tag').remove; // remove old tags for( var i=0, len=usertags[currentuser].length; i < len; i++) $(' ' + usertags[currentuser][i] + ' ').appendTo('.masthead-info hgroup'); }