This commit is contained in:
Mirco Wittrien 2019-09-11 14:31:41 +02:00
parent 60dfd63e4c
commit 57dab3d38c
18 changed files with 39 additions and 90 deletions

File diff suppressed because one or more lines are too long

View File

@ -544,28 +544,28 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
itemlayer.style.setProperty('left', left + 'px');
if (tooltip.position == "top" || tooltip.position == "bottom") {
if (irects.left < 0) {
if (left < 0) {
itemlayer.style.setProperty('left', '5px');
tooltippointer.style.setProperty('margin-left', `${irects.left - 10}px`);
pointer.style.setProperty('margin-left', `${left - 10}px`);
}
else {
var rightmargin = arects.width - (irects.left + irects.width);
var rightmargin = arects.width - (left + irects.width);
if (rightmargin < 0) {
itemlayer.style.setProperty('left', arects.width - irects.width - 5 + 'px');
tooltippointer.style.setProperty('margin-left', `${-1*rightmargin}px`);
pointer.style.setProperty('margin-left', `${-1*rightmargin}px`);
}
}
}
else if (tooltip.position == "left" || tooltip.position == "right") {
if (irects.top < 0) {
if (top < 0) {
itemlayer.style.setProperty('top', '5px');
tooltippointer.style.setProperty('margin-top', `${irects.top - 10}px`);
pointer.style.setProperty('margin-top', `${top - 10}px`);
}
else {
var bottommargin = arects.height - (irects.top + irects.height);
var bottommargin = arects.height - (top + irects.height);
if (bottommargin < 0) {
itemlayer.style.setProperty('top', arects.height - irects.height - 5 + 'px');
tooltippointer.style.setProperty('margin-top', `${-1*bottommargin}px`);
pointer.style.setProperty('margin-top', `${-1*bottommargin}px`);
}
}
}
@ -3252,11 +3252,6 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
itemlayer.style.setProperty('top', (e.pageY + irects.height > arects.height ? (newpos.pageY < 0 ? 11 : newpos.pageY) : e.pageY) + 'px');
BDFDB.initElements(menu);
};
BDFDB.getContextMenuDevGroup = function (menu) {
let text = BDFDB.LanguageStrings.COPY_ID;
for (let item of menu.querySelectorAll(BDFDB.dotCN.contextmenuitem)) if (item.textContent == text) return BDFDB.getParentEle(BDFDB.dotCN.contextmenuitemgroup, item);
};
BDFDB.getContextMenuGroupAndIndex = function (startchildren, names) {
names = Array.isArray(names) ? names : (typeof names == "string" ? [names] : Array.from(names));
@ -3269,11 +3264,11 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
children = children.props.children;
}
if (children && !Array.isArray(children)) {
if (check(children) && parent && parent.props) {
if (parent && parent.props) {
var child = children;
parent.props.children = [];
parent.props.children.push(child);
return [parent.props.children, 0]
return [parent.props.children, check(child) ? 0 : -1];
}
else return [startchildren, -1];
}
@ -3313,58 +3308,12 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
});
};
BDFDB.appendContextMenu = function (menu, e = Object.assign({currentTarget: document.querySelector(BDFDB.dotCN.app)}, BDFDB.mousePosition)) {
if (!Node.prototype.isPrototypeOf(menu)) return;
var itemlayer = menu.parentElement;
BDFDB.appendItemLayer(menu, e.currentTarget);
itemlayer = menu;
var arects = BDFDB.getRects(document.querySelector(BDFDB.dotCN.appmount));
var irects = BDFDB.getRects(itemlayer);
BDFDB.toggleClass(itemlayer, 'invertX', e.pageX + irects.width > arects.width);
BDFDB.toggleClass(itemlayer, 'invertY', e.pageY + irects.height > arects.height);
BDFDB.updateContextPosition(menu, e);
var mousedown = e2 => {
if (!document.contains(itemlayer) || !itemlayer.contains(e2.target) || (Node.prototype.isPrototypeOf(itemlayer.BDFDBsubmenu) && !itemlayer.BDFDBsubmenu.contains(e2.target))) {
document.removeEventListener('mousedown', mousedown);
itemlayer.remove();
}
else {
var item = BDFDB.getParentEle(BDFDB.dotCN.contextmenuitem, e2.target);
if (item && !BDFDB.containsClass(item, BDFDB.disCN.contextmenuitemdisabled, BDFDB.disCN.contextmenuitemsubmenu, BDFDB.disCN.contextmenuitemtoggle, BDFDB.disCN.contextmenuitemslider, false)) document.removeEventListener('mousedown', mousedown);
}
};
document.addEventListener('mousedown', mousedown);
BDFDB.initElements(menu);
};
BDFDB.closeContextMenu = function (nodeOrInstance) {
if (!BDFDB.isObject(nodeOrInstance)) return;
var instance = Node.prototype.isPrototypeOf(nodeOrInstance) ? BDFDB.getOwnerInstance({node:nodeOrInstance, name:"ContextMenu", up:true}) : BDFDB.getOwnerInstance({instance:nodeOrInstance, name:"ContextMenu", up:true});
if (BDFDB.isObject(instance) && instance.props && typeof instance.props.closeContextMenu == "function") instance.props.closeContextMenu();
};
BDFDB.setContextHint = function (item, text) {
if (!text || !Node.prototype.isPrototypeOf(item)) return;
var hint = item.querySelector(BDFDB.dotCN.contextmenuhint);
if (hint) {
item.style.setProperty('position', 'relative', 'important');
hint.innerHTML = `<div class="BDFDB-textscrollwrapper" speed=3><div class="BDFDB-textscroll">${BDFDB.encodeToHTML(text)}</div></div>`;
if (!BDFDB.containsClass(hint.previousElementSibling, 'BDFDB-textscrollwrapper')) {
BDFDB.addClass(hint.previousElementSibling, 'BDFDB-textscrollwrapper');
hint.previousElementSibling.setAttribute('speed', 3);
hint.previousElementSibling.innerHTML = `<div class="BDFDB-textscroll">${BDFDB.encodeToHTML(hint.previousElementSibling.innerText)}</div>`;
}
var width = BDFDB.getRects(item).width - (parseFloat(getComputedStyle(item).paddingLeft) + parseFloat(getComputedStyle(item).paddingRight));
hint.previousElementSibling.style.setProperty('width', width - 36 + 'px', 'important');
hint.previousElementSibling.style.setProperty('max-width', width - 36 + 'px', 'important');
hint.style.setProperty('position', 'absolute', 'important');
hint.style.setProperty('top', getComputedStyle(item).paddingTop, 'important');
hint.style.setProperty('right', getComputedStyle(item).paddingRight, 'important');
hint.style.setProperty('width', '32px', 'important');
hint.style.setProperty('max-width', '32px', 'important');
}
};
BDFDB.createMessageOptionPopout = function (button) {
if (!button) return;
var popouts = document.querySelector(BDFDB.dotCN.popouts);
@ -3932,7 +3881,8 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
DiscordClassModules.OptionPopout = BDFDB.WebModules.findByProperties('container', 'button', 'item');
DiscordClassModules.PictureInPicture = BDFDB.WebModules.findByProperties('pictureInPicture', 'pictureInPictureWindow');
DiscordClassModules.PillWrapper = BDFDB.WebModules.find(module => typeof module['item'] == 'string' && typeof module['wrapper'] == 'string' && Object.keys(module).length == 2);
DiscordClassModules.PrivateChannel = BDFDB.WebModules.findByProperties('channel');
DiscordClassModules.PrivateChannel = BDFDB.WebModules.findByProperties('channel', 'closeButton');
DiscordClassModules.PrivateChannelActivity = BDFDB.WebModules.findByProperties('activity', 'text');
DiscordClassModules.PrivateChannelList = BDFDB.WebModules.findByProperties('privateChannels', 'searchBar');
DiscordClassModules.Popout = BDFDB.WebModules.findByProperties('popout', 'arrowAlignmentTop');
DiscordClassModules.PopoutActivity = BDFDB.WebModules.findByProperties('ellipsis', 'activityActivityFeed');
@ -4257,11 +4207,10 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
directiontransition: ['IconDirection', 'transition'],
disabled: ['SettingsItems', 'disabled'],
dmchannel: ['PrivateChannel', 'channel'],
dmchannelactivity: ['PrivateChannel', 'activity'],
dmchannelactivityicon: ['PrivateChannel', 'activityIcon'],
dmchannelactivityiconforeground: ['PrivateChannel', 'activityIconForeground'],
dmchannelactivitytext: ['PrivateChannel', 'activityText'],
dmchannelclose: ['PrivateChannel', DiscordClassModules.PrivateChannel.close ? 'close' : 'closeButton'],
dmchannelactivity: ['PrivateChannelActivity', 'activity'],
dmchannelactivityicon: ['PrivateChannelActivity', 'icon'],
dmchannelactivitytext: ['PrivateChannelActivity', 'text'],
dmchannelclose: ['PrivateChannel', 'closeButton'],
dmchannelnamewithactivity: ['PrivateChannel', 'nameWithActivity'],
dmchannels: ['PrivateChannelList', 'privateChannels'],
dmpill: ['GuildDm', 'pill'],

View File

@ -316,7 +316,7 @@ class ChatAliases {
}
appendItem (menu, returnvalue, text) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -308,7 +308,7 @@ class ChatFilter {
}
appendItem (menu, returnvalue, text) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -75,7 +75,7 @@ class CopyRawMessage {
onMessageContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.message && instance.props.message.content && instance.props.target && !menu.querySelector(`${this.name}-contextMenuItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
@ -96,7 +96,7 @@ class CopyRawMessage {
onMessageOptionPopout (instance, popout, returnvalue) {
if (instance.props.message && instance.props.channel && instance._reactInternalFiber.memoizedProps.target && !popout.querySelector(".copyrawmessage-itembtn")) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, BDFDB.LanguageStrings.DELETE);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, BDFDB.LanguageStrings.DELETE);
const copyItem = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: BDFDB.LanguageStrings.COPY_TEXT + " (Raw)",
className: `${BDFDB.disCN.optionpopoutitem} BDFDB-popoutMenuItem ${this.name}-popoutMenuItem ${this.name}-copyraw-popoutMenuItem`,

View File

@ -215,7 +215,7 @@ class EditChannels {
onChannelContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.channel && !BDFDB.getParentEle(".container-hidden", instance.props.target) && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -272,7 +272,7 @@ class EditServers {
onGuildContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.guild && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -309,7 +309,7 @@ class EditUsers {
onUserContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.user && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -145,7 +145,7 @@ class GoogleSearchReplace {
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-disabled-contextMenuItem`,
disabled: true
}));
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, "SearchWithGoogle");
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, "SearchWithGoogle");
const item = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_googlesearchreplace_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-search-contextMenuSubItem`,

View File

@ -230,7 +230,7 @@ class GoogleTranslateOption {
let {messagediv, pos} = this.getMessageAndPos(instance.props.target);
if (!messagediv || pos == -1) return;
let translated = BDFDB.containsClass(messagediv, "GTO-translated-message");
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, "MessagePinItem");
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, "MessagePinItem");
const translateUntranslateItem = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: translated ? this.labels.context_messageuntranslateoption_text : this.labels.context_messagetranslateoption_text,
hint: BDFDB.isPluginEnabled("MessageUtilities") ? window.bdplugins.MessageUtilities.plugin.getActiveShortcutString("__Translate_Message") : null,
@ -245,7 +245,7 @@ class GoogleTranslateOption {
let text = document.getSelection().toString();
if (text) {
let GSRstring = BDFDB.getReactValue(bdplugins, "GoogleSearchReplace.plugin.labels.context_googlesearchreplace_text");
let [children2, index2] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, GSRstring ? ["SearchWithGoogle", GSRstring] : "SearchWithGoogle");
let [children2, index2] = BDFDB.getContextMenuGroupAndIndex(returnvalue, GSRstring ? ["SearchWithGoogle", GSRstring] : "SearchWithGoogle");
var foundtranslation, foundinput, foundoutput;
const searchTranslationItem = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_googletranslateoption_text,
@ -283,7 +283,7 @@ class GoogleTranslateOption {
let {messagediv, pos} = this.getMessageAndPos(instance.props.target);
if (!messagediv || pos == -1) return;
let translated = BDFDB.containsClass(messagediv, "GTO-translated-message");
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, [BDFDB.LanguageStrings.PIN, BDFDB.LanguageStrings.UNPIN]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, [BDFDB.LanguageStrings.PIN, BDFDB.LanguageStrings.UNPIN]);
const translateUntranslateItem = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels[translated ? "popout_untranslateoption_text" : "popout_translateoption_text"],
className: `${BDFDB.disCN.optionpopoutitem} BDFDB-popoutMenuItem ${this.name}-popoutMenuItem ${this.name}-${translated ? "untranslate" : "translate"}-popoutMenuItem`,

View File

@ -228,7 +228,7 @@ class PersonalPins {
let {messagediv, pos} = this.getMessageAndPos(instance.props.target);
if (!messagediv || pos == -1) return;
let note = this.getNoteData(instance.props.message, instance.props.target, instance.props.channel);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, "MessagePinItem");
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, "MessagePinItem");
const pinUnpinItem = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels[note ? "context_unpinoption_text" : "context_pinoption_text"],
hint: BDFDB.isPluginEnabled("MessageUtilities") ? window.bdplugins.MessageUtilities.plugin.getActiveShortcutString("__Note_Message") : null,
@ -264,7 +264,7 @@ class PersonalPins {
let {messagediv, pos} = this.getMessageAndPos(instance.props.target);
if (!messagediv || pos == -1) return;
let note = this.getNoteData(instance.props.message, instance.props.target, instance.props.channel);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, [BDFDB.LanguageStrings.PIN, BDFDB.LanguageStrings.UNPIN]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, [BDFDB.LanguageStrings.PIN, BDFDB.LanguageStrings.UNPIN]);
const pinUnpinItem = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels[note ? "context_unpinoption_text" : "popout_pinoption_text"],
className: `${BDFDB.disCN.optionpopoutitem} BDFDB-popoutMenuItem ${this.name}-popoutMenuItem ${this.name}-${note ? "unpin" : "pin"}-popoutMenuItem`,

View File

@ -223,7 +223,7 @@ class PinDMs {
onUserContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.user && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, "UserCloseChatItem");
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, "UserCloseChatItem");
if (index > -1) {
let id = BDFDB.LibraryModules.ChannelStore.getDMFromUserId(instance.props.user.id);
if (id) this.appendItem(menu, id, children, index);
@ -234,7 +234,7 @@ class PinDMs {
onGroupDMContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.channelId && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, "ChangeIcon");
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, "ChangeIcon");
if (index > -1) this.appendItem(menu, instance.props.channelId, children, index);
}
}

View File

@ -78,7 +78,7 @@ class RevealAllSpoilersOption {
if (instance.props && instance.props.message && instance.props.target && !menu.querySelector(`${this.name}-contextMenuItem`)) {
let messagediv = BDFDB.getParentEle(BDFDB.dotCN.messagegroup + "> [aria-disabled]", instance.props.target);
if (!messagediv || !messagediv.querySelector(BDFDB.dotCN.spoilerhidden)) return;
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -3,7 +3,7 @@
class ReverseImageSearch {
getName () {return "ReverseImageSearch";}
getVersion () {return "3.4.3";}
getVersion () {return "3.4.4";}
getAuthor () {return "DevilBro";}
@ -148,7 +148,7 @@ class ReverseImageSearch {
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-disabled-contextMenuItem`,
disabled: true
}));
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -457,7 +457,7 @@ class ServerFolders {
this.addServerToFolder(instance.props.guild, folders[i]);
}
}));
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -169,7 +169,7 @@ class ServerHider {
onGuildContextMenu (instance, menu, returnvalue) {
if (document.querySelector(".BDFDB-modal")) return;
if (instance.props && instance.props.target && instance.props.type.indexOf("GUILD_ICON_") == 0 && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [

View File

@ -172,7 +172,7 @@ class SpellCheck {
}
}
if (word && this.isWordNotInDictionary(word)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let items = [];
let similarWords = this.getSimilarWords(word.toLowerCase().trim());
for (let suggestion of similarWords.sort()) items.push(BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItem, {

View File

@ -139,7 +139,7 @@ class UserNotes {
onUserContextMenu (instance, menu, returnvalue) {
if (instance.props && instance.props.user && !menu.querySelector(`${this.name}-contextMenuItem`)) {
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue.props.children, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
let [children, index] = BDFDB.getContextMenuGroupAndIndex(returnvalue, ["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]);
const itemgroup = BDFDB.React.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [