This commit is contained in:
Mirco Wittrien 2022-02-11 15:49:25 +01:00
parent 4f8854c7ce
commit d34adf54d7
5 changed files with 65 additions and 81 deletions

View File

@ -2,7 +2,7 @@
* @name CharCounter
* @author DevilBro
* @authorId 278543574059057154
* @version 1.5.8
* @version 1.5.9
* @description Adds a Character Counter to most Inputs
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": {
"name": "CharCounter",
"author": "DevilBro",
"version": "1.5.8",
"version": "1.5.9",
"description": "Adds a Character Counter to most Inputs"
}
};
@ -181,7 +181,7 @@ module.exports = (_ => {
let editorContainer = BDFDB.ReactUtils.findChild(e.returnvalue, {name: "ChannelEditorContainer"});
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, BDFDB.dotCN.textarea);
this.injectCounter(e.returnvalue, e.returnvalue.props.children, editorContainer.props.type.analyticsName || editorContainer.props.type, BDFDB.dotCN.textarea);
}
}

View File

@ -2,7 +2,7 @@
* @name EditChannels
* @author DevilBro
* @authorId 278543574059057154
* @version 4.3.4
* @version 4.3.5
* @description Allows you to locally edit Channels
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": {
"name": "EditChannels",
"author": "DevilBro",
"version": "4.3.4",
"version": "4.3.5",
"description": "Allows you to locally edit Channels"
},
"changeLog": {
@ -273,7 +273,7 @@ module.exports = (_ => {
}
processChannelEditorContainer (e) {
if (!e.instance.props.disabled && e.instance.props.channel && (BDFDB.ChannelUtils.isTextChannel(e.instance.props.channel) || BDFDB.ChannelUtils.isThread(e.instance.props.channel) || e.instance.props.channel.isGroupDM()) && (e.instance.props.type == BDFDB.DiscordConstants.TextareaTypes.NORMAL || e.instance.props.type == BDFDB.DiscordConstants.TextareaTypes.SIDEBAR) && this.settings.places.chatTextarea) {
if (!e.instance.props.disabled && e.instance.props.channel && (BDFDB.ChannelUtils.isTextChannel(e.instance.props.channel) || BDFDB.ChannelUtils.isThread(e.instance.props.channel) || e.instance.props.channel.isGroupDM()) && (e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.NORMAL || e.instance.props.type == BDFDB.LibraryComponents.ChannelTextAreaTypes.SIDEBAR) && this.settings.places.chatTextarea) {
if (changedChannels[e.instance.props.channel.id] && changedChannels[e.instance.props.channel.id].name) e.instance.props.placeholder = BDFDB.LanguageUtils.LanguageStringsFormat("TEXTAREA_PLACEHOLDER", `#${changedChannels[e.instance.props.channel.id].name}`);
}
}
@ -307,34 +307,12 @@ module.exports = (_ => {
let channelName = BDFDB.ReactUtils.findChild(returnValue, {props: [["className", BDFDB.disCN.messagesystemname]]});
this.changeChannelColor(channelName, e.instance.props.message.messageReference.channel_id);
return returnValue;
}, "", this);
}, "Error in Type Render of ThreadMessageAccessories!", this);
}
}
processAutocompleteChannelResult (e) {
if (e.instance.props.channel && this.settings.places.autocompletes) {
if (!e.returnvalue) {
e.instance.props.channel = this.getChannelData(e.instance.props.channel.id);
if (e.instance.props.category) e.instance.props.category = this.getChannelData(e.instance.props.category.id);
}
else {
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
let channelName = BDFDB.ReactUtils.findChild(children, {name: "AutocompleteRowHeading"});
if (channelName) this.changeChannelColor(channelName, e.instance.props.channel.id);
let channelIcon = BDFDB.ReactUtils.findChild(children, {props: [["className", BDFDB.disCN.autocompleteicon]]});
if (channelIcon) this.changeChannelIconColor(channelIcon, e.instance.props.channel.id);
if (e.instance.props.category) {
let categoryName = BDFDB.ReactUtils.findChild(children, {name: "AutocompleteRowContentSecondary"});
if (categoryName) this.changeChannelColor(categoryName, e.instance.props.category.id);
}
return children;
}, "", this);
}
}
}
console.log(e);
}
processGuildSettingsAuditLogEntry (e) {
@ -386,7 +364,7 @@ module.exports = (_ => {
let icon = iconRender(...args);
this.changeChannelIconColor(icon, channel.id);
return icon;
}, "", this);
}, "Error in Channel Icon Render of HeaderBarContainer!", this);
}
if (thread && channelIcons[1].props.icon) {
let iconRender = channelIcons[1].props.icon;
@ -394,7 +372,7 @@ module.exports = (_ => {
let icon = iconRender(...args);
this.changeChannelIconColor(icon, thread.id);
return icon;
}, "", this);
}, "Error in Thread Icon Render of HeaderBarContainer!", this);
}
}
}
@ -494,10 +472,10 @@ module.exports = (_ => {
let renderedChildren = childrenRender(...args2);
this.changeChannelIconColor(renderedChildren.props.children, e.instance.props.channel.id, modify);
return renderedChildren;
}, "", this);
}, "Error in Children Render of ChannelItem!", this);
}
return returnValue;
}, "", this);
}, "Error in Type Render of ChannelItem!", this);
}
}
}
@ -527,32 +505,34 @@ module.exports = (_ => {
let renderedChildren = childrenRender(...args);
if (renderedChildren && renderedChildren.props) renderedChildren.props.icon = this.getGroupIcon(e.instance.props.channel.id);
return renderedChildren;
}, "", this);
}, "Error in Avatar Render of DirectMessage!", this);
}
}
}
processPrivateChannel (e) {
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children);
return children;
}, "", this);
if (e.instance.props.channel && e.instance.props.channel.isGroupDM() && this.settings.places.channelList) {
if (typeof e.returnvalue.props.children == "function") {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
this._processPrivateChannel(e.instance, children);
return children;
}, "Error in Children Render of PrivateChannel!", this);
}
else this._processPrivateChannel(e.instance, e.returnvalue);
}
else this._processPrivateChannel(e.instance, e.returnvalue);
}
_processPrivateChannel (instance, returnvalue) {
if (instance.props.channel && instance.props.channel.isGroupDM() && this.settings.places.channelList) {
if (changedChannels[instance.props.channel.id] && changedChannels[instance.props.channel.id].name) {
returnvalue.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(instance.props.channel.id)});
}
this.changeChannelColor(returnvalue.props.name, instance.props.channel.id, {modify: BDFDB.ObjectUtils.extract(Object.assign({}, instance.props, instance.state), "hovered", "selected", "hasUnreadMessages", "muted")});
returnvalue.props.name = [returnvalue.props.name];
returnvalue.props.avatar.props.src = this.getGroupIcon(instance.props.channel.id);
const wrapper = returnvalue.props.avatar ? returnvalue : BDFDB.ReactUtils.findChild(returnvalue, {props: ["avatar"]});
if (!wrapper) return;
if (changedChannels[instance.props.channel.id] && changedChannels[instance.props.channel.id].name) {
wrapper.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getGroupName(instance.props.channel.id)});
}
this.changeChannelColor(wrapper.props.name, instance.props.channel.id, {modify: BDFDB.ObjectUtils.extract(Object.assign({}, instance.props, instance.state), "hovered", "selected", "hasUnreadMessages", "muted")});
wrapper.props.name = [wrapper.props.name];
if (wrapper.props.avatar) wrapper.props.avatar.props.src = this.getGroupIcon(instance.props.channel.id);
}
processPrivateChannel (e) {
@ -676,7 +656,7 @@ module.exports = (_ => {
let children = renderChildren(...args);
this.changeMention(children, {name, color});
return children;
}, "", this);
}, "Error in Children Render of RichChannelMention!", this);
}
else this.changeMention(e.returnvalue, {name, color});
}

