This commit is contained in:
Mirco Wittrien 2023-04-16 17:53:34 +02:00
parent 7ad04c5cc4
commit 5a49132e8e
2 changed files with 37 additions and 24 deletions

View File

@ -95,6 +95,12 @@
}},
"AppUtils": {"props": ["clipboard", "os"]},
"ArrayUtils": {"props": ["isArrayLike", "zipObject"]},
"CategoryCollapseUtils": {"strings": ["type:\"CATEGORY_EXPAND_ALL", "type:\"CATEGORY_COLLAPSE_ALL", "dispatch"], "exported": false, "value": "exports", "map": {
"collapse": ["\"CATEGORY_COLLAPSE\""],
"collapseAll": ["\"CATEGORY_COLLAPSE_ALL\""],
"expand": ["\"CATEGORY_EXPAND\""],
"expandAll": ["\"CATEGORY_EXPAND_ALL\""]
}},
"ChannelUtils": {"props": ["selectChannel", "selectPrivateChannel"]},
"ChatRestrictionUtils": {"strings": ["openWarningPopout", "userCanUsePremiumMessageLength"], "exported": false, "value": "exports", "map": {
"applyChatRestrictions": ["openWarningPopout", "userCanUsePremiumMessageLength"]
@ -247,7 +253,7 @@
"TabBar": {"props": ["Item", "Header", "Panel"]},
"Table": {"props": ["SortDirection", "defaultProps"]},
"TextArea": {"strings": ["onKeyDown=function", "defaultDirty"]},
"TextInput": {"strings": ["onFocus=function", "MAXIMUM_LENGTH_ERROR", "translate3d"]},
"TextInput": {"strings": ["onFocus=function", "MAXIMUM_LENGTH_ERROR", "getIsOverFlowing"]},
"TooltipContainer": {"strings": ["handleContextMenu=function", "shouldShowTooltip", "clickable"]}
},
"LibraryComponents": {
@ -522,6 +528,7 @@
"SystemMessageWrapper": {"strings": ["unknown message type", "\"SystemMessage\""]},
"TabBar": {"props": ["Item", "Header", "Panel"]},
"TextChannelEmptyMessage": {"strings": ["MANAGE_CHANNELS", ".BEGINNING_CHANNEL_DESCRIPTION", "topicHook:"]},
"TextInput": {"strings": ["onFocus=function", "MAXIMUM_LENGTH_ERROR", "getIsOverFlowing"], "noSearch": true},
"ThreadCard": {"strings": [".threadId", ".gotoThread", ".container", ".threadName"]},
"ThreadCardDescription": {"strings": [".Messages.THREAD_BROWSER_STARTED_BY", ".bullet", ".lastMessageId"]},
"ThreadEmptyMessage": {"strings": [",{channel:", ".name", "{channelId:", ".iconWrapper", ".icon}"]},

View File

@ -2,7 +2,7 @@
* @name WriteUpperCase
* @author DevilBro
* @authorId 278543574059057154
* @version 1.3.7
* @version 1.3.8
* @description Changes the first Letter of each Sentence in Message Inputs to Uppercase
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -98,11 +98,12 @@ module.exports = (_ => {
this.modulePatches = {
before: [
"ChannelTextAreaEditor"
"ChannelTextAreaEditor",
"TextInput"
],
after: [
"ChannelTextAreaButtons",
"QuickMessage"
"TextInput"
]
};
@ -189,27 +190,32 @@ module.exports = (_ => {
}
}
processQuickMessage (e) {
if (!this.settings.places.quickmessage) return;
let input = e.returnvalue.props.inputRef.current;
processTextInput (e) {
if (!this.settings.places.quickmessage || !e.instance.props.className || e.instance.props.className.indexOf(BDFDB.disCN.userpopoutmessageinputcontainer) == -1) return;
let channelId = BDFDB.LibraryStores.SelectedChannelStore.getChannelId();
if (this.settings.general.addQuickToggle) e.returnvalue = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
children: [
e.returnvalue,
BDFDB.ReactUtils.createElement(QuickToogleButtonComponent, {
type: "quickmessage",
channelId: channelId
})
]
});
if (!input) return;
BDFDB.ListenerUtils.add(this, input, "keyup", event => {
if (this.settings.places.quickmessage && (!this.settings.general.addQuickToggle || channelBlacklist.indexOf(channelId) == -1)) {
let string = input.value;
let newString = this.parse(string);
if (string != newString) input.value = newString;
}
});
if (!e.returnvalue) {
let input = e.instance.props.inputRef.current;
if (input) BDFDB.ListenerUtils.add(this, input, "keyup", event => {
if (this.settings.places.quickmessage && (!this.settings.general.addQuickToggle || channelBlacklist.indexOf(channelId) == -1)) {
let string = input.value;
let newString = this.parse(string);
if (string != newString) input.value = newString;
}
});
}
else {
if (this.settings.general.addQuickToggle) e.returnvalue = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
children: [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex.Child, {
children: e.returnvalue
}),
BDFDB.ReactUtils.createElement(QuickToogleButtonComponent, {
type: "quickmessage",
channelId: channelId
})
]
});
}
}
parse (string) {