This commit is contained in:
Mirco Wittrien 2018-12-27 10:19:30 +01:00
parent 2a88ba70cd
commit 1f5a1328c7
2 changed files with 12 additions and 9 deletions

View File

@ -10,7 +10,8 @@ class EditChannels {
"ChannelCategoryItem":"componentDidMount",
"ChannelItem":"componentDidMount",
"HeaderBar":["componentDidMount","componentDidUpdate"],
"Clickable":"componentDidMount"
"Clickable":"componentDidMount",
"StandardSidebarView":"componentWillUnmount"
};
this.channelContextEntryMarkup =
@ -267,7 +268,6 @@ class EditChannels {
}
processChannelTextArea (instance, wrapper) {
if (!wrapper) return;
if (instance.props && instance.props.type == "normal" && instance.props.channel && instance.props.channel.type == 0) {
let channel = instance.props.channel;
let data = BDFDB.loadData(channel.id, this, "channels") || {};
@ -276,7 +276,6 @@ class EditChannels {
}
processAuditLog (instance, wrapper) {
if (!wrapper) return;
if (instance.props && instance.props.log && instance.props.log.options && instance.props.log.options.channel) {
let hooks = wrapper.querySelectorAll(BDFDB.dotCN.flexchild + " > span:not(" + BDFDB.dotCN.auditloguserhook + ")");
if (hooks.length > 0) this.changeChannel2(instance.props.log.options.channel, hooks[0].firstChild);
@ -284,14 +283,12 @@ class EditChannels {
}
processChannelCategoryItem (instance, wrapper) {
if (!wrapper) return;
if (instance.props && instance.props.channel) {
this.changeChannel(instance.props.channel, wrapper.querySelector(BDFDB.dotCN.categorycolortransition));
}
}
processChannelItem (instance, wrapper) {
if (!wrapper) return;
if (instance.props && instance.props.channel) {
this.changeChannel(instance.props.channel, wrapper.querySelector(BDFDB.dotCN.channelname));
}
@ -318,7 +315,7 @@ class EditChannels {
}
processClickable (instance, wrapper) {
if (!wrapper || !instance.props || !instance.props.className) return;
if (!instance.props || !instance.props.className) return;
else if (instance.props.tag == "span" && instance.props.className.indexOf(BDFDB.disCN.mentionwrapper) > -1 && instance.props.className.indexOf(BDFDB.disCN.mention) == -1) {
let fiber = instance._reactInternalFiber;
if (fiber.memoizedProps && fiber.memoizedProps.children && typeof fiber.memoizedProps.children[0] == "string") {
@ -353,6 +350,13 @@ class EditChannels {
}
}
processStandardSidebarView (instance, wrapper) {
if (this.updateChannels) {
this.updateChannels = false;
BDFDB.WebModules.forceAllUpdates(this);
}
}
changeChannel (info, channelname) {
if (!info || !channelname || !channelname.parentElement) return;
if (channelname.EditChannelsChangeObserver && typeof channelname.EditChannelsChangeObserver.disconnect == "function") channelname.EditChannelsChangeObserver.disconnect();
@ -396,7 +400,6 @@ class EditChannels {
if (channelname.EditChannelsChangeObserver && typeof channelname.EditChannelsChangeObserver.disconnect == "function") channelname.EditChannelsChangeObserver.disconnect();
let data = BDFDB.loadData(info.id, this, "channels") || {};
let color = this.chooseColor(channelname, data.color);
console.log();
channelname.style.setProperty("color", color, "important");
BDFDB.setInnerText(channelname, "#" + (data.name || info.name));
if (color) {

View File

@ -67,7 +67,7 @@ class SendLargeMessages {
getDescription () {return "Opens a popout when your message is too large, which allows you to automatically send the message in several smaller messages.";}
getVersion () {return "1.5.0";}
getVersion () {return "1.5.1";}
getAuthor () {return "DevilBro";}
@ -252,7 +252,7 @@ class SendLargeMessages {
sendMessage (text) {
let textarea = document.querySelector(BDFDB.dotCNS.textareawrapchat + "textarea");
if (textarea) {
var instance = BDFDB.getOwnerInstance({"node":textarea.parentElement, "name":"ChannelTextAreaForm", "up":true});
let instance = BDFDB.getOwnerInstance({"node":textarea.parentElement, "name":"ChannelTextAreaForm", "up":true});
if (instance) {
instance.setState({textValue:text});
BDFDB.triggerSend(textarea);