remove extra classes

This commit is contained in:
Mirco Wittrien 2019-11-07 22:33:27 +01:00
parent 4fd78ec172
commit 30b887316a
20 changed files with 13 additions and 91 deletions

View File

@ -307,11 +307,9 @@ class ChatAliases {
appendItem (menu, returnvalue, text) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: "Add to ChatAliases",
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-addalias-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.openAddModal(text);

View File

@ -299,11 +299,9 @@ class ChatFilter {
appendItem (menu, returnvalue, text) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: "Add to ChatFilter",
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-addalias-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.openAddModal(text);

View File

@ -62,12 +62,10 @@ class CopyRawMessage {
if (e.instance.props && e.instance.props.message && e.instance.props.message.content) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("Copy_Raw") : null,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-copyraw-contextMenuItem`,
action: _ => {
BDFDB.ContextMenuUtils.close(e.instance);
BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.content});
@ -85,7 +83,7 @@ class CopyRawMessage {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["label", BDFDB.LanguageUtils.LanguageStrings.DELETE]]});
children.splice(index, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
className: `${BDFDB.disCN.optionpopoutitem} BDFDB-popoutMenuItem ${this.name}-popoutMenuItem ${this.name}-copyraw-popoutMenuItem`,
className: BDFDB.disCN.optionpopoutitem,
action: _ => {
BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.content});
e.instance.props.onClose();

View File

@ -145,17 +145,13 @@ class EditChannels {
if (instance.props && 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"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_localchannelsettings_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-channelsettings-contextMenuSubItem`,
render: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_channelsettings_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-channelsettings-ContextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.showChannelSettings(instance.props.channel);
@ -163,7 +159,6 @@ class EditChannels {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_resetsettings_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-resetsettings-ContextMenuItem`,
disabled: !BDFDB.DataUtils.load(this, "channels", instance.props.channel.id),
action: e => {
BDFDB.ContextMenuUtils.close(menu);

View File

@ -136,17 +136,13 @@ class EditServers {
if (instance.props && instance.props.guild && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_localserversettings_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-serversettings-contextMenuSubItem`,
render: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_serversettings_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-serversettings-ContextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.showServerSettings(instance.props.guild);
@ -154,7 +150,6 @@ class EditServers {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_resetsettings_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-resetsettings-ContextMenuItem`,
disabled: !BDFDB.DataUtils.load(this, "servers", instance.props.guild.id),
action: e => {
BDFDB.ContextMenuUtils.close(menu);

View File

@ -192,17 +192,13 @@ class EditUsers {
if (instance.props && instance.props.user && !menu.querySelector(`${this.name}-contextMenuSubItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_localusersettings_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-usersettings-contextMenuSubItem`,
render: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_usersettings_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-usersettings-ContextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.showUserSettings(instance.props.user);
@ -210,7 +206,6 @@ class EditUsers {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_resetsettings_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-resetsettings-ContextMenuItem`,
disabled: !BDFDB.DataUtils.load(this, "users", instance.props.user.id),
action: e => {
BDFDB.ContextMenuUtils.close(menu);

View File

@ -121,7 +121,6 @@ class GoogleSearchReplace {
let items = [];
for (let key in engines) if (engines[key]) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.defaults.engines[key].name,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-engine-contextMenuItem`,
danger: key == "_all",
action: e => {
if (!e.shiftKey) BDFDB.ContextMenuUtils.close(e.instance);
@ -133,13 +132,11 @@ class GoogleSearchReplace {
}));
if (!items.length) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_disabled_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-disabled-contextMenuItem`,
disabled: true
}));
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"SearchWithGoogle"});
const item = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_googlesearchreplace_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-search-contextMenuSubItem`,
render: items
});
if (index > -1) children.splice(index, 1, item);

View File

@ -161,7 +161,6 @@ class GoogleTranslateOption {
const translateUntranslateItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: translated ? this.labels.context_messageuntranslateoption_text : this.labels.context_messagetranslateoption_text,
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Translate_Message") : null,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-${translated ? "untranslate" : "translate"}-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.translateMessage(instance.props.message, instance.props.target, instance.props.channel);
@ -176,7 +175,6 @@ class GoogleTranslateOption {
var foundtranslation, foundinput, foundoutput;
const searchTranslationItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_googletranslateoption_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-searchtranslation-contextMenuItem`,
action: e => {
var item = BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenuitem, e.target);
if (item) {
@ -211,15 +209,14 @@ class GoogleTranslateOption {
if (!messagediv || pos == -1) return;
let translated = BDFDB.DOMUtils.containsClass(messagediv, "GTO-translated-message");
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {props:[["label", [BDFDB.LanguageUtils.LanguageStrings.PIN, BDFDB.LanguageUtils.LanguageStrings.UNPIN]]]});
const translateUntranslateItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
children.splice(index + 1, 0, BDFDB.ReactUtils.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`,
className: BDFDB.disCN.optionpopoutitem,
action: e => {
this.translateMessage(instance.props.message, instance.props.target, instance.props.channel);
instance.props.onClose();
}
});
children.splice(index + 1, 0, translateUntranslateItem);
}));
}
}

View File

@ -115,8 +115,7 @@ class ImageZoom {
let items = [];
for (let type in settings) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSliderItem, {
label: this.defaults.settings[type].name + ": " + settings[type] + this.defaults.settings[type].unit,
className: `BDFDB-contextMenuSliderItem ${this.name}-contextMenuSliderItem ${this.name}-${type}-contextMenuSliderItem`,
type,
type: type,
defaultValue: BDFDB.NumberUtils.mapRange([this.defaults.settings[type].min, this.defaults.settings[type].max], [0, 100], settings[type]),
onValueChange: value => {
BDFDB.DataUtils.save(Math.round(BDFDB.NumberUtils.mapRange([0, 100], [this.defaults.settings[type].min, this.defaults.settings[type].max], value)), this, "settings", type);
@ -132,11 +131,9 @@ class ImageZoom {
}});
}
}));
const itemGroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
BDFDB.ContextMenuUtils.open(this, e, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
children: items
});
BDFDB.ContextMenuUtils.open(this, e, itemGroup);
}));
};
settingslink.addEventListener("click", openContext);
settingslink.addEventListener("contextmenu", openContext);

View File

@ -219,7 +219,6 @@ class PersonalPins {
const pinUnpinItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels[note ? "context_unpinoption_text" : "context_pinoption_text"],
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Note_Message") : null,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-${note ? "unpin" : "pin"}-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.addMessageToNotes(instance.props.message, instance.props.target, instance.props.channel);
@ -233,7 +232,6 @@ class PersonalPins {
if (note.markup != newmarkup || note.accessory != newaccessory) {
const updateItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_updateoption_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-update-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.updateNoteData(note, newmarkup, newaccessory);
@ -252,28 +250,26 @@ class PersonalPins {
if (!messagediv || pos == -1) return;
let note = this.getNoteData(instance.props.message, instance.props.target, instance.props.channel);
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {props:[["label", [BDFDB.LanguageUtils.LanguageStrings.PIN, BDFDB.LanguageUtils.LanguageStrings.UNPIN]]]});
const pinUnpinItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
children.splice(index + 1, 0, BDFDB.ReactUtils.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`,
className: BDFDB.disCN.optionpopoutitem,
action: e => {
this.addMessageToNotes(instance.props.message, instance.props.target, instance.props.channel);
instance.props.onClose();
}
});
children.splice(index + 1, 0, pinUnpinItem);
}));
if (note) {
let newmarkup = this.getMarkup(messagediv).innerHTML;
let newaccessory = messagediv.querySelector(BDFDB.dotCN.messageaccessory).innerHTML;
if (note.markup != newmarkup || note.accessory != newaccessory) {
const updateItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_updateoption_text,
className: `${BDFDB.disCN.optionpopoutitem} BDFDB-popoutMenuItem ${this.name}-popoutMenuItem ${this.name}-update-popoutMenuItem`,
className: BDFDB.disCN.optionpopoutitem,
action: e => {
this.updateNoteData(note, newmarkup, newaccessory);
instance.props.onClose();
}
});
children.splice(index + 1, 0, updateItem);
}));
}
}
}

