This commit is contained in:
Mirco Wittrien 2021-07-27 18:25:02 +02:00
parent d1ffa34d8a
commit 8fe2892923
5 changed files with 55 additions and 38 deletions

View File

@ -5051,24 +5051,23 @@ module.exports = (_ => {
if (!this.props.value) return style;
style = Object.assign({}, style);
this.props.color = typeof this.props.getColor == "function" ? this.props.getColor(this.props.value) : this.props.color;
style.borderColor = this.props.color;
if (InternalComponents.NativeSubComponents.Checkbox.Types) switch (this.props.type) {
case InternalComponents.NativeSubComponents.Checkbox.Types.DEFAULT:
if (InternalComponents.LibraryComponents.Checkbox.Types) switch (this.props.type) {
case InternalComponents.LibraryComponents.Checkbox.Types.DEFAULT:
style.borderColor = this.props.color;
break;
case InternalComponents.NativeSubComponents.Checkbox.Types.GHOST:
case InternalComponents.LibraryComponents.Checkbox.Types.GHOST:
let color = BDFDB.ColorUtils.setAlpha(this.props.color, 0.15, "RGB");
style.backgroundColor = color;
style.borderColor = color;
break;
case InternalComponents.NativeSubComponents.Checkbox.Types.INVERTED:
case InternalComponents.LibraryComponents.Checkbox.Types.INVERTED:
style.backgroundColor = this.props.color;
style.borderColor = this.props.color;
}
return style;
}
getColor() {
return this.props.value ? (InternalComponents.NativeSubComponents.Checkbox.Types && this.props.type === InternalComponents.NativeSubComponents.Checkbox.Types.INVERTED ? BDFDB.DiscordConstants.Colors.WHITE : this.props.color) : "transparent";
return this.props.value ? (InternalComponents.LibraryComponents.Checkbox.Types && this.props.type === InternalComponents.LibraryComponents.Checkbox.Types.INVERTED ? BDFDB.DiscordConstants.Colors.WHITE : this.props.color) : "transparent";
}
handleChange(e) {
this.props.value = typeof this.props.getValue == "function" ? this.props.getValue(this.props.value, e) : !this.props.value;
@ -5101,7 +5100,7 @@ module.exports = (_ => {
})
}),
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.checkbox, this.props.shape, this.props.value && BDFDB.disCN.checkboxchecked),
className: BDFDB.DOMUtils.formatClassName(BDFDB.disCN.checkbox, BDFDB.disCN["checkbox" + this.props.shape], this.props.value && BDFDB.disCN.checkboxchecked),
style: Object.assign({
width: this.props.size,
height: this.props.size,
@ -5119,6 +5118,16 @@ module.exports = (_ => {
});
}
};
InternalComponents.LibraryComponents.Checkbox.Types = {
DEFAULT: "DEFAULT",
GHOST: "GHOST",
INVERTED: "INVERTED"
};
InternalComponents.LibraryComponents.Checkbox.Shapes = {
BOX: "box",
ROUND: "round"
};
InternalBDFDB.setDefaultProps(InternalComponents.LibraryComponents.Checkbox, {type: InternalComponents.LibraryComponents.Checkbox.Types.INVERTED, shape: InternalComponents.LibraryComponents.Checkbox.Shapes.ROUND});
InternalComponents.LibraryComponents.Clickable = reactInitialized && class BDFDB_Clickable extends LibraryModules.React.Component {
handleClick(e) {if (typeof this.props.onClick == "function") this.props.onClick(e, this);}

View File

@ -982,7 +982,8 @@
"verifiedBadge": "verifiedBadge-mH2YpO"
},
"ShowHiddenChannels": {
"accessModal": "accessModal-w5HjsV"
"accessModal": "accessModal-w5HjsV",
"hiddenChannel": "hidden-9f2Dsa"
},
"SpotifyControls": {
"activityButton": "activityButton-5Fs4Aa",
@ -1470,6 +1471,7 @@
"_showconnectionsicon": ["ShowConnections", "connectionIcon"],
"_showconnectionsverifiedbadge": ["ShowConnections", "verifiedBadge"],
"_showhiddenchannelsaccessmodal": ["ShowHiddenChannels", "accessModal"],
"_showhiddenchannelshiddenchannel": ["ShowHiddenChannels", "hiddenChannel"],
"_spellcheckerror": ["SpellCheck", "error"],
"_spellcheckoverlay": ["SpellCheck", "overlay"],
"_spotifycontrolsactivitybutton": ["SpotifyControls", "activityButton"],

View File

@ -2,7 +2,7 @@
* @name RevealAllSpoilers
* @author DevilBro
* @authorId 278543574059057154
* @version 1.0.7
* @version 1.0.8
* @description Allows you to reveal all Spoilers within a Message/Status by holding the Ctrl Key and clicking a Spoiler
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -17,14 +17,12 @@ module.exports = (_ => {
"info": {
"name": "RevealAllSpoilers",
"author": "DevilBro",
"version": "1.0.7",
"version": "1.0.8",
"description": "Allows you to reveal all Spoilers within a Message/Status by holding the Ctrl Key and clicking a Spoiler"
},
"changeLog": {
"improved": {
"Plugin Name": "Changed to clarify the Usage",
"Behaviour": "You no longer need to right click a message and press reveal all, simply hold Ctrl and click a Spoiler",
"About Me": "Also works on About Mes"
"fixed": {
"Replies": "No longer reveals spoilers within reply preview if revealing all spoilers within a message"
}
}
};
@ -97,7 +95,7 @@ module.exports = (_ => {
if (e2.methodArguments[0].ctrlKey) {
BDFDB.ListenerUtils.stopEvent(e2.methodArguments[0]);
let parent = BDFDB.DOMUtils.getParent(BDFDB.dotCN.message, e2.methodArguments[0].target) || e2.methodArguments[0].target.parentElement;
if (parent) for (let spoiler of parent.querySelectorAll(BDFDB.dotCN.spoilerhidden)) spoiler.click();
if (parent) for (let spoiler of parent.querySelectorAll(BDFDB.dotCN.spoilerhidden)) if (!BDFDB.DOMUtils.getParent(BDFDB.dotCN.messagerepliedmessagepreview, spoiler)) spoiler.click();
}
}}, {force: true, noCache: true});
}

View File

@ -202,6 +202,7 @@ module.exports = (_ => {
before: {
Channels: "render",
ChannelCategoryItem: "type",
ChannelItem: "default",
VoiceUsers: "render"
},
after: {
@ -492,6 +493,8 @@ module.exports = (_ => {
processChannelItem (e) {
if (e.instance.props.channel && this.isChannelHidden(e.instance.props.channel.id)) {
if (!e.returnvalue) e.instance.props.className = BDFDB.DOMUtils.formatClassName(e.instance.props.className, BDFDB.disCN._showhiddenchannelshiddenchannel);
else {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ChannelItemIcon"});
let channelChildren = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelchildren]]});
if (channelChildren && channelChildren.props && channelChildren.props.children) {
@ -521,6 +524,7 @@ module.exports = (_ => {
}
}
}
}
processVoiceUsers (e) {
if (!this.settings.general.showVoiceUsers && this.isChannelHidden(e.instance.props.channel.id)) e.instance.props.voiceStates = [];

View File

@ -2043,6 +2043,10 @@ a.metadataName-14STf- {
.checkbox-1ix_J3.checked-3_4uQ9[style*="border-color: hsl(235, "] {
border-color: rgb(var(--accentcolor)) !important;
}
.checkbox-1ix_J3 path[fill*="hsl(227, "],
.checkbox-1ix_J3 path[fill*="hsl(235, "] {
fill: rgb(var(--accentcolor)) !important;
}
.container-3auIfb { /* switch unchecked */
background-color: rgb(114, 118, 125) !important;