stuff
This commit is contained in:
parent
34e753d940
commit
f314081fea
|
@ -3796,6 +3796,7 @@
|
|||
colorPickerSwatchSingle: "single-Fbb1wB",
|
||||
colorPickerSwatchSelected: "selected-f5IVXN",
|
||||
confirmModal: "confirmModal-t-WDWJ",
|
||||
contextMenuHint: "hint-BK71lM",
|
||||
dev: "dev-A7f2Rx",
|
||||
favButtonContainer: "favbutton-8Fzu45",
|
||||
guild: "guild-r3yAE_",
|
||||
|
@ -4631,7 +4632,7 @@
|
|||
contextmenucheckboxdisabled: ["ContextMenuCheckbox", "disabled"],
|
||||
contextmenucheckboxinner: ["ContextMenuCheckbox", "checkboxInner"],
|
||||
contextmenucheckboxelement: ["ContextMenuCheckbox", "checkboxElement"],
|
||||
contextmenuhint: ["ContextMenu", "hint"],
|
||||
contextmenuhint: ["BDFDB", "contextMenuHint"],
|
||||
contextmenuimage: ["ContextMenu", "image"],
|
||||
contextmenuitem: ["ContextMenu", "item"],
|
||||
contextmenuitembrand: ["ContextMenu", "brand"],
|
||||
|
@ -7433,7 +7434,17 @@
|
|||
}
|
||||
};
|
||||
|
||||
InternalComponents.LibraryComponents.MenuItems = BDFDB.ModuleUtils.findByProperties("MenuItem", "MenuGroup");
|
||||
InternalComponents.LibraryComponents.MenuItems = Object.assign({}, BDFDB.ModuleUtils.findByProperties("MenuItem", "MenuGroup"));
|
||||
InternalComponents.LibraryComponents.MenuItems.MenuHint = InternalBDFDB.loadPatchedComp("MenuItems.MenuHint") || reactInitialized && class BDFDB_MenuHint extends LibraryModules.React.Component {
|
||||
render() {
|
||||
return !this.props.hint ? null : BDFDB.ReactUtils.createElement("div", {
|
||||
className: BDFDB.disCN.contextmenuhint,
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, {
|
||||
children: this.props.hint
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// REMOVE
|
||||
InternalComponents.LibraryComponents.ContextMenuItems = {};
|
||||
|
@ -8516,6 +8527,12 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
${BDFDB.dotCN.contextmenuhint} {
|
||||
width: 42px;
|
||||
max-width: 42px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
${BDFDB.dotCN.cursordefault} {
|
||||
cursor: default !important;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@ var CopyRawMessage = (_ => {
|
|||
return class CopyRawMessage {
|
||||
getName () {return "CopyRawMessage";}
|
||||
|
||||
getVersion () {return "1.0.7";}
|
||||
getVersion () {return "1.0.8";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -12,10 +12,7 @@ var CopyRawMessage = (_ => {
|
|||
|
||||
constructor () {
|
||||
this.changelog = {
|
||||
"fixed":[["Crash","Fixed crash on message 3-dot menu"]]
|
||||
};
|
||||
this.changelog = {
|
||||
"improved":[["Raw Embed Text","Right clicking inside an embed which contains a description will add an extra option in the context menu to copy the raw contents of the embed description"]]
|
||||
"fixed":[["Context Menu Update","Fixes for the context menu update, yaaaaaay"]]
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -66,17 +63,24 @@ var CopyRawMessage = (_ => {
|
|||
if (e.instance.props.message) {
|
||||
let embed = BDFDB.DOMUtils.getParent(BDFDB.dotCN.embedwrapper, e.instance.props.target);
|
||||
let embedIndex = embed ? Array.from(embed.parentElement.querySelectorAll(BDFDB.dotCN.embedwrapper)).indexOf(embed) : -1;
|
||||
let hint = BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("Copy_Raw") : null;
|
||||
let entries = [
|
||||
e.instance.props.message.content && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Item, {
|
||||
e.instance.props.message.content && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
|
||||
hint: BDFDB.BDUtils.isPluginEnabled("MessageUtilities") ? BDFDB.BDUtils.getPlugin("MessageUtilities").getActiveShortcutString("Copy_Raw") : null,
|
||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message"),
|
||||
hint: hint && (_ => {
|
||||
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuHint, {
|
||||
hint: hint
|
||||
});
|
||||
}),
|
||||
action: _ => {
|
||||
BDFDB.ContextMenuUtils.close(e.instance);
|
||||
BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.content});
|
||||
}
|
||||
}),
|
||||
embed && embed.querySelector(BDFDB.dotCN.embeddescription) && e.instance.props.message.embeds[embedIndex] && e.instance.props.message.embeds[embedIndex].rawDescription && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Item, {
|
||||
embed && embed.querySelector(BDFDB.dotCN.embeddescription) && e.instance.props.message.embeds[embedIndex] && e.instance.props.message.embeds[embedIndex].rawDescription && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw Embed)",
|
||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-embed"),
|
||||
action: _ => {
|
||||
BDFDB.ContextMenuUtils.close(e.instance);
|
||||
BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.embeds[embedIndex].rawDescription});
|
||||
|
@ -84,8 +88,8 @@ var CopyRawMessage = (_ => {
|
|||
})
|
||||
].filter(n => n);
|
||||
if (entries.length) {
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
|
||||
children.splice(index > -1 ? index : children.length, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Group, {
|
||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["id", "devmode-copy-id"]]});
|
||||
children.splice(index > -1 ? index : children.length, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
||||
children: entries
|
||||
}));
|
||||
}
|
||||
|
@ -97,7 +101,7 @@ var CopyRawMessage = (_ => {
|
|||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["id", "mark-unread"]]});
|
||||
children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||
label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)",
|
||||
id: "copy-raw",
|
||||
id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message"),
|
||||
icon: _ => {
|
||||
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN.menuicon,
|
||||
|
|
Loading…
Reference in New Issue