This commit is contained in:
Mirco Wittrien 2019-11-11 11:11:33 +01:00
parent b704460e05
commit 5ebbba15ff
16 changed files with 124 additions and 187 deletions

View File

@ -292,13 +292,13 @@ class ChatAliases {
} }
onNativeContextMenu (instance, menu, returnvalue) { onNativeContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.value && instance.props.value.trim()) { if (instance.props.value && instance.props.value.trim()) {
if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, instance.props.value.trim()); if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, instance.props.value.trim());
} }
} }
onMessageContextMenu (instance, menu, returnvalue) { onMessageContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.message && instance.props.channel && instance.props.target) { if (instance.props.message && instance.props.channel && instance.props.target) {
let text = document.getSelection().toString().trim(); let text = document.getSelection().toString().trim();
if (text && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, text); if (text && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, text);
} }
@ -329,7 +329,7 @@ class ChatAliases {
} }
processChannelTextArea (instance, wrapper, returnvalue) { processChannelTextArea (instance, wrapper, returnvalue) {
if (instance.props && instance.props.channel && instance.props.type) { if (instance.props.channel && instance.props.type) {
var textarea = wrapper.querySelector("textarea"); var textarea = wrapper.querySelector("textarea");
if (!textarea) return; if (!textarea) return;
let settings = BDFDB.DataUtils.get(this, "settings"); let settings = BDFDB.DataUtils.get(this, "settings");

View File

@ -284,13 +284,13 @@ class ChatFilter {
} }
onNativeContextMenu (instance, menu, returnvalue) { onNativeContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.value && instance.props.value.trim()) { if (instance.props.value && instance.props.value.trim()) {
if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, instance.props.value.trim()); if ((instance.props.type == "NATIVE_TEXT" || instance.props.type == "CHANNEL_TEXT_AREA") && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, instance.props.value.trim());
} }
} }
onMessageContextMenu (instance, menu, returnvalue) { onMessageContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.message && instance.props.channel && instance.props.target) { if (instance.props.message && instance.props.channel && instance.props.target) {
let text = document.getSelection().toString().trim(); let text = document.getSelection().toString().trim();
if (text && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, text); if (text && BDFDB.DataUtils.get(this, "settings", "addContextMenu")) this.appendItem(menu, returnvalue, text);
} }

View File

