BetterDiscordAddons/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.pl...

608 lines
30 KiB
JavaScript
Raw Normal View History

2020-10-20 23:25:34 +02:00
/**
* @name DisplayServersAsChannels
2021-03-05 13:26:41 +01:00
* @author DevilBro
2020-10-20 23:25:34 +02:00
* @authorId 278543574059057154
* @version 1.6.0
2021-03-05 13:26:41 +01:00
* @description Displays Servers in a similar way as Channels
2020-10-20 23:25:34 +02:00
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
* @patreon https://www.patreon.com/MircoWittrien
2021-03-09 15:10:55 +01:00
* @website https://mwittrien.github.io/
* @source https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/DisplayServersAsChannels/
2021-03-10 09:17:37 +01:00
* @updateUrl https://mwittrien.github.io/BetterDiscordAddons/Plugins/DisplayServersAsChannels/DisplayServersAsChannels.plugin.js
2020-10-20 23:25:34 +02:00
*/
2018-10-11 10:21:26 +02:00
2020-09-19 20:49:33 +02:00
module.exports = (_ => {
2022-09-01 14:40:11 +02:00
const changeLog = {
2022-09-02 12:37:10 +02:00
2020-09-19 20:49:33 +02:00
};
2020-11-19 17:36:25 +01:00
2022-02-05 21:14:17 +01:00
return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class {
2022-09-01 14:55:22 +02:00
constructor (meta) {for (let key in meta) this[key] = meta[key];}
getName () {return this.name;}
getAuthor () {return this.author;}
getVersion () {return this.version;}
getDescription () {return `The Library Plugin needed for ${this.name} is missing. Open the Plugin Settings to download it. \n\n${this.description}`;}
2021-02-01 17:13:13 +01:00
downloadLibrary () {
require("request").get("https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js", (e, r, b) => {
2021-03-05 13:14:18 +01:00
if (!e && b && r.statusCode == 200) require("fs").writeFile(require("path").join(BdApi.Plugins.folder, "0BDFDB.plugin.js"), b, _ => BdApi.showToast("Finished downloading BDFDB Library", {type: "success"}));
2021-03-06 14:59:48 +01:00
else BdApi.alert("Error", "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library");
2021-02-01 17:13:13 +01:00
});
}
2020-02-12 14:02:42 +01:00
2021-01-06 12:38:36 +01:00
load () {
2020-11-19 16:51:14 +01:00
if (!window.BDFDB_Global || !Array.isArray(window.BDFDB_Global.pluginQueue)) window.BDFDB_Global = Object.assign({}, window.BDFDB_Global, {pluginQueue: []});
2020-09-19 20:49:33 +02:00
if (!window.BDFDB_Global.downloadModal) {
window.BDFDB_Global.downloadModal = true;
2022-09-01 14:55:22 +02:00
BdApi.showConfirmationModal("Library Missing", `The Library Plugin needed for ${this.name} is missing. Please click "Download Now" to install it.`, {
2020-09-19 20:49:33 +02:00
confirmText: "Download Now",
cancelText: "Cancel",
onCancel: _ => {delete window.BDFDB_Global.downloadModal;},
2020-09-20 08:15:13 +02:00
onConfirm: _ => {
delete window.BDFDB_Global.downloadModal;
2021-02-01 17:13:13 +01:00
this.downloadLibrary();
2020-09-20 08:15:13 +02:00
}
2020-09-19 20:49:33 +02:00
});
2020-02-12 14:02:42 +01:00
}
2022-09-01 14:55:22 +02:00
if (!window.BDFDB_Global.pluginQueue.includes(this.name)) window.BDFDB_Global.pluginQueue.push(this.name);
2020-10-09 21:09:35 +02:00
}
2021-01-06 12:38:36 +01:00
start () {this.load();}
stop () {}
getSettingsPanel () {
2020-11-28 23:12:09 +01:00
let template = document.createElement("template");
2022-09-01 14:55:22 +02:00
template.innerHTML = `<div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The Library Plugin needed for ${this.name} is missing.\nPlease click <a style="font-weight: 500;">Download Now</a> to install it.</div>`;
2021-02-01 17:13:13 +01:00
template.content.firstElementChild.querySelector("a").addEventListener("click", this.downloadLibrary);
2020-11-28 23:12:09 +01:00
return template.content.firstElementChild;
}
2021-04-24 14:27:23 +02:00
} : (([Plugin, BDFDB]) => {
2020-10-09 21:09:35 +02:00
return class DisplayServersAsChannels extends Plugin {
2021-01-06 12:38:36 +01:00
onLoad () {
2020-09-19 20:49:33 +02:00
this.defaults = {
2021-04-24 14:27:23 +02:00
general: {
2020-11-19 16:51:14 +01:00
showGuildIcon: {value: true, description: "Show a icon for servers"},
2020-09-19 20:49:33 +02:00
},
amounts: {
2020-11-19 16:51:14 +01:00
serverListWidth: {value: 240, min: 45, description: "Server list width in px: "},
2021-04-24 14:27:23 +02:00
serverElementHeight: {value: 32, min: 16, description: "Server element height in px: "}
2020-09-19 20:49:33 +02:00
}
};
2021-04-09 18:13:38 +02:00
this.patchPriority = 9;
2020-09-19 20:49:33 +02:00
this.patchedModules = {
after: {
2022-10-13 12:59:46 +02:00
GuildsBar: "type",
2021-10-18 20:51:42 +02:00
HomeButton: "type",
2022-06-23 19:28:44 +02:00
GuildFavorites: "default",
2020-09-19 20:49:33 +02:00
DirectMessage: "render",
2022-02-06 18:09:47 +01:00
GuildItem: "type",
2021-11-03 11:41:24 +01:00
FolderItem: "default",
FolderHeader: "default",
2020-09-19 20:49:33 +02:00
CircleIconButton: "render",
2021-10-08 11:42:54 +02:00
UnavailableGuildsButton: "default"
2020-09-19 20:49:33 +02:00
}
};
this.css = `
${BDFDB.dotCN.forumpagelist} {
justify-content: flex-start;
}
`;
2020-09-19 20:49:33 +02:00
}
onStart () {
2020-02-12 14:02:42 +01:00
BDFDB.DOMUtils.addClass(document.body, BDFDB.disCN._displayserversaschannelsstyled);
2019-09-04 12:34:02 +02:00
2020-09-11 19:31:36 +02:00
BDFDB.PatchUtils.patch(this, BDFDB.LibraryComponents.GuildComponents.Guild.prototype, "render", {after: e => {
if (e.thisObject.props.list) this.processGuildItem({instance: e.thisObject, returnvalue: e.returnValue, methodname: "render"});
2020-02-12 14:02:42 +01:00
}});
2019-09-04 12:34:02 +02:00
this.forceUpdateAll();
this.addCSS();
2020-02-12 14:02:42 +01:00
}
2020-09-19 20:49:33 +02:00
2021-01-06 12:38:36 +01:00
onStop () {
2020-02-12 14:02:42 +01:00
BDFDB.DOMUtils.removeClassFromDOM(BDFDB.disCN._displayserversaschannelsstyled);
2019-09-04 12:34:02 +02:00
2020-02-12 14:02:42 +01:00
BDFDB.DOMUtils.removeLocalStyle("DSACStyle" + this.name);
2019-09-04 12:34:02 +02:00
this.forceUpdateAll();
}
2020-09-19 20:49:33 +02:00
getSettingsPanel (collapseStates = {}) {
2021-04-24 14:27:23 +02:00
let settingsPanel;
return settingsPanel = BDFDB.PluginUtils.createSettingsPanel(this, {
collapseStates: collapseStates,
children: _ => {
let settingsItems = [];
2020-09-19 20:49:33 +02:00
2021-04-24 14:27:23 +02:00
for (let key in this.defaults.general) settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "Switch",
plugin: this,
keys: ["general", key],
label: this.defaults.general[key].description,
value: this.settings.general[key]
}));
for (let key in this.defaults.amounts) settingsItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
type: "TextInput",
childProps: {
type: "number"
},
plugin: this,
keys: ["amounts", key],
label: this.defaults.amounts[key].description,
basis: "20%",
min: this.defaults.amounts[key].min,
max: this.defaults.amounts[key].max,
value: this.settings.amounts[key]
}));
return settingsItems;
}
});
2020-09-19 20:49:33 +02:00
}
2019-09-04 12:34:02 +02:00
2021-01-06 12:38:36 +01:00
onSettingsClosed () {
2020-09-19 20:49:33 +02:00
if (this.SettingsUpdated) {
delete this.SettingsUpdated;
this.forceUpdateAll();
this.addCSS();
}
}
2020-02-12 14:02:42 +01:00
2022-10-10 15:53:50 +02:00
forceUpdateAll () {
BDFDB.DiscordUtils.rerenderAll();
}
2020-11-19 17:36:25 +01:00
2020-09-19 20:49:33 +02:00
processGuilds (e) {
2022-06-23 19:28:44 +02:00
let [favoritesChildren, favoritesIndex] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: n => n && n.type && [".favoriteIcon", "FAVORITES_GUILD_NAME"].every(s => n.type.toString().indexOf(s) > -1)});
if (favoritesIndex > -1) favoritesChildren[favoritesIndex] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Favorites, {});
2021-10-08 11:42:54 +02:00
let [errorChildren, errorIndex] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FluxContainer(<Unknown>)"});
if (errorIndex > -1) errorChildren[errorIndex] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.UnavailableGuildsButton, {
2022-09-27 16:53:10 +02:00
unavailableGuilds: BDFDB.LibraryStores.GuildAvailabilityStore.totalUnavailableGuilds
});
2021-10-08 11:42:54 +02:00
let scroller = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.guildsscroller]]});
2020-09-19 20:49:33 +02:00
if (scroller) {
scroller.props.fade = true;
scroller.type = BDFDB.LibraryComponents.Scrollers.Thin;
}
}
2020-09-19 20:49:33 +02:00
2021-10-18 20:51:42 +02:00
processHomeButton (e) {
2020-02-12 14:02:42 +01:00
this.removeTooltip(e.returnvalue);
2021-11-03 11:41:24 +01:00
e.returnvalue = this.removeMask(e.returnvalue);
2020-09-19 20:49:33 +02:00
this.addElementName(e.returnvalue, BDFDB.LanguageUtils.LanguageStrings.HOME);
}
2022-06-23 19:28:44 +02:00
processGuildFavorites (e) {
this.removeTooltip(e.returnvalue);
e.returnvalue = this.removeMask(e.returnvalue);
this.addElementName(e.returnvalue, BDFDB.LanguageUtils.LanguageStrings.FAVORITES_GUILD_NAME);
}
2020-09-19 20:49:33 +02:00
processDirectMessage (e) {
if (e.instance.props.channel.id) {
2022-09-27 16:53:10 +02:00
if (e.returnvalue.props.children && e.returnvalue.props.children.props) e.returnvalue.props.children.props.className = BDFDB.DOMUtils.formatClassName(e.returnvalue.props.children.props.className, BDFDB.LibraryStores.UserGuildSettingsStore.isChannelMuted(null, e.instance.props.channel.id) && BDFDB.disCN._displayserversaschannelsmuted);
2020-09-19 20:49:33 +02:00
let text = BDFDB.ReactUtils.findValue(e.returnvalue, "text");
this.removeTooltip(e.returnvalue);
2021-11-03 11:41:24 +01:00
e.returnvalue = this.removeMask(e.returnvalue);
2020-09-19 20:49:33 +02:00
this.addElementName(e.returnvalue, text, {
2020-11-11 00:49:43 +01:00
isDm: true
2020-09-19 20:49:33 +02:00
});
}
}
2020-09-19 20:49:33 +02:00
2021-11-03 11:41:24 +01:00
processGuildItem (e) {
2020-09-19 20:49:33 +02:00
if (e.instance.props.guild) {
2022-09-27 16:53:10 +02:00
e.returnvalue.props.className = BDFDB.DOMUtils.formatClassName(e.returnvalue.props.className, BDFDB.LibraryStores.UserGuildSettingsStore.isMuted(e.instance.props.guild.id) && BDFDB.disCN._displayserversaschannelsmuted);
2022-03-09 14:18:46 +01:00
if (!BDFDB.BDUtils.isPluginEnabled("ServerDetails")) this.removeTooltip(e.returnvalue, e.instance.props.guild);
2021-11-03 11:41:24 +01:00
e.returnvalue = this.removeMask(e.returnvalue);
2020-09-19 20:49:33 +02:00
this.addElementName(e.returnvalue, e.instance.props.guild.name, {
badges: [
2022-10-11 13:15:58 +02:00
this.settings.general.showGuildIcon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildIconComponents.Icon, {
2020-09-19 20:49:33 +02:00
animate: e.instance.props.animatable && e.instance.state && e.instance.state.hovered,
guild: e.instance.props.guild,
2022-10-11 13:15:58 +02:00
size: BDFDB.LibraryComponents.GuildIconComponents.Icon.Sizes.SMALLER
2020-09-19 20:49:33 +02:00
}),
2022-10-17 17:29:29 +02:00
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildBadge, {
2021-04-24 14:27:23 +02:00
size: this.settings.amounts.serverElementHeight * 0.5,
2020-09-19 20:49:33 +02:00
badgeColor: BDFDB.DiscordConstants.Colors.STATUS_GREY,
tooltipColor: BDFDB.LibraryComponents.TooltipContainer.Colors.BLACK,
tooltipPosition: BDFDB.LibraryComponents.TooltipContainer.Positions.RIGHT,
guild: e.instance.props.guild
})
]
});
}
}
2021-11-03 11:41:24 +01:00
processFolderItem (e) {
if (e.instance.props.folderNode) this.removeTooltip(e.returnvalue);
}
processFolderHeader (e) {
if (e.instance.props.folderNode) {
e.returnvalue = this.removeMask(e.returnvalue);
let folderColor = BDFDB.ColorUtils.convert(e.instance.props.folderNode.color, "HEX") || "var(--bdfdb-blurple)";
let folderSize = Math.round(this.settings.amounts.serverElementHeight * 0.725);
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FolderIconContent"});
if (index > -1) children[index] = null;
this.addElementName(e.returnvalue, e.instance.props.folderNode.name || BDFDB.LanguageUtils.LanguageStrings.SERVER_FOLDER_PLACEHOLDER, {
2020-09-19 20:49:33 +02:00
wrap: true,
backgroundColor: e.instance.props.expanded && BDFDB.ColorUtils.setAlpha(folderColor, 0.2),
badges: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
color: folderColor,
width: folderSize,
height: folderSize,
name: BDFDB.LibraryComponents.SvgIcon.Names.FOLDER
})
});
}
}
processCircleIconButton (e) {
2021-10-18 20:51:42 +02:00
const child = BDFDB.ReactUtils.findChild(e.returnvalue, {filter: n => n.props && n.props.id && typeof n.props.children == "function"});
if (child) {
let renderChildren = child.props.children;
child.props.children = BDFDB.TimeUtils.suppress((...args) => {
2021-11-03 11:41:24 +01:00
let childE = {instance: e.instance, returnvalue: renderChildren(...args)};
childE.returnvalue = BDFDB.ReactUtils.createElement(BDFDB.ReactUtils.Fragment, {children: childE.returnvalue});
this._processCircleIconButton(childE);
return childE.returnvalue;
2021-10-18 20:51:42 +02:00
});
}
2021-11-03 11:41:24 +01:00
else this._processCircleIconButton(e);
2021-10-18 20:51:42 +02:00
}
2021-11-03 11:41:24 +01:00
_processCircleIconButton (e) {
this.removeTooltip(e.returnvalue);
e.returnvalue = this.removeMask(e.returnvalue);
this.addElementName(e.returnvalue, e.instance.props.tooltip, {
2020-02-12 14:02:42 +01:00
wrap: true,
2020-09-19 20:49:33 +02:00
backgroundColor: "transparent"
2020-02-12 14:02:42 +01:00
});
}
2020-09-19 20:49:33 +02:00
processUnavailableGuildsButton (e) {
this.removeTooltip(e.returnvalue);
this.addElementName(e.returnvalue, `${e.instance.props.unavailableGuilds} ${e.instance.props.unavailableGuilds == 1 ? "Server" : "Servers"}`, {
wrap: true,
backgroundColor: "transparent"
});
2019-09-26 20:09:46 +02:00
}
2020-09-19 20:49:33 +02:00
2022-03-09 14:18:46 +01:00
removeTooltip (parent, guild) {
2020-09-19 20:49:33 +02:00
let [children, index] = BDFDB.ReactUtils.findParent(parent, {name: ["Tooltip", "ListItemTooltip", "GuildTooltip", "BDFDB_TooltipContainer"]});
2022-03-09 14:18:46 +01:00
if (index > -1) {
if (!guild) children[index] = children[index].props.children;
else children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildVoiceList, {
guild: guild
}),
tooltipConfig: {
type: "right"
},
children: children[index].props.children
});
}
2019-09-26 20:09:46 +02:00
}
2020-09-19 20:49:33 +02:00
removeMask (parent) {
let [children, index] = BDFDB.ReactUtils.findParent(parent, {name: "BlobMask"});
2021-11-03 11:41:24 +01:00
let parentIsMask = index == -1 && parent.type.displayName == "BlobMask";
if (parentIsMask) [children, index] = [[parent], 0];
2020-09-19 20:49:33 +02:00
if (index > -1) {
let badges = [];
for (let key of Object.keys(children[index].props)) {
if (key && key.endsWith("Badge") && BDFDB.ReactUtils.isValidElement(children[index].props[key])) badges.push(children[index].props[key]);
}
if (badges.length) {
let insertBadges = returnvalue => {
if (returnvalue.props.children) (returnvalue.props.children[0] || returnvalue.props.children).props.children = [
(returnvalue.props.children[0] || returnvalue.props.children).props.children,
badges
].flat(10).filter(n => n);
else returnvalue.props.children = [badges];
};
if (children[index].props.children && children[index].props.children.props && typeof children[index].props.children.props.children == "function") {
let childrenRender = children[index].props.children.props.children;
2021-07-05 16:33:10 +02:00
children[index].props.children.props.children = BDFDB.TimeUtils.suppress((...args) => {
let renderedChildren = childrenRender(...args);
insertBadges(renderedChildren);
return renderedChildren;
2021-07-05 16:33:10 +02:00
}, "", this);
}
else insertBadges(children[index]);
}
2020-09-19 20:49:33 +02:00
children[index] = children[index].props.children;
2021-11-03 11:41:24 +01:00
if (parentIsMask) return children[index];
2020-02-12 14:02:42 +01:00
}
2021-11-03 11:41:24 +01:00
return parent;
2020-09-19 20:49:33 +02:00
}
addElementName (parent, name, options = {}) {
let [children, index] = BDFDB.ReactUtils.findParent(parent, {
name: ["NavItem", "Clickable"],
props: [["className", BDFDB.disCN.guildserrorinner]],
filter: c => c && c.props && (c.props.id == "home" || !isNaN(parseInt(c.props.id)))
});
2020-09-19 20:49:33 +02:00
if (index > -1) {
2022-03-09 14:18:46 +01:00
const insertElements = returnvalue => {
2021-04-08 18:13:57 +02:00
if (BDFDB.ReactUtils.findChild(parent, {props: [["className", BDFDB.disCN._displayserversaschannelsname]]})) return;
let childEles = [
2020-11-11 00:49:43 +01:00
[
2022-09-30 16:50:38 +02:00
options.isDm && returnvalue.props.icon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatars.Avatar, {
2020-11-11 00:49:43 +01:00
src: returnvalue.props.icon,
2022-09-30 16:50:38 +02:00
size: BDFDB.LibraryComponents.Avatars.Sizes.SIZE_24
2020-11-11 00:49:43 +01:00
}),
options.badges,
].flat(10).filter(n => n).map(badge => BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._displayserversaschannelsbadge,
children: badge
})),
BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN._displayserversaschannelsname,
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, {
children: name
})
}),
[returnvalue.props.children].flat(10).filter(n => !(n && (n.type && n.type.displayName == "FolderIcon" || n.props && n.props.className && n.props.className.indexOf(BDFDB.disCN.guildfoldericonwrapper) > -1)))
].flat().filter(n => n);
2020-11-11 00:49:43 +01:00
delete returnvalue.props.icon;
delete returnvalue.props.name;
returnvalue.props.children = options.wrap ? BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildiconchildwrapper,
style: {backgroundColor: options.backgroundColor},
children: childEles
}) : childEles;
};
if (typeof children[index].props.children == "function") {
let childrenRender = children[index].props.children;
2021-07-05 16:33:10 +02:00
children[index].props.children = BDFDB.TimeUtils.suppress((...args) => {
let renderedChildren = childrenRender(...args);
insertElements(renderedChildren);
return renderedChildren;
2021-07-05 16:33:10 +02:00
}, "", this);
}
else insertElements(children[index]);
2020-07-11 23:07:03 +02:00
}
2020-09-19 20:49:33 +02:00
}
2020-07-26 16:39:51 +02:00
2021-01-06 12:38:36 +01:00
addCSS () {
2020-09-19 20:49:33 +02:00
BDFDB.DOMUtils.appendLocalStyle("DSACStyle" + this.name, `
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper + BDFDB.notCN.guildswrapperhidden}:not(._closed),
2020-09-19 20:49:33 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildsscroller},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildswrapperunreadmentionsbartop},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildswrapperunreadmentionsbarbottom} {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverListWidth}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS.themedark + BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildsscroller}::-webkit-scrollbar-thumb,
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper + BDFDB.dotCNS.themedark + BDFDB.dotCN.guildsscroller}::-webkit-scrollbar-thumb {
background-color: ${BDFDB.DiscordConstants.Colors.PRIMARY_DARK_800};
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildouter} {
width: auto;
display: flex;
justify-content: flex-start;
margin-left: 8px;
}
2022-03-09 14:18:46 +01:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildinboxicon},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildinnerwrapper},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildinner} {
width: ${this.settings.amounts.serverListWidth - 20}px;
height: ${this.settings.amounts.serverElementHeight}px;
border-radius: 4px !important;
}
2020-09-19 20:49:33 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildsscroller} > div[style*="transform"][style*="height"] {
height: unset !important;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildpillwrapper} {
2021-04-24 14:27:23 +02:00
top: ${-1 * (48 - this.settings.amounts.serverElementHeight) / 2}px;
2020-09-19 20:49:33 +02:00
left: -8px;
2021-04-24 14:27:23 +02:00
transform: scaleY(calc(${this.settings.amounts.serverElementHeight}/48));
2020-09-19 20:49:33 +02:00
}
2022-03-09 14:18:46 +01:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildinboxicon},
2020-09-19 20:49:33 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildiconchildwrapper} {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverListWidth - 20}px;
2022-03-09 14:18:46 +01:00
height: ${this.settings.amounts.serverElementHeight}px;
2020-09-19 20:49:33 +02:00
padding: 0 8px;
box-sizing: border-box;
cursor: pointer;
2020-09-19 20:49:33 +02:00
}
2022-03-09 14:18:46 +01:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildinboxicon}::before {
content: attr(aria-label);
flex: 1 0 auto;
font-size: ${this.settings.amounts.serverElementHeight / 2}px;
font-weight: 500;
padding-top: 1px;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildinboxtooltip} {
display: none;
}
2020-09-19 20:49:33 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildiconchildwrapper + BDFDB.dotCN._displayserversaschannelsname} {
flex: 1 1 auto;
2021-04-24 14:27:23 +02:00
font-size: ${this.settings.amounts.serverElementHeight / 2}px;
2022-03-09 14:18:46 +01:00
font-weight: 500;
2020-09-19 20:49:33 +02:00
padding-top: 1px;
overflow: hidden;
}
2022-03-09 14:18:46 +01:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS._displayserversaschannelsmuted + BDFDB.dotCN._displayserversaschannelsname} {
opacity: 0.6;
}
2020-09-19 20:49:33 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildiconchildwrapper + BDFDB.dotCN._displayserversaschannelsbadge}:not(:empty) {
display: flex;
margin-right: 4px;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildiconchildwrapper + BDFDB.dotCNS._displayserversaschannelsbadge + BDFDB.dotCN.avataricon} {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 24}px;
height: ${this.settings.amounts.serverElementHeight/32 * 24}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildiconchildwrapper + BDFDB.dotCN.badgebase} {
margin-left: 4px;
2021-04-24 14:27:23 +02:00
border-radius: ${this.settings.amounts.serverElementHeight/32 * 8}px;
width: ${this.settings.amounts.serverElementHeight/32 * 16}px;
height: ${this.settings.amounts.serverElementHeight/32 * 16}px;
font-size: ${this.settings.amounts.serverElementHeight/32 * 12}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildiconchildwrapper + BDFDB.dotCN.badgebase}[style*="width: 16px;"] {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 16}px !important;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildiconchildwrapper + BDFDB.dotCN.badgebase}[style*="width: 22px;"] {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 22}px !important;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildiconchildwrapper + BDFDB.dotCN.badgebase}[style*="width: 30px;"] {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 30}px !important;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.homebuttonicon} {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 28}px;
height: ${this.settings.amounts.serverElementHeight/32 * 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.avatarwrapper} {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 24}px !important;
height: ${this.settings.amounts.serverElementHeight/32 * 24}px !important;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildseparator} {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverListWidth - 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildiconwrapper} {
2021-04-24 14:27:23 +02:00
height: ${this.settings.amounts.serverElementHeight}px;
width: ${this.settings.amounts.serverListWidth - 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildfolderwrapper} {
width: auto;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildfolder} {
2021-04-24 14:27:23 +02:00
height: ${this.settings.amounts.serverElementHeight}px;
width: ${this.settings.amounts.serverListWidth - 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildfolderexpandedbackground} {
top: -2px;
right: 2px;
bottom: -2px;
left: 6px;
width: auto;
border-radius: 4px;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildfolderwrapper} [role="group"] {
height: auto !important;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildfolderwrapper} [role="group"] ${BDFDB.dotCN.guildouter}:last-child {
margin-bottom: 10px;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildbuttoninner} {
2021-04-24 14:27:23 +02:00
height: ${this.settings.amounts.serverElementHeight}px;
width: ${this.settings.amounts.serverListWidth - 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildbuttoninner} svg {
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 20}px;
height: ${this.settings.amounts.serverElementHeight/32 * 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildbuttoninner + BDFDB.dotCN._displayserversaschannelsname} {
padding-top: 0;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildserror} {
2021-04-24 14:27:23 +02:00
height: ${this.settings.amounts.serverElementHeight}px;
width: ${this.settings.amounts.serverListWidth - 20}px;
font-size: ${this.settings.amounts.serverElementHeight/32 * 20}px;
2020-09-19 20:49:33 +02:00
border: none;
display: block;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildserror + BDFDB.dotCN.guildiconchildwrapper} {
2021-04-24 14:27:23 +02:00
padding-right: ${this.settings.amounts.serverElementHeight/32 * 16 + (32/this.settings.amounts.serverElementHeight - 1) * 4}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCNS.guildserror + BDFDB.dotCN._displayserversaschannelsname} {
padding-top: 0;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN._readallnotificationsbuttonframe},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN._readallnotificationsbuttoninner},
2022-10-12 10:36:49 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN._readallnotificationsbuttonbutton} {
2021-04-24 14:27:23 +02:00
height: ${this.settings.amounts.serverElementHeight}px !important;
width: ${this.settings.amounts.serverListWidth - 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN._friendnotificationsfriendsonline},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildslabel} {
2021-04-24 14:27:23 +02:00
height: ${this.settings.amounts.serverElementHeight * 0.6}px !important;
width: ${this.settings.amounts.serverListWidth - 20}px;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN._readallnotificationsbuttonbutton},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN._friendnotificationsfriendsonline},
2022-10-12 10:36:49 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildslabel} {
2020-09-19 20:49:33 +02:00
display: flex;
justify-content: flex-start;
align-items: center;
2021-04-24 14:27:23 +02:00
font-size: ${this.settings.amounts.serverElementHeight / 2}px;
2022-03-09 14:18:46 +01:00
font-weight: 500;
2020-09-19 20:49:33 +02:00
text-transform: capitalize;
padding-top: 1px;
padding-left: 8px;
}
2021-11-23 21:50:31 +01:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildplaceholdermask},
2020-09-19 20:49:33 +02:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildiconwrapper},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildfolder},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildbuttoninner},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildserror} {
border-radius: 4px;
overflow: hidden;
}
2021-11-23 21:50:31 +01:00
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildplaceholdermask},
background-color: var(--background-primary);
border-radius: 4px;
height: ${this.settings.amounts.serverElementHeight}px;
width: ${this.settings.amounts.serverListWidth}px;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildplaceholdermask} > *,
display: none;
}
2021-04-08 18:13:57 +02:00
${BDFDB.dotCN._displayserversaschannelsstyled} .typingindicator-guild,
${BDFDB.dotCN._displayserversaschannelsstyled} .typingindicator-dms,
${BDFDB.dotCN._displayserversaschannelsstyled} .typingindicator-folder {
position: static !important;
margin-left: -34px !important;
padding-left: 6px !important;
box-shadow: unset !important;
background: var(--background-primary) !important;
z-index: 1 !important;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper} #server-search ${BDFDB.dotCN.guildinner}::before {
2020-09-19 20:49:33 +02:00
content: "Server Search";
color: var(--text-normal);
display: flex;
align-items: center;
2021-04-24 14:27:23 +02:00
height: ${this.settings.amounts.serverElementHeight}px;
font-size: ${this.settings.amounts.serverElementHeight / 2}px;
2022-03-09 14:18:46 +01:00
font-weight: 500;
2020-09-19 20:49:33 +02:00
padding-left: 8px;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper} #server-search ${BDFDB.dotCN.guildinner}::after {
2020-09-19 20:49:33 +02:00
content: "";
position: absolute;
2021-04-24 14:27:23 +02:00
top: ${this.settings.amounts.serverElementHeight/32 * 6}px;
2020-09-19 20:49:33 +02:00
right: 7px;
2021-04-24 14:27:23 +02:00
width: ${this.settings.amounts.serverElementHeight/32 * 20}px;
height: ${this.settings.amounts.serverElementHeight/32 * 20}px;
2020-09-19 20:49:33 +02:00
background: var(--text-normal);
2020-11-19 16:56:08 +01:00
-webkit-mask: url('data:image/svg+xml;base64,PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAxOCAxOCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTMuNjAwOTE0ODEsNy4yMDI5NzMxMyBDMy42MDA5MTQ4MSw1LjIwOTgzNDE5IDUuMjA5ODM0MTksMy42MDA5MTQ4MSA3LjIwMjk3MzEzLDMuNjAwOTE0ODEgQzkuMTk2MTEyMDYsMy42MDA5MTQ4MSAxMC44MDUwMzE0LDUuMjA5ODM0MTkgMTAuODA1MDMxNCw3LjIwMjk3MzEzIEMxMC44MDUwMzE0LDkuMTk2MTEyMDYgOS4xOTYxMTIwNiwxMC44MDUwMzE0IDcuMjAyOTczMTMsMTAuODA1MDMxNCBDNS4yMDk4MzQxOSwxMC44MDUwMzE0IDMuNjAwOTE0ODEsOS4xOTYxMTIwNiAzLjYwMDkxNDgxLDcuMjAyOTczMTMgWiBNMTIuMDA1NzE3NiwxMC44MDUwMzE0IEwxMS4zNzMzNTYyLDEwLjgwNTAzMTQgTDExLjE0OTIyODEsMTAuNTg4OTA3OSBDMTEuOTMzNjc2NCw5LjY3NjM4NjUxIDEyLjQwNTk0NjMsOC40OTE3MDk1NSAxMi40MDU5NDYzLDcuMjAyOTczMTMgQzEyLjQwNTk0NjMsNC4zMjkzMzEwNSAxMC4wNzY2MTUyLDIgNy4yMDI5NzMxMywyIEM0LjMyOTMzMTA1LDIgMiw0LjMyOTMzMTA1IDIsNy4yMDI5NzMxMyBDMiwxMC4wNzY2MTUyIDQuMzI5MzMxMDUsMTIuNDA1OTQ2MyA3LjIwMjk3MzEzLDEyLjQwNTk0NjMgQzguNDkxNzA5NTUsMTIuNDA1OTQ2MyA5LjY3NjM4NjUxLDExLjkzMzY3NjQgMTAuNTg4OTA3OSwxMS4xNDkyMjgxIEwxMC44MDUwMzE0LDExLjM3MzM1NjIgTDEwLjgwNTAzMTQsMTIuMDA1NzE3NiBMMTQuODA3MzE4NSwxNiBMMTYsMTQuODA3MzE4NSBMMTIuMjEwMjUzOCwxMS4wMDk5Nzc2IEwxMi4wMDU3MTc2LDEwLjgwNTAzMTQgWiI+PC9wYXRoPjwvZz48L3N2Zz4=') center/cover no-repeat;
2020-09-19 20:49:33 +02:00
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper} #server-search ${BDFDB.dotCN.guildbuttonpill},
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper} #server-search ${BDFDB.dotCN.guildsvg} {
2020-09-19 20:49:33 +02:00
display: none;
}`);
}
};
2022-09-01 14:40:11 +02:00
})(window.BDFDB_Global.PluginUtils.buildPlugin(changeLog));
})();