This commit is contained in:
Mirco Wittrien 2019-07-18 12:18:54 +02:00
parent 8db16bab15
commit f54b348c51
5 changed files with 44 additions and 40 deletions

View File

@ -3,7 +3,7 @@
class BadgesEverywhere {
getName () {return "BadgesEverywhere";}
getVersion () {return "1.3.4";}
getVersion () {return "1.3.5";}
getAuthor () {return "DevilBro";}
@ -11,12 +11,13 @@ class BadgesEverywhere {
initConstructor () {
this.changelog = {
"fixed":[["Showing at the bottom","Badges are now properlly at the bottom even when a custom status is set"]]
"fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]]
};
this.patchModules = {
"NameTag":"componentDidMount",
"ChannelMember":"componentDidMount",
"MessageUsername":"componentDidMount",
"UserPopout":"componentDidMount",
"StandardSidebarView":"componentWillUnmount"
};
@ -229,14 +230,8 @@ class BadgesEverywhere {
// begin of own functions
processNameTag (instance, wrapper) {
if (!wrapper.classList || !instance || !instance.props) return;
else if (BDFDB.containsClass(wrapper, BDFDB.disCN.membernametag) && BDFDB.getData("showInMemberList", this, "settings")) {
this.addBadges(instance.props.user, wrapper, "list");
}
else if (BDFDB.containsClass(wrapper, BDFDB.disCN.userpopoutheadertag) && BDFDB.getData("showInPopout", this, "settings")) {
this.addBadges(instance.props.user, BDFDB.getParentEle(BDFDB.dotCN.userpopoutheadertext, wrapper), "popout");
}
processChannelMember (instance, wrapper) {
if (instance.props && BDFDB.getData("showInMemberList", this, "settings")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.nametag), "list");
}
processMessageUsername (instance, wrapper) {
@ -246,6 +241,10 @@ class BadgesEverywhere {
if (username && BDFDB.getData("showInChat", this, "settings")) this.addBadges(message.author, wrapper, "chat");
}
}
processUserPopout (instance, wrapper) {
if (instance.props && BDFDB.getData("showInPopout", this, "settings")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.userpopoutheadertext), "popout");
}
processStandardSidebarView (instance, wrapper) {
if (this.SettingsUpdated) {

View File

@ -11,7 +11,7 @@ class BetterFriendCount {
initConstructor () {
this.changelog = {
"fixed":[["New Structure","Fixed issues that will occure once the avatar/name changes from canary will hit stable/ptb"]]
"fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]]
};
this.patchModules = {

View File

@ -3,7 +3,7 @@
class OwnerTag {
getName () {return "OwnerTag";}
getVersion () {return "1.1.3";}
getVersion () {return "1.1.4";}
getAuthor () {return "DevilBro";}
@ -11,12 +11,14 @@ class OwnerTag {
initConstructor () {
this.changelog = {
"improved":[["Crown","Changed the crown to the new crown icon"]]
"fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]]
};
this.patchModules = {
"NameTag":["componentDidMount","componentDidUpdate"],
"ChannelMember":["componentDidMount","componentDidUpdate"],
"MessageUsername":["componentDidMount","componentDidUpdate"],
"UserPopout":["componentDidMount","componentDidUpdate"],
"UserProfile":["componentDidMount","componentDidUpdate"],
"StandardSidebarView":"componentWillUnmount"
};
@ -142,18 +144,16 @@ class OwnerTag {
this.SettingsUpdated = true;
}
processNameTag (instance, wrapper) {
let container = null;
if (!instance.props || !wrapper.classList) return;
else if (BDFDB.containsClass(wrapper, BDFDB.disCN.membernametag) && BDFDB.getData("addInMemberList", this, "settings")) {
this.addOwnerTag(instance.props.user, null, wrapper, "list", BDFDB.disCN.bottagnametag + (instance.props.botClass ? (" " + instance.props.botClass) : ""), container);
}
else if ((container = BDFDB.getParentEle(BDFDB.dotCN.userpopout, wrapper)) != null && BDFDB.getData("addInUserPopout", this, "settings")) {
this.addOwnerTag(instance.props.user, null, wrapper, "popout", BDFDB.disCN.bottagnametag + (instance.props.botClass ? (" " + instance.props.botClass) : ""), container);
}
else if ((container = BDFDB.getParentEle(BDFDB.dotCN.userprofile, wrapper)) != null && BDFDB.getData("addInUserProfil", this, "settings")) {
this.addOwnerTag(instance.props.user, null, wrapper, "profile", BDFDB.disCN.bottagnametag + (instance.props.botClass ? (" " + instance.props.botClass) : ""), container);
}
processChannelMember (instance, wrapper) {
if (instance.props && BDFDB.getData("addInMemberList", this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "list", BDFDB.disCN.bottagnametag, null);
}
processUserPopout (instance, wrapper) {
if (instance.props && BDFDB.getData("addInUserPopout", this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "popout", BDFDB.disCN.bottagnametag, wrapper);
}
processUserProfile (instance, wrapper) {
if (instance.props && BDFDB.getData("addInUserProfil", this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "profile", BDFDB.disCN.bottagnametag, wrapper);
}
processMessageUsername (instance, wrapper, methodnames) {
@ -162,7 +162,7 @@ class OwnerTag {
let username = wrapper.querySelector(BDFDB.dotCN.messageusername);
if (username) {
let messagegroup = BDFDB.getParentEle(BDFDB.dotCN.messagegroup, wrapper);
this.addOwnerTag(message.author, message.channel_id, username.parentElement, "chat", BDFDB.disCN.bottagmessage + " " + (BDFDB.containsClass(messagegroup, BDFDB.disCN.messagegroupcozy) ? BDFDB.disCN.bottagmessagecozy : BDFDB.disCN.bottagmessagecompact), null);
this.addOwnerTag(message.author, message.channel_id, username.parentElement, "chat", BDFDB.containsClass(messagegroup, BDFDB.disCN.messagegroupcozy) ? BDFDB.disCN.bottagmessagecozy : BDFDB.disCN.bottagmessagecompact, null);
}
}
}

View File

@ -3,7 +3,7 @@
class RemoveNicknames {
getName () {return "RemoveNicknames";}
getVersion () {return "1.2.2";}
getVersion () {return "1.2.3";}
getAuthor () {return "DevilBro";}
@ -11,13 +11,13 @@ class RemoveNicknames {
initConstructor () {
this.changelog = {
"improved":[["Normalized Classes","Normalized Classes no longer make the plugin be rendered useless in the member list"]]
"fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]]
};
this.patchModules = {
"NameTag":"componentDidMount",
"TypingUsers":"componentDidUpdate",
"ChannelMember":"componentDidMount",
"MessageUsername":"componentDidMount",
"TypingUsers":"componentDidUpdate",
"Clickable":"componentDidMount",
"StandardSidebarView":"componentWillUnmount"
};
@ -126,10 +126,11 @@ class RemoveNicknames {
return settings.addNickname ? (settings.swapPositions ? (member.nick + " (" + username + ")") : (username + " (" + member.nick + ")")) : username;
}
processNameTag (instance, wrapper) {
if (wrapper && !BDFDB.getParentEle(BDFDB.dotCNC.userprofile + BDFDB.dotCN.userpopout, wrapper)) {
let username = wrapper.parentElement.querySelector("." + instance.props.usernameClass.replace(/ /g, "."));
if (username) BDFDB.setInnerText(username, this.getNewName(instance.props.user));
processChannelMember (instance, wrapper) {
let user = BDFDB.getReactValue(instance, "props.user");
if (user) {
let username = wrapper.querySelector(BDFDB.dotCN.memberusername);
if (username) BDFDB.setInnerText(username, this.getNewName(user));
}
}

View File

@ -3,15 +3,19 @@
class TopRoleEverywhere {
getName () {return "TopRoleEverywhere";}
getVersion () {return "2.7.9";}
getVersion () {return "2.8.0";}
getAuthor () {return "DevilBro";}
getDescription () {return "Adds the highest role of a user as a tag.";}
initConstructor () {
this.changelog = {
"fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]]
};
this.patchModules = {
"NameTag":"componentDidMount",
"ChannelMember":"componentDidMount",
"MessageUsername":"componentDidMount",
"StandardSidebarView":"componentWillUnmount"
};
@ -132,8 +136,8 @@ class TopRoleEverywhere {
// begin of own functions
processNameTag (instance, wrapper) {
if (instance.props && BDFDB.containsClass(wrapper, BDFDB.disCN.membernametag) && BDFDB.getData("showInMemberList", this, "settings")) {
processChannelMember (instance, wrapper) {
if (instance.props && BDFDB.getData("showInMemberList", this, "settings")) {
this.addRoleTag(instance.props.user, wrapper.querySelector(BDFDB.dotCN.memberusername), "list");
}
}