View File

@ -1087,6 +1087,7 @@ module.exports = (_ => {
_processPrivateChannel (instance, returnvalue) {
const wrapper = returnvalue.props.avatar ? returnvalue : BDFDB.ReactUtils.findChild(returnvalue, {props: ["avatar"]});
if (!wrapper) return;
wrapper.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getUserData(instance.props.user.id).username});
this.changeUserColor(wrapper.props.name, instance.props.user.id, {modify: BDFDB.ObjectUtils.extract(Object.assign({}, instance.props, instance.state), "hovered", "selected", "hasUnreadMessages", "muted")});
if (wrapper.props.avatar) wrapper.props.avatar.props.src = this.getUserAvatar(instance.props.user.id);

View File

@ -2,7 +2,7 @@
* @name ShowBadgesInChat
* @author DevilBro
* @authorId 278543574059057154
* @version 1.8.2
* @version 1.8.4
* @description Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": {
"name": "ShowBadgesInChat",
"author": "DevilBro",
"version": "1.8.2",
"version": "1.8.4",
"description": "Displays Badges (Nitro, Hypesquad, etc...) in the Chat/MemberList/DMList"
}
};
@ -285,15 +285,18 @@ module.exports = (_ => {
let childrenRender = e.returnvalue.props.children;
e.returnvalue.props.children = BDFDB.TimeUtils.suppress((...args) => {
let children = childrenRender(...args);
children.props.decorators = [children.props.decorators].flat(10);
this.injectBadges(children.props.decorators, e.instance.props.user, null, "dms");
this._processPrivateChannel(e.instance, children);
return children;
}, "", this);
}
else {
e.returnvalue.props.decorators = [e.returnvalue.props.decorators].flat(10);
this.injectBadges(e.returnvalue.props.decorators, e.instance.props.user, null, "dms");
}, "Error in Children Render of PrivateChannel!", this);
}
else this._processPrivateChannel(e.instance, e.returnvalue);
}
_processPrivateChannel (instance, returnvalue, a) {
const wrapper = returnvalue.props.decorators ? returnvalue : BDFDB.ReactUtils.findChild(returnvalue, {props: ["decorators"]}) || returnvalue;
if (!wrapper) return;
wrapper.props.decorators = [wrapper.props.decorators].flat(10);
this.injectBadges(wrapper.props.decorators, instance.props.user, null, "dms");
}
processUserProfileBadgeList (e) {

View File

@ -1351,14 +1351,14 @@ img[src="/assets/4697ec960e57790ad4f6251af4c246b4.svg"] { /* widgetsettings wid
position: relative;
}
.attachment-1PZZB2 .icon-1KCy88,
.uploadContainer-1neFYt .icon-2fEp67,
.uploadContainer-TCg-Ji .icon-2bPCaV,
.audioMetadata-1Hrt8T::before,
.uploadModal-2ie9O_ .icon-HW4tZ-:not(.image-2ssF8k),
.uploadModalIn-2w48Zf .icon-HW4tZ-:not(.image-2ssF8k) {
object-position: -999999px -999999px;
background: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_bg.svg) center/contain no-repeat !important;
}
.uploadContainer-1neFYt .icon-2fEp67 {
.uploadContainer-TCg-Ji .icon-2bPCaV {
background-size: 72px 96px !important;
}
.uploadModal-2ie9O_ .icon-HW4tZ-:not(.image-2ssF8k),
@ -1367,8 +1367,8 @@ img[src="/assets/4697ec960e57790ad4f6251af4c246b4.svg"] { /* widgetsettings wid
}
.attachment-1PZZB2 .icon-1KCy88 + *::before,
.attachment-1PZZB2 .icon-1KCy88 + *::after,
.uploadContainer-1neFYt .icon-2fEp67::before,
.uploadContainer-1neFYt .icon-2fEp67::after,
.uploadContainer-TCg-Ji .icon-2bPCaV::before,
.uploadContainer-TCg-Ji .icon-2bPCaV::after,
.audioMetadata-1Hrt8T > *:first-child::before,
.audioMetadata-1Hrt8T > *:first-child::after,
.uploadModal-2ie9O_ .icon-HW4tZ-:not(.image-2ssF8k)::before,
@ -1398,8 +1398,8 @@ img[src="/assets/4697ec960e57790ad4f6251af4c246b4.svg"] { /* widgetsettings wid
width: 24px;
height: 32px;
}
.uploadContainer-1neFYt .icon-2fEp67::before,
.uploadContainer-1neFYt .icon-2fEp67::after {
.uploadContainer-TCg-Ji .icon-2bPCaV::before,
.uploadContainer-TCg-Ji .icon-2bPCaV::after {
width: 108px;
height: 144px;
margin-left: 46px;
@ -1418,83 +1418,83 @@ img[src="/assets/4697ec960e57790ad4f6251af4c246b4.svg"] { /* widgetsettings wid
background: #d83c3f;
}
.attachment-1PZZB2 .icon-1KCy88 + *::before,
.uploadContainer-1neFYt .icon-2fEp67::before,
.uploadContainer-TCg-Ji .icon-2bPCaV::before,
.audioMetadata-1Hrt8T > *:first-child::before,
.uploadModal-2ie9O_ .icon-HW4tZ-:not(.image-2ssF8k)::before,
.uploadModalIn-2w48Zf .icon-HW4tZ-:not(.image-2ssF8k)::before {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_details.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88 + *::after,
.uploadContainer-1neFYt .icon-2fEp67.unknown-3zKKmA::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.unknown-1HSceW::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.unknown-3ClW7Z::after,
.uploadModal-2ie9O_ .icon-HW4tZ-:not(.image-2ssF8k)::after,
.uploadModalIn-2w48Zf .icon-HW4tZ-:not(.image-2ssF8k)::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/common/empty.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="acrobat"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.acrobat-33WAV6::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.acrobat-3i7zSC::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.acrobat-2-m_um::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_acrobat_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="ae"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.ae-17cU1_::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.ae-1ZAdFv::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.ae-1bPydY::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_ae_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="ai"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.ai-3R_H7o::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.ai-3QkK4s::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.ai-1QhRgT::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_ai_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="archive"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.archive-2dk1co::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.archive-1zydwk::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.archive-2bNoJA::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_archive_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="audio"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.audio-2Xxeqv::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.audio-bZBBRF::after,
.audioMetadata-1Hrt8T > *:first-child::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.audio-YC1s9s::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_audio_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="code"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.code-10NPWN::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.code-1hTP09::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.code-rRQnfi::after,
.uploadModalIn-2w48Zf .icon-HW4tZ-.two-1t2_74::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_code_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="document"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.document-1HIQqD::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.document-3AUmU1::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.document-1u6V3N::after,
.uploadModalIn-2w48Zf .icon-HW4tZ-.three-fZYihQ::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_document_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="photoshop"] + *::after,
.attachment-1PZZB2 .icon-1KCy88[title="ps"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.photoshop-3aNHj5::after,
.uploadContainer-1neFYt .icon-2fEp67.ps-3aLfSc::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.photoshop-4gkCVB::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.ps-1mWY_j::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.photoshop-LN9Et_::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.ps-1C6rg4::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_photoshop_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="sketch"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.sketch-3b6dg-::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.sketch-1CwZfM::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.sketch-t3m6M1::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_sketch_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="spreadsheet"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.spreadsheet-1PqMsQ::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.spreadsheet-34d5T3::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.spreadsheet-1wEQpO::after,
.uploadModalIn-2w48Zf .icon-HW4tZ-.one-NzgGbt::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_spreadsheet_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="video"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.video-2cigyM::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.video-qa3DnY::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.video-L7uQxc::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_video_accent.svg) center/contain no-repeat;
}
.attachment-1PZZB2 .icon-1KCy88[title="webcode"] + *::after,
.uploadContainer-1neFYt .icon-2fEp67.webcode-1sNqh1::after,
.uploadContainer-TCg-Ji .icon-2bPCaV.webcode-3EYK4X::after,
.uploadModal-2ie9O_ .icon-HW4tZ-.webcode-18ObW7::after {
-webkit-mask: url(https://mwittrien.github.io/BetterDiscordAddons/Themes/_res/svgs/blurple/files_webcode_accent.svg) center/contain no-repeat;
}