Update UserNotes.plugin.js
This commit is contained in:
parent
5792b2d6a9
commit
5831603a66
|
@ -1,9 +1,10 @@
|
||||||
//META{"name":"UserNotes","authorId":"278543574059057154","invite":"Jx3TjNS","donate":"https://www.paypal.me/MircoWittrien","patreon":"https://www.patreon.com/MircoWittrien","website":"https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/UserNotes","source":"https://raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/UserNotes/UserNotes.plugin.js"}*//
|
//META{"name":"UserNotes","authorId":"278543574059057154","invite":"Jx3TjNS","donate":"https://www.paypal.me/MircoWittrien","patreon":"https://www.patreon.com/MircoWittrien","website":"https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/UserNotes","source":"https://raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/UserNotes/UserNotes.plugin.js"}*//
|
||||||
|
|
||||||
class UserNotes {
|
var UserNotes = (_ => {
|
||||||
|
return class UserNotes {
|
||||||
getName () {return "UserNotes";}
|
getName () {return "UserNotes";}
|
||||||
|
|
||||||
getVersion () {return "1.0.4";}
|
getVersion () {return "1.0.5";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@ class UserNotes {
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
this.changelog = {
|
this.changelog = {
|
||||||
"improved":[["New Library Structure & React","Restructured my Library and switched to React rendering instead of DOM manipulation"]]
|
"fixed":[["Context Menu Update","Fixes for the context menu update, yaaaaaay"]]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,20 +89,17 @@ class UserNotes {
|
||||||
|
|
||||||
onUserContextMenu (e) {
|
onUserContextMenu (e) {
|
||||||
if (e.instance.props.user) {
|
if (e.instance.props.user) {
|
||||||
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:["FluxContainer(MessageDeveloperModeGroup)", "DeveloperModeGroup"]});
|
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["id", "devmode-copy-id"]]});
|
||||||
const itemgroup = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Group, {
|
children.splice(index > -1 ? index : children.length, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
|
||||||
children: [
|
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ContextMenuItems.Item, {
|
|
||||||
label: BDFDB.LanguageUtils.LanguageStrings.USERS + " " + BDFDB.LanguageUtils.LanguageStrings.NOTE,
|
label: BDFDB.LanguageUtils.LanguageStrings.USERS + " " + BDFDB.LanguageUtils.LanguageStrings.NOTE,
|
||||||
|
id: BDFDB.ContextMenuUtils.createItemId(this.name, "user-note"),
|
||||||
action: _ => {
|
action: _ => {
|
||||||
BDFDB.ContextMenuUtils.close(e.instance);
|
BDFDB.ContextMenuUtils.close(e.instance);
|
||||||
this.openNotesModal(e.instance.props.user);
|
this.openNotesModal(e.instance.props.user);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
}));
|
||||||
});
|
|
||||||
if (index > -1) children.splice(index, 0, itemgroup);
|
|
||||||
else children.push(itemgroup);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,3 +131,4 @@ class UserNotes {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})();
|
Loading…
Reference in New Issue