Finished work on chat nameplate format settings.
This commit is contained in:
parent
6346b8f148
commit
cd5f168243
8 changed files with 94 additions and 5 deletions
|
|
@ -97,8 +97,9 @@ class chatPostprocessor{
|
|||
const classSuffix = pm ? 'pm-panel-sesh' : 'chat';
|
||||
const classSuffixAlt = pm ? classSuffix : 'chat-panel';
|
||||
|
||||
//Create chat-entry span
|
||||
//Create chat-entry span, and store raw message data
|
||||
this.chatEntry = document.createElement('span');
|
||||
this.chatEntry.dataset.rawData = JSON.stringify(this.rawData);
|
||||
|
||||
//Add classes to classlist
|
||||
this.chatEntry.classList.add(
|
||||
|
|
@ -137,8 +138,19 @@ class chatPostprocessor{
|
|||
flairSpan.classList.add(`${classSuffix}-entry-flair-span`, flair);
|
||||
flairSpan.innerHTML = this.rawData.user;
|
||||
|
||||
//Inject flair span into user label before the colon
|
||||
userLabel.innerHTML = `${flairSpan.outerHTML}: `;
|
||||
let colonSpan = document.createElement('span');
|
||||
colonSpan.classList.add(`${classSuffix}-entry-colon-span`);
|
||||
if(localStorage.getItem('nameplateFormat') == "left"){
|
||||
colonSpan.innerHTML = ': ';
|
||||
}else if(localStorage.getItem('nameplateFormat') == "timestamp"){
|
||||
colonSpan.classList.add(`${classSuffix}-entry-timestamp`);
|
||||
colonSpan.innerHTML = ` (${timestamp.toLocaleString()})`;
|
||||
}
|
||||
|
||||
|
||||
//Append flair and colon(or timestamp) spans to userLabel
|
||||
userLabel.appendChild(flairSpan);
|
||||
userLabel.appendChild(colonSpan);
|
||||
|
||||
//Append user label to the nameplate
|
||||
nameplate.appendChild(userLabel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue