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
2021-08-20 17:17:24 +02:00
* @ version 1.5 . 1
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
2020-11-19 16:45:36 +01:00
* @ 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 = ( _ => {
2020-10-09 21:09:35 +02:00
const config = {
2020-09-19 20:49:33 +02:00
"info" : {
"name" : "DisplayServersAsChannels" ,
"author" : "DevilBro" ,
2021-08-20 17:17:24 +02:00
"version" : "1.5.1" ,
2021-03-04 12:15:46 +01:00
"description" : "Displays Servers in a similar way as Channels"
2021-04-24 14:27:23 +02:00
} ,
"changeLog" : {
"fixed" : {
2021-08-20 17:17:24 +02:00
"HideServersChannelsRedux" : "Works with it now"
2021-04-24 14:27:23 +02:00
} ,
2020-02-12 14:02:42 +01:00
}
2020-09-19 20:49:33 +02:00
} ;
2020-11-19 17:36:25 +01:00
2021-09-06 18:58:10 +02:00
return ( window . Lightcord && ! Node . prototype . isPrototypeOf ( window . Lightcord ) || window . LightCord && ! Node . prototype . isPrototypeOf ( window . LightCord ) || window . Astra && ! Node . prototype . isPrototypeOf ( window . Astra ) ) ? class {
2021-06-15 13:42:02 +02:00
getName ( ) { return config . info . name ; }
getAuthor ( ) { return config . info . author ; }
getVersion ( ) { return config . info . version ; }
getDescription ( ) { return "Do not use LightCord!" ; }
load ( ) { BdApi . alert ( "Attention!" , "By using LightCord you are risking your Discord Account, due to using a 3rd Party Client. Switch to an official Discord Client (https://discord.com/) with the proper BD Injection (https://betterdiscord.app/)" ) ; }
start ( ) { }
stop ( ) { }
} : ! window . BDFDB _Global || ( ! window . BDFDB _Global . loaded && ! window . BDFDB _Global . started ) ? class {
2021-01-06 12:38:36 +01:00
getName ( ) { return config . info . name ; }
getAuthor ( ) { return config . info . author ; }
getVersion ( ) { return config . info . version ; }
2021-02-01 17:13:13 +01:00
getDescription ( ) { return ` The Library Plugin needed for ${ config . info . name } is missing. Open the Plugin Settings to download it. \n \n ${ config . info . description } ` ; }
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 ;
2021-01-14 16:14:44 +01:00
BdApi . showConfirmationModal ( "Library Missing" , ` The Library Plugin needed for ${ config . info . 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
}
2020-09-19 20:49:33 +02:00
if ( ! window . BDFDB _Global . pluginQueue . includes ( config . info . name ) ) window . BDFDB _Global . pluginQueue . push ( config . info . 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" ) ;
2021-01-14 16:14:44 +01: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 ${ config . info . name } is missing. \n Please 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 : {
Guilds : "render" ,
2021-05-22 13:59:01 +02:00
DefaultHomeButton : "DefaultHomeButton" ,
2020-09-19 20:49:33 +02:00
DirectMessage : "render" ,
Guild : "render" ,
2021-03-03 13:50:55 +01:00
GuildFolder : "render" ,
2020-09-19 20:49:33 +02:00
CircleIconButton : "render" ,
UnavailableGuildsButton : "UnavailableGuildsButton"
}
} ;
}
2021-05-22 13:59:01 +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 => {
2020-11-19 16:51:14 +01:00
if ( e . thisObject . props . list ) this . processGuild ( { instance : e . thisObject , returnvalue : e . returnValue , methodname : "render" } ) ;
2020-02-12 14:02:42 +01:00
} } ) ;
2019-09-04 12:34:02 +02:00
2020-04-01 16:48:28 +02:00
this . forceUpdateAll ( ) ;
2020-06-08 20:34:49 +02:00
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
2020-04-01 16:48:28 +02:00
this . forceUpdateAll ( ) ;
2019-06-16 20:15:09 +02:00
}
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 ( ) ;
}
2019-06-16 20:15:09 +02:00
}
2020-02-12 14:02:42 +01:00
2021-04-24 14:27:23 +02:00
forceUpdateAll ( ) {
2020-09-19 20:49:33 +02:00
BDFDB . PatchUtils . forceAllUpdates ( this ) ;
BDFDB . GuildUtils . rerenderAll ( ) ;
2020-07-19 22:39:06 +02:00
}
2020-11-19 17:36:25 +01:00
2020-09-19 20:49:33 +02:00
processGuilds ( e ) {
2020-10-30 22:08:45 +01:00
if ( typeof e . returnvalue . props . children == "function" ) {
let childrenRender = e . returnvalue . props . children ;
2021-07-05 16:33:10 +02:00
e . returnvalue . props . children = BDFDB . TimeUtils . suppress ( ( ... args ) => {
2020-11-19 17:36:25 +01:00
let children = childrenRender ( ... args ) ;
this . checkTree ( children ) ;
return children ;
2021-07-05 16:33:10 +02:00
} , "" , this ) ;
2020-11-19 17:36:25 +01:00
}
else this . checkTree ( e . returnvalue ) ;
}
checkTree ( returnvalue ) {
let tree = BDFDB . ReactUtils . findChild ( returnvalue , { filter : n => n && n . props && typeof n . props . children == "function" } ) ;
if ( tree ) {
let childrenRender = tree . props . children ;
2021-07-05 16:33:10 +02:00
tree . props . children = BDFDB . TimeUtils . suppress ( ( ... args ) => {
2020-10-30 22:08:45 +01:00
let children = childrenRender ( ... args ) ;
this . handleGuilds ( children ) ;
return children ;
2021-07-05 16:33:10 +02:00
} , "" , this ) ;
2020-10-30 22:08:45 +01:00
}
2020-11-19 17:36:25 +01:00
else this . handleGuilds ( returnvalue ) ;
2020-10-30 22:08:45 +01:00
}
handleGuilds ( returnvalue ) {
let [ errorChildren , errorIndex ] = BDFDB . ReactUtils . findParent ( returnvalue , { name : "FluxContainer(<Unknown>)" } ) ;
2020-09-19 20:49:33 +02:00
if ( errorIndex > - 1 ) errorChildren [ errorIndex ] = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . Items . UnavailableGuildsButton , {
unavailableGuilds : BDFDB . LibraryModules . GuildUnavailableStore . totalUnavailableGuilds
2020-02-14 17:33:37 +01:00
} ) ;
2020-11-19 16:51:14 +01:00
let scroller = BDFDB . ReactUtils . findChild ( 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-02-14 17:33:37 +01:00
}
2020-09-19 20:49:33 +02:00
processDefaultHomeButton ( e ) {
2020-02-12 14:02:42 +01:00
this . removeTooltip ( e . returnvalue ) ;
this . removeMask ( e . returnvalue ) ;
2020-09-19 20:49:33 +02:00
this . addElementName ( e . returnvalue , BDFDB . LanguageUtils . LanguageStrings . HOME ) ;
}
processDirectMessage ( e ) {
if ( e . instance . props . channel . id ) {
let text = BDFDB . ReactUtils . findValue ( e . returnvalue , "text" ) ;
this . removeTooltip ( e . returnvalue ) ;
this . removeMask ( e . returnvalue ) ;
this . addElementName ( e . returnvalue , text , {
2020-11-11 00:49:43 +01:00
isDm : true
2020-09-19 20:49:33 +02:00
} ) ;
}
2019-06-16 20:15:09 +02:00
}
2020-09-19 20:49:33 +02:00
processGuild ( e ) {
if ( e . instance . props . guild ) {
2020-09-26 18:56:08 +02:00
if ( ! BDFDB . BDUtils . isPluginEnabled ( "ServerDetails" ) ) this . removeTooltip ( e . returnvalue ) ;
2020-09-19 20:49:33 +02:00
this . removeMask ( e . returnvalue ) ;
this . addElementName ( e . returnvalue , e . instance . props . guild . name , {
badges : [
2021-04-24 14:27:23 +02:00
this . settings . general . showGuildIcon && BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . 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 ,
size : BDFDB . LibraryComponents . GuildComponents . Icon . Sizes . SMALLER
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . Badge , {
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
} )
]
} ) ;
}
}
processGuildFolder ( e ) {
if ( e . instance . props . folderId ) {
this . removeTooltip ( e . returnvalue ) ;
this . removeMask ( e . returnvalue ) ;
2020-12-16 16:35:56 +01:00
let folderColor = BDFDB . ColorUtils . convert ( e . instance . props . folderColor , "HEX" ) || "var(--bdfdb-blurple)" ;
2021-04-24 14:27:23 +02:00
let folderSize = Math . round ( this . settings . amounts . serverElementHeight * 0.6 ) ;
2020-09-19 20:49:33 +02:00
this . addElementName ( e . returnvalue , e . instance . props . folderName || BDFDB . LanguageUtils . LanguageStrings . SERVER _FOLDER _PLACEHOLDER , {
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 ) {
2020-02-12 14:02:42 +01:00
this . removeTooltip ( e . returnvalue ) ;
this . removeMask ( e . returnvalue ) ;
2020-09-19 20:49:33 +02:00
this . addElementName ( e . returnvalue , e . instance . props . tooltipText , {
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
removeTooltip ( parent ) {
let [ children , index ] = BDFDB . ReactUtils . findParent ( parent , { name : [ "Tooltip" , "ListItemTooltip" , "GuildTooltip" , "BDFDB_TooltipContainer" ] } ) ;
if ( index > - 1 ) children [ index ] = children [ index ] . props . children ;
2019-09-26 20:09:46 +02:00
}
2020-06-08 20:34:49 +02:00
2020-09-19 20:49:33 +02:00
removeMask ( parent ) {
let [ children , index ] = BDFDB . ReactUtils . findParent ( parent , { name : "BlobMask" } ) ;
if ( index > - 1 ) {
let badges = [ ] ;
2020-10-31 12:47:55 +01:00
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 => {
2020-11-01 08:20:53 +01:00
if ( returnvalue . props . children ) ( returnvalue . props . children [ 0 ] || returnvalue . props . children ) . props . children = [
2020-10-31 12:47:55 +01:00
( returnvalue . props . children [ 0 ] || returnvalue . props . children ) . props . children ,
badges
] . flat ( 10 ) . filter ( n => n ) ;
2020-11-01 08:20:53 +01:00
else returnvalue . props . children = [ badges ] ;
2020-10-31 12:47:55 +01:00
} ;
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 ) => {
2020-10-31 12:47:55 +01:00
let renderedChildren = childrenRender ( ... args ) ;
insertBadges ( renderedChildren ) ;
return renderedChildren ;
2021-07-05 16:33:10 +02:00
} , "" , this ) ;
2020-10-31 12:47:55 +01:00
}
else insertBadges ( children [ index ] ) ;
}
2020-09-19 20:49:33 +02:00
children [ index ] = children [ index ] . props . children ;
2020-02-12 14:02:42 +01:00
}
2020-09-19 20:49:33 +02:00
}
addElementName ( parent , name , options = { } ) {
2020-10-31 12:47:55 +01:00
let [ children , index ] = BDFDB . ReactUtils . findParent ( parent , {
name : [ "NavItem" , "Clickable" ] ,
2020-11-01 08:20:53 +01:00
props : [ [ "className" , BDFDB . disCN . guildserrorinner ] ] ,
filter : c => c && c . props && ( c . props . id == "home" || ! isNaN ( parseInt ( c . props . id ) ) )
2020-10-31 12:47:55 +01:00
} ) ;
2020-09-19 20:49:33 +02:00
if ( index > - 1 ) {
2020-10-31 12:47:55 +01:00
let insertElements = returnvalue => {
2021-04-08 18:13:57 +02:00
if ( BDFDB . ReactUtils . findChild ( parent , { props : [ [ "className" , BDFDB . disCN . _displayserversaschannelsname ] ] } ) ) return ;
2020-10-31 12:47:55 +01:00
let childEles = [
2020-11-11 00:49:43 +01:00
[
options . isDm && returnvalue . props . icon && BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . AvatarComponents . default , {
src : returnvalue . props . icon ,
size : BDFDB . LibraryComponents . AvatarComponents . Sizes . SIZE _24
} ) ,
options . badges ,
] . flat ( 10 ) . filter ( n => n ) . map ( badge => BDFDB . ReactUtils . createElement ( "div" , {
2020-10-31 12:47:55 +01:00
className : BDFDB . disCN . _displayserversaschannelsbadge ,
children : badge
} ) ) ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _displayserversaschannelsname ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TextScroller , {
children : name
} )
} ) ,
2020-11-01 08:20:53 +01:00
[ 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 ) ) )
2020-10-31 12:47:55 +01:00
] . flat ( ) . filter ( n => n ) ;
2020-11-11 00:49:43 +01:00
delete returnvalue . props . icon ;
delete returnvalue . props . name ;
2020-10-31 12:47:55 +01:00
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 ) => {
2020-10-31 12:47:55 +01:00
let renderedChildren = childrenRender ( ... args ) ;
insertElements ( renderedChildren ) ;
return renderedChildren ;
2021-07-05 16:33:10 +02:00
} , "" , this ) ;
2020-10-31 12:47:55 +01:00
}
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 , `
2021-08-20 17:17:24 +02:00
$ { 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 : 8 px ;
}
2021-08-20 17:17:24 +02:00
$ { 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 : 4 px ! 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 : - 8 px ;
2021-04-24 14:27:23 +02:00
transform : scaleY ( calc ( $ { this . settings . amounts . serverElementHeight } / 48 ) ) ;
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
height : $ { this . settings . amounts . serverElementHeight } px ;
width : $ { this . settings . amounts . serverListWidth - 20 } px ;
2020-09-19 20:49:33 +02:00
padding : 0 8 px ;
box - sizing : border - box ;
2020-12-31 12:50:48 +01:00
cursor : pointer ;
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 ;
2020-09-19 20:49:33 +02:00
font - weight : 400 ;
padding - top : 1 px ;
overflow : hidden ;
}
$ { BDFDB . dotCNS . _displayserversaschannelsstyled + BDFDB . dotCNS . guildswrapper + BDFDB . dotCNS . guildiconchildwrapper + BDFDB . dotCN . _displayserversaschannelsbadge } : not ( : empty ) {
display : flex ;
margin - right : 4 px ;
}
$ { 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 : 4 px ;
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 : - 2 px ;
right : 2 px ;
bottom : - 2 px ;
left : 6 px ;
width : auto ;
border - radius : 4 px ;
}
$ { 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 : 10 px ;
}
$ { 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 } ,
$ { BDFDB . dotCNS . _displayserversaschannelsstyled + BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . _readallnotificationsbuttonbutton } ,
$ { BDFDB . dotCNS . _displayserversaschannelsstyled + BDFDB . dotCN . guildswrapper } # bd - pub - li ,
$ { BDFDB . dotCNS . _displayserversaschannelsstyled + BDFDB . dotCN . guildswrapper } # bd - pub - button {
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 } ,
$ { BDFDB . dotCNS . _displayserversaschannelsstyled + BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guildslabel } ,
$ { BDFDB . dotCNS . _displayserversaschannelsstyled + BDFDB . dotCN . guildswrapper } # bd - pub - button {
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 ;
2020-09-19 20:49:33 +02:00
font - weight : 400 ;
text - transform : capitalize ;
padding - top : 1 px ;
padding - left : 8 px ;
}
$ { 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 : 4 px ;
overflow : hidden ;
}
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 : - 34 px ! important ;
padding - left : 6 px ! important ;
box - shadow : unset ! important ;
background : var ( -- background - primary ) ! important ;
z - index : 1 ! important ;
}
2021-08-20 17:17:24 +02:00
$ { 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 ;
2020-09-19 20:49:33 +02:00
font - weight : 400 ;
padding - left : 8 px ;
}
2021-08-20 17:17:24 +02:00
$ { 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 : 7 px ;
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
}
2021-08-20 17:17:24 +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 ;
} ` );
}
} ;
2020-10-09 21:09:35 +02:00
} ) ( window . BDFDB _Global . PluginUtils . buildPlugin ( config ) ) ;
2020-10-30 22:08:45 +01:00
} ) ( ) ;