3
3
* @author programmer2514
4
4
* @authorId 563652755814875146
5
5
* @description A feature-rich BetterDiscord plugin that reworks the Discord UI to be significantly more modular
6
- * @version 12.0 .0
6
+ * @version 12.1 .0
7
7
* @donate https://ko-fi.com/benjaminpryor
8
8
* @patreon https://www.patreon.com/BenjaminPryor
9
9
* @website https://github.com/programmer2514/BetterDiscord-CollapsibleUI
@@ -155,17 +155,17 @@ const settings = {
155
155
const config = {
156
156
changelog : [
157
157
{
158
- title : '12.0 .0' ,
158
+ title : '12.1 .0' ,
159
159
type : 'added' ,
160
160
items : [
161
- 'Updated to work with Discord UI refresh (no longer works on old Discord UI) ' ,
162
- 'Fixed call container buttons being cut off when window is too small ' ,
163
- 'More visual tweaks for UI consistency ' ,
164
- 'Removed obsolete advanced settings ' ,
161
+ 'Fixed for latest Discord version ' ,
162
+ 'Fixed user settings overlapping user profile picture when channel list is collapsed ' ,
163
+ 'Fixed Horizontal Server List compatibility ' ,
164
+ 'Removed static class references ' ,
165
165
] ,
166
166
} ,
167
167
{
168
- title : '1.0.0 - 11 .0.2 ' ,
168
+ title : '1.0.0 - 12 .0.0 ' ,
169
169
type : 'added' ,
170
170
items : [
171
171
'See the full changelog here: https://programmer2514.github.io/?l=cui-changelog' ,
@@ -1133,7 +1133,7 @@ const modules = {
1133
1133
get dispatcher ( ) { return this . _dispatcher ?? ( this . _dispatcher = runtime . api . Webpack . getByKeys ( 'dispatch' , 'isDispatching' ) ) ; } ,
1134
1134
get social ( ) { return this . _social ?? ( this . _social = runtime . api . Webpack . getByKeys ( 'inviteToolbar' , 'peopleColumn' , 'addFriend' ) ) ; } ,
1135
1135
get toolbar ( ) { return this . _toolbar ?? ( this . _toolbar = runtime . api . Webpack . getByKeys ( 'updateIconForeground' , 'search' , 'forumOrHome' ) ) ; } ,
1136
- get panel ( ) { return this . _panel ?? ( this . _panel = runtime . api . Webpack . getByKeys ( 'biteSize' , 'fullSize' , 'panel' , ' outer', 'inner' , 'overlay' ) ) ; } ,
1136
+ get panel ( ) { return this . _panel ?? ( this . _panel = runtime . api . Webpack . getByKeys ( 'outer' , 'inner' , 'overlay' ) ) ; } ,
1137
1137
get guilds ( ) { return this . _guilds ?? ( this . _guilds = runtime . api . Webpack . getByKeys ( 'chatContent' , 'noChat' , 'parentChannelName' , 'linkedLobby' ) ) ; } ,
1138
1138
get frame ( ) { return this . _frame ?? ( this . _frame = runtime . api . Webpack . getByKeys ( 'bar' , 'title' , 'winButtons' ) ) ; } ,
1139
1139
get calls ( ) { return this . _calls ?? ( this . _calls = runtime . api . Webpack . getByKeys ( 'wrapper' , 'fullScreen' , 'callContainer' ) ) ; } ,
@@ -1152,21 +1152,22 @@ const modules = {
1152
1152
get callIcons ( ) { return this . _callIcons ?? ( this . _callIcons = runtime . api . Webpack . getByKeys ( 'button' , 'divider' , 'lastButton' ) ) ; } ,
1153
1153
get callButtons ( ) { return this . _callButtons ?? ( this . _callButtons = runtime . api . Webpack . getByKeys ( 'controlButton' , 'wrapper' , 'buttonContainer' ) ) ; } ,
1154
1154
get userAreaButtons ( ) { return this . _userAreaButtons ?? ( this . _userAreaButtons = runtime . api . Webpack . getByKeys ( 'actionButtons' , 'micTestButton' , 'buttonIcon' ) ) ; } ,
1155
+ get scroller ( ) { return this . _scroller ?? ( this . _scroller = runtime . api . Webpack . getByKeys ( 'wrapper' , 'scroller' , 'discoveryIcon' ) ) ; } ,
1155
1156
} ;
1156
1157
1157
1158
const elements = {
1158
1159
get inviteToolbar ( ) { return document . querySelector ( `.${ modules . social ?. inviteToolbar } ` ) ; } ,
1159
1160
get searchBar ( ) { return document . querySelector ( `.${ modules . toolbar ?. search } ` ) ; } ,
1160
1161
get toolbar ( ) { return document . querySelector ( `.${ modules . icons ?. toolbar } ` ) ; } ,
1161
1162
get membersList ( ) { return document . querySelector ( `.${ modules . members ?. membersWrap } ` ) ; } ,
1162
- get userProfile ( ) { return document . querySelector ( `.${ modules . panel ?. inner } .${ modules . panel ?. panel } ` ) ; } ,
1163
+ get userProfile ( ) { return document . querySelector ( `.${ modules . guilds ?. content } .${ modules . panel ?. inner } ` ) ; } ,
1163
1164
get messageInput ( ) { return document . querySelector ( `.${ modules . guilds ?. form } ` ) ; } ,
1164
1165
get windowBar ( ) { return document . querySelector ( `.${ modules . frame ?. bar } ` ) ; } ,
1165
1166
get callWindow ( ) { return document . querySelector ( `.${ modules . calls ?. wrapper } :not(.${ modules . calls ?. noChat } )` ) ; } ,
1166
1167
get settingsContainer ( ) { return [ ...document . querySelectorAll ( `.${ modules . user ?. buttons } ` ) ] . slice ( - 1 ) [ 0 ] ; } ,
1167
1168
get messageInputContainer ( ) { return [ ...document . querySelectorAll ( `.${ modules . input ?. buttons } ` ) ] . slice ( - 1 ) [ 0 ] ; } ,
1168
1169
get forumPopout ( ) { return document . querySelector ( `.${ modules . popout ?. chatLayerWrapper } ` ) ; } ,
1169
- get biteSizePanel ( ) { return document . querySelector ( `.${ modules . panel ?. outer } . ${ modules . panel ?. biteSize } ` ) ; } ,
1170
+ get biteSizePanel ( ) { return document . querySelector ( `[role="dialog"] .${ modules . panel ?. outer } ` ) ; } ,
1170
1171
get userArea ( ) { return document . querySelector ( `.${ modules . sidebar ?. panels } ` ) ; } ,
1171
1172
get serverList ( ) { return document . querySelector ( `.${ modules . sidebar ?. guilds } ` ) ; } ,
1172
1173
get channelList ( ) { return document . querySelector ( `.${ modules . sidebar ?. sidebarList } ` ) ; } ,
@@ -1333,12 +1334,12 @@ const styles = {
1333
1334
border-top: 1px solid var(--border-subtle) !important;
1334
1335
}
1335
1336
1336
- .scroller_ef3116 {
1337
+ .${ modules . scroller ?. scroller } {
1337
1338
padding-top: var(--space-xs) !important;
1338
1339
}
1339
1340
1340
- .${ modules . sidebar ?. base } {
1341
- transition: top var(--cui-transition-speed);
1341
+ .${ modules . sidebar ?. content } {
1342
+ transition: margin- top var(--cui-transition-speed);
1342
1343
}
1343
1344
1344
1345
${ ( settings . sizeCollapse )
@@ -1358,10 +1359,11 @@ const styles = {
1358
1359
1359
1360
.${ modules . sidebar ?. guilds } {
1360
1361
width: var(--cui-collapse-size) !important;
1362
+ border: 0 !important;
1361
1363
}
1362
1364
1363
- .${ modules . sidebar ?. base } {
1364
- --server-container : 0px;
1365
+ .${ modules . sidebar ?. content } {
1366
+ margin-top : 0px !important ;
1365
1367
}
1366
1368
` . replace ( / \s + / g, ' ' ) ] ) ;
1367
1369
} ,
@@ -1635,7 +1637,7 @@ const styles = {
1635
1637
document . querySelector ( `.${ modules . panel ?. outer } header > svg > mask > rect` ) ?. setAttribute ( 'width' , '500%' ) ;
1636
1638
document . querySelector ( `.${ modules . panel ?. outer } header > svg` ) ?. removeAttribute ( 'viewBox' ) ;
1637
1639
return this . __init ?? ( this . __init = [ `${ runtime . meta . name } -userProfile_init` , `
1638
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } {
1640
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } {
1639
1641
max-width: var(--cui-user-profile-width) !important;
1640
1642
width: var(--cui-user-profile-width) !important;
1641
1643
min-width: var(--cui-user-profile-width) !important;
@@ -1644,25 +1646,25 @@ const styles = {
1644
1646
border-left: 1px solid var(--border-subtle) !important;
1645
1647
}
1646
1648
1647
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } > * {
1649
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } > * {
1648
1650
width: 100% !important;
1649
1651
}
1650
1652
1651
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } header > svg {
1653
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } header > svg {
1652
1654
min-width: 100% !important;
1653
1655
}
1654
1656
1655
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } header > svg > mask > rect {
1657
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } header > svg > mask > rect {
1656
1658
width: 500% !important;
1657
1659
}
1658
1660
1659
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } .${ modules . effects ?. effect } {
1661
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } .${ modules . effects ?. effect } {
1660
1662
min-height: 100% !important;
1661
1663
}
1662
1664
1663
1665
${ ( settings . userProfileWidth )
1664
1666
? `
1665
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } :before {
1667
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } :before {
1666
1668
cursor: e-resize;
1667
1669
z-index: 200;
1668
1670
position: absolute;
@@ -1685,7 +1687,7 @@ const styles = {
1685
1687
} ,
1686
1688
get _toggle ( ) {
1687
1689
return this . __toggle ?? ( this . __toggle = [ `${ runtime . meta . name } -userProfile_toggle` , `
1688
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } {
1690
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } {
1689
1691
max-width: var(--cui-collapse-size) !important;
1690
1692
width: var(--cui-collapse-size) !important;
1691
1693
min-width: var(--cui-collapse-size) !important;
@@ -1694,7 +1696,7 @@ const styles = {
1694
1696
} ,
1695
1697
get _float ( ) {
1696
1698
return this . __float ?? ( this . __float = [ `${ runtime . meta . name } -userProfile_float` , `
1697
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } {
1699
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } {
1698
1700
position: absolute !important;
1699
1701
z-index: 190 !important;
1700
1702
max-height: 100% !important;
@@ -1709,7 +1711,7 @@ const styles = {
1709
1711
${ ( settings . sizeCollapse )
1710
1712
? `
1711
1713
@media ${ this . query } {
1712
- .${ modules . panel ?. outer } .${ modules . panel ?. panel } {
1714
+ .${ modules . guilds ?. content } .${ modules . panel ?. outer } {
1713
1715
max-width: var(--cui-user-profile-width) !important;
1714
1716
width: var(--cui-user-profile-width) !important;
1715
1717
min-width: var(--cui-user-profile-width) !important;
@@ -1720,9 +1722,9 @@ const styles = {
1720
1722
` . replace ( / \s + / g, ' ' ) ] ) ;
1721
1723
} ,
1722
1724
_clear : function ( ) {
1723
- document . querySelector ( `.${ modules . panel ?. outer } header > svg` ) ?. style . removeProperty ( 'max-height' ) ;
1724
- document . querySelector ( `.${ modules . panel ?. outer } header > svg > mask > rect` ) ?. setAttribute ( 'width' , '100%' ) ;
1725
- document . querySelector ( `.${ modules . panel ?. outer } header > svg` ) ?. setAttribute ( 'viewBox' , `0 0 ${ parseInt ( document . querySelector ( `.${ modules . panel ?. outer } header > svg` ) ?. style . minWidth ) } ${ parseInt ( document . querySelector ( `.${ modules . panel ?. outer } header > svg` ) ?. style . minHeight ) } ` ) ;
1725
+ document . querySelector ( `.${ modules . guilds ?. content } . ${ modules . panel ?. outer } header > svg` ) ?. style . removeProperty ( 'max-height' ) ;
1726
+ document . querySelector ( `.${ modules . guilds ?. content } . ${ modules . panel ?. outer } header > svg > mask > rect` ) ?. setAttribute ( 'width' , '100%' ) ;
1727
+ document . querySelector ( `.${ modules . guilds ?. content } . ${ modules . panel ?. outer } header > svg` ) ?. setAttribute ( 'viewBox' , `0 0 ${ parseInt ( document . querySelector ( `.${ modules . panel ?. outer } header > svg` ) ?. style . minWidth ) } ${ parseInt ( document . querySelector ( `.${ modules . panel ?. outer } header > svg` ) ?. style . minHeight ) } ` ) ;
1726
1728
} ,
1727
1729
...styleFunctions ,
1728
1730
} ,
@@ -1910,9 +1912,9 @@ const styles = {
1910
1912
transition: max-height var(--cui-transition-speed), width var(--cui-transition-speed), border var(--cui-transition-speed) !important;
1911
1913
max-height: ${ settings . userAreaMaxHeight } px !important;
1912
1914
overflow: hidden !important;
1913
- width: calc((var(--cui-channel-list-width) * var(--cui-channel-list-toggled)) + (var(--custom-guild-list-width) * var(--cui-server-list-toggled)) - (var(--space-xs) * 2)) !important;
1914
- border-left-width: clamp(0px, calc(1px * (var(--cui-server-list-toggled) + var(--cui-channel-list-toggled))), 1px) !important;
1915
- border-right-width: clamp(0px, calc(1px * (var(--cui-server-list-toggled) + var(--cui-channel-list-toggled))), 1px) !important;
1915
+ width: calc((var(--cui-channel-list-width) * var(--cui-channel-list-toggled)) + (var(--custom-guild-list-width) * var(--cui-server-list-toggled) * var(--cui-compat-hsl) ) - (var(--space-xs) * 2)) !important;
1916
+ border-left-width: clamp(0px, calc(1px * (( var(--cui-server-list-toggled) * var(--cui-compat-hsl) ) + var(--cui-channel-list-toggled))), 1px) !important;
1917
+ border-right-width: clamp(0px, calc(1px * (( var(--cui-server-list-toggled) * var(--cui-compat-hsl) ) + var(--cui-channel-list-toggled))), 1px) !important;
1916
1918
z-index: 191 !important;
1917
1919
}
1918
1920
@@ -2238,8 +2240,12 @@ const styles = {
2238
2240
.${ modules . user ?. avatarWrapper } {
2239
2241
flex-grow: 1 !important;
2240
2242
}
2243
+
2244
+ .${ modules . user ?. buttons } {
2245
+ transform: translateX(calc((1 - var(--cui-channel-list-toggled)) * 1000000000px));
2246
+ }
2241
2247
2242
- .${ modules . user ?. buttons } > *:not(:last-child) {
2248
+ .${ modules . user ?. buttons } > *:not(:nth- last-child(2)):not(.gameActivityToggleButton_fd3fb5 ) {
2243
2249
transition: width var(--cui-transition-speed) !important;
2244
2250
overflow: hidden !important;
2245
2251
}
@@ -2248,7 +2254,7 @@ const styles = {
2248
2254
} ,
2249
2255
hide : function ( ) {
2250
2256
runtime . api . DOM . addStyle ( `${ runtime . meta . name } -settingsButtons_hide_col` , `
2251
- .${ modules . user ?. buttons } > *:not(:last-child) {
2257
+ .${ modules . user ?. buttons } > *:not(:nth- last-child(2)):not(.gameActivityToggleButton_fd3fb5 ) {
2252
2258
width: 0px !important;
2253
2259
}
2254
2260
` . replace ( / \s + / g, ' ' ) ) ;
@@ -2350,7 +2356,7 @@ const styles = {
2350
2356
if ( document . querySelector ( '.public-DraftEditor-content' ) . querySelector ( '[data-text="true"]' ) . innerHTML ) return ;
2351
2357
2352
2358
runtime . api . DOM . addStyle ( `${ runtime . meta . name } -toolbarFull_hide_col` , `
2353
- .${ modules . icons ?. toolbar } > *:not(:last-child) {
2359
+ .${ modules . icons ?. toolbar } > *:not(:nth- last-child(2) ) {
2354
2360
max-width: 0px !important;
2355
2361
}
2356
2362
` . replace ( / \s + / g, ' ' ) ) ;
@@ -2423,6 +2429,8 @@ const styles = {
2423
2429
--cui-activity-panel-width: ${ settings . activityPanelWidth || settings . defaultActivityPanelWidth } px;
2424
2430
2425
2431
--cui-forum-panel-top: ${ ( elements . noChat ) ? '0px' : 'var(--custom-channel-header-height)' } ;
2432
+
2433
+ --cui-compat-hsl: ${ ( runtime . api . Themes . isEnabled ( 'Horizontal Server List' ) ) ? 0 : 1 } ;
2426
2434
}
2427
2435
` . replace ( / \s + / g, ' ' ) ) ;
2428
2436
} ,
@@ -3037,7 +3045,7 @@ module.exports = class CollapsibleUI {
3037
3045
// Update dynamic collapsed state of user settings buttons
3038
3046
tickCollapseSettings = ( x , y ) => {
3039
3047
if ( settings . collapseSettings ) {
3040
- if ( this . isNear ( elements . settingsContainer , settings . buttonCollapseFudgeFactor , x , y ) ) {
3048
+ if ( this . isNear ( elements . settingsContainer , settings . buttonCollapseFudgeFactor , x , y ) && ! ( document . querySelector ( `# ${ runtime . meta . name } -channelList_toggle_dynamic` ) ) ) {
3041
3049
if ( styles . buttons [ constants . I_SETTINGS_BUTTONS ] . hidden ) styles . buttons [ constants . I_SETTINGS_BUTTONS ] . show ( ) ;
3042
3050
}
3043
3051
else {
0 commit comments