@ -142,7 +142,7 @@ class EditChannels {
// begin of own functions // begin of own functions
onChannelContextMenu (instance, menu, returnvalue) { onChannelContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.channel && !BDFDB.DOMUtils.getParent(".container-hidden", instance.props.target) && !menu.querySelector(`${this.name}-contextMenuSubItem`)) { if (instance.props.channel && !BDFDB.DOMUtils.getParent(".container-hidden", instance.props.target) && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
children: [ children: [
@ -316,13 +316,13 @@ class EditChannels {
} }
processChannelCategoryItem (instance, wrapper, returnvalue) { processChannelCategoryItem (instance, wrapper, returnvalue) {
if (instance.props && instance.props.channel) { if (instance.props.channel) {
this.changeChannel(instance.props.channel, wrapper.querySelector(BDFDB.dotCN.categoryname), true); this.changeChannel(instance.props.channel, wrapper.querySelector(BDFDB.dotCN.categoryname), true);
} }
} }
processChannelItem (instance, wrapper, returnvalue) { processChannelItem (instance, wrapper, returnvalue) {
if (instance.props && instance.props.channel) { if (instance.props.channel) {
this.changeChannel(instance.props.channel, wrapper.querySelector(BDFDB.dotCN.channelname), true); this.changeChannel(instance.props.channel, wrapper.querySelector(BDFDB.dotCN.channelname), true);
} }
} }

View File

@ -133,7 +133,7 @@ class EditServers {
// begin of own functions // begin of own functions
onGuildContextMenu (instance, menu, returnvalue) { onGuildContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.guild && !menu.querySelector(`${this.name}-contextMenuSubItem`)) { if (instance.props.guild && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
children: [ children: [
@ -168,7 +168,7 @@ class EditServers {
} }
processGuild (instance, wrapper, returnvalue) { processGuild (instance, wrapper, returnvalue) {
if (instance.props && instance.props.guild) { if (instance.props.guild) {
let icon = wrapper.querySelector(BDFDB.dotCN.guildicon + ":not(.fake-guildicon), " + BDFDB.dotCN.guildiconacronym + ":not(.fake-guildacronym)"); let icon = wrapper.querySelector(BDFDB.dotCN.guildicon + ":not(.fake-guildicon), " + BDFDB.dotCN.guildiconacronym + ":not(.fake-guildacronym)");
if (!icon) return; if (!icon) return;
this.changeGuildIcon(instance.props.guild, icon); this.changeGuildIcon(instance.props.guild, icon);
@ -177,7 +177,7 @@ class EditServers {
} }
processGuildIconWrapper (instance, wrapper, returnvalue) { processGuildIconWrapper (instance, wrapper, returnvalue) {
if (instance.props && instance.props.guild) { if (instance.props.guild) {
let icon = wrapper.classList && BDFDB.DOMUtils.containsClass(wrapper, BDFDB.disCN.avataricon) ? wrapper : wrapper.querySelector(BDFDB.dotCN.avataricon); let icon = wrapper.classList && BDFDB.DOMUtils.containsClass(wrapper, BDFDB.disCN.avataricon) ? wrapper : wrapper.querySelector(BDFDB.dotCN.avataricon);
if (!icon) return; if (!icon) return;
this.changeGuildIcon(instance.props.guild, icon); this.changeGuildIcon(instance.props.guild, icon);
@ -186,7 +186,7 @@ class EditServers {
} }
processGuildHeader (instance, wrapper, returnvalue) { processGuildHeader (instance, wrapper, returnvalue) {
if (instance.props && instance.props.guild) { if (instance.props.guild) {
this.changeGuildName(instance.props.guild, wrapper.querySelector(BDFDB.dotCN.guildheadername)); this.changeGuildName(instance.props.guild, wrapper.querySelector(BDFDB.dotCN.guildheadername));
} }
} }

View File

@ -189,7 +189,7 @@ class EditUsers {
// begin of own functions // begin of own functions
onUserContextMenu (instance, menu, returnvalue) { onUserContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.user && !menu.querySelector(`${this.name}-contextMenuSubItem`)) { if (instance.props.user && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
children: [ children: [
@ -520,7 +520,7 @@ class EditUsers {
} }
processBannedCard (instance, wrapper, returnvalue) { processBannedCard (instance, wrapper, returnvalue) {
if (instance.props && instance.props.user && instance.props.guild) { if (instance.props.user && instance.props.guild) {
let username = wrapper.querySelector(BDFDB.dotCN.guildsettingsbannedusername); let username = wrapper.querySelector(BDFDB.dotCN.guildsettingsbannedusername);
if (username) { if (username) {
this.changeName3(instance.props.user, username); this.changeName3(instance.props.user, username);
@ -541,7 +541,7 @@ class EditUsers {
} }
processMemberCard (instance, wrapper, returnvalue) { processMemberCard (instance, wrapper, returnvalue) {
if (instance.props && instance.props.user && instance.props.guild) { if (instance.props.user && instance.props.guild) {
let username = wrapper.querySelector(BDFDB.dotCN.guildsettingsmembername); let username = wrapper.querySelector(BDFDB.dotCN.guildsettingsmembername);
if (username) { if (username) {
this.changeName2(instance.props.user, username, instance.props.guild.id); this.changeName2(instance.props.user, username, instance.props.guild.id);
@ -551,7 +551,7 @@ class EditUsers {
} }
processInvitationCard (instance, wrapper, returnvalue) { processInvitationCard (instance, wrapper, returnvalue) {
if (instance.props && instance.props.user) { if (instance.props.user) {
let username = wrapper.querySelector(BDFDB.dotCN.invitemodalinviterowname); let username = wrapper.querySelector(BDFDB.dotCN.invitemodalinviterowname);
if (username) { if (username) {
this.changeName3(instance.props.user, username); this.changeName3(instance.props.user, username);
@ -582,7 +582,7 @@ class EditUsers {
} }
processCallAvatar (instance, wrapper, returnvalue) { processCallAvatar (instance, wrapper, returnvalue) {
if (instance.props && instance.props.id) { if (instance.props.id) {
let user = BDFDB.LibraryModules.UserStore.getUser(instance.props.id); let user = BDFDB.LibraryModules.UserStore.getUser(instance.props.id);
if (!user) { if (!user) {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(instance.props.id); let channel = BDFDB.LibraryModules.ChannelStore.getChannel(instance.props.id);
@ -600,18 +600,18 @@ class EditUsers {
} }
processVideoTile (instance, wrapper, returnvalue) { processVideoTile (instance, wrapper, returnvalue) {
if (instance.props && instance.props.user) this.changeAvatar(instance.props.user, this.getAvatarDiv(wrapper)); if (instance.props.user) this.changeAvatar(instance.props.user, this.getAvatarDiv(wrapper));
} }
processPictureInPictureVideo (instance, wrapper, returnvalue) { processPictureInPictureVideo (instance, wrapper, returnvalue) {
if (instance.props && instance.props.backgroundKey) { if (instance.props.backgroundKey) {
let user = BDFDB.LibraryModules.UserStore.getUser(instance.props.backgroundKey); let user = BDFDB.LibraryModules.UserStore.getUser(instance.props.backgroundKey);
if (user) this.changeAvatar(user, this.getAvatarDiv(wrapper)); if (user) this.changeAvatar(user, this.getAvatarDiv(wrapper));
} }
} }
processPrivateChannel (instance, wrapper, returnvalue) { processPrivateChannel (instance, wrapper, returnvalue) {
if (instance.props && instance.props.user) { if (instance.props.user) {
let username = wrapper.querySelector(BDFDB.dotCN.namecontainername); let username = wrapper.querySelector(BDFDB.dotCN.namecontainername);
this.changePrivateChannel(instance.props.user, username && username.firstElementChild ? username.firstElementChild : username); this.changePrivateChannel(instance.props.user, username && username.firstElementChild ? username.firstElementChild : username);
this.changeAvatar(instance.props.user, this.getAvatarDiv(wrapper)); this.changeAvatar(instance.props.user, this.getAvatarDiv(wrapper));

View File

@ -66,7 +66,7 @@ class ForceImagePreviews {
// begin of own functions // begin of own functions
processMessage (instance, wrapper, returnvalue) { processMessage (instance, wrapper, returnvalue) {
if (instance.props && instance.props.message) { if (instance.props.message) {
let accessory = wrapper.querySelector(BDFDB.dotCN.messageaccessory); let accessory = wrapper.querySelector(BDFDB.dotCN.messageaccessory);
if (accessory) { if (accessory) {
let links = []; let links = [];

View File

@ -153,7 +153,7 @@ class GoogleTranslateOption {
// begin of own functions // begin of own functions
onMessageContextMenu (instance, menu, returnvalue) { onMessageContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.message && instance.props.channel && instance.props.target) { if (instance.props.message && instance.props.channel && instance.props.target) {
let {messagediv, pos} = this.getMessageAndPos(instance.props.target); let {messagediv, pos} = this.getMessageAndPos(instance.props.target);
if (!messagediv || pos == -1) return; if (!messagediv || pos == -1) return;
let translated = BDFDB.DOMUtils.containsClass(messagediv, "GTO-translated-message"); let translated = BDFDB.DOMUtils.containsClass(messagediv, "GTO-translated-message");
@ -258,7 +258,7 @@ class GoogleTranslateOption {
} }
processMessageContent (instance, wrapper, returnvalue) { processMessageContent (instance, wrapper, returnvalue) {
if (instance.props && instance.props.message && instance.props.channel) { if (instance.props.message && instance.props.channel) {
let messagediv = BDFDB.DOMUtils.getParent(".GTO-translated-message", wrapper); let messagediv = BDFDB.DOMUtils.getParent(".GTO-translated-message", wrapper);
if (messagediv && !wrapper.querySelector(".GTO-translation")) BDFDB.DOMUtils.removeClass(messagediv, "GTO-translated-message"); if (messagediv && !wrapper.querySelector(".GTO-translation")) BDFDB.DOMUtils.removeClass(messagediv, "GTO-translated-message");
} }

View File

@ -94,7 +94,7 @@ class ImageGallery {
// begin of own functions // begin of own functions
processImageModal (instance, wrapper, returnvalue, methodnames) { processImageModal (instance, wrapper, returnvalue, methodnames) {
if (this.closemodal && instance.props && instance.props.onClose) instance.props.onClose(); if (this.closemodal && instance.props.onClose) instance.props.onClose();
else if (methodnames.includes("componentDidMount")) { else if (methodnames.includes("componentDidMount")) {
let modal = BDFDB.DOMUtils.getParent(BDFDB.dotCN.modal, wrapper); let modal = BDFDB.DOMUtils.getParent(BDFDB.dotCN.modal, wrapper);
if (!modal) return; if (!modal) return;

View File

@ -145,7 +145,7 @@ class MessageUtilities {
//begin of own functions //begin of own functions
processMessageContextMenu (instance, menu, returnvalue) { processMessageContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.message && instance.props.channel && instance.props.target) { if (instance.props.message && instance.props.channel && instance.props.target) {
let changed = false; let changed = false;
for (let itemlabel of menu.querySelectorAll(BDFDB.dotCN.contextmenulabel)) { for (let itemlabel of menu.querySelectorAll(BDFDB.dotCN.contextmenulabel)) {
let hint = itemlabel.parentElement.querySelector(BDFDB.dotCN.contextmenuhint); let hint = itemlabel.parentElement.querySelector(BDFDB.dotCN.contextmenuhint);

View File

@ -208,7 +208,7 @@ class PinDMs {
// begin of own functions // begin of own functions
onUserContextMenu (instance, menu, returnvalue) { onUserContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.user && !menu.querySelector(`${this.name}-contextMenuSubItem`)) { if (instance.props.user && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:"UserCloseChatItem"}); let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:"UserCloseChatItem"});
if (index > -1) { if (index > -1) {
let id = BDFDB.LibraryModules.ChannelStore.getDMFromUserId(instance.props.user.id); let id = BDFDB.LibraryModules.ChannelStore.getDMFromUserId(instance.props.user.id);
@ -219,7 +219,7 @@ class PinDMs {
} }
onGroupDMContextMenu (instance, menu, returnvalue) { onGroupDMContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.channelId && !menu.querySelector(`${this.name}-contextMenuSubItem`)) { if (instance.props.channelId && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:"ChangeIcon"}); let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:"ChangeIcon"});
if (index > -1) this.appendItem(menu, instance.props.channelId, children, index); if (index > -1) this.appendItem(menu, instance.props.channelId, children, index);
} }
@ -278,7 +278,7 @@ class PinDMs {
} }
processPrivateChannel (instance, wrapper, returnvalue) { processPrivateChannel (instance, wrapper, returnvalue) {
if (instance && instance.props && instance.props.ispin) { if (instance.props.ispin) {
let id = BDFDB.ReactUtils.getValue(instance, "props.channel.id"); let id = BDFDB.ReactUtils.getValue(instance, "props.channel.id");
wrapper.setAttribute("channelid", id); wrapper.setAttribute("channelid", id);
BDFDB.DOMUtils.addClass(wrapper, "pinned"); BDFDB.DOMUtils.addClass(wrapper, "pinned");
@ -338,7 +338,7 @@ class PinDMs {
} }
processDirectMessage (instance, wrapper, returnvalue, methodnames) { processDirectMessage (instance, wrapper, returnvalue, methodnames) {
if (instance.props && instance.props.channel) { if (instance.props.channel) {
if (methodnames.includes("componentDidMount")) { if (methodnames.includes("componentDidMount")) {
wrapper.removeEventListener("contextmenu", wrapper.PinDMsContextMenuListener); wrapper.removeEventListener("contextmenu", wrapper.PinDMsContextMenuListener);
wrapper.PinDMsContextMenuListener = e => { wrapper.PinDMsContextMenuListener = e => {

View File

@ -203,7 +203,7 @@ class ReadAllNotificationsButton {
processRecentMentions (instance, wrapper, returnvalue) { processRecentMentions (instance, wrapper, returnvalue) {
BDFDB.DOMUtils.remove(".RAMbutton"); BDFDB.DOMUtils.remove(".RAMbutton");
if (instance.props && instance.props.popoutName == "RECENT_MENTIONS_POPOUT" && BDFDB.DataUtils.get(this, "settings", "addClearButton")) { if (instance.props.popoutName == "RECENT_MENTIONS_POPOUT" && BDFDB.DataUtils.get(this, "settings", "addClearButton")) {
let recentmentionstitle = wrapper.querySelector(BDFDB.dotCN.messagespopouttitle); let recentmentionstitle = wrapper.querySelector(BDFDB.dotCN.messagespopouttitle);
if (recentmentionstitle) { if (recentmentionstitle) {
let ranbutton = BDFDB.DOMUtils.create(this.RAMbuttonMarkup); let ranbutton = BDFDB.DOMUtils.create(this.RAMbuttonMarkup);

View File

@ -3,7 +3,7 @@
class SendLargeMessages { class SendLargeMessages {
getName () {return "SendLargeMessages";} getName () {return "SendLargeMessages";}
getVersion () {return "1.5.4";} getVersion () {return "1.5.5";}
getAuthor () {return "DevilBro";} getAuthor () {return "DevilBro";}
@ -11,11 +11,11 @@ class SendLargeMessages {
constructor () { constructor () {
this.changelog = { this.changelog = {
"fixed":[["Light Theme Update","Fixed bugs for the Light Theme Update, which broke 99% of my plugins"]] "improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]]
}; };
this.patchModules = { this.patchModules = {
"ChannelTextArea":"componentDidMount" ChannelTextArea: "componentDidMount"
}; };
} }
@ -24,59 +24,8 @@ class SendLargeMessages {
this.css = ` this.css = `
.${this.name}-modal textarea { .${this.name}-modal textarea {
rows: 0; height: 50vh;
cols: 0;
height: 100vw;
resize: none;
}
.${this.name}-modal #warning-message {
color: red;
}
.${this.name}-modal #character-counter {
float: right;
color: white;
opacity: .5;
}`; }`;
this.sendMessageModalMarkup =
`<span class="${this.name}-modal BDFDB-modal">
<div class="${BDFDB.disCN.backdrop}"></div>
<div class="${BDFDB.disCN.modal}">
<div class="${BDFDB.disCN.modalinner}">
<div class="${BDFDB.disCNS.modalsub + BDFDB.disCN.modalsizelarge}">
<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.modalheader}" style="flex: 0 0 auto;">
<div class="${BDFDB.disCN.flexchild}" style="flex: 1 1 auto;">
<h4 class="${BDFDB.disCNS.h4 + BDFDB.disCNS.defaultcolor + BDFDB.disCN.h4defaultmargin}">REPLACE_modal_header_text</h4>
<div class="${BDFDB.disCNS.modalguildname + BDFDB.disCNS.small + BDFDB.disCNS.titlesize12 + BDFDB.disCNS.height16 + BDFDB.disCN.primary}"></div>
</div>
<button type="button" class="${BDFDB.disCNS.modalclose + BDFDB.disCNS.flexchild + BDFDB.disCNS.button + BDFDB.disCNS.buttonlookblank + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCN.buttongrow}">
<div class="${BDFDB.disCN.buttoncontents}">
<svg name="Close" width="18" height="18" viewBox="0 0 12 12" style="flex: 0 1 auto;">
<g fill="none" fill-rule="evenodd">
<path d="M0 0h12v12H0"></path>
<path class="fill" fill="currentColor" d="M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6"></path>
</g>
</svg>
</div>
</button>
</div>
<div class="${BDFDB.disCNS.scrollerwrap + BDFDB.disCNS.modalcontent + BDFDB.disCNS.scrollerthemed + BDFDB.disCNS.scrollerthemeghosthairline + BDFDB.disCNS.inputwrapper + BDFDB.disCNS.vertical + BDFDB.disCNS.flex2 + BDFDB.disCNS.flexchild + BDFDB.disCN.modalsubinner}" style="flex: 1 1 auto;">
<textarea class="${BDFDB.disCNS.scroller + BDFDB.disCNS.inputdefault + BDFDB.disCN.input}" id="modal-inputtext"></textarea>
</div>
<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCNS.nowrap + BDFDB.disCNS.modalsubinner + BDFDB.disCN.marginbottom8}" style="flex: 0 0 auto;">
<h5 id="warning-message" class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.h5 + BDFDB.disCNS.titlesize12 + BDFDB.disCNS.height16 + BDFDB.disCNS.weightbold + BDFDB.disCNS.h5defaultmargin}" style="flex: 1 1 auto;"></h5>
<h5 id="character-counter" class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.h5 + BDFDB.disCNS.titlesize12 + BDFDB.disCNS.height16 + BDFDB.disCNS.weightmedium + BDFDB.disCNS.h5defaultmargin}" style="flex: 0 0 auto;"></h5>
</div>
<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontalreverse + BDFDB.disCNS.horizontalreverse2 + BDFDB.disCNS.directionrowreverse + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.modalfooter}">
<button type="button" class="btn-send ${BDFDB.disCNS.button + BDFDB.disCNS.buttonlookfilled + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCNS.buttonsizemedium + BDFDB.disCN.buttongrow}">
<div class="${BDFDB.disCN.buttoncontents}"></div>
</button>
</div>
</div>
</div>
</div>
</span>`;
} }
//legacy //legacy
@ -118,6 +67,8 @@ class SendLargeMessages {
if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) { if (global.BDFDB && typeof BDFDB === "object" && BDFDB.loaded) {
this.stopping = true; this.stopping = true;
BDFDB.ModuleUtils.forceAllUpdates(this);
BDFDB.PluginUtils.clear(this); BDFDB.PluginUtils.clear(this);
} }
} }
@ -125,20 +76,16 @@ class SendLargeMessages {
// begin of own functions // begin of own functions
changeLanguageStrings () { processChannelTextArea (e) {
this.sendMessageModalMarkup = this.sendMessageModalMarkup.replace("REPLACE_modal_header_text", this.labels.modal_header_text); if (e.instance.props && e.instance.props.type && e.instance.props.type == "normal") {
} var textarea = e.node.querySelector("textarea");
processChannelTextArea (instance, wrapper, returnvalue) {
if (instance.props && instance.props.type && instance.props.type == "normal") {
var textarea = wrapper.querySelector("textarea");
if (!textarea) return; if (!textarea) return;
let modaltext, checkTextarea = () => { let modaltext, checkTextarea = () => {
if (BDFDB.StringUtils.getParsedLength(textarea.value) > 1950) { if (BDFDB.StringUtils.getParsedLength(textarea.value) > 1950) {
textarea.selectionStart = 0; textarea.selectionStart = 0;
textarea.selectionEnd = textarea.value.length; textarea.selectionEnd = textarea.value.length;
document.execCommand("insertText", false, ""); document.execCommand("insertText", false, "");
this.showSendModal(modaltext); this.openMessageModal(modaltext, e.instance.props.channel);
} }
}; };
BDFDB.ListenerUtils.add(this, textarea, "keyup", e => { BDFDB.ListenerUtils.add(this, textarea, "keyup", e => {
@ -155,47 +102,53 @@ class SendLargeMessages {
} }
} }
showSendModal (text) { openMessageModal (text, channel) {
let sendMessageModal = BDFDB.DOMUtils.create(this.sendMessageModalMarkup); BDFDB.ModalUtils.open(this, {
let textinput = sendMessageModal.querySelector("#modal-inputtext"); size: "LARGE",
let warning = sendMessageModal.querySelector("#warning-message"); header: this.labels.modal_header_text,
let counter = sendMessageModal.querySelector("#character-counter"); subheader: BDFDB.LanguageUtils.LanguageStringsFormat("TEXTAREA_PLACEHOLDER", `#${channel.name}`),
scroller: false,
let updateCounter = () => { children: [
let parsedlength = BDFDB.StringUtils.getParsedLength(textinput.value); BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextArea, {
let messageAmount = Math.ceil(parsedlength/1900); className: "textmessage-textarea",
warning.innerText = messageAmount > 15 ? this.labels.modal_messages_warning : ""; value: text,
counter.innerText = parsedlength + " (" + (textinput.selectionEnd - textinput.selectionStart) + ") => " + this.labels.modal_messages_translation + ": " + messageAmount; placeholder: text,
}; autoFocus: true
}),
BDFDB.appendModal(sendMessageModal); BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.CharCounter, {
className: BDFDB.disCN.marginbottom8,
BDFDB.ListenerUtils.addToChildren(sendMessageModal, "click", ".btn-send", e => { parsing: true,
let messages = this.formatText(textinput.value || ""); refClass: ".textmessage-textarea",
renderPrefix: length => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextElement, {
className: BDFDB.disCN.weightbold,
color: BDFDB.LibraryComponents.TextElement.Colors.RED,
children: Math.ceil(length/1900) > 7 ? this.labels.modal_messages_warning : null
})
});
},
renderSuffix: length => {
return ` 🠚 ${BDFDB.LanguageUtils.LanguageStrings.MESSAGES}: ${Math.ceil(length/1900)}`;
}
})
],
buttons: [{
contents: BDFDB.LanguageUtils.LanguageStrings.SEND,
color: "BRAND",
close: true,
click: modal => {
let textinput = (modal.querySelector(".textmessage-textarea").value || "").trim();
let messages = this.formatText(textinput);
messages.forEach((message,i) => { messages.forEach((message,i) => {
BDFDB.TimeUtils.timeout(() => { BDFDB.TimeUtils.timeout(() => {
this.sendMessage(message); this.sendMessage(message);
if (i >= messages.length-1) BDFDB.NotificationUtils.toast(this.labels.toast_allsent_text, {type:"success"}); if (i >= messages.length-1) BDFDB.NotificationUtils.toast(this.labels.toast_allsent_text, {type:"success"});
},this.messageDelay * i); }, this.messageDelay * i);
}); });
}
}]
}); });
textinput.value = text || "";
textinput.addEventListener("keyup", () => {BDFDB.TimeUtils.timeout(() => {updateCounter();},10);});
textinput.addEventListener("click", () => {updateCounter();});
textinput.addEventListener("mousedown", () => {
var mouseup = () => {
document.removeEventListener("mouseup", mouseup);
document.removeEventListener("mousemove", mousemove);
};
var mousemove = () => {
BDFDB.TimeUtils.timeout(() => {updateCounter();},10);
};
document.addEventListener("mouseup", mouseup);
document.addEventListener("mousemove", mousemove);
});
updateCounter();
textinput.focus();
} }
formatText (text) { formatText (text) {
@ -251,7 +204,12 @@ class SendLargeMessages {
let instance = BDFDB.ReactUtils.findOwner(BDFDB.DOMUtils.getParent(BDFDB.dotCNS.chat + "form", textarea), {name:"ChannelTextAreaForm", up:true}); let instance = BDFDB.ReactUtils.findOwner(BDFDB.DOMUtils.getParent(BDFDB.dotCNS.chat + "form", textarea), {name:"ChannelTextAreaForm", up:true});
if (instance) { if (instance) {
instance.setState({textValue:text}); instance.setState({textValue:text});
BDFDB.triggerSend(textarea); BDFDB.TimeUtils.timeout(_ => {
var e = new KeyboardEvent("keypress", {key:"Enter", code:"Enter", which:13, keyCode:13, bubbles:true });
Object.defineProperty(e, "keyCode", {value:13});
Object.defineProperty(e, "which", {value:13});
textarea.dispatchEvent(e);
});
} }
} }
} }
@ -261,147 +219,126 @@ class SendLargeMessages {
case "hr": //croatian case "hr": //croatian
return { return {
toast_allsent_text: "Sve veliku poslane.", toast_allsent_text: "Sve veliku poslane.",
modal_messages_translation: "Vijesti",
modal_messages_warning: "Nemojte slati previše veliku!", modal_messages_warning: "Nemojte slati previše veliku!",
modal_header_text: "Pošalji veliku poruku:" modal_header_text: "Pošalji veliku poruku:"
}; };
case "da": //danish case "da": //danish
return { return {
toast_allsent_text: "Alle beskeder sendes.", toast_allsent_text: "Alle beskeder sendes.",
modal_messages_translation: "Beskeder",
modal_messages_warning: "Send ikke for mange beskeder!", modal_messages_warning: "Send ikke for mange beskeder!",
modal_header_text: "Send stor besked:" modal_header_text: "Send stor besked:"
}; };
case "de": //german case "de": //german
return { return {
toast_allsent_text: "Alle Nachrichten versendet.", toast_allsent_text: "Alle Nachrichten versendet.",
modal_messages_translation: "Nachrichten",
modal_messages_warning: "Schicke nicht zu viele Nachrichten!", modal_messages_warning: "Schicke nicht zu viele Nachrichten!",
modal_header_text: "Große Nachricht senden:" modal_header_text: "Große Nachricht senden:"
}; };
case "es": //spanish case "es": //spanish
return { return {
toast_allsent_text: "Todos los mensajes enviados.", toast_allsent_text: "Todos los mensajes enviados.",
modal_messages_translation: "Mensajes",
modal_messages_warning: "¡No envíe demasiados mensajes!", modal_messages_warning: "¡No envíe demasiados mensajes!",
modal_header_text: "Enviar mensaje grande:" modal_header_text: "Enviar mensaje grande:"
}; };
case "fr": //french case "fr": //french
return { return {
toast_allsent_text: "Tous les messages envoyés", toast_allsent_text: "Tous les messages envoyés",
modal_messages_translation: "Messages",
modal_messages_warning: "N'envoyez pas trop de messages!", modal_messages_warning: "N'envoyez pas trop de messages!",
modal_header_text: "Envoyer un gros message:" modal_header_text: "Envoyer un gros message:"
}; };
case "it": //italian case "it": //italian
return { return {
toast_allsent_text: "Tutti i messaggi inviati.", toast_allsent_text: "Tutti i messaggi inviati.",
modal_messages_translation: "Messaggi",
modal_messages_warning: "Non inviare troppi messaggi!", modal_messages_warning: "Non inviare troppi messaggi!",
modal_header_text: "Invia grande messaggio:" modal_header_text: "Invia grande messaggio:"
}; };
case "nl": //dutch case "nl": //dutch
return { return {
toast_allsent_text: "Alle berichten verzonden.", toast_allsent_text: "Alle berichten verzonden.",
modal_messages_translation: "Berichten",
modal_messages_warning: "Stuur niet te veel berichten!", modal_messages_warning: "Stuur niet te veel berichten!",
modal_header_text: "Stuur een groot bericht:" modal_header_text: "Stuur een groot bericht:"
}; };
case "no": //norwegian case "no": //norwegian
return { return {
toast_allsent_text: "Alle meldinger sendt.", toast_allsent_text: "Alle meldinger sendt.",
modal_messages_translation: "Meldinger",
modal_messages_warning: "Ikke send for mange meldinger!", modal_messages_warning: "Ikke send for mange meldinger!",
modal_header_text: "Send stor melding:" modal_header_text: "Send stor melding:"
}; };
case "pl": //polish case "pl": //polish
return { return {
toast_allsent_text: "Wszystkie wiadomości zostały wysłane.", toast_allsent_text: "Wszystkie wiadomości zostały wysłane.",
modal_messages_translation: "Wiadomości",
modal_messages_warning: "Nie wysyłaj zbyt wielu wiadomości!", modal_messages_warning: "Nie wysyłaj zbyt wielu wiadomości!",
modal_header_text: "Wyślij dużą wiadomość:" modal_header_text: "Wyślij dużą wiadomość:"
}; };
case "pt-BR": //portuguese (brazil) case "pt-BR": //portuguese (brazil)
return { return {
toast_allsent_text: "Todas as mensagens enviadas.", toast_allsent_text: "Todas as mensagens enviadas.",
modal_messages_translation: "Mensagens",
modal_messages_warning: "Não envie muitas mensagens!", modal_messages_warning: "Não envie muitas mensagens!",
modal_header_text: "Enviar mensagem grande:" modal_header_text: "Enviar mensagem grande:"
}; };
case "fi": //finnish case "fi": //finnish
return { return {
toast_allsent_text: "Kaikki lähetetyt viestit.", toast_allsent_text: "Kaikki lähetetyt viestit.",
modal_messages_translation: "Viestien",
modal_messages_warning: "Älä lähetä liian monta viestiä!", modal_messages_warning: "Älä lähetä liian monta viestiä!",
modal_header_text: "Lähetä suuri viesti:" modal_header_text: "Lähetä suuri viesti:"
}; };
case "sv": //swedish case "sv": //swedish
return { return {
toast_allsent_text: "Alla meddelanden skickade.", toast_allsent_text: "Alla meddelanden skickade.",
modal_messages_translation: "Meddelanden",
modal_messages_warning: "Skicka inte för många meddelanden!", modal_messages_warning: "Skicka inte för många meddelanden!",
modal_header_text: "Skicka stort meddelande:" modal_header_text: "Skicka stort meddelande:"
}; };
case "tr": //turkish case "tr": //turkish
return { return {
toast_allsent_text: "Tüm mesajlar gönderildi.", toast_allsent_text: "Tüm mesajlar gönderildi.",
modal_messages_translation: "Mesajları",
modal_messages_warning: "Çok fazla mesaj göndermeyin!", modal_messages_warning: "Çok fazla mesaj göndermeyin!",
modal_header_text: "Büyük mesaj gönder:" modal_header_text: "Büyük mesaj gönder:"
}; };
case "cs": //czech case "cs": //czech
return { return {
toast_allsent_text: "Všechny zprávy byly odeslány.", toast_allsent_text: "Všechny zprávy byly odeslány.",
modal_messages_translation: "Zpráv",
modal_messages_warning: "Neposílejte příliš mnoho zpráv!", modal_messages_warning: "Neposílejte příliš mnoho zpráv!",
modal_header_text: "Odeslat velkou zprávu:" modal_header_text: "Odeslat velkou zprávu:"
}; };
case "bg": //bulgarian case "bg": //bulgarian
return { return {
toast_allsent_text: "Всички изпратени съобщения.", toast_allsent_text: "Всички изпратени съобщения.",
modal_messages_translation: "Съобщения",
modal_messages_warning: "Не изпращайте твърде много съобщения!", modal_messages_warning: "Не изпращайте твърде много съобщения!",
modal_header_text: "Изпратете голямо съобщение:" modal_header_text: "Изпратете голямо съобщение:"
}; };
case "ru": //russian case "ru": //russian
return { return {
toast_allsent_text: "Все отправленные сообщения.", toast_allsent_text: "Все отправленные сообщения.",
modal_messages_translation: "Сообщения",
modal_messages_warning: "Не отправляйте слишком много сообщений!", modal_messages_warning: "Не отправляйте слишком много сообщений!",
modal_header_text: "Отправить сообщение:" modal_header_text: "Отправить сообщение:"
}; };
case "uk": //ukrainian case "uk": //ukrainian
return { return {
toast_allsent_text: "Всі повідомлення надіслано.", toast_allsent_text: "Всі повідомлення надіслано.",
modal_messages_translation: "Повідомлення",
modal_messages_warning: "Не надсилайте надто багато повідомлень!", modal_messages_warning: "Не надсилайте надто багато повідомлень!",
modal_header_text: "Надіслати велике повідомлення:" modal_header_text: "Надіслати велике повідомлення:"
}; };
case "ja": //japanese case "ja": //japanese
return { return {
toast_allsent_text: "すべてのメッセージが送信されました。", toast_allsent_text: "すべてのメッセージが送信されました。",
modal_messages_translation: "メッセージ",
modal_messages_warning: "あまりにも多くのメッセージを送信しないでください!", modal_messages_warning: "あまりにも多くのメッセージを送信しないでください!",
modal_header_text: "大きなメッセージを送信する:" modal_header_text: "大きなメッセージを送信する:"
}; };
case "zh-TW": //chinese (traditional) case "zh-TW": //chinese (traditional)
return { return {
toast_allsent_text: "發送的所有消息。", toast_allsent_text: "發送的所有消息。",
modal_messages_translation: "消息",
modal_messages_warning: "不要發送太多信息!", modal_messages_warning: "不要發送太多信息!",
modal_header_text: "發送大信息:" modal_header_text: "發送大信息:"
}; };
case "ko": //korean case "ko": //korean
return { return {
toast_allsent_text: "모든 메시지가 전송되었습니다.", toast_allsent_text: "모든 메시지가 전송되었습니다.",
modal_messages_translation: "메시지",
modal_messages_warning: "너무 많은 메시지를 보내지 마십시오!", modal_messages_warning: "너무 많은 메시지를 보내지 마십시오!",
modal_header_text: "큰 메시지 보내기:" modal_header_text: "큰 메시지 보내기:"
}; };
default: //default: english default: //default: english
return { return {
toast_allsent_text: "All messages sent.", toast_allsent_text: "All messages sent.",
modal_messages_translation: "Messages",
modal_messages_warning: "Do not send too many messages!", modal_messages_warning: "Do not send too many messages!",
modal_header_text: "Send large message:" modal_header_text: "Send large message:"
}; };

View File

@ -311,7 +311,7 @@ class ServerFolders {
onGuildContextMenu (instance, menu, returnvalue) { onGuildContextMenu (instance, menu, returnvalue) {
if (document.querySelector(".BDFDB-modal")) return; if (document.querySelector(".BDFDB-modal")) return;
if (instance.props && instance.props.target && instance.props.folderId && instance.props.type == "GUILD_ICON_FOLDER") { if (instance.props.target && instance.props.folderId && instance.props.type == "GUILD_ICON_FOLDER") {
let folderid = instance.props.folderId; let folderid = instance.props.folderId;
let folder = BDFDB.LibraryModules.FolderStore.getGuildFolderById(folderid); let folder = BDFDB.LibraryModules.FolderStore.getGuildFolderById(folderid);
let data = this.getFolderConfig(folderid); let data = this.getFolderConfig(folderid);
@ -355,7 +355,7 @@ class ServerFolders {
}); });
returnvalue.props.children.push(deleteGroup); returnvalue.props.children.push(deleteGroup);
} }
else if (instance.props && instance.props.target && instance.props.guild && instance.props.type == "GUILD_ICON_BAR") { else if (instance.props.target && instance.props.guild && instance.props.type == "GUILD_ICON_BAR") {
let guildid = instance.props.guild.id; let guildid = instance.props.guild.id;
let folders = this.getFolders(); let folders = this.getFolders();
let folder = this.getFolderOfGuildId(guildid); let folder = this.getFolderOfGuildId(guildid);
@ -462,7 +462,7 @@ class ServerFolders {
processGuild (instance, wrapper, returnvalue, methodnames) { processGuild (instance, wrapper, returnvalue, methodnames) {
if (!this.foldercontentguilds) return; if (!this.foldercontentguilds) return;
if (instance.props && instance.props.guild) { if (instance.props.guild) {
if (methodnames.includes("componentDidMount")) { if (methodnames.includes("componentDidMount")) {
BDFDB.ListenerUtils.add(this, wrapper, "click", () => {BDFDB.TimeUtils.timeout(() => { BDFDB.ListenerUtils.add(this, wrapper, "click", () => {BDFDB.TimeUtils.timeout(() => {
let folder = this.getFolderOfGuildId(instance.props.guild.id); let folder = this.getFolderOfGuildId(instance.props.guild.id);
@ -489,7 +489,7 @@ class ServerFolders {
} }
processGuildFolderSettingsModal (instance, wrapper, returnvalue) { processGuildFolderSettingsModal (instance, wrapper, returnvalue) {
if (instance.props && instance.props.folderId) { if (instance.props.folderId) {
let folderid = instance.props.folderId; let folderid = instance.props.folderId;
let data = this.getFolderConfig(folderid); let data = this.getFolderConfig(folderid);
wrapper = wrapper.parentElement; wrapper = wrapper.parentElement;

View File

@ -155,7 +155,7 @@ class ServerHider {
onGuildContextMenu (instance, menu, returnvalue) { onGuildContextMenu (instance, menu, returnvalue) {
if (document.querySelector(".BDFDB-modal")) return; if (document.querySelector(".BDFDB-modal")) return;
if (instance.props && instance.props.target && instance.props.type.indexOf("GUILD_ICON_") == 0 && !menu.querySelector(`${this.name}-contextMenuSubItem`)) { if (instance.props.target && instance.props.type.indexOf("GUILD_ICON_") == 0 && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]}); let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, { const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
children: [ children: [
@ -189,7 +189,7 @@ class ServerHider {
} }
processGuild (instance, wrapper, returnvalue, methodnames) { processGuild (instance, wrapper, returnvalue, methodnames) {
if (instance.props && instance.props.guild) { if (instance.props.guild) {
let hiddenservers = BDFDB.DataUtils.load(this, "hiddenservers", "hiddenservers") || []; let hiddenservers = BDFDB.DataUtils.load(this, "hiddenservers", "hiddenservers") || [];
if (methodnames.includes("componentDidMount")) this.toggleServer(instance.props.guild, wrapper, !hiddenservers.includes(instance.props.guild.id)); if (methodnames.includes("componentDidMount")) this.toggleServer(instance.props.guild, wrapper, !hiddenservers.includes(instance.props.guild.id));
if (methodnames.includes("componentDidUpdate") && hiddenservers.includes(instance.props.guild.id) && instance.props.unread) this.unreadServer(instance.props.guild.id); if (methodnames.includes("componentDidUpdate") && hiddenservers.includes(instance.props.guild.id) && instance.props.unread) this.unreadServer(instance.props.guild.id);

View File

@ -175,18 +175,18 @@ class ShowHiddenChannels {
// begin of own functions // begin of own functions
processChannels (instance, wrapper, returnvalue, methodnames) { processChannels (instance, wrapper, returnvalue, methodnames) {
if (instance.props && instance.props.guild) { if (instance.props.guild) {
if (methodnames.includes("componentDidMount")) this.appendHiddenContainer(instance.props.guild); if (methodnames.includes("componentDidMount")) this.appendHiddenContainer(instance.props.guild);
if (methodnames.includes("componentDidUpdate")) this.reappendHiddenContainer(instance.props.guild); if (methodnames.includes("componentDidUpdate")) this.reappendHiddenContainer(instance.props.guild);
} }
} }
processChannelItem (instance, wrapper, returnvalue) { processChannelItem (instance, wrapper, returnvalue) {
if (instance.props && instance.props.channel) this.reappendHiddenContainer(BDFDB.LibraryModules.GuildStore.getGuild(instance.props.channel.guild_id)); if (instance.props.channel) this.reappendHiddenContainer(BDFDB.LibraryModules.GuildStore.getGuild(instance.props.channel.guild_id));
} }
processChannelCategoryItem (instance, wrapper, returnvalue) { processChannelCategoryItem (instance, wrapper, returnvalue) {
if (instance.props && instance.props.channel) this.reappendHiddenContainer(BDFDB.LibraryModules.GuildStore.getGuild(instance.props.channel.guild_id)); if (instance.props.channel) this.reappendHiddenContainer(BDFDB.LibraryModules.GuildStore.getGuild(instance.props.channel.guild_id));
} }
processStandardSidebarView (instance, wrapper, returnvalue) { processStandardSidebarView (instance, wrapper, returnvalue) {

View File

@ -143,7 +143,7 @@ class SpellCheck {
// begin of own functions // begin of own functions
onNativeContextMenu (instance, menu, returnvalue) { onNativeContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.target && instance.props.target.tagName == "TEXTAREA") { if (instance.props.target && instance.props.target.tagName == "TEXTAREA") {
let [SCparent, SCindex] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["NativeSpellcheckGroup", "FluxContainer(NativeSpellcheckGroup)"]}); let [SCparent, SCindex] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["NativeSpellcheckGroup", "FluxContainer(NativeSpellcheckGroup)"]});
if (SCindex > -1) { if (SCindex > -1) {
if (BDFDB.ReactUtils.findValue(instance._reactInternalFiber, "spellcheckEnabled") == true) { if (BDFDB.ReactUtils.findValue(instance._reactInternalFiber, "spellcheckEnabled") == true) {
@ -211,7 +211,7 @@ class SpellCheck {
} }
processChannelTextArea (instance, wrapper, returnvalue) { processChannelTextArea (instance, wrapper, returnvalue) {
if (instance.props && instance.props.type) { if (instance.props.type) {
var textarea = wrapper.querySelector("textarea"); var textarea = wrapper.querySelector("textarea");
if (!textarea) return; if (!textarea) return;