This commit is contained in:
Mirco Wittrien 2019-08-29 23:23:06 +02:00
parent 953866ee3a
commit 49a1bc6ed0
2 changed files with 20 additions and 14 deletions

View File

@ -3,7 +3,7 @@
class EditChannels {
getName () {return "EditChannels";}
getVersion () {return "3.9.9";}
getVersion () {return "4.0.0";}
getAuthor () {return "DevilBro";}
@ -11,7 +11,7 @@ class EditChannels {
initConstructor () {
this.changelog = {
"improved":[["<span style='-webkit-background-clip: text; color: transparent; background-image: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)'>Color Gradients</span>","You can now use color gradients to edit channels"]]
"fixed":[["EditUsers bug","Fixed a bug that occured when EditUsers is enabled"]]
};
this.labels = {};
@ -401,9 +401,12 @@ class EditChannels {
else {
if (channel.type == 1) channel = this.UserUtils.getUser(channel.recipients[0]) || channel;
if (channelname.EditChannelsChangeObserver && typeof channelname.EditChannelsChangeObserver.disconnect == "function") channelname.EditChannelsChangeObserver.disconnect();
channelname.style.removeProperty("color");
channelname.style.removeProperty("background");
BDFDB.setInnerText(channelname, channel.name || channel.username);
if (BDFDB.isPluginEnabled("EditUsers")) bdplugins.EditUsers.plugin.changeName(channel, channelname);
else {
channelname.style.removeProperty("color");
channelname.style.removeProperty("background");
BDFDB.setInnerText(channelname, channel.name || channel.username);
}
}
}
}

View File

@ -3,7 +3,7 @@
class EditUsers {
getName () {return "EditUsers";}
getVersion () {return "3.5.2";}
getVersion () {return "3.5.3";}
getAuthor () {return "DevilBro";}
@ -11,7 +11,7 @@ class EditUsers {
initConstructor () {
this.changelog = {
"fixed":[["DM Header","Now works properly in DM Headers"]]
"fixed":[["EditChannels bug","Fixed a bug that occured when EditChannels is enabled"]]
};
this.labels = {};
@ -711,16 +711,19 @@ class EditUsers {
processHeaderBar (instance, wrapper) {
let channel_id = BDFDB.getReactValue(instance, "props.channelId") || BDFDB.getReactValue(instance, "_reactInternalFiber.return.memoizedProps.channelId");
if (channel_id) {
let username = wrapper.querySelector(BDFDB.dotCN.channelheaderheaderbartitle);
if (username) {
let channelname = wrapper.querySelector(BDFDB.dotCN.channelheaderheaderbartitle);
if (channelname) {
let channel = this.ChannelUtils.getChannel(channel_id);
if (channel) {
if (channel.type == 1) this.changeName(this.UserUtils.getUser(channel.recipients[0]), username);
if (channel.type == 1) this.changeName(this.UserUtils.getUser(channel.recipients[0]), channelname);
else {
if (username.EditUsersChangeObserver && typeof username.EditUsersChangeObserver.disconnect == "function") username.EditUsersChangeObserver.disconnect();
username.style.removeProperty("color");
username.style.removeProperty("background");
BDFDB.setInnerText(username, channel.name);
if (channelname.EditUsersChangeObserver && typeof channelname.EditUsersChangeObserver.disconnect == "function") channelname.EditUsersChangeObserver.disconnect();
if (BDFDB.isPluginEnabled("EditChannels")) bdplugins.EditChannels.plugin.changeChannel(channel, channelname);
else {
channelname.style.removeProperty("color");
channelname.style.removeProperty("background");
BDFDB.setInnerText(channelname, channel.name);
}
}
}
}