View File

@ -231,7 +231,6 @@ class PinDMs {
let items = [];
items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels[pinnedInChannel ? "context_unpinchannel_text" : "context_pinchannel_text"],
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-${pinnedInChannel ? "unpin" : "pin"}channel-contextMenuItem`,
danger: pinnedInChannel,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
@ -252,7 +251,6 @@ class PinDMs {
}));
items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels[pinnedInGuild ? "context_unpinguild_text" : "context_pinguild_text"],
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-${pinnedInGuild ? "unpin" : "pin"}guild-contextMenuItem`,
danger: pinnedInGuild,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
@ -270,7 +268,6 @@ class PinDMs {
}));
const subitem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_pindm_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-pindm-contextMenuSubItem`,
render: items
});
children.splice(index, 0, subitem);
@ -347,11 +344,9 @@ class PinDMs {
wrapper.PinDMsContextMenuListener = e => {
if (BDFDB.DataUtils.load(this, "pinnedRecents")[instance.props.channel.id] == undefined) {
const itemGroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_pinguild_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-pinguild-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
this.addPinnedRecent(instance.props.channel.id);
@ -528,12 +523,10 @@ class PinDMs {
});
avatar.parentElement.addEventListener("contextmenu", e => {
const itemGroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_unpinguild_text,
danger: true,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-unpinguild-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
BDFDB.DOMUtils.remove(dmdiv);

View File

@ -340,7 +340,6 @@ class PluginRepo {
BDFDB.TimeUtils.timeout(() => {for (let child of returnvalue.props.children) if (child && child.props && child.props.label == "BandagedBD" && Array.isArray(child.props.render)) {
const repoItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: "Plugin Repo",
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-repo-contextMenuItem`,
action: e => {
if (!this.loading.is) BDFDB.ContextMenuUtils.close(menu);
this.openPluginRepoModal();

View File

@ -149,11 +149,9 @@ class ReadAllNotificationsButton {
});
ranbutton.addEventListener("contextmenu", e => {
const itemGroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_unreadguilds_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-unreadguilds-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
BDFDB.GuildUtils.markAsRead(BDFDB.GuildUtils.getUnread());
@ -161,7 +159,6 @@ class ReadAllNotificationsButton {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_pingedguilds_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-pingedguilds-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
BDFDB.GuildUtils.markAsRead(BDFDB.GuildUtils.getPinged());
@ -169,7 +166,6 @@ class ReadAllNotificationsButton {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_mutedguilds_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-mutedguilds-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
BDFDB.GuildUtils.markAsRead(BDFDB.GuildUtils.getMuted());
@ -177,7 +173,6 @@ class ReadAllNotificationsButton {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_guilds_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-guilds-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
this.addPinnedRecent(instance.props.channel.id);
@ -186,7 +181,6 @@ class ReadAllNotificationsButton {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_dms_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-dms-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
BDFDB.DMUtils.markAsRead(BDFDB.DMUtils.getAll());

View File

@ -65,12 +65,10 @@ class RevealAllSpoilersOption {
if (!messagediv || !messagediv.querySelector(BDFDB.dotCN.spoilerhidden)) return;
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: "Reveal all Spoilers",
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("__Reveal_Spoilers") : null,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-reveal-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(e.instance);
this.revealAllSpoilers(messagediv);

View File

@ -152,7 +152,6 @@ class ReverseImageSearch {
let items = [];
for (let key in engines) if (engines[key]) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.defaults.engines[key].name,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-engine-contextMenuItem`,
danger: key == "_all",
action: e => {
if (!e.shiftKey) BDFDB.ContextMenuUtils.close(e.instance);
@ -164,16 +163,13 @@ class ReverseImageSearch {
}));
if (!items.length) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_disabled_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-disabled-contextMenuItem`,
disabled: true
}));
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: "Reverse Image Search",
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-search-contextMenuSubItem`,
render: items
})
]

View File

@ -323,7 +323,6 @@ class ServerFolders {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:"GuildFolderMarkReadItem"});
const autoreaditem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuToggleItem, {
label: this.labels.foldercontext_autoreadfolder_text,
className: `BDFDB-contextMenuToggleItem ${this.name}-contextMenuToggleItem ${this.name}-autoread-contextMenuToggleItem`,
active: data.autoRead,
action: state => {
data.autoRead = state;
@ -333,10 +332,8 @@ class ServerFolders {
if (index > -1) children.splice(index + 1, 0, autoreaditem);
else children.push(autoreaditem);
const muteGroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuToggleItem, {
label: this.labels.foldercontext_mutefolder_text,
className: `BDFDB-contextMenuToggleItem ${this.name}-contextMenuToggleItem ${this.name}-mutefolder-contextMenuToggleItem`,
active: muted,
action: state => {
data.muteFolder = state;
@ -347,10 +344,8 @@ class ServerFolders {
});
returnvalue.props.children.splice(returnvalue.props.children.length - 1, 0, muteGroup);
const deleteGroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.foldercontext_removefolder_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-removefolder-contextMenuItem`,
danger: true,
action: e => {
BDFDB.ContextMenuUtils.close(BDFDB.DOMUtils.getParent(BDFDB.dotCN.contextmenu, e.target));
@ -367,7 +362,6 @@ class ServerFolders {
let addtofolderitems = [], openguilds = BDFDB.LibraryModules.FolderStore.getSortedGuilds().filter(n => !n.folderId).map(n => n.guilds[0]);
for (let i = 0; i < folders.length; i++) addtofolderitems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: folders[i].folderName || (this.labels.modal_tabheader1_text + " #" + parseInt(i+1)),
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-addtofolder-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.addGuildToFolder(folders[i].folderId, guildid);
@ -376,15 +370,12 @@ class ServerFolders {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const addType = !addtofolderitems.length ? "contextMenuItem" : "contextMenuSubItem";
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.servercontext_serverfolders_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-guild-contextMenuSubItem`,
render: folder ? [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.serversubmenu_removefromfolder_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-removefromfolder-contextMenuItem`,
danger: true,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
@ -394,7 +385,6 @@ class ServerFolders {
] : [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.serversubmenu_createfolder_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-createfolder-contextMenuItem`,
disabled: !openguilds.length,
action: e => {
BDFDB.ContextMenuUtils.close(menu);

View File

@ -158,17 +158,13 @@ class ServerHider {
if (instance.props && 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"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_serverhider_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem`,
render: [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_openhidemenu_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-hidemenu-ContextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.showServerModal();
@ -176,7 +172,6 @@ class ServerHider {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.submenu_hideserver_text,
className: `BDFDB-ContextMenuItem ${this.name}-ContextMenuItem ${this.name}-hideserver-ContextMenuItem`,
disabled: !(instance.props.guild && !instance.props.target.getAttribute("folder")),
action: e => {
BDFDB.ContextMenuUtils.close(menu);

View File

@ -176,7 +176,6 @@ class SpellCheck {
let similarWords = this.getSimilarWords(word.toLowerCase().trim());
for (let suggestion of similarWords.sort()) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: suggestion,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-suggestion-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.replaceWord(textarea, word, suggestion);
@ -184,19 +183,15 @@ class SpellCheck {
}));
if (!items.length) items.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.similarwordssubmenu_none_text,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-none-contextMenuItem`,
disabled: true
}));
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: BDFDB.LanguageUtils.LanguageStrings.SPELLCHECK,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-spellcheck-contextMenuSubItem`,
render: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: this.labels.context_spellcheck_text,
hint: word,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-addword-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.addToOwnDictionary(word);
@ -204,7 +199,6 @@ class SpellCheck {
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuSubItem, {
label: this.labels.context_similarwords_text,
className: `BDFDB-contextMenuSubItem ${this.name}-contextMenuSubItem ${this.name}-suggestions-contextMenuSubItem`,
render: items
})
]

View File

@ -400,7 +400,6 @@ class ThemeRepo {
BDFDB.TimeUtils.timeout(() => {for (let child of returnvalue.props.children) if (child && child.props && child.props.label == "BandagedBD" && Array.isArray(child.props.render)) {
const repoItem = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: "Theme Repo",
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-repo-contextMenuItem`,
action: e => {
if (!this.loading.is) BDFDB.ContextMenuUtils.close(menu);
this.openThemeRepoModal();

View File

@ -130,11 +130,9 @@ class UserNotes {
if (instance.props && instance.props.user && !menu.querySelector(`${this.name}-contextMenuItem`)) {
let [children, index] = BDFDB.ReactUtils.findChildren(returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItemGroup, {
className: `BDFDB-contextMenuItemGroup ${this.name}-contextMenuItemGroup`,
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.USERS + " " + BDFDB.LanguageUtils.LanguageStrings.NOTE,
className: `BDFDB-contextMenuItem ${this.name}-contextMenuItem ${this.name}-usernote-contextMenuItem`,
action: e => {
BDFDB.ContextMenuUtils.close(menu);
this.openNotesModal(instance.props.user);