(Created page with "→‎This script was created by [[User:452]] for the Saints Row Wiki: http://saintsrow.wikia.com: →‎Any JavaScript here will be loaded for all users on every page load.: ...") Tag: sourceedit  |
m (Applied for now) Tag: sourceedit  |
||
Line 6: | Line 6: | ||
/* Adding tags */ |
/* Adding tags */ |
||
− | + | /* usertags["?"] = ["?"]; */ |
|
var currentuser = $('.UserProfileMasthead .masthead-info h1').html(); |
var currentuser = $('.UserProfileMasthead .masthead-info h1').html(); |
Latest revision as of 13:38, 24 March 2016
/* This script was created by [[User:452]] for the Saints Row Wiki: http://saintsrow.wikia.com */
/* Any JavaScript here will be loaded for all users on every page load. */
function customusertags() {
var usertags = {}; // variable
/* Adding tags */
/* usertags["?"] = ["?"]; */
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++)
$('<span class="tag">' + usertags[currentuser][i] + '</span>').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++)
$('<img src="'+starfile[stars[i]]+'" title="' + userstars[stars[i]][currentuser][j] + '" class="userstar '+stars[i]+'">').appendTo('.masthead-info hgroup');
}
}
addOnloadHook(customusertags);