This commit is contained in:
Mirco Wittrien 2022-10-24 10:42:20 +02:00
parent 024a714114
commit 01fab2788d
6 changed files with 11 additions and 11 deletions

View File

@ -2,7 +2,7 @@
* @name BDFDB
* @author DevilBro
* @authorId 278543574059057154
* @version 2.8.8
* @version 2.8.9
* @description Required Library for DevilBro's Plugins
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -4886,7 +4886,7 @@ module.exports = (_ => {
getCounterString() {
let input = this.refElement || {}, string = "";
if (BDFDB.DOMUtils.containsClass(this.refElement, BDFDB.disCN.textarea)) {
let instance = BDFDB.ReactUtils.findOwner(input, {name: "ChannelEditorContainer", up: true});
let instance = BDFDB.ReactUtils.findOwner(input, {name: "ChannelTextAreaEditor", up: true});
if (instance) string = instance.props.textValue;
else string = input.value || input.textContent || "";
}

View File

@ -175,7 +175,7 @@ module.exports = (_ => {
}
processChannelTextAreaContainer (e) {
let editorContainer = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "ChannelEditorContainer"});
let editorContainer = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "ChannelTextAreaEditor"});
if (editorContainer && editorContainer.props.type && !editorContainer.props.disabled) {
if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children];
this.injectCounter(e.returnvalue, e.returnvalue.props.children, editorContainer.props.type.analyticsName || editorContainer.props.type, BDFDB.dotCN.textarea);

View File

@ -85,7 +85,7 @@ module.exports = (_ => {
this.patchedModules = {
before: {
ChannelEditorContainer: "render",
ChannelTextAreaEditor: "render",
TextChannelEmptyMessage: "default",
ThreadEmptyMessage: "default",
SystemMessageWrapper: "type",
@ -249,7 +249,7 @@ module.exports = (_ => {
}
}
processChannelEditorContainer (e) {
processChannelTextAreaEditor (e) {
if (!e.instance.props.disabled && e.instance.props.channel && changedChannels[e.instance.props.channel.id] && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && this.settings.places.chatTextarea) {
if (changedChannels[e.instance.props.channel.id].name) e.instance.props.placeholder = BDFDB.LanguageUtils.LanguageStringsFormat("TEXTAREA_PLACEHOLDER", `#${changedChannels[e.instance.props.channel.id].name}`);
}

View File

@ -96,7 +96,7 @@ module.exports = (_ => {
this.patchedModules = {
before: {
HeaderBarContainer: "default",
ChannelEditorContainer: "render",
ChannelTextAreaEditor: "render",
AutocompleteUserResult: "render",
UserThemedBanner: "default",
UserBanner: "default",
@ -483,7 +483,7 @@ module.exports = (_ => {
});
}
processChannelEditorContainer (e) {
processChannelTextAreaEditor (e) {
if (!e.instance.props.disabled && e.instance.props.channel && e.instance.props.channel.isDM() && (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY) && this.settings.places.chatTextarea) {
let user = BDFDB.LibraryStores.UserStore.getUser(e.instance.props.channel.recipients[0]);
if (user) e.instance.props.placeholder = BDFDB.LanguageUtils.LanguageStringsFormat("TEXTAREA_PLACEHOLDER", `@${changedUsers[user.id] && changedUsers[user.id].name || user.username}`);

View File

@ -80,7 +80,7 @@ module.exports = (_ => {
this.patchedModules = {
after: {
ChannelEditorContainer: ["componentDidMount", "componentDidUpdate"]
ChannelTextAreaEditor: ["componentDidMount", "componentDidUpdate"]
}
};
@ -238,7 +238,7 @@ module.exports = (_ => {
}
}
processChannelEditorContainer (e) {
processChannelTextAreaEditor (e) {
let newText = BDFDB.SlateUtils.toTextValue(e.instance.props.richValue);
if (newText != currentText) {
currentText = newText;

View File

@ -70,7 +70,7 @@ module.exports = (_ => {
this.patchedModules = {
before: {
ChannelTextAreaForm: "render",
ChannelEditorContainer: "render"
ChannelTextAreaEditor: "render"
},
after: {
ChannelTextAreaContainer: "render",
@ -160,7 +160,7 @@ module.exports = (_ => {
}
}
processChannelEditorContainer (e) {
processChannelTextAreaEditor (e) {
if (e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.ChannelTextAreaTypes.NORMAL_WITH_ACTIVITY || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) {
e.instance.props.uploadPromptCharacterCount = 999999999999999;
BDFDB.PatchUtils.patch(this, e.instance, "handlePasteItem", {instead: e2 => {