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"]; usertags["Olaf-Tiffi-Odus2711"] = ["Banana Train"]; usertags["Lefty7788"] = ["Muffin"]; usertags["Storm2"] = ["Keeping meteorologists in business"]; usertags["Emmaelise401"] = ['Burning Snowmen since 1964']; usertags["Candy crushin' enderman"] = ['Best Brother Ever']; usertags["3primetime3"] = ['Time After Time']; usertags["Supermario3459"] = ['Hero of the winds']; usertags["CC-8589934592"] = ['Let it go']; usertags["Asew54321"] = ['Rawr']; /* 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."]; userstars["Gold"]["Storm2"] = ["Dear Storm2, Thanks for keeping me in a job. Yours sincerely, some random meteorologist from Fungalola."];

/* 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'); }   for( var i=0, lena=stars.length; i < lena; i++) if (typeof userstars[stars[i]][currentuser] != "undefined") for( var j=0, lenb=userstars[stars[i]][currentuser].length; j < lenb; j++) $('').appendTo('.masthead-info hgroup'); } } addOnloadHook(customusertags);