From aef148722bd33230443f88b616a303f9d7e9e0b3 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Sat, 24 Oct 2020 18:30:11 -0400 Subject: [PATCH] Fixes button hiding settings --- .travis.yml | 2 +- README.md | 30 ++++++++++++------- .../{gifpickerhider.js => hidegifbutton.js} | 14 ++++----- ...rogiftpickerhider.js => hidegiftbutton.js} | 10 +++---- src/builtins/builtins.js | 4 ++- src/data/settings/config.js | 4 +-- src/data/strings.js | 12 ++++---- 7 files changed, 43 insertions(+), 33 deletions(-) rename src/builtins/appearance/{gifpickerhider.js => hidegifbutton.js} (62%) rename src/builtins/appearance/{nitrogiftpickerhider.js => hidegiftbutton.js} (70%) diff --git a/.travis.yml b/.travis.yml index 66e36795..1290c39c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ branches: - development install: - - npm install + - npm ci script: - npm run deploy diff --git a/README.md b/README.md index bc786689..92e55a98 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ These people have all subscribed to the `True Supporter` tier on Patreon to supp Gibbu - Orekieh
+ Orekieh
Orekieh @@ -125,18 +125,26 @@ These people have all subscribed to the `Bandager` tier on Patreon to support me - + William JCM
+ William JCM + + NFLD99
+ NFLD99 + + + +
- William JCM
- William JCM -
- NFLD99
- NFLD99 -
- Tenuit
- Tenuit -
+ Tenuit
+ Tenuit +
+ Pu
+ Pu +
+ Paco
+ Paco +
diff --git a/src/builtins/appearance/gifpickerhider.js b/src/builtins/appearance/hidegifbutton.js similarity index 62% rename from src/builtins/appearance/gifpickerhider.js rename to src/builtins/appearance/hidegifbutton.js index f51cad65..341a09f2 100644 --- a/src/builtins/appearance/gifpickerhider.js +++ b/src/builtins/appearance/hidegifbutton.js @@ -2,13 +2,13 @@ import Builtin from "../../structs/builtin"; import WebpackModules from "../../modules/webpackmodules"; import Utilities from "../../modules/utilities"; -export default new class GifPickerHider extends Builtin { - get name() {return "GifPickerHider";} +export default new class HideGIFButton extends Builtin { + get name() {return "HideGIFButton";} get category() {return "appearance";} - get id() {return "gifPickerHider";} + get id() {return "hideGIFButton";} enabled() { - this.unpatch = this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => { + this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => { const buttons = Utilities.getNestedProp(returnValue, "props.children.props.children.props.children.1.props.children.props.children.2.props.children"); if (Array.isArray(buttons)) { for (const button of buttons) { @@ -16,8 +16,8 @@ export default new class GifPickerHider extends Builtin { const renderFunc = Utilities.getNestedProp(button, "type.type.render"); if (!renderFunc) continue; - // "ChannelGIFPickerButton" for sticker button - if (["ChannelStickerPickerButton"].includes(renderFunc.displayName)) { + // ChannelStickerPickerButton for sticker button + if (renderFunc.displayName === "ChannelGIFPickerButton") { button.props.disabled = true; break; } @@ -27,6 +27,6 @@ export default new class GifPickerHider extends Builtin { } disabled() { - this.unpatch(); + this.unpatchAll(); } }; \ No newline at end of file diff --git a/src/builtins/appearance/nitrogiftpickerhider.js b/src/builtins/appearance/hidegiftbutton.js similarity index 70% rename from src/builtins/appearance/nitrogiftpickerhider.js rename to src/builtins/appearance/hidegiftbutton.js index 65cac264..225240bb 100644 --- a/src/builtins/appearance/nitrogiftpickerhider.js +++ b/src/builtins/appearance/hidegiftbutton.js @@ -2,13 +2,13 @@ import Builtin from "../../structs/builtin"; import WebpackModules from "../../modules/webpackmodules"; import Utilities from "../../modules/utilities"; -export default new class NitroGiftPickerHider extends Builtin { - get name() {return "NitroGiftPickerHider";} +export default new class HideGiftButton extends Builtin { + get name() {return "HideGiftButton";} get category() {return "appearance";} - get id() {return "nitroGiftPickerHider";} + get id() {return "hideGiftButton";} enabled() { - this.unpatch = this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => { + this.after(WebpackModules.find(m => m.type && m.type.render && m.type.render.displayName === "ChannelTextAreaContainer").type, "render", (_, __, returnValue) => { const buttons = Utilities.getNestedProp(returnValue, "props.children.props.children.props.children.1.props.children.props.children.2.props.children"); if (Array.isArray(buttons)) { for (const button of buttons) { @@ -24,6 +24,6 @@ export default new class NitroGiftPickerHider extends Builtin { } disabled() { - this.unpatch(); + this.unpatchAll(); } }; \ No newline at end of file diff --git a/src/builtins/builtins.js b/src/builtins/builtins.js index b5d59bbf..4fa253f1 100644 --- a/src/builtins/builtins.js +++ b/src/builtins/builtins.js @@ -3,13 +3,15 @@ export {default as CustomCSS} from "./customcss"; export {default as WindowPrefs} from "./windowprefs"; -export {default as TwentyFourHour} from "./appearance/24hour"; export {default as ClassNormalizer} from "./general/classnormalizer"; export {default as PublicServers} from "./general/publicservers"; export {default as VoiceDisconnect} from "./general/voicedisconnect"; +export {default as TwentyFourHour} from "./appearance/24hour"; export {default as ColoredText} from "./appearance/coloredtext"; export {default as DarkMode} from "./appearance/darkmode"; +export {default as HideGIFButton} from "./appearance/hidegifbutton"; +export {default as HideGiftButton} from "./appearance/hidegiftbutton"; export {default as MinimalMode} from "./appearance/minimalmode"; export {default as VoiceMode} from "./appearance/voicemode"; diff --git a/src/data/settings/config.js b/src/data/settings/config.js index 7db9cc9a..baa5e4b0 100644 --- a/src/data/settings/config.js +++ b/src/data/settings/config.js @@ -17,8 +17,8 @@ export default [ collapsible: true, settings: [ {type: "switch", id: "twentyFourHour", value: false}, - {type: "switch", id: "nitroGiftPickerHider", value: false}, - {type: "switch", id: "gifPickerHider", value: false}, + {type: "switch", id: "hideGiftButton", value: false}, + {type: "switch", id: "hideGIFButton", value: false}, {type: "switch", id: "voiceMode", value: false}, {type: "switch", id: "minimalMode", value: false}, {type: "switch", id: "hideChannels", value: false, enableWith: "minimalMode"}, diff --git a/src/data/strings.js b/src/data/strings.js index 9bd5acc5..fdc14e9c 100644 --- a/src/data/strings.js +++ b/src/data/strings.js @@ -56,13 +56,13 @@ export default { name: "Colored Text", note: "Make text colour the same as role color" }, - gifpickerhider: { - name: "Hide Gift Picker", - note: "Hides the Gif picker button in the textarea" + hideGIFButton: { + name: "Hide GIF Button", + note: "Hides the GIF picker button in the textarea" }, - nitroGiftPickerHider: { - name: "Hide NitroGift Picker", - note: "Hides the NitroGift button in the textarea" + hideGiftButton: { + name: "Hide Gift Button", + note: "Hides the Nitro Gift button in the textarea" } }, addons: {