From 285ba141e6d9f3b4942eea067dc96812440c6139 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Mon, 24 Oct 2022 10:50:14 +0200 Subject: [PATCH] stuff --- Library/_res/0BDFDB.data.json | 3 +-- Plugins/CharCounter/CharCounter.plugin.js | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index f4b5258a81..fb744e949d 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -391,6 +391,7 @@ "ModalCarousel": {"strings": [".gotoNext", "currentIndex", "gotoPrevThrottled"]}, "ModalFooter": {"strings": [".footerSeparator", ".separator", "Direction.HORIZONTAL_REVERSE"]}, "NameTag": {"strings": ["invertColor:", "usernameClass", "discriminatorClass"]}, + "Note": {"strings": [".noteRef", "handleBlur", ".SPACE"]}, "NowPlayingHeader": {"strings": ["ACTIVITY_FEED_NOW_PLAYING_HEADER", "partiedMembers"]}, "NowPlayingItem": {"strings": [".wrapper", "padded:"]}, "PanelButton": {"strings": ["Masks.PANEL_BUTTON"]}, @@ -970,7 +971,6 @@ "counterAdded": "charCounterAdded-zz9O4t", "customStatusCounter": "customStatusCounter-G8FrsT", "editCounter": "editCounter-pNT1Xe", - "nickCounter": "nickCounter-tJrO_4", "popoutNoteCounter": "popoutNoteCounter-62U4Rh", "profileNoteCounter": "profileNoteCounter-p0fWA_", "threadCreation": "threadCreation-p0fWA_", @@ -1510,7 +1510,6 @@ "_charcountercounteradded": ["CharCounter", "counterAdded"], "_charcountercustomstatuscounter": ["CharCounter", "customStatusCounter"], "_charcountereditcounter": ["CharCounter", "editCounter"], - "_charcounternickcounter": ["CharCounter", "nickCounter"], "_charcounterpopoutnotecounter": ["CharCounter", "popoutNoteCounter"], "_charcounterprofilenotecounter": ["CharCounter", "profileNoteCounter"], "_charcounterthreadcreationcounter": ["CharCounter", "threadCreation"], diff --git a/Plugins/CharCounter/CharCounter.plugin.js b/Plugins/CharCounter/CharCounter.plugin.js index 9d1fd84999..d30f9594d1 100644 --- a/Plugins/CharCounter/CharCounter.plugin.js +++ b/Plugins/CharCounter/CharCounter.plugin.js @@ -2,7 +2,7 @@ * @name CharCounter * @author DevilBro * @authorId 278543574059057154 - * @version 1.6.1 + * @version 1.6.2 * @description Adds a Character Counter to most Inputs * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -57,7 +57,6 @@ module.exports = (_ => { } } : (([Plugin, BDFDB]) => { const maxLengths = { - nick: 32, customstatus: 128, popoutnote: 256, profilenote: 256 @@ -72,13 +71,12 @@ module.exports = (_ => { return class CharCounter extends Plugin { onLoad () { - this.patchedModules = { - after: { - ChannelTextAreaContainer: "render", - Note: "render", - NicknameSection: "default", - CustomStatusModal: "render" - } + this.modulePatches = { + after: [ + "ChannelTextAreaContainer", + "CustomStatusModal", + "Note" + ] }; this.defaults = { @@ -114,10 +112,6 @@ module.exports = (_ => { right: 0; bottom: -1.0em; } - ${BDFDB.dotCN._charcounternickcounter} { - right: 0 !important; - top: -1.5em; - } ${BDFDB.dotCN._charcountercustomstatuscounter} { right: 0 !important; top: -1.5em; @@ -183,7 +177,8 @@ module.exports = (_ => { } processNote (e) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["TextAreaAutosize", "TextArea", "PlainTextArea"]}); + console.log(e); + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: n => n && n.props && n.props.autoCorrect != undefined}); if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.className && e.instance.props.className.indexOf(BDFDB.disCN.usernotepopout) > -1 ? "popoutnote" : "profilenote", "textarea"); }