From 1f5a1328c762c4bc72eea4d0c4aaf310714357d6 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Thu, 27 Dec 2018 10:19:30 +0100 Subject: [PATCH] changes --- Plugins/EditChannels/EditChannels.plugin.js | 17 ++++++++++------- .../SendLargeMessages.plugin.js | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Plugins/EditChannels/EditChannels.plugin.js b/Plugins/EditChannels/EditChannels.plugin.js index 619d7b5c00..609eca8e15 100644 --- a/Plugins/EditChannels/EditChannels.plugin.js +++ b/Plugins/EditChannels/EditChannels.plugin.js @@ -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) { diff --git a/Plugins/SendLargeMessages/SendLargeMessages.plugin.js b/Plugins/SendLargeMessages/SendLargeMessages.plugin.js index 39d883216c..813adc2a83 100644 --- a/Plugins/SendLargeMessages/SendLargeMessages.plugin.js +++ b/Plugins/SendLargeMessages/SendLargeMessages.plugin.js @@ -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);