-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathCollapsibleUI.plugin.js
More file actions
3265 lines (3017 loc) · 131 KB
/
CollapsibleUI.plugin.js
File metadata and controls
3265 lines (3017 loc) · 131 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* @name CollapsibleUI
* @author programmer2514
* @authorId 563652755814875146
* @description A feature-rich BetterDiscord plugin that reworks the Discord UI to be significantly more modular
* @version 12.3.4
* @donate https://ko-fi.com/benjaminpryor
* @patreon https://www.patreon.com/BenjaminPryor
* @website https://github.com/programmer2514/BetterDiscord-CollapsibleUI
* @source https://github.com/programmer2514/BetterDiscord-CollapsibleUI/raw/refs/heads/main/CollapsibleUI.plugin.js
*/
// Abstract settings calls
const settings = {
get transitionSpeed() { return this._transitionSpeed ?? (this._transitionSpeed = runtime.api.Data.load('transition-speed') ?? 200); },
set transitionSpeed(v) { runtime.api.Data.save('transition-speed', this._transitionSpeed = v); },
get collapseToolbar() { return this._collapseToolbar ?? (this._collapseToolbar = runtime.api.Data.load('collapse-toolbar') ?? 'cui'); },
set collapseToolbar(v) { runtime.api.Data.save('collapse-toolbar', this._collapseToolbar = v); },
get collapseSettings() { return this._collapseSettings ?? (this._collapseSettings = runtime.api.Data.load('collapse-settings') ?? true); },
set collapseSettings(v) { runtime.api.Data.save('collapse-settings', this._collapseSettings = v); },
get messageInputCollapse() { return this._messageInputCollapse ?? (this._messageInputCollapse = runtime.api.Data.load('message-input-collapse') ?? true); },
set messageInputCollapse(v) { runtime.api.Data.save('message-input-collapse', this._messageInputCollapse = v); },
get keyboardShortcuts() { return this._keyboardShortcuts ?? (this._keyboardShortcuts = runtime.api.Data.load('keyboard-shortcuts') ?? true); },
set keyboardShortcuts(v) { runtime.api.Data.save('keyboard-shortcuts', this._keyboardShortcuts = v); },
get shortcutList() {
if (!this._shortcutList) {
let shortcuts = runtime.api.Data.load('shortcut-list') ?? [['Alt', 's'], ['Alt', 'c'], ['Alt', 'm'], ['Alt', 'p'], ['Alt', 'i'], ['Alt', 'w'], ['Alt', 'v'], ['Alt', 'u'], ['Alt', 'q'], ['Alt', 'f'], ['Alt', 'a']];
this._shortcutList = [
new Set(shortcuts[0]),
new Set(shortcuts[1]),
new Set(shortcuts[2]),
new Set(shortcuts[3]),
new Set(shortcuts[4]),
new Set(shortcuts[5]),
new Set(shortcuts[6]),
new Set(shortcuts[7]),
new Set(shortcuts[8]),
new Set(shortcuts[9]),
new Set(shortcuts[10]),
];
}
return this._shortcutList;
},
set shortcutList(v) {
runtime.api.Data.save('shortcut-list', v);
this._shortcutList = [
new Set(v[0]),
new Set(v[1]),
new Set(v[2]),
new Set(v[3]),
new Set(v[4]),
new Set(v[5]),
new Set(v[6]),
new Set(v[7]),
new Set(v[8]),
new Set(v[9]),
new Set(v[10]),
];
},
get collapseDisabledButtons() { return this._collapseDisabledButtons ?? (this._collapseDisabledButtons = runtime.api.Data.load('collapse-disabled-buttons') ?? false); },
set collapseDisabledButtons(v) { runtime.api.Data.save('collapse-disabled-buttons', this._collapseDisabledButtons = v); },
get buttonIndexes() { return this._buttonIndexes ?? (this._buttonIndexes = runtime.api.Data.load('button-indexes') ?? [1, 2, 4, 5, 3, 0, 9, 0, 6, 7, 8]); },
set buttonIndexes(v) { runtime.api.Data.save('button-indexes', this._buttonIndexes = v); },
get floatingPanels() { return this._floatingPanels ?? (this._floatingPanels = runtime.api.Data.load('floating-panels') ?? true); },
set floatingPanels(v) { runtime.api.Data.save('floating-panels', this._floatingPanels = v); },
get floatingEnabled() { return this._floatingEnabled ?? (this._floatingEnabled = runtime.api.Data.load('floating-enabled') ?? ['hover', 'hover', 'hover', 'hover', 'hover', 'hover', null, null, 'hover', 'hover', 'hover']); },
set floatingEnabled(v) { runtime.api.Data.save('floating-enabled', this._floatingEnabled = v); },
get expandOnHover() { return this._expandOnHover ?? (this._expandOnHover = runtime.api.Data.load('expand-on-hover') ?? true); },
set expandOnHover(v) { runtime.api.Data.save('expand-on-hover', this._expandOnHover = v); },
get expandOnHoverEnabled() { return this._expandOnHoverEnabled ?? (this._expandOnHoverEnabled = runtime.api.Data.load('expand-on-hover-enabled') ?? [true, true, true, true, true, true, true, true, true, true, true]); },
set expandOnHoverEnabled(v) { runtime.api.Data.save('expand-on-hover-enabled', this._expandOnHoverEnabled = v); },
get sizeCollapse() { return this._sizeCollapse ?? (this._sizeCollapse = runtime.api.Data.load('size-collapse') ?? false); },
set sizeCollapse(v) { runtime.api.Data.save('size-collapse', this._sizeCollapse = v); },
get sizeCollapseThreshold() { return this._sizeCollapseThreshold ?? (this._sizeCollapseThreshold = runtime.api.Data.load('size-collapse-threshold') ?? [500, 600, 950, 1200, 400, 200, 550, 400, 950, 950, 950]); },
set sizeCollapseThreshold(v) { runtime.api.Data.save('size-collapse-threshold', this._sizeCollapseThreshold = v); },
get conditionalCollapse() { return this._conditionalCollapse ?? (this._conditionalCollapse = runtime.api.Data.load('conditional-collapse') ?? false); },
set conditionalCollapse(v) { runtime.api.Data.save('conditional-collapse', this._conditionalCollapse = v); },
get collapseConditionals() { return this._collapseConditionals ?? (this._collapseConditionals = runtime.api.Data.load('collapse-conditionals') ?? ['', '', '', '', '', '', '', '', '', '', '']); },
set collapseConditionals(v) { runtime.api.Data.save('collapse-conditionals', this._collapseConditionals = v); },
get collapseSize() { return this._collapseSize ?? (this._collapseSize = runtime.api.Data.load('collapse-size') ?? 0); },
set collapseSize(v) { runtime.api.Data.save('collapse-size', this._collapseSize = v); },
get buttonCollapseFudgeFactor() { return this._buttonCollapseFudgeFactor ?? (this._buttonCollapseFudgeFactor = runtime.api.Data.load('button-collapse-fudge-factor') ?? 10); },
set buttonCollapseFudgeFactor(v) { runtime.api.Data.save('button-collapse-fudge-factor', this._buttonCollapseFudgeFactor = v); },
get expandOnHoverFudgeFactor() { return this._expandOnHoverFudgeFactor ?? (this._expandOnHoverFudgeFactor = runtime.api.Data.load('expand-on-hover-fudge-factor') ?? 15); },
set expandOnHoverFudgeFactor(v) { runtime.api.Data.save('expand-on-hover-fudge-factor', this._expandOnHoverFudgeFactor = v); },
get messageInputButtonWidth() { return this._messageInputButtonWidth ?? (this._messageInputButtonWidth = runtime.api.Data.load('message-input-button-width') ?? 40); },
set messageInputButtonWidth(v) { runtime.api.Data.save('message-input-button-width', this._messageInputButtonWidth = v); },
get toolbarElementMaxWidth() { return this._toolbarElementMaxWidth ?? (this._toolbarElementMaxWidth = runtime.api.Data.load('toolbar-element-max-width') ?? 400); },
set toolbarElementMaxWidth(v) { runtime.api.Data.save('toolbar-element-max-width', this._toolbarElementMaxWidth = v); },
get userAreaMaxHeight() { return this._userAreaMaxHeight ?? (this._userAreaMaxHeight = runtime.api.Data.load('user-area-max-height') ?? 420); },
set userAreaMaxHeight(v) { runtime.api.Data.save('user-area-max-height', this._userAreaMaxHeight = v); },
get buttonsActive() { return this._buttonsActive ?? (this._buttonsActive = runtime.api.Data.load('buttons-active') ?? [true, true, true, true, true, true, true, true, true, true, true]); },
set buttonsActive(v) { runtime.api.Data.save('buttons-active', this._buttonsActive = v); },
get channelListWidth() { return this._channelListWidth ?? (this._channelListWidth = runtime.api.Data.load('channel-list-width') ?? 240); },
set channelListWidth(v) { runtime.api.Data.save('channel-list-width', this._channelListWidth = v); },
get membersListWidth() { return this._membersListWidth ?? (this._membersListWidth = runtime.api.Data.load('members-list-width') ?? 240); },
set membersListWidth(v) { runtime.api.Data.save('members-list-width', this._membersListWidth = v); },
get userProfileWidth() { return this._userProfileWidth ?? (this._userProfileWidth = runtime.api.Data.load('user-profile-width') ?? 340); },
set userProfileWidth(v) { runtime.api.Data.save('user-profile-width', this._userProfileWidth = v); },
get searchPanelWidth() { return this._searchPanelWidth ?? (this._searchPanelWidth = runtime.api.Data.load('search-panel-width') ?? 418); },
set searchPanelWidth(v) { runtime.api.Data.save('search-panel-width', this._searchPanelWidth = v); },
get forumPopoutWidth() { return this._forumPopoutWidth ?? (this._forumPopoutWidth = runtime.api.Data.load('forum-popout-width') ?? 450); },
set forumPopoutWidth(v) { runtime.api.Data.save('forum-popout-width', this._forumPopoutWidth = v); },
get activityPanelWidth() { return this._activityPanelWidth ?? (this._activityPanelWidth = runtime.api.Data.load('activity-panel-width') ?? 360); },
set activityPanelWidth(v) { runtime.api.Data.save('activity-panel-width', this._activityPanelWidth = v); },
get defaultChannelListWidth() { return this._defaultChannelListWidth ?? (this._defaultChannelListWidth = runtime.api.Data.load('default-channel-list-width') ?? 240); },
set defaultChannelListWidth(v) { runtime.api.Data.save('default-channel-list-width', this._defaultChannelListWidth = v); },
get defaultMembersListWidth() { return this._defaultMembersListWidth ?? (this._defaultMembersListWidth = runtime.api.Data.load('default-members-list-width') ?? 240); },
set defaultMembersListWidth(v) { runtime.api.Data.save('default-members-list-width', this._defaultMembersListWidth = v); },
get defaultUserProfileWidth() { return this._defaultUserProfileWidth ?? (this._defaultUserProfileWidth = runtime.api.Data.load('default-user-profile-width') ?? 340); },
set defaultUserProfileWidth(v) { runtime.api.Data.save('default-user-profile-width', this._defaultUserProfileWidth = v); },
get defaultSearchPanelWidth() { return this._defaultSearchPanelWidth ?? (this._defaultSearchPanelWidth = runtime.api.Data.load('default-search-panel-width') ?? 418); },
set defaultSearchPanelWidth(v) { runtime.api.Data.save('default-search-panel-width', this._defaultSearchPanelWidth = v); },
get defaultForumPopoutWidth() { return this._defaultForumPopoutWidth ?? (this._defaultForumPopoutWidth = runtime.api.Data.load('default-forum-popout-width') ?? 450); },
set defaultForumPopoutWidth(v) { runtime.api.Data.save('default-forum-popout-width', this._defaultForumPopoutWidth = v); },
get defaultActivityPanelWidth() { return this._defaultActivityPanelWidth ?? (this._defaultActivityPanelWidth = runtime.api.Data.load('default-activity-panel-width') ?? 360); },
set defaultActivityPanelWidth(v) { runtime.api.Data.save('default-activity-panel-width', this._defaultActivityPanelWidth = v); },
};
// Define plugin changelog and settings panel layout
const config = {
changelog: [
{
title: '12.3.4',
type: 'added',
items: [
'Fixed plugin crash on Discord startup',
'Fixed collapsing user settings buttons',
'Fixed plugin reload on settings change',
'Fixed user area blocking upload button when channel list is collapsed',
],
},
{
title: '1.0.0 - 12.3.3',
type: 'added',
items: [
'See the full changelog here: https://programmer2514.github.io/?l=cui-changelog',
],
},
],
settings: [
{
type: 'category',
id: 'main-group',
name: 'Main',
collapsible: true,
shown: true,
settings: [
{
type: 'number',
id: 'transitionSpeed',
name: 'UI Transition Speed (ms)',
note: 'Sets the speed of UI animations. Set to 0 to disable transitions',
get value() { return settings.transitionSpeed; },
},
{
type: 'dropdown',
id: 'collapseToolbar',
name: 'Collapse Toolbar Buttons',
note: 'Automatically collapse the top-right toolbar buttons',
get value() { return settings.collapseToolbar; },
options: [
{
label: 'None',
value: false,
},
{
label: 'Just CollapsibleUI',
value: 'cui',
},
{
label: 'All',
value: 'all',
},
],
},
{
type: 'switch',
id: 'collapseSettings',
name: 'Collapse Settings',
note: 'Automatically collapse the bottom-left settings buttons',
get value() { return settings.collapseSettings; },
},
{
type: 'switch',
id: 'messageInputCollapse',
name: 'Collapse Message Input Buttons',
note: 'Automatically collapse the GIF/sticker/emoji/gift buttons',
get value() { return settings.messageInputCollapse; },
},
],
},
{
type: 'category',
id: 'keyboard-shortcuts-group',
name: 'Keyboard Shortcuts',
collapsible: true,
shown: false,
settings: [
{
type: 'switch',
id: 'keyboardShortcuts',
name: 'Keyboard Shortcuts',
note: 'Collapse UI panels using keyboard shortcuts',
get value() { return settings.keyboardShortcuts; },
},
{
type: 'keybind',
id: 'server-list-shortcut',
name: 'Toggle Server List',
get value() { return [...settings.shortcutList[constants.I_SERVER_LIST]]; },
},
{
type: 'keybind',
id: 'channel-list-shortcut',
name: 'Toggle Channel List',
get value() { return [...settings.shortcutList[constants.I_CHANNEL_LIST]]; },
},
{
type: 'keybind',
id: 'members-list-shortcut',
name: 'Toggle Members List',
get value() { return [...settings.shortcutList[constants.I_MEMBERS_LIST]]; },
},
{
type: 'keybind',
id: 'user-profile-shortcut',
name: 'Toggle User Profile',
get value() { return [...settings.shortcutList[constants.I_USER_PROFILE]]; },
},
{
type: 'keybind',
id: 'message-input-shortcut',
name: 'Toggle Message Input',
get value() { return [...settings.shortcutList[constants.I_MESSAGE_INPUT]]; },
},
{
type: 'keybind',
id: 'window-bar-shortcut',
name: 'Toggle Window Bar',
get value() { return [...settings.shortcutList[constants.I_WINDOW_BAR]]; },
},
{
type: 'keybind',
id: 'call-window-shortcut',
name: 'Toggle Call Window',
get value() { return [...settings.shortcutList[constants.I_CALL_WINDOW]]; },
},
{
type: 'keybind',
id: 'user-area-shortcut',
name: 'Toggle User Area',
get value() { return [...settings.shortcutList[constants.I_USER_AREA]]; },
},
{
type: 'keybind',
id: 'search-panel-shortcut',
name: 'Toggle Search Panel',
get value() { return [...settings.shortcutList[constants.I_SEARCH_PANEL]]; },
},
{
type: 'keybind',
id: 'forum-popout-shortcut',
name: 'Toggle Forum Popout',
get value() { return [...settings.shortcutList[constants.I_FORUM_POPOUT]]; },
},
{
type: 'keybind',
id: 'activity-panel-shortcut',
name: 'Toggle Activity Panel',
get value() { return [...settings.shortcutList[constants.I_ACTIVITY_PANEL]]; },
},
],
},
{
type: 'category',
id: 'toolbar-buttons-group',
name: 'Toolbar Buttons',
collapsible: true,
shown: false,
settings: [
{
type: 'switch',
id: 'collapseDisabledButtons',
name: 'Disabled Buttons Stay Collapsed?',
note: 'Panels with disabled toggle buttons will keep their toggled state. If disabled, they will default to open',
get value() { return settings.collapseDisabledButtons; },
},
{
type: 'slider',
id: 'server-list-button-index',
name: 'Server List Button',
note: 'Sets the order of the Server List toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_SERVER_LIST]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'channel-list-button-index',
name: 'Channel List Button',
note: 'Sets the order of the Channel List toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_CHANNEL_LIST]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'members-list-button-index',
name: 'Members List Button',
note: 'Sets the order of the Members List toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_MEMBERS_LIST]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'user-profile-button-index',
name: 'User Profile Button',
note: 'Sets the order of the User Profile toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_USER_PROFILE]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'message-input-button-index',
name: 'Message Input Button',
note: 'Sets the order of the Message Input toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_MESSAGE_INPUT]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'window-bar-button-index',
name: 'Window Bar Button',
note: 'Sets the order of the Window Bar toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_WINDOW_BAR]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'call-window-button-index',
name: 'Call Window Button',
note: 'Sets the order of the Call Window toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_CALL_WINDOW]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'user-area-button-index',
name: 'User Area Button',
note: 'Sets the order of the User Area toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_USER_AREA]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'search-panel-button-index',
name: 'Search Panel Button',
note: 'Sets the order of the Search Panel toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_SEARCH_PANEL]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'forum-popout-button-index',
name: 'Forum Popout Button',
note: 'Sets the order of the Forum Popout toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_FORUM_POPOUT]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
{
type: 'slider',
id: 'activity-panel-button-index',
name: 'Activity Panel Button',
note: 'Sets the order of the Activity Panel toolbar button. Set to 0 to disable',
get value() { return settings.buttonIndexes[constants.I_ACTIVITY_PANEL]; },
min: 0,
max: 11,
step: 1,
markers: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
},
],
},
{
type: 'category',
id: 'resizable-panels-group',
name: 'Resizable Panels',
collapsible: true,
shown: false,
settings: [
{
type: 'switch',
id: 'resizable-channel-list',
name: 'Resizable Channel List',
note: 'Resize the channel list by clicking-and-dragging right edge. Right-click to reset width',
get value() { return settings.channelListWidth !== 0; },
},
{
type: 'switch',
id: 'resizable-members-list',
name: 'Resizable Members List',
note: 'Resize the members list by clicking-and-dragging the left edge. Right-click to reset width',
get value() { return settings.membersListWidth !== 0; },
},
{
type: 'switch',
id: 'resizable-user-profile',
name: 'Resizable User Profile',
note: 'Resize the user profile in DMs by clicking-and-dragging the left edge. Right-click to reset width',
get value() { return settings.userProfileWidth !== 0; },
},
{
type: 'switch',
id: 'resizable-search-panel',
name: 'Resizable Search Panel',
note: 'Resize the message search panel by clicking-and-dragging the left edge. Right-click to reset width',
get value() { return settings.searchPanelWidth !== 0; },
},
{
type: 'switch',
id: 'resizable-forum-popout',
name: 'Resizable Forum Popout',
note: 'Resize the thread popup in forum channels by clicking-and-dragging the left edge. Right-click to reset width',
get value() { return settings.forumPopoutWidth !== 0; },
},
{
type: 'switch',
id: 'resizable-activity-panel',
name: 'Resizable Activity Panel',
note: 'Resize the activity panel in the friends list by clicking-and-dragging the left edge. Right-click to reset width',
get value() { return settings.activityPanelWidth !== 0; },
},
],
},
{
type: 'category',
id: 'floating-panels-group',
name: 'Floating Panels',
collapsible: true,
shown: false,
settings: [
{
type: 'switch',
id: 'floatingPanels',
name: 'Floating Panels',
note: 'Expanded UI panels will float over other panels, instead of moving them out of the way',
get value() { return settings.floatingPanels; },
},
{
type: 'dropdown',
id: 'server-list-floating',
name: 'Server List',
note: 'Server List floats over other panels',
get value() { return settings.floatingEnabled[constants.I_SERVER_LIST]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'channel-list-floating',
name: 'Channel List',
note: 'Channel List floats over other panels',
get value() { return settings.floatingEnabled[constants.I_CHANNEL_LIST]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'members-list-floating',
name: 'Members List',
note: 'Members List floats over other panels',
get value() { return settings.floatingEnabled[constants.I_MEMBERS_LIST]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'user-profile-floating',
name: 'User Profile',
note: 'User Profile floats over other panels',
get value() { return settings.floatingEnabled[constants.I_USER_PROFILE]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'message-input-floating',
name: 'Message Input',
note: 'Message Input floats over other panels',
get value() { return settings.floatingEnabled[constants.I_MESSAGE_INPUT]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'window-bar-floating',
name: 'Window Bar',
note: 'Window Bar floats over other panels',
get value() { return settings.floatingEnabled[constants.I_WINDOW_BAR]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'search-panel-floating',
name: 'Search Panel',
note: 'Search Panel floats over other panels',
get value() { return settings.floatingEnabled[constants.I_SEARCH_PANEL]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'forum-popout-floating',
name: 'Forum Popout',
note: 'Forum Popout floats over other panels',
get value() { return settings.floatingEnabled[constants.I_FORUM_POPOUT]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
{
type: 'dropdown',
id: 'activity-panel-floating',
name: 'Activity Panel',
note: 'Activity Panel floats over other panels',
get value() { return settings.floatingEnabled[constants.I_ACTIVITY_PANEL]; },
options: [
{
label: 'Never',
value: false,
},
{
label: 'On Hover',
value: 'hover',
},
{
label: 'Always',
value: 'always',
},
],
},
],
},
{
type: 'category',
id: 'expand-on-hover-group',
name: 'Expand on Hover',
collapsible: true,
shown: false,
settings: [
{
type: 'switch',
id: 'expandOnHover',
name: 'Expand on Hover',
note: 'Expands collapsed UI panels when the mouse is near them. Must be enabled for conditional/size collapse to work',
get value() { return settings.expandOnHover; },
},
{
type: 'switch',
id: 'server-list-expand-on-hover',
name: 'Server List',
note: 'Server List expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_SERVER_LIST]; },
},
{
type: 'switch',
id: 'channel-list-expand-on-hover',
name: 'Channel List',
note: 'Channel List expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_CHANNEL_LIST]; },
},
{
type: 'switch',
id: 'members-list-expand-on-hover',
name: 'Members List',
note: 'Members List expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_MEMBERS_LIST]; },
},
{
type: 'switch',
id: 'user-profile-expand-on-hover',
name: 'User Profile',
note: 'User Profile expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_USER_PROFILE]; },
},
{
type: 'switch',
id: 'message-input-expand-on-hover',
name: 'Message Input',
note: 'Message Input expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_MESSAGE_INPUT]; },
},
{
type: 'switch',
id: 'window-bar-expand-on-hover',
name: 'Window Bar',
note: 'Window Bar expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_WINDOW_BAR]; },
},
{
type: 'switch',
id: 'call-window-expand-on-hover',
name: 'Call Window',
note: 'Call Window expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_CALL_WINDOW]; },
},
{
type: 'switch',
id: 'user-area-expand-on-hover',
name: 'User Area',
note: 'User Area expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_USER_AREA]; },
},
{
type: 'switch',
id: 'search-panel-expand-on-hover',
name: 'Search Panel',
note: 'Search Panel expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_SEARCH_PANEL]; },
},
{
type: 'switch',
id: 'forum-popout-expand-on-hover',
name: 'Forum Popout',
note: 'Forum Popout expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_FORUM_POPOUT]; },
},
{
type: 'switch',
id: 'activity-panel-expand-on-hover',
name: 'Activity Panel',
note: 'Activity Panel expands on hover',
get value() { return settings.expandOnHoverEnabled[constants.I_ACTIVITY_PANEL]; },
},
],
},
{
type: 'category',
id: 'size-collapse-group',
name: 'Size Collapse',
collapsible: true,
shown: false,
settings: [
{
type: 'switch',
id: 'sizeCollapse',
name: 'Size Collapse',
note: 'Auto-collapse UI panels based on window size',
get value() { return settings.sizeCollapse; },
},
{
type: 'number',
id: 'server-list-threshold',
name: 'Server List - Width Threshold (px)',
note: 'Window width at which the Server List will collapse. Specifies height if Horizontal Server List is enabled',
get value() { return settings.sizeCollapseThreshold[constants.I_SERVER_LIST]; },
},
{
type: 'number',
id: 'channel-list-threshold',
name: 'Channel List - Width Threshold (px)',
note: 'Window width at which the Channel List will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_CHANNEL_LIST]; },
},
{
type: 'number',
id: 'members-list-threshold',
name: 'Members List - Width Threshold (px)',
note: 'Window width at which the Members List will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_MEMBERS_LIST]; },
},
{
type: 'number',
id: 'user-profile-threshold',
name: 'User Profile - Width Threshold (px)',
note: 'Window width at which the User Profile will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_USER_PROFILE]; },
},
{
type: 'number',
id: 'message-input-threshold',
name: 'Message Input - Height Threshold (px)',
note: 'Window height at which the Message Input will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_MESSAGE_INPUT]; },
},
{
type: 'number',
id: 'window-bar-threshold',
name: 'Window Bar - Height Threshold (px)',
note: 'Window height at which the Window Bar will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_WINDOW_BAR]; },
},
{
type: 'number',
id: 'call-window-threshold',
name: 'Call Window - Height Threshold (px)',
note: 'Window height at which the Call Window will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_CALL_WINDOW]; },
},
{
type: 'number',
id: 'user-area-threshold',
name: 'User Area - Height Threshold (px)',
note: 'Window height at which the User Area will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_USER_AREA]; },
},
{
type: 'number',
id: 'search-panel-threshold',
name: 'Search Panel - Width Threshold (px)',
note: 'Window width at which the Search Panel will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_SEARCH_PANEL]; },
},
{
type: 'number',
id: 'forum-popout-threshold',
name: 'Forum Popout - Width Threshold (px)',
note: 'Window width at which the Forum Popout will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_FORUM_POPOUT]; },
},
{
type: 'number',
id: 'activity-panel-threshold',
name: 'Activity Panel - Width Threshold (px)',
note: 'Window width at which the Activity Panel will collapse',
get value() { return settings.sizeCollapseThreshold[constants.I_ACTIVITY_PANEL]; },
},
],
},
{
type: 'category',
id: 'conditional-collapse-group',
name: 'Conditional Collapse (Advanced)',
collapsible: true,
shown: false,
settings: [
{
type: 'switch',
id: 'conditionalCollapse',
name: 'Conditional Collapse',
note: 'Auto-collapse UI panels based on custom conditional expression. Overrides size collapse',
get value() { return settings.conditionalCollapse; },
},
{
type: 'text',
id: 'server-list-conditional',
name: 'Server List - Collapse Expression (JS)',
note: 'The Server List will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_SERVER_LIST]; },
},
{
type: 'text',
id: 'channel-list-conditional',
name: 'Channel List - Collapse Expression (JS)',
note: 'The Channel List will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_CHANNEL_LIST]; },
},
{
type: 'text',
id: 'members-list-conditional',
name: 'Members List - Collapse Expression (JS)',
note: 'The Members List will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_MEMBERS_LIST]; },
},
{
type: 'text',
id: 'user-profile-conditional',
name: 'User Profile - Collapse Expression (JS)',
note: 'The User Profile will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_USER_PROFILE]; },
},
{
type: 'text',
id: 'message-input-conditional',
name: 'Message Input - Collapse Expression (JS)',
note: 'The Message Input will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_MESSAGE_INPUT]; },
},
{
type: 'text',
id: 'window-bar-conditional',
name: 'Window Bar - Collapse Expression (JS)',
note: 'The Window Bar will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_WINDOW_BAR]; },
},
{
type: 'text',
id: 'call-window-conditional',
name: 'Call Window - Collapse Expression (JS)',
note: 'The Call Window will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_CALL_WINDOW]; },
},
{
type: 'text',
id: 'user-area-conditional',
name: 'User Area - Collapse Expression (JS)',
note: 'The User Area will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_USER_AREA]; },
},
{
type: 'text',
id: 'search-panel-conditional',
name: 'Search Panel - Collapse Expression (JS)',
note: 'The Search Panel will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_SEARCH_PANEL]; },
},
{
type: 'text',
id: 'forum-popout-conditional',
name: 'Forum Popout - Collapse Expression (JS)',
note: 'The Forum Popout will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_FORUM_POPOUT]; },
},
{
type: 'text',
id: 'activity-panel-conditional',
name: 'Activity Panel - Collapse Expression (JS)',
note: 'The Activity Panel will collapse when this expression is true, and expand when it is false',
get value() { return settings.collapseConditionals[constants.I_ACTIVITY_PANEL]; },
},
],
},
{
type: 'category',
id: 'advanced-group',
name: 'Advanced',
collapsible: true,
shown: false,
settings: [
{
type: 'number',
id: 'collapseSize',
name: 'Collapsed Panel Size (px)',
note: 'The size of UI panels when collapsed',
get value() { return settings.collapseSize; },
},
{
type: 'number',
id: 'buttonCollapseFudgeFactor',
name: 'Button Groups - Collapse Fudge Factor (px)',
note: 'The distance the mouse must be from a set of buttons before they collapse',
get value() { return settings.buttonCollapseFudgeFactor; },