global badge/class fix
This commit is contained in:
+2
-2
@@ -42,7 +42,7 @@ function overrideStyles(text) {
|
||||
function gooseAppendMessage(id, type, timestamp, username, text, icon) {
|
||||
var html = ""
|
||||
if(parseInt(id) > 0 && type.length > 0) {
|
||||
var classes = type.split('-'), cl = classes.length, j,
|
||||
var classes = type.split('^'), cl = classes.length, j,
|
||||
colorpref = null, badges = [], platform, bname
|
||||
for(j=0;j<cl;j++) { /* detect color preference */
|
||||
if(classes[j].startsWith('color'))
|
||||
@@ -57,7 +57,7 @@ function gooseAppendMessage(id, type, timestamp, username, text, icon) {
|
||||
html += '<span class=icon>'
|
||||
for(j=0,cl=badges.length;j<cl;j++) { /* iterate over badges */
|
||||
platform = badges[j].slice(0,2) /* first 2 characters denote the platform */
|
||||
bname = badges[j].slice(2) /* thre rest is the badge name itself */
|
||||
bname = badges[j].slice(2) /* the rest is the badge name itself */
|
||||
html += '<img class=badge src="/badge/{platform}/{badgename}">'
|
||||
.replace('{platform}', platform).replace('{badgename}', bname)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user