global badge/class fix

This commit is contained in:
Luxferre
2024-09-20 13:44:13 +03:00
parent b6200db5de
commit 9f298cba52
6 changed files with 18 additions and 21 deletions
+2 -2
View File
@@ -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)
}
+2 -6
View File
@@ -36,7 +36,7 @@ html, body {
#msglist > div .icon img { /* userpic */
max-height: 16px;
padding: 0 3px;
padding: 0 1px;
margin-top: -20px;
position: relative;
top: 3px;
@@ -45,11 +45,7 @@ html, body {
.username {
display: inline;
font-weight: 600;
margin-left: 5px;
}
.icon ~ .username { /* don't apply margin if there's an icon */
margin-left: 0;
margin-left: 1px;
}
#msglist > div:not(.me) .username:after{content:":"}