add !whisper command for tiny chats
This commit is contained in:
parent
4c1f0f10a7
commit
0182c6927e
6 changed files with 92 additions and 37 deletions
|
|
@ -76,31 +76,31 @@ class chatBox{
|
|||
});
|
||||
}
|
||||
|
||||
displayChat(chat){
|
||||
displayChat(data){
|
||||
//Create chat-entry span
|
||||
var chatEntry = document.createElement('span');
|
||||
chatEntry.classList.add("chat-panel-buffer","chat-entry",`chat-entry-${chat.user}`);
|
||||
chatEntry.classList.add("chat-panel-buffer","chat-entry",`chat-entry-${data.user}`);
|
||||
|
||||
//Create high-level label
|
||||
var highLevel = document.createElement('p');
|
||||
highLevel.classList.add("chat-panel-buffer","chat-entry-high-level","high-level");
|
||||
highLevel.innerHTML = `${chat.highLevel}`;
|
||||
highLevel.innerHTML = `${data.highLevel}`;
|
||||
chatEntry.appendChild(highLevel);
|
||||
|
||||
//Create username label
|
||||
var userLabel = document.createElement('p');
|
||||
userLabel.classList.add("chat-panel-buffer","chat-entry-username");
|
||||
|
||||
if(chat.flair != "classic"){
|
||||
var flair = `flair-${chat.flair}`;
|
||||
if(data.flair != "classic"){
|
||||
var flair = `flair-${data.flair}`;
|
||||
}else{
|
||||
var flair = this.client.userList.colorMap.get(chat.user);
|
||||
var flair = this.client.userList.colorMap.get(data.user);
|
||||
}
|
||||
|
||||
//Create color span
|
||||
var colorSpan = document.createElement('span');
|
||||
colorSpan.classList.add("chat-entry-flair-span", flair);
|
||||
colorSpan.innerHTML = `${chat.user}`;
|
||||
colorSpan.innerHTML = `${data.user}`;
|
||||
userLabel.innerHTML = `${colorSpan.outerHTML}: `;
|
||||
|
||||
chatEntry.appendChild(userLabel);
|
||||
|
|
@ -108,11 +108,11 @@ class chatBox{
|
|||
//Create chat body
|
||||
var chatBody = document.createElement('p');
|
||||
chatBody.classList.add("chat-panel-buffer","chat-entry-body");
|
||||
chatBody.innerHTML = chat.msg;
|
||||
chatBody.innerHTML = data.msg;
|
||||
chatEntry.appendChild(chatBody);
|
||||
|
||||
|
||||
this.chatBuffer.appendChild(this.chatPreprocessor.preprocess(chatEntry));
|
||||
this.chatBuffer.appendChild(this.chatPreprocessor.preprocess(chatEntry, data));
|
||||
|
||||
//Set size to aspect on launch
|
||||
this.resizeAspect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue