repalced old color function with new one
This commit is contained in:
parent
ae3ddbc434
commit
46bf209588
|
@ -324,7 +324,7 @@ class EditChannels {
|
|||
resetChannel (channelObj) {
|
||||
if (!channelObj || !channelObj.div) return;
|
||||
|
||||
if (typeof channelObj.div.editChannelsObserver == "object") channelObj.div.editChannelsObserver.disconnect();
|
||||
if (channelObj.div.EditChannelsObserver && typeof channelObj.div.EditChannelsObserver.disconnect == "function") channelObj.div.EditChannelsObserver.disconnect();
|
||||
|
||||
var channel = channelObj.div.querySelector(BDFDB.dotCNC.channelname + BDFDB.dotCN.categorycolortransition);
|
||||
|
||||
|
@ -337,7 +337,7 @@ class EditChannels {
|
|||
loadChannel (channelObj) {
|
||||
if (!channelObj || !channelObj.div) return;
|
||||
|
||||
if (typeof channelObj.div.editChannelsObserver == "object") channelObj.div.editChannelsObserver.disconnect();
|
||||
if (channelObj.div.EditChannelsObserver && typeof channelObj.div.EditChannelsObserver.disconnect == "function") channelObj.div.EditChannelsObserver.disconnect();
|
||||
|
||||
var channel = channelObj.div.querySelector(BDFDB.dotCNC.channelname + BDFDB.dotCN.categorycolortransition);
|
||||
|
||||
|
@ -349,8 +349,8 @@ class EditChannels {
|
|||
channelObj.div.setAttribute("custom-editchannels", true);
|
||||
channel.style.setProperty("color", color);
|
||||
if (color) {
|
||||
channelObj.div.editChannelsObserver = new MutationObserver(() => {channel.style.setProperty("color", this.chooseColor(channel, color));});
|
||||
channelObj.div.editChannelsObserver.observe(channelObj.div, {attributes:true,characterData:true,subtree:true});
|
||||
channelObj.div.EditChannelsObserver = new MutationObserver(() => {channel.style.setProperty("color", this.chooseColor(channel, color));});
|
||||
channelObj.div.EditChannelsObserver.observe(channelObj.div, {attributes:true,characterData:true,subtree:true});
|
||||
}
|
||||
|
||||
BDFDB.setInnerText(channel, name);
|
||||
|
|
|
@ -116,7 +116,7 @@ class EditServers {
|
|||
|
||||
getDescription () {return "Allows you to change the icon, name and color of servers.";}
|
||||
|
||||
getVersion () {return "1.8.7";}
|
||||
getVersion () {return "1.8.8";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -441,8 +441,8 @@ class EditServers {
|
|||
var bgImage = data.url ? ("url(" + data.url + ")") : (serverObj.icon ? "url('https://cdn.discordapp.com/icons/" + serverObj.id + "/" + serverObj.icon + ".png')" : "");
|
||||
var removeIcon = data.removeIcon;
|
||||
var shortName = data.shortName ? data.shortName : (serverObj.icon && !removeIcon ? "" : serverObj.data.acronym);
|
||||
var color1 = data.color1 ? BDFDB.color2RGB(data.color1) : "";
|
||||
var color2 = data.color2 ? BDFDB.color2RGB(data.color2) : "";
|
||||
var color1 = data.color1 ? BDFDB.colorCONVERT(data.color1, "RGB") : "";
|
||||
var color2 = data.color2 ? BDFDB.colorCONVERT(data.color2, "RGB") : "";
|
||||
$(serverObj.div)
|
||||
.off("mouseenter." + this.getName())
|
||||
.on("mouseenter." + this.getName(), () => {this.createServerToolTip(serverObj);})
|
||||
|
@ -469,8 +469,8 @@ class EditServers {
|
|||
var data = BDFDB.loadData(serverObj.id, this, "servers");
|
||||
if (data) {
|
||||
var text = data.name ? data.name : serverObj.name;
|
||||
var bgColor = data.color3 ? BDFDB.color2RGB(data.color3) : "";
|
||||
var fontColor = data.color4 ? BDFDB.color2RGB(data.color4) : "";
|
||||
var bgColor = data.color3 ? BDFDB.colorCONVERT(data.color3, "RGB") : "";
|
||||
var fontColor = data.color4 ? BDFDB.colorCONVERT(data.color4, "RGB") : "";
|
||||
var customTooltipCSS = `
|
||||
body ${BDFDB.dotCN.tooltip}:not(.guild-custom-tooltip) {
|
||||
display: none !important;
|
||||
|
|
|
@ -169,7 +169,7 @@ class EditUsers {
|
|||
|
||||
getDescription () {return "Allows you to change the icon, name, tag and color of users. Does not work in compact mode.";}
|
||||
|
||||
getVersion () {return "2.4.7";}
|
||||
getVersion () {return "2.4.8";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -760,25 +760,25 @@ class EditUsers {
|
|||
var member = this.MemberPerms.getMember(this.LastGuildStore.getGuildId(), info.id);
|
||||
if (username) {
|
||||
var name = data.name ? data.name : (type == "info" || type == "profil" || !member || !member.nick ? info.username : member.nick);
|
||||
var color1 = data.color1 ? BDFDB.color2RGB(data.color1) : (member && member.colorString ? BDFDB.color2RGB(member.colorString) : "");
|
||||
var color2 = data.color2 ? BDFDB.color2RGB(data.color2) : "";
|
||||
var color1 = data.color1 ? BDFDB.colorCONVERT(data.color1, "RGB") : (member && member.colorString ? BDFDB.colorCONVERT(member.colorString, "RGB") : "");
|
||||
var color2 = data.color2 ? BDFDB.colorCONVERT(data.color2, "RGB") : "";
|
||||
BDFDB.setInnerText(username, name);
|
||||
username.style.color = color1;
|
||||
username.style.background = color2;
|
||||
username.style.setProperty("color", color1);
|
||||
username.style.setProperty("background", color2);
|
||||
|
||||
for (let markup of div.querySelectorAll(BDFDB.dotCN.messagemarkup)) {
|
||||
markup.style.color = settingsCookie["bda-gs-7"] && settingsCookie["bda-gs-7"] == true ? color1 : "";
|
||||
markup.style.setProperty("color", settingsCookie["bda-gs-7"] && settingsCookie["bda-gs-7"] == true ? color1 : "");
|
||||
}
|
||||
}
|
||||
if (avatar && (data.removeIcon || data.url)) {
|
||||
if (avatar.style.background.indexOf(info.id + "/a_")) {
|
||||
if (avatar.style.getPropertyValue("background-image").indexOf(info.id + "/a_")) {
|
||||
let changeblock = false;
|
||||
avatar.EditUsersAvatarObserver = new MutationObserver((changes, _) => {
|
||||
changes.forEach(
|
||||
(change, i) => {
|
||||
if (!changeblock && avatar.style.background.indexOf(info.id + "/a_")) {
|
||||
if (!changeblock && avatar.style.getPropertyValue("background-image").indexOf(info.id + "/a_")) {
|
||||
changeblock = true;
|
||||
avatar.style.background = data.removeIcon ? "" : "url(" + data.url + ") center/cover";
|
||||
avatar.style.setProperty("background", data.removeIcon ? "" : "url(" + data.url + ") center/cover");
|
||||
setImmediate(() => {changeblock = false;});
|
||||
}
|
||||
}
|
||||
|
@ -786,7 +786,7 @@ class EditUsers {
|
|||
});
|
||||
avatar.EditUsersAvatarObserver.observe(avatar, {attributes:true});
|
||||
}
|
||||
avatar.style.background = data.removeIcon ? "" : "url(" + data.url + ") center/cover";
|
||||
avatar.style.setProperty("background", data.removeIcon ? "" : "url(" + data.url + ") center/cover");
|
||||
if (type == "call") {
|
||||
$(avatar)
|
||||
.off("mouseenter." + this.getName())
|
||||
|
@ -799,17 +799,17 @@ class EditUsers {
|
|||
var tag = data.tag ? data.tag : null;
|
||||
if (tag && wrapper && !wrapper.querySelector(".user-tag") && (type == "list" || type == "chat" || type == "popout" || type == "profil" || type == "dmheader")) {
|
||||
var color3 = data.ignoreTagColor ?
|
||||
(member && member.colorString ? BDFDB.color2RGB(member.colorString) : "") :
|
||||
(data.color3 ? BDFDB.color2RGB(data.color3) : "");
|
||||
var color3COMP = color3 ? BDFDB.color2COMP(color3) : [0,0,0];
|
||||
(member && member.colorString ? BDFDB.colorCONVERT(member.colorString, "RGB") : "") :
|
||||
(data.color3 ? BDFDB.colorCONVERT(data.color3, "RGB") : "");
|
||||
var color3COMP = color3 ? BDFDB.colorCONVERT(color3, "RGBCOMP") : [0,0,0];
|
||||
var color4 = !data.ignoreTagColor && data.color4 ?
|
||||
BDFDB.color2RGB(data.color4) :
|
||||
BDFDB.colorCONVERT(data.color4, "RGB") :
|
||||
(color3COMP[0] > 180 && color3COMP[1] > 180 && color3COMP[2] > 180 ? "black" : "white");
|
||||
var thisTag = $(this.tagMarkup)[0];
|
||||
thisTag.classList.add(type + "-tag");
|
||||
thisTag.innerText = tag;
|
||||
thisTag.style.background = color3;
|
||||
thisTag.style.color = color4;
|
||||
thisTag.style.setProperty("background", color3);
|
||||
thisTag.style.setProperty("color", color4);
|
||||
wrapper.appendChild(thisTag);
|
||||
}
|
||||
|
||||
|
@ -839,22 +839,20 @@ class EditUsers {
|
|||
var serverObj = BDFDB.getSelectedServer();
|
||||
var member = serverObj ? this.MemberPerms.getMember(serverObj.id, info.id) : null;
|
||||
var name = div.classList.contains(BDFDB.disCN.accountinfo) || !member || !member.nick ? info.username : member.nick;
|
||||
var color1 = member && member.colorString ? BDFDB.color2RGB(member.colorString) : "";
|
||||
var color2 = "";
|
||||
var color1 = member && member.colorString ? BDFDB.colorCONVERT(member.colorString, "RGB") : "";
|
||||
|
||||
BDFDB.setInnerText(username, name);
|
||||
username.style.color = color1;
|
||||
username.style.background = color2;
|
||||
username.style.setProperty("color", color1);
|
||||
username.style.removeProperty("background");
|
||||
|
||||
for (let markup of div.querySelectorAll(BDFDB.dotCN.messagemarkup)) {
|
||||
markup.style.color = settingsCookie["bda-gs-7"] && settingsCookie["bda-gs-7"] == true ? color1 : "";
|
||||
markup.style.setProperty("color", settingsCookie["bda-gs-7"] && settingsCookie["bda-gs-7"] == true ? color1 : "");
|
||||
}
|
||||
}
|
||||
|
||||
if (avatar) {
|
||||
if (avatar.EditUsersAvatarObserver && typeof avatar.EditUsersAvatarObserver.disconnect == "function") avatar.EditUsersAvatarObserver.disconnect();
|
||||
avatar.style.background = "url(" + BDFDB.getUserAvatar(info.id) + ")";
|
||||
avatar.style.backgroundSize = "cover";
|
||||
avatar.style.setProperty("background", "url(" + BDFDB.getUserAvatar(info.id) + ") center/cover");
|
||||
$(avatar).off("mouseenter." + this.getName());
|
||||
}
|
||||
|
||||
|
@ -896,7 +894,7 @@ class EditUsers {
|
|||
let info = this.UserStore.getUser(div.getAttribute("custom-editusers"));
|
||||
if (!info) {
|
||||
let avatar = div.querySelector("[style*='/avatars/']");
|
||||
if (avatar) info = this.UserStore.getUser(avatar.style.backgroundImage.split("/avatars/")[1].split("/")[0]);
|
||||
if (avatar) info = this.UserStore.getUser(avatar.style.getPropertyValue("background-image").split("/avatars/")[1].split("/")[0]);
|
||||
else {
|
||||
info = BDFDB.getKeyInformation({"node":div,"key":"user"});
|
||||
if (!info) {
|
||||
|
@ -930,7 +928,7 @@ class EditUsers {
|
|||
let data = BDFDB.loadData(id, this, "users");
|
||||
if (data) {
|
||||
if (data.name) mention.innerText = "@" + data.name;
|
||||
let color = data.color1 ? BDFDB.color2COMP(data.color1) : null;
|
||||
let color = data.color1 ? BDFDB.colorCONVERT(data.color1, "RGBCOMP") : null;
|
||||
if (data.color1) {
|
||||
mention.style.setProperty("color", "rgb(" + color[0] + "," + color[1] + "," + color[2] + ")", "important");
|
||||
mention.style.setProperty("background", "rgba(" + color[0] + "," + color[1] + "," + color[2] + ",.1)", "important");
|
||||
|
@ -959,8 +957,8 @@ class EditUsers {
|
|||
let member = this.MemberPerms.getMember(this.LastGuildStore.getGuildId(), sortedids[i].id);
|
||||
if (user) {
|
||||
var name = data && data.name ? data.name : (member && member.nick ? member.nick : user.username);
|
||||
var color1 = data && data.color1 ? BDFDB.color2RGB(data.color1) : (member && member.colorString ? BDFDB.color2RGB(member.colorString) : "");
|
||||
var color2 = data && data.color2 ? BDFDB.color2RGB(data.color2) : "";
|
||||
var color1 = data && data.color1 ? BDFDB.colorCONVERT(data.color1, "RGB") : (member && member.colorString ? BDFDB.colorCONVERT(member.colorString, "RGB") : "");
|
||||
var color2 = data && data.color2 ? BDFDB.colorCONVERT(data.color2, "RGB") : "";
|
||||
strong.innerHTML = `<label style="color:${color1};background-color:${color2};">${BDFDB.encodeToHTML(name)}</label>`;
|
||||
}
|
||||
i++;
|
||||
|
|
|
@ -304,7 +304,7 @@ class ServerFolders {
|
|||
|
||||
getDescription () {return "Adds the feature to create folders to organize your servers. Right click a server > 'Serverfolders' > 'Create Server' to create a server. To add servers to a folder hold 'Ctrl' and drag the server onto the folder, this will add the server to the folderlist and hide it in the serverlist. To open a folder click the folder. A folder can only be opened when it has at least one server in it. To remove a server from a folder, open the folder and either right click the server > 'Serverfolders' > 'Remove Server from Folder' or hold 'Del' and click the server in the folderlist.";}
|
||||
|
||||
getVersion () {return "5.8.8";}
|
||||
getVersion () {return "5.8.9";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -807,8 +807,8 @@ class ServerFolders {
|
|||
var data = BDFDB.loadData(folderDiv.id, this, "folders");
|
||||
if (data) {
|
||||
if (data.folderName) {
|
||||
var bgColor = data.color3 ? BDFDB.color2RGB(data.color3) : "";
|
||||
var fontColor = data.color4 ? BDFDB.color2RGB(data.color4) : "";
|
||||
var bgColor = data.color3 ? BDFDB.colorCONVERT(data.color3, "RGB") : "";
|
||||
var fontColor = data.color4 ? BDFDB.colorCONVERT(data.color4, "RGB") : "";
|
||||
BDFDB.createTooltip(data.folderName, folderDiv, {type:"right",selector:"guild-folder-tooltip",style:`color: ${fontColor} !important; background-color: ${bgColor} !important; border-color: ${bgColor} !important;`});
|
||||
}
|
||||
}
|
||||
|
@ -817,8 +817,8 @@ class ServerFolders {
|
|||
createServerToolTip (serverObj, target, e) {
|
||||
var data = BDFDB.loadData(serverObj.id, "EditServers", "servers");
|
||||
var text = data ? (data.name ? data.name : serverObj.name) : serverObj.name;
|
||||
var bgColor = data ? (data.color3 ? BDFDB.color2RGB(data.color3) : "") : "";
|
||||
var fontColor = data ? (data.color4 ? BDFDB.color2RGB(data.color4) : "") : "";
|
||||
var bgColor = data ? (data.color3 ? BDFDB.colorCONVERT(data.color3, "RGB") : "") : "";
|
||||
var fontColor = data ? (data.color4 ? BDFDB.colorCONVERT(data.color4, "RGB") : "") : "";
|
||||
|
||||
BDFDB.createTooltip(text, target, {type:"right",selector:"guild-custom-tooltip",style:`color: ${fontColor} !important; background-color: ${bgColor} !important; border-color: ${bgColor} !important;`});
|
||||
}
|
||||
|
@ -903,8 +903,8 @@ class ServerFolders {
|
|||
}
|
||||
|
||||
changeImgColor (color1, color2, icon, callback) {
|
||||
color1 = BDFDB.color2COMP(color1);
|
||||
color2 = BDFDB.color2COMP(color2);
|
||||
color1 = BDFDB.colorCONVERT(color1, "RGBCOMP");
|
||||
color2 = BDFDB.colorCONVERT(color2, "RGBCOMP");
|
||||
if (!color1 || !color2 || !icon) return;
|
||||
var img = new Image();
|
||||
img.src = icon;
|
||||
|
@ -1264,7 +1264,7 @@ class ServerFolders {
|
|||
let hasicon = !serverCopy.querySelector(BDFDB.dotCN.guildicon).classList.contains(BDFDB.disCN.avatarnoicon);
|
||||
|
||||
copyinner.style.setProperty("border-radius", isselected ? "15px" : "25px");
|
||||
copyinner.style.setProperty("background-color", hasicon ? null : BDFDB.color2RGB(this.DiscordConstants.Colors[isselected ? "BRAND_PURPLE" : "CHANNELS_GREY"]));
|
||||
copyinner.style.setProperty("background-color", hasicon ? null : BDFDB.colorCONVERT(this.DiscordConstants.Colors[isselected ? "BRAND_PURPLE" : "CHANNELS_GREY"], "RGB"));
|
||||
|
||||
this.addHoverBehaviour(serverCopy);
|
||||
|
||||
|
@ -1283,8 +1283,8 @@ class ServerFolders {
|
|||
})
|
||||
.addListener((value) => {
|
||||
if (divicon.classList.contains(BDFDB.disCN.avatarnoicon)) {
|
||||
let comp = BDFDB.color2COMP(value.value.replace("a",""));
|
||||
divinner.style.setProperty("background-color", `rgb(${comp[0]}, ${comp[1]}, ${comp[2]})`);
|
||||
let comp = BDFDB.colorCONVERT(value.value, "RGBCOMP");
|
||||
if (comp) divinner.style.setProperty("background-color", `rgb(${comp[0]}, ${comp[1]}, ${comp[2]})`);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ class ShowHiddenChannels {
|
|||
|
||||
getDescription () {return "Displays channels that are hidden from you by role restrictions.";}
|
||||
|
||||
getVersion () {return "2.3.5";}
|
||||
getVersion () {return "2.3.6";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -480,11 +480,11 @@ class ShowHiddenChannels {
|
|||
if (allowedRoles.length > 0 || overwrittenRoles.length > 0) {
|
||||
htmlString += `<div class="${BDFDB.disCN.marginbottom4}">Allowed Roles:</div><div class="${BDFDB.disCNS.flex + BDFDB.disCN.wrap}">`;
|
||||
for (let role of allowedRoles) {
|
||||
let color = role.colorString ? BDFDB.color2COMP(role.colorString) : [255,255,255];
|
||||
let color = role.colorString ? BDFDB.colorCONVERT(role.colorString, "RGBCOMP") : [255,255,255];
|
||||
htmlString += `<div class="${BDFDB.disCNS.userpopoutrole + BDFDB.disCNS.flex + BDFDB.disCNS.aligncenter + BDFDB.disCN.wrap + BDFDB.disCNS.size12 + BDFDB.disCN.weightmedium} SHC-allowedrole" style="border-color: rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.6);"><div class="${BDFDB.disCNS.userpopoutrolecircle}" style="background-color: rgb(${color[0]}, ${color[1]}, ${color[2]});"></div><div class="${BDFDB.disCNS.userpopoutrolename}">${BDFDB.encodeToHTML(role.name)}</div></div>`;
|
||||
}
|
||||
for (let role of overwrittenRoles) {
|
||||
let color = role.colorString ? BDFDB.color2COMP(role.colorString) : [255,255,255];
|
||||
let color = role.colorString ? BDFDB.colorCONVERT(role.colorString, "RGBCOMP") : [255,255,255];
|
||||
htmlString += `<div class="${BDFDB.disCNS.userpopoutrole + BDFDB.disCNS.flex + BDFDB.disCNS.aligncenter + BDFDB.disCN.wrap + BDFDB.disCNS.size12 + BDFDB.disCN.weightmedium} SHC-overwrittenrole" style="border-color: rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.6);"><div class="${BDFDB.disCNS.userpopoutrolecircle}" style="background-color: rgb(${color[0]}, ${color[1]}, ${color[2]});"></div><div class="${BDFDB.disCNS.userpopoutrolename}" style="text-decoration: line-through !important;">${BDFDB.encodeToHTML(role.name)}</div></div>`;
|
||||
}
|
||||
htmlString += `</div>`;
|
||||
|
@ -492,7 +492,7 @@ class ShowHiddenChannels {
|
|||
if (allowedUsers.length > 0) {
|
||||
htmlString += `<div class="${BDFDB.disCN.marginbottom4}">Allowed Users:</div><div class="${BDFDB.disCNS.flex + BDFDB.disCN.wrap}">`;
|
||||
for (let user of allowedUsers) {
|
||||
let color = user.colorString ? BDFDB.color2COMP(user.colorString) : [255,255,255];
|
||||
let color = user.colorString ? BDFDB.colorCONVERT(user.colorString, "RGBCOMP") : [255,255,255];
|
||||
htmlString += `<div class="${BDFDB.disCNS.userpopoutrole + BDFDB.disCNS.flex + BDFDB.disCNS.aligncenter + BDFDB.disCN.wrap + BDFDB.disCNS.size12 + BDFDB.disCN.weightmedium} SHC-denieduser" style="border-color: rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.6);"><div class="${BDFDB.disCNS.userpopoutrolecircle}" style="background-color: rgb(${color[0]}, ${color[1]}, ${color[2]});"></div><div class="${BDFDB.disCNS.userpopoutrolename}">${BDFDB.encodeToHTML(user.nick ? user.nick : user.name)}</div></div>`;
|
||||
}
|
||||
htmlString += `</div>`;
|
||||
|
@ -500,7 +500,7 @@ class ShowHiddenChannels {
|
|||
if (deniedRoles.length > 0) {
|
||||
htmlString += `<div class="${BDFDB.disCN.marginbottom4}">Denied Roles:</div><div class="${BDFDB.disCNS.flex + BDFDB.disCN.wrap}">`;
|
||||
for (let role of deniedRoles) {
|
||||
let color = role.colorString ? BDFDB.color2COMP(role.colorString) : [255,255,255];
|
||||
let color = role.colorString ? BDFDB.colorCONVERT(role.colorString, "RGBCOMP") : [255,255,255];
|
||||
htmlString += `<div class="${BDFDB.disCNS.userpopoutrole + BDFDB.disCNS.flex + BDFDB.disCNS.aligncenter + BDFDB.disCN.wrap + BDFDB.disCNS.size12 + BDFDB.disCN.weightmedium} SHC-deniedrole" style="border-color: rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.6);"><div class="${BDFDB.disCNS.userpopoutrolecircle}" style="background-color: rgb(${color[0]}, ${color[1]}, ${color[2]});"></div><div class="${BDFDB.disCNS.userpopoutrolename}">${BDFDB.encodeToHTML(role.name)}</div></div>`;
|
||||
}
|
||||
htmlString += `</div>`;
|
||||
|
@ -508,7 +508,7 @@ class ShowHiddenChannels {
|
|||
if (deniedUsers.length > 0) {
|
||||
htmlString += `<div class="${BDFDB.disCN.marginbottom4}">Denied Users:</div><div class="${BDFDB.disCNS.flex + BDFDB.disCN.wrap}">`;
|
||||
for (let user of deniedUsers) {
|
||||
let color = user.colorString ? BDFDB.color2COMP(user.colorString) : [255,255,255];
|
||||
let color = user.colorString ? BDFDB.colorCONVERT(user.colorString, "RGBCOMP") : [255,255,255];
|
||||
htmlString += `<div class="${BDFDB.disCNS.userpopoutrole + BDFDB.disCNS.flex + BDFDB.disCNS.aligncenter + BDFDB.disCN.wrap + BDFDB.disCNS.size12 + BDFDB.disCN.weightmedium} SHC-denieduser" style="border-color: rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.6);"><div class="${BDFDB.disCNS.userpopoutrolecircle}" style="background-color: rgb(${color[0]}, ${color[1]}, ${color[2]});"></div><div class="${BDFDB.disCNS.userpopoutrolename}">${BDFDB.encodeToHTML(user.nick ? user.nick : user.name)}</div></div>`;
|
||||
}
|
||||
htmlString += `</div>`;
|
||||
|
|
|
@ -45,7 +45,7 @@ class TopRoleEverywhere {
|
|||
|
||||
getDescription () {return "Adds the highest role of a user as a tag.";}
|
||||
|
||||
getVersion () {return "2.7.2";}
|
||||
getVersion () {return "2.7.3";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -117,7 +117,7 @@ class TopRoleEverywhere {
|
|||
if (change.addedNodes) {
|
||||
change.addedNodes.forEach((node) => {
|
||||
if (BDFDB.getData("showInChat", this, "settings")) {
|
||||
if (node && node.tagName && node.querySelector(BDFDB.dotCN.messageusername)) {
|
||||
if (node.tagName && node.querySelector(BDFDB.dotCN.messageusername)) {
|
||||
this.addRoleTag(node, "chat", BDFDB.getDiscordMode() == "compact");
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ class TopRoleEverywhere {
|
|||
var role = this.GuildPerms.getHighestRole(guild, userID);
|
||||
|
||||
if ((role && (role.colorString || settings.includeColorless)) || userID == 278543574059057154) {
|
||||
var roleColor = role && role.colorString ? BDFDB.color2COMP(role.colorString) : [255,255,255];
|
||||
var roleColor = role && role.colorString ? BDFDB.colorCONVERT(role.colorString, "RGBCOMP") : [255,255,255];
|
||||
var roleName = role ? role.name : "";
|
||||
var totalwidth, oldwidth, newwidth, maxwidth;
|
||||
if (type == "list") {
|
||||
|
|
Loading…
Reference in New Issue