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["Lefty7788"] = ["W"]; usertags["Storm2"] = ["50% cat, 50% thunderstorm"]; usertags["EndermanR169"] = ['Best Brother Ever']; usertags["3primetime3"] = ['Time After Time']; usertags["Supermario3459"] = [':-)']; usertags["CC-8589934592"] = ['Let it go!'];  usertags["Asew54321"] = ['Rawr'];  usertags["EeveeLover1988"] = ['Eevee 4ever!'];  usertags["Blackbird625"] = ["Never cussed before, never will"];  usertags["Liquoritz"] = ["Vanished forever"];  usertags["Olaf-Tiffi-Odus2711"] = ["I like trains"];  usertags["3litecandycrusher"] = ["Never liked 323, never will"];  usertags["ChaneyTheSamurott"] = ["Samurott, the formidable Pokémon"];  usertags["The Gatling Pea"] = ["Disturbed a nest of wasps for no good reason"];  usertags["Flockky II"] = ["Flappy-Go-Lucky"];  usertags["Solstice2000"] = ["Shiba Inu!!!"];  usertags["DoCheonGong"] = ["The Sweet Sky"];  usertags["Spongebob789"] = ["The Unlucky Sponge"]; /* Adding stars */  userstars["Gold"]["Lefty7788"] = ["This is a medal given to you. If not for 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."]; userstars["Gold"]["3primetime3"] = ["I'm Queen Elsa. Congratulations you for being a bureaucrat! So, this is a medal I give you for the hard work you do on this wiki."]; userstars["Gold"]["Wildoneshelper"] = ["Gold star for bureaucrat by DCG"]; userstars["Medal"]["Jacob5664"] = ["Flockky here. You have followed and accomplished the task about the usage of Game Maker. A medal deserves for you. Take good care of it. :)"]; userstars["Gold"]["Imamadmad"] = ["This is 3primetime3. You've definitely worked hard to make this wiki the best it can be. I want to give you this medal to show you my thanks!"];  userstars["Gold"]["Catinthedark"] = ["This is 3primetime3. You've worked diligently to make this wiki the best it can be. I want to give you this medal to show you my thanks!"];  userstars["Medal"]["Spongebob789"] = ["Flockky here. Congratulations for being Chat Moderator! Take good care of the medal. :)"]; userstars["Gold"]["Marisa1980"] = ["Queen Elsa here. I give you a gold medal because you did many things that beyond imagination with us. Use it well! <3"]; /* 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);