2020-10-20 23:25:34 +02:00
/ * *
* @ name ServerFolders
* @ authorId 278543574059057154
* @ invite Jx3TjNS
* @ donate https : //www.paypal.me/MircoWittrien
* @ patreon https : //www.patreon.com/MircoWittrien
* @ website https : //github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/ServerFolders
* @ source https : //raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/ServerFolders/ServerFolders.plugin.js
2020-11-12 17:30:48 +01:00
* @ updateUrl https : //raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/ServerFolders/ServerFolders.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" : "ServerFolders" ,
"author" : "DevilBro" ,
2021-01-20 14:30:38 +01:00
"version" : "6.8.6" ,
2020-10-16 10:25:30 +02:00
"description" : "Patch Discords native Folders in a way to open Servers within a Folder in a new bar to the right, also adds a bunch of new features to more easily organize, customize and manage your Folders"
2021-01-20 14:30:38 +01:00
} ,
"changeLog" : {
"fixed" : {
"Custom Icons" : "You can now add custom icons again"
}
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
} ;
2020-11-13 19:47:44 +01:00
2020-10-09 21:09:35 +02:00
return ! 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-01-14 16:14:44 +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 } ` ; }
2020-09-19 20:49:33 +02: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 ;
require ( "request" ) . get ( "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js" , ( e , r , b ) => {
2020-10-20 23:25:34 +02:00
if ( ! e && b && b . indexOf ( ` * @name BDFDB ` ) > - 1 ) require ( "fs" ) . writeFile ( require ( "path" ) . join ( BdApi . Plugins . folder , "0BDFDB.plugin.js" ) , b , _ => { } ) ;
2021-01-14 16:14:44 +01:00
else BdApi . alert ( "Error" , "Could not download BDFDB Library Plugin, try again later or download it manually from GitHub: https://github.com/mwittrien/BetterDiscordAddons/tree/master/Library/" ) ;
2020-09-20 08:15:13 +02: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> ` ;
2020-11-28 23:12:09 +01:00
template . content . firstElementChild . querySelector ( "a" ) . addEventListener ( "click" , _ => {
require ( "request" ) . get ( "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js" , ( e , r , b ) => {
if ( ! e && b && b . indexOf ( ` * @name BDFDB ` ) > - 1 ) require ( "fs" ) . writeFile ( require ( "path" ) . join ( BdApi . Plugins . folder , "0BDFDB.plugin.js" ) , b , _ => { } ) ;
2021-01-14 16:14:44 +01:00
else BdApi . alert ( "Error" , "Could not download BDFDB Library Plugin, try again later or download it manually from GitHub: https://github.com/mwittrien/BetterDiscordAddons/tree/master/Library/" ) ;
2020-11-28 23:12:09 +01:00
} ) ;
} ) ;
return template . content . firstElementChild ;
}
2020-10-09 21:09:35 +02:00
} : ( ( [ Plugin , BDFDB ] ) => {
2020-09-19 20:49:33 +02:00
var _this ;
var folderStates , folderReads , guildStates ;
var folderConfigs = { } , customIcons = { } , settings = { } ;
const folderIcons = [
2020-11-19 16:51:14 +01:00
{ openicon : ` <path d="M 200,390 H 955 L 795,770 H 200 Z" fill="REPLACE_FILL2"/><path d="M 176.6,811 C 163.9,811 155.1,802.6 155,784.7 V 212.9 C 157.9,190.5 169,179.8 195.9,176 h 246 c 20.3,3.2 34.5,18.7 41,28.6 C 494.9,228.3 492.9,240.4 494,266 l 313.6,1.3 c 17.6,0.4 23.3,3.7 23.3,3.7 8.6,4.2 14.8,10.7 19,19.5 C 856.3,319.5 854,360 854,360 h 108.9 c 4.4,2.4 13.7,1.2 11.8,23.5 L 815.8,789.4 c -2.1,5.2 -12.5,13.6 -18.7,16.1 -6.8,2.7 -18.5,5.5 -23.9,5.5 z M 767,759 897,430 H 360 L 230,759 Z" fill="REPLACE_FILL1"/> ` ,
closedicon : ` <path d="M 175,320 V 790 H 820 V 320 Z" fill="REPLACE_FILL2"/><path d="M 183,811 c -12.2,-0.6 -17.9,-4.8 -21.5,-8.2 C 159.5,801 154.8,792.6 155,779.7 V 215.6 c 3.3,-14.1 9.3,-21.4 15.1,-26.4 7.4,-6.3 16,-11.6 36.7,-13.2 h 237.3 c 23.3,6 32.2,18.7 38.7,28.6 7.6,11.7 9.4,18.6 10.3,41.4 L 494,266 h 313.4 c 16.9,0.1 23.5,5.1 23.5,5.1 8.6,4.2 14.5,10.9 19,19.5 0,0 3.7,7.5 3.1,19.8 V 777.2 c -1.1,9 -4.1,13.7 -4.1,13.7 -4.2,8.6 -10.7,14.8 -19.5,19 L 823.3,811 Z m 602.8,-55 c 2.8,-1.7 6.9,-4.5 8.9,-7.4 2.4,-3.6 5,-10.8 5.4,-24.7 V 362 c -0.2,-10.9 -4.2,-16.3 -4.2,-16.3 -2,-3 -5.9,-6.8 -8.7,-8.6 0,0 -5.8,-3 -12.7,-3.2 h -548.1 c -7.8,0 -13.9,3.6 -13.9,3.6 -3,2 -7.3,6.7 -8.4,17.3 v 386.4 c 2.8,10.4 7.5,16 13.6,17.7 h 544.9 c 11,-0.2 18.4,-1.9 23.3,-3 z" fill="REPLACE_FILL1"/> ` } ,
{ openicon : ` <path d="M 167,200 h 200 l 50,50 H 829.8 L 830,330 H 970 L 825,779 H 167 Z" fill="REPLACE_FILL2"/><path d="M 184,799 c -10.5,0 -22.3,-5.3 -27,-10 -4.7,-4.7 -9,-15.1 -9,-34 V 212 c 0,-13.3 5,-22 11,-28 4.4,-4.4 15.4,-10 30,-10 h 170.3 l 53.3,53 H 820 c 13.1,0 18.2,4.2 25,10 6.4,5.5 7,14.4 7,31 v 52 h 122.3 c 11.6,0 17.1,3.3 17.1,3.3 2.9,2.9 3.3,4.4 3.3,14.2 0,8.4 -0.9,13.5 -3.8,22.4 L 849,799 Z M 933,360 H 335 l -130,398.1 603.2,1.3 z M 289.7,334.6 c 3,-8.2 8,-14.8 17,-14.8 0,0 506.6,0.2 506.3,0.2 0,-39.8 -12.2,-53 -53,-53 L 403.3,266.7 350,213 H 240 c -37.6,0 -53,10.1 -53,53 v 382.7 z" fill="REPLACE_FILL1"/> ` ,
closedicon : ` <path d="M 173,190 V 771 H 825 V 250 H 420 l -70,-60 z" fill="REPLACE_FILL2"/><path d="M 184.2,799 C 170.3,799 164.3,795.8 157.4,788.9 151.7,783.3 148,774.6 148,754.9 V 211.2 c 0.7,-18.6 6,-21.7 11.9,-27.6 6.8,-6.8 15.5,-9.4 29.3,-9.6 h 170.1 l 53.3,53 h 407.7 c 14.1,0 18.6,2.8 25.3,9.4 6.4,6.4 7.1,13.4 7.1,30.8 v 246.1 247.4 c 0.2,11.8 -1.9,22.1 -7.4,27.6 C 839.7,793.9 831,799 819.4,799 Z M 813,707 V 415 c 0,-36.9 -13.9,-53 -53,-53 H 240 c -38.1,0 -53,11.7 -53,53 v 292 c 0,38.8 11.5,53 53,53 h 520 c 37.8,0 53,-12.1 53,-53 z M 760,267 c 0,0 -228.6,-0.3 -356.7,-0.3 L 350,213 H 240 c -41.6,2.7 -52.2,14.3 -53,53 v 54 h 626 c -0.6,-37.5 -12,-53 -53,-53 z" fill="REPLACE_FILL1"/> ` } ,
{ openicon : ` <path d="M 307,330 H 970 L 825,779 H 167 Z" fill="REPLACE_FILL2"/><path d="M 189 174 C 174.4 174 163.4 179.6 159 184 C 153 190 148 198.7 148 212 L 148 755 C 148 773.9 152.3 784.3 157 789 C 161.7 793.7 173.5 799 184 799 L 849 799 L 990.8 359.8 C 993.8 350.9 994.7 345.9 994.7 337.4 C 994.7 327.6 994.3 326.2 991.4 323.3 C 991.4 323.3 985.9 320 974.3 320 L 852 320 L 852 268 C 852 251.4 851.4 242.5 845 237 C 838.2 231.2 833.1 227 820 227 L 412.6 227 L 359.3 174 L 189 174 z M 335 360 L 933 360 L 808.2 759.3 L 205 758.1 L 335 360 z" fill="REPLACE_FILL1"/> ` ,
closedicon : ` <path d="M 173,345 V 771 H 825 V 345 Z" fill="REPLACE_FILL2"/><path d="M 189.2 174 C 175.4 174.2 166.7 176.8 159.9 183.6 C 154 189.5 148.7 192.7 148 211.2 L 148 754.9 C 148 774.6 151.7 783.3 157.4 788.9 C 164.3 795.8 170.3 799 184.2 799 L 819.4 799 C 831 799 839.7 793.9 845.2 788.4 C 850.8 782.8 852.9 772.5 852.7 760.8 L 852.7 513.3 L 852.7 267.2 C 852.7 249.8 852 242.8 845.6 236.4 C 838.9 229.7 834.4 227 820.3 227 L 412.6 227 L 359.3 174 L 189.2 174 z M 240 362 L 760 362 C 799.1 362 813 378.1 813 415 L 813 707 C 813 747.9 797.8 760 760 760 L 240 760 C 198.5 760 187 745.8 187 707 L 187 415 C 187 373.7 201.9 362 240 362 z" fill="REPLACE_FILL1"/> ` } ,
{ openicon : ` <path d="M 167,200 h 200 l 50,50 H 829.8 L 830,330 H 314 L 167,779 Z" fill="REPLACE_FILL2"/><path d="M 189 174 C 174.4 174 163.4 179.6 159 184 C 153 190 148 198.7 148 212 L 148 755 C 148 773.9 152.3 784.3 157 789 C 161.7 793.7 173.5 799 184 799 L 849 799 L 990.8 359.8 C 993.8 350.9 994.7 345.9 994.7 337.4 C 994.7 327.6 994.3 326.2 991.4 323.3 C 991.4 323.3 985.9 320 974.3 320 L 852 320 L 852 268 C 852 251.4 851.4 242.5 845 237 C 838.2 231.2 833.1 227 820 227 L 412.6 227 L 359.3 174 L 189 174 z M 240 213 L 350 213 L 403.3 266.7 L 760 267 C 800.8 267 813 280.2 813 320 C 813.3 320 306.7 319.8 306.7 319.8 C 297.7 319.8 292.7 326.4 289.7 334.6 L 187 648.7 L 187 266 C 187 223.1 202.4 213 240 213 z" fill="REPLACE_FILL1"/> ` ,
closedicon : ` <path d="M 173,190 V 350 H 825 V 250 H 420 l -70,-60 z" fill="REPLACE_FILL2"/><path d="M 189.2 174 C 175.4 174.2 166.7 176.8 159.9 183.6 C 154 189.5 148.7 192.7 148 211.2 L 148 754.9 C 148 774.6 151.7 783.3 157.4 788.9 C 164.3 795.8 170.3 799 184.2 799 L 819.4 799 C 831 799 839.7 793.9 845.2 788.4 C 850.8 782.8 852.9 772.5 852.7 760.8 L 852.7 513.3 L 852.7 267.2 C 852.7 249.8 852 242.8 845.6 236.4 C 838.9 229.7 834.4 227 820.3 227 L 412.6 227 L 359.3 174 L 189.2 174 z M 240 213 L 350 213 L 403.3 266.7 C 531.4 266.7 760 267 760 267 C 801 267 812.4 282.5 813 320 L 187 320 L 187 266 C 187.8 227.3 198.4 215.7 240 213 z" fill="REPLACE_FILL1"/> ` } ,
{ openicon : ` <path d="M 132,305 H 880 V 750 H 132 Z" fill="REPLACE_FILL2"/><path d="M 135,188 c -5.6,0 -13.9,2.9 -19.8,8.9 C 109.4,203 107,206.8 107,216 c 0,189.7 0,379.3 0,569 0,11.1 1.7,14.8 7,20.2 C 120.5,811.6 125.4,813 135,813 h 717 c 16.7,0 16.7,-1.6 18.6,-6.6 L 981.3,423.4 c 0,-5.8 -1,-6.2 -2.8,-8.1 -1.9,-1.9 -4.3,-2 -11.9,-2 l -691.9,2.1 c -16.4,0 -21.3,11.5 -23.4,17.2 l -80.9,263 -0.2,0 C 159.1,714.4 147,704.3 147,677.2 V 334 h 733 v -26 c 0,-7.7 -1.6,-14.7 -7.6,-19.8 C 866.3,283.1 860.4,280 852,280 H 440 l -20,-82 c -1.2,-2.5 -3.1,-6.8 -5.8,-7.7 0,0 -3,-2.3 -10.2,-2.3 z" fill="REPLACE_FILL1"/> ` ,
closedicon : ` <path d="M 132,305 H 880 V 750 H 132 Z" fill="REPLACE_FILL2"/><path d="M 135,813 c -10.3,0 -14.5,-1.4 -21,-7.8 C 108.7,799.8 107,796.1 107,785 c 0,-189.7 0,-379.3 0,-569 0,-9.2 2.4,-13 8.2,-19.1 C 121.1,190.9 129.4,188 135,188 h 269 c 7.2,0 10.2,2.3 10.2,2.3 2.7,0.9 4.6,5.2 5.8,7.7 l 20,82 h 412 c 8.4,0 14.3,3.1 20.4,8.2 C 878.4,293.3 880,300.3 880,308 v 26 H 147 v 343.2 c 0,27.1 18.1,25.2 21.7,5.4 l 32.7,-277.7 c 0.7,-2.8 2.7,-7.5 5.8,-10.6 C 210.4,391.1 214.5,388 222.7,388 H 852 c 7.9,0 15.9,2.9 20.5,7.5 C 878.3,401.3 880,408.6 880,416 v 369 c 0,6.9 -1.8,14.7 -7.4,19.3 C 866.2,809.6 858.9,813 852,813 Z" fill="REPLACE_FILL1"/> ` } ,
{ openicon : ` <path d="M 186.3,187 c -20,0 -35.7,7.4 -47.4,19.3 -11.7,11.9 -17.6,25 -17.6,45.7 v 80 l -0.3,416 c 0,10.9 4.6,32.6 16.7,45.1 C 149.8,805.6 168,813 186.3,813 365.7,749.3 880.3,734.5 880.3,734.5 c 0,0 0,-255.4 0,-402.5 0,-16.9 -4.7,-35 -17.2,-47.4 -12.5,-12.4 -30.1,-17.6 -47.8,-17.6 h -310 l -79,-80 z" fill="REPLACE_FILL1"/><path d="m 175.1,810.3 79.1,-393 c 8.3,-23.6 21.8,-42.9 53.1,-43 H 920.6 c 17.7,0 35.9,19.5 33.7,29.3 l -73.7,365.7 c -9,24.8 -11.1,41.3 -51.8,44 H 185.6 c -3.6,0 -6.4,-0.1 -11.1,-0.9 z" fill="REPLACE_FILL2"/> ` ,
closedicon : ` <path d="M 121,252 c 0,-20.7 5.9,-33.8 17.6,-45.7 C 150.3,194.4 166,187 186,187 h 240 l 79,80 -384,113 z" fill="REPLACE_FILL1"/><path d="M 186,813 c -18.4,0 -36.5,-7.4 -48.6,-19.9 C 125.3,780.6 120.7,758.9 120.7,748 L 121,332 c 0,-16.9 7.2,-31.7 18.6,-43.5 C 151,276.7 170.1,267 186,267 h 629 c 17.6,0 35.2,5.3 47.8,17.6 C 875.3,297 880,315.1 880,332 v 416 c 0,14.8 -3.4,36.6 -17,47.9 C 849.5,807.2 830.9,813 815,813 Z" fill="REPLACE_FILL2"/> ` } ,
{ openicon : ` <path d="M 160,253 h 614 c 14.8,0 29.7,8.6 36.9,15.8 C 819.4,277.3 826,289.4 826,305 v 95 H 160 Z" fill="REPLACE_FILL2"/><path d="M 199,200 c -26.2,0 -33.9,6.5 -41.5,15.6 C 149.8,224.8 147,231.8 147,252 V 386.7 387 c -20.9,0.5 -56.5,-3.5 -70.3,6.9 -2.5,1.9 -5.4,3.2 -8.3,9.8 -6.8,25.6 -0.3,54.8 1.1,70.3 9.1,59.2 69.1,294.7 74.9,310 3.7,9.8 4.6,13.6 10,15 h 689.6 c 6.3,-1.4 11.6,-15 11.6,-15 L 931.8,474 c 2.7,-20 8.3,-54 -0.2,-70.3 -2,-3.5 -6.5,-8.1 -9.3,-9.8 C 902.5,385.1 881.9,387 853,387 852.6,369.4 855,346.8 846.6,333 842.4,326.2 830.5,321.3 826,321.3 V 387 L 173.2,386.7 173,387 v -82 c 0,-14.6 2.8,-25.9 12.4,-35.5 C 195.9,259 207.7,253 225,253 h 201 l -54,-53 z" fill="REPLACE_FILL1"/> ` ,
closedicon : ` <path d="M 160,400 V 253 h 440 v 147 z" fill="REPLACE_FILL2"/><path d="M 186,799 c -24.2,0 -34,-8 -39.7,-13.6 C 140.8,779.9 134,769.1 134,747 V 372 c 0,-21.5 13,-32 13,-32 V 252 c 0,-20.2 2.8,-27.2 10.5,-36.4 C 165.1,206.5 172.8,200 199,200 h 173 l 54,53 H 225 c -17.3,0 -29.1,6 -39.6,16.5 C 175.8,279.1 173,290.4 173,305 l -0.4,19 c 0,0 9.6,-4 20.9,-4 H 494 L 614,200 h 186 c 17.7,0 26.6,7.1 36,14.2 C 846.5,222 852,233.6 852,252 v 495 c 0,16.1 -7.5,30.2 -14.1,36.7 C 831.4,790.2 815.9,799 800,799 Z" fill="REPLACE_FILL1"/> ` }
2020-09-19 20:49:33 +02:00
] ;
var folderGuildContent = null ;
const folderGuildContentComponent = class FolderGuildsContent extends BdApi . React . Component {
2021-01-06 12:38:36 +01:00
componentDidMount ( ) {
2020-09-19 20:49:33 +02:00
folderGuildContent = this ;
}
2021-01-06 12:38:36 +01:00
render ( ) {
2020-09-19 20:49:33 +02:00
let closing = this . props . closing ;
delete this . props . closing ;
let folders = Array . from ( BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) . map ( folderId => BDFDB . LibraryModules . FolderStore . getGuildFolderById ( folderId ) ) . filter ( folder => folder && folder . guildIds ) ;
this . props . folders = folders . length || closing ? folders : ( this . props . folders || [ ] ) ;
BDFDB . TimeUtils . clear ( this . _rerenderTimeout ) ;
if ( ! folders . length && this . props . folders . length && ! closing ) this . _rerenderTimeout = BDFDB . TimeUtils . timeout ( _ => {
this . props . closing = true ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} , 300 ) ;
return BDFDB . ReactUtils . createElement ( "nav" , {
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . guildswrapper , BDFDB . disCN . guilds , this . props . themeOverride && BDFDB . disCN . themedark , BDFDB . disCN . _serverfoldersfoldercontent , ( ! folders . length || closing ) && BDFDB . disCN . _serverfoldersfoldercontentclosed ) ,
2020-10-30 17:20:33 +01:00
children : BDFDB . ReactUtils . createElement ( "ul" , {
role : "tree" ,
tabindex : 0 ,
"data-list-id" : "guildfoldersnav" ,
className : BDFDB . disCN . guildstree ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Scrollers . None , {
className : BDFDB . disCN . guildsscroller ,
children : this . props . folders . map ( folder => {
let data = _this . getFolderConfig ( folder . folderId ) ;
return folder . guildIds . map ( guildId => {
return [
this . draggedGuild == guildId ? null : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . Guild , {
guild : BDFDB . LibraryModules . GuildStore . getGuild ( guildId ) ,
state : true ,
list : true ,
tooltipConfig : Object . assign ( {
offset : 12
} , data . copyTooltipColor && {
backgroundColor : data . color3 ,
fontColor : data . color4 ,
} ) ,
onClick : event => {
if ( BDFDB . ListenerUtils . isPressed ( 46 ) ) {
2020-09-19 20:49:33 +02:00
BDFDB . ListenerUtils . stopEvent ( event ) ;
2020-10-30 17:20:33 +01:00
_this . removeGuildFromFolder ( folder . folderId , guildId ) ;
}
else {
if ( settings . closeAllFolders ) {
for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( openFolderId != folder . folderId || ! settings . forceOpenFolder ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
}
else if ( settings . closeTheFolder && ! settings . forceOpenFolder && BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
else BDFDB . ReactUtils . forceUpdate ( this ) ;
}
} ,
onMouseDown : ( event , instance ) => {
event = event . nativeEvent || event ;
let mousemove = event2 => {
if ( Math . sqrt ( ( event . pageX - event2 . pageX ) * * 2 ) > 20 || Math . sqrt ( ( event . pageY - event2 . pageY ) * * 2 ) > 20 ) {
BDFDB . ListenerUtils . stopEvent ( event ) ;
this . draggedGuild = guildId ;
let dragpreview = _this . createDragPreview ( BDFDB . ReactUtils . findDOMNode ( instance ) . cloneNode ( true ) , event2 ) ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
document . removeEventListener ( "mousemove" , mousemove ) ;
document . removeEventListener ( "mouseup" , mouseup ) ;
let dragging = event3 => {
_this . updateDragPreview ( dragpreview , event3 ) ;
let placeholder = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . _serverfoldersguildplaceholder , event3 . target ) ;
let hoveredGuild = ( BDFDB . ReactUtils . findValue ( BDFDB . DOMUtils . getParent ( BDFDB . dotCNS . _serverfoldersfoldercontent + BDFDB . dotCN . guildouter , placeholder ? placeholder . previousSibling : event3 . target ) , "guild" , { up : true } ) || { } ) . id ;
if ( hoveredGuild ) {
let hoveredGuildFolder = BDFDB . GuildUtils . getFolder ( hoveredGuild ) ;
if ( ! hoveredGuildFolder || hoveredGuildFolder . folderId != folder . folderId ) hoveredGuild = null ;
}
let update = hoveredGuild != this . hoveredGuild ;
if ( hoveredGuild ) this . hoveredGuild = hoveredGuild ;
else delete this . hoveredGuild ;
if ( update ) BDFDB . ReactUtils . forceUpdate ( this ) ;
} ;
let releasing = event3 => {
BDFDB . ListenerUtils . stopEvent ( event3 ) ;
BDFDB . DOMUtils . remove ( dragpreview ) ;
if ( this . hoveredGuild ) {
let guildIds = [ ] . concat ( folder . guildIds ) ;
BDFDB . ArrayUtils . remove ( guildIds , this . draggedGuild , true ) ;
guildIds . splice ( guildIds . indexOf ( this . hoveredGuild ) + 1 , 0 , this . draggedGuild ) ;
_this . updateFolder ( Object . assign ( { } , folder , { guildIds } ) ) ;
}
delete this . draggedGuild ;
delete this . hoveredGuild ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
document . removeEventListener ( "mousemove" , dragging ) ;
document . removeEventListener ( "mouseup" , releasing ) ;
} ;
document . addEventListener ( "mousemove" , dragging ) ;
document . addEventListener ( "mouseup" , releasing ) ;
}
} ;
let mouseup = _ => {
2020-09-19 20:49:33 +02:00
document . removeEventListener ( "mousemove" , mousemove ) ;
document . removeEventListener ( "mouseup" , mouseup ) ;
2020-10-30 17:20:33 +01:00
} ;
document . addEventListener ( "mousemove" , mousemove ) ;
document . addEventListener ( "mouseup" , mouseup ) ;
}
} ) ,
this . hoveredGuild != guildId ? null : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCNS . guildouter + BDFDB . disCN . _serverfoldersguildplaceholder ,
children : BDFDB . ReactUtils . createElement ( "div" , {
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . Items . DragPlaceholder , { } )
} )
2020-09-19 20:49:33 +02:00
} )
2020-10-30 17:20:33 +01:00
]
} ) ;
} ) . filter ( n => n ) . reduce ( ( r , a ) => r . concat ( a , settings . addSeparators ? BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . Items . Separator , { } ) : null ) , [ 0 ] ) . slice ( 1 , - 1 ) . flat ( 10 ) . filter ( n => n )
} )
2020-09-19 20:49:33 +02:00
} )
} ) ;
}
} ;
const folderIconPickerComponent = class FolderIconPicker extends BdApi . React . Component {
2021-01-06 12:38:36 +01:00
render ( ) {
2020-09-19 20:49:33 +02:00
let folderIcons = _this . loadAllIcons ( ) ;
for ( let id in folderIcons ) if ( ! folderIcons [ id ] . customID ) {
folderIcons [ id ] . openicon = _this . createBase64SVG ( folderIcons [ id ] . openicon ) ;
folderIcons [ id ] . closedicon = _this . createBase64SVG ( folderIcons [ id ] . closedicon ) ;
}
folderIcons [ "-1" ] = { } ;
return BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex , {
wrap : BDFDB . LibraryComponents . Flex . Wrap . WRAP ,
children : Object . keys ( folderIcons ) . sort ( ) . map ( id => {
return BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Card , {
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . _serverfoldersiconswatch , this . props . selectedIcon == id && BDFDB . disCN . _serverfoldersiconswatchselected ) ,
backdrop : false ,
iconID : id ,
grow : 0 ,
shrink : 0 ,
noRemove : ! folderIcons [ id ] . customID || this . props . selectedIcon == id ,
onMouseEnter : _ => {
this . props . hoveredIcon = id ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} ,
onMouseLeave : _ => {
delete this . props . hoveredIcon ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} ,
onClick : _ => {
this . props . selectedIcon = id ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} ,
onRemove : _ => {
delete customIcons [ id ] ;
BDFDB . DataUtils . save ( customIcons , _this , "customicons" ) ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} ,
children : folderIcons [ id ] . closedicon ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
style : { background : ` url( ${ this . props . hoveredIcon == id ? folderIcons [ id ] . openicon : folderIcons [ id ] . closedicon } ) center/cover no-repeat ` }
} ) : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SvgIcon , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
name : BDFDB . LibraryComponents . SvgIcon . Names . FOLDER ,
style : { color : "rbg(0, 0, 0)" }
} )
2020-07-20 21:41:30 +02:00
} ) ;
2020-09-19 20:49:33 +02:00
} )
2020-02-08 19:07:33 +01:00
} )
}
2020-09-19 20:49:33 +02:00
} ;
2020-11-19 16:56:08 +01:00
var redCross = ` 'data:image/svg+xml; base64, PHN2ZyB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIj48cGF0aCBkPSJNNDAuNDAwIDE3LjE3OCBDIDM5Ljg1MCAxNy4zNjYsMzguNzkzIDE3LjUzOCwzOC4wNTAgMTcuNTYwIEMgMzMuMzUxIDE3LjY5OSwyMy4zOTcgMjQuNzg4LDIxLjM4MSAyOS40MzIgQyAyMS4wODcgMzAuMTA5LDIwLjU2NiAzMC44OTYsMjAuMjIzIDMxLjE4MSBDIDE5Ljg4MCAzMS40NjUsMTkuNjAwIDMxLjg2NiwxOS42MDAgMzIuMDcxIEMgMTkuNjAwIDMyLjI3NiwxOS4yMzYgMzMuMjQyLDE4Ljc5MiAzNC4yMTggQyAxNi4zNDUgMzkuNTg5LDE2LjM0NSA0OS42MTEsMTguNzkyIDU0Ljk4MiBDIDE5LjIzNiA1NS45NTgsMTkuNjAwIDU2LjkxOCwxOS42MDAgNTcuMTE2IEMgMTkuNjAwIDU3LjMxNCwxOS45NjAgNTcuODAyLDIwLjQwMCA1OC4yMDAgQyAyMC44NDAgNTguNTk4LDIxLjIwMCA1OS4xMzEsMjEuMjAwIDU5LjM4NSBDIDIxLjIwMCA2MC4zOTEsMjUuNjgwIDY0Ljk0Miw5MS41MDUgMTMwLjgwMCBDIDEyOC45OTUgMTY4LjMxMCwxNTkuODQ5IDE5OS4zMjYsMTYwLjA2OCAxOTkuNzI0IEMgMTYwLjQwOSAyMDAuMzQ0LDE1MC45NTAgMjA5Ljk2NCw5My45ODkgMjY2LjkyNCBDIDE4Ljc5OCAzNDIuMTEzLDE5LjYwMCAzNDEuMjkyLDE5LjYwMCAzNDMuMTI2IEMgMTkuNjAwIDM0My4yODMsMTkuMjUwIDM0NC4wNjUsMTguODIyIDM0NC44NjQgQyAxNS40MjkgMzUxLjE5NSwxNS45NTggMzYyLjkxOCwxOS45MzIgMzY5LjQ0MCBDIDIyLjA5NCAzNzIuOTkwLDI3LjQ3NCAzNzguODAwLDI4LjU5OCAzNzguODAwIEMgMjguODYxIDM3OC44MDAsMjkuNDAyIDM3OS4xNjAsMjkuODAwIDM3OS42MDAgQyAzMC4xOTggMzgwLjA0MCwzMC43MDMgMzgwLjQwMCwzMC45MjIgMzgwLjQwMCBDIDMxLjE0MSAzODAuNDAwLDMyLjIzOCAzODAuODMxLDMzLjM2MCAzODEuMzU4IEMgMzQuNDgyIDM4MS44ODYsMzYuNDgwIDM4Mi41MzMsMzcuODAwIDM4Mi43OTcgQyA0My43ODYgMzgzLjk5NCw0NC4zMjMgMzg0LjAyNyw0Ny4yOTkgMzgzLjM4NiBDIDQ4Ljg5NSAzODMuMDQyLDUxLjAxMCAzODIuNjE5LDUyLjAwMCAzODIuNDQ2IEMgNTIuOTkwIDM4Mi4yNzQsNTQuNTE3IDM4MS43NDMsNTUuMzk0IDM4MS4yNjYgQyA1Ni4yNzEgMzgwLjc5MCw1Ny4xODggMzgwLjQwMCw1Ny40MzIgMzgwLjQwMCBDIDU3LjY3NiAzODAuNDAwLDU4LjIwMiAzODAuMDQwLDU4LjYwMCAzNzkuNjAwIEMgNTguOTk4IDM3OS4xNjAsNTkuNTk4IDM3OC44MDAsNTkuOTMyIDM3OC44MDAgQyA2MC4yNjcgMzc4LjgwMCw5MS43MjUgMzQ3LjYxNSwxMjkuODM5IDMwOS41MDAgQyAxNjkuMDU3IDI3MC4yODEsMTk5LjQ5NiAyNDAuMTQ1LDE5OS45NjQgMjQwLjA3MyBDIDIwMC42MDIgMjM5Ljk3NSwyMTYuMDAxIDI1NS4xOTMsMjY3LjQ5NSAzMDYuODE0IEMgMzI3LjA0NiAzNjYuNTExLDMzOS41MzEgMzc4LjgwMCwzNDAuNjI3IDM3OC44MDAgQyAzNDAuNzk4IDM3OC44MDAsMzQxLjI2NSAzNzkuMDk3LDM0MS42NjcgMzc5LjQ2MSBDIDM0NS43MjggMzgzLjEzNiwzNjEuMDEzIDM4NC40MDksMzY1LjY4NSAzODEuNDYxIEMgMzY2LjE4OCAzODEuMTQzLDM2Ny4wMjQgMzgwLjc1NywzNjcuNTQxIDM4MC42MDIgQyAzNzAuNTgzIDM3OS42OTEsMzc2LjYyMyAzNzQuMjAwLDM3OS4zODIgMzY5LjgzNiBDIDM4NS4xMDUgMzYwLjc4NSwzODQuMDM5IDM0Ni40MDksMzc3LjAzOSAzMzguMjI4IEMgMzc2LjA4NCAzMzcuMTEzLDM0NC44NDYgMzA1Ljc0MywzMDcuNjIxIDI2OC41MTcgQyAyNTUuMzI5IDIxNi4yMjQsMjM5Ljk2OSAyMDAuNjQ3LDI0MC4wNzAgMjAwLjAwOSBDIDI0MC4xNDMgMTk5LjU0NSwyNzAuMDYyIDE2OS4yODgsMzA4LjIxNiAxMzEuMDkxIEMgMzQ1LjYyNSA5My42NDEsMzc2LjcyMyA2Mi4zNzAsMzc3LjMyNCA2MS42MDAgQyAzODQuMjg2IDUyLjY3OCwzODUuMDM2IDQwLjYyMSwzNzkuMjc3IDMwLjE3MSBDIDM3Ni4xMzYgMjQuNDY5LDM2Ny45MDYgMTguNTM3LDM2MS42NjggMTcuNDc3IEMgMzU0LjY1NiAxNi4yODYsMzQ1LjA5NSAxNy42NjUsMzQxLjg4MyAyMC4zMzEgQyAzNDEuNTY3IDIwLjU5NCwzNDAuNTQ5IDIxLjMxOCwzMzkuNjIyIDIxLjk0MSBDIDMzOC42OTUgMjIuNTYzLDMwNy4wMzEgNTMuOTcyLDI2OS4yNTkgOTEuNzM3IEMgMjMxLjQ4NiAxMjkuNTAxLDIwMC4zMzAgMTYwLjQwMCwyMDAuMDIyIDE2MC40MDAgQyAxOTkuNzE0IDE2MC40MDAsMTY4LjkzOCAxMjkuODY5LDEzMS42MzEgOTIuNTU0IEMgNTYuMjI1IDE3LjEzMSw2MC4yODggMjEuMDQ3LDU1LjIwMCAxOC44ODcgQyA1MS41OTEgMTcuMzU0LDQyLjgzNiAxNi4zNDMsNDAuNDAwIDE3LjE3OHoiIGZpbGw9InJnYigyNDAsIDcxLCA3MSkiPjwvcGF0aD48L3N2Zz4=' ` ;
2020-09-19 20:49:33 +02:00
const folderIconCustomPreviewComponent = class FolderIconCustomPreview extends BdApi . React . Component {
2021-01-06 12:38:36 +01:00
componentDidMount ( ) {
2020-09-19 20:49:33 +02:00
this . _previewInterval = BDFDB . TimeUtils . interval ( _ => {
this . props . tick = ! this . props . tick ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} , 2000 ) ;
}
2021-01-06 12:38:36 +01:00
componentWillUnmount ( ) {
2020-09-19 20:49:33 +02:00
BDFDB . TimeUtils . clear ( this . _previewInterval ) ;
}
checkImage ( base64OrUrl , callback ) {
if ( base64OrUrl . indexOf ( "https://" ) == 0 || base64OrUrl . indexOf ( "http://" ) == 0 ) BDFDB . LibraryRequires . request ( base64OrUrl . trim ( ) , ( error , response , body ) => {
if ( response && response . headers [ "content-type" ] && response . headers [ "content-type" ] . indexOf ( "image" ) != - 1 && response . headers [ "content-type" ] != "image/gif" ) {
2020-11-22 15:07:19 +01:00
this . resizeImage ( "data:" + response . headers [ "content-type" ] + ";base64," + ( new Buffer ( body ) . toString ( "base64" ) ) , callback ) ;
2020-06-17 17:16:11 +02:00
}
2020-09-19 20:49:33 +02:00
else callback ( base64OrUrl ) ;
} ) ;
else this . resizeImage ( base64OrUrl , callback ) ;
2020-06-17 17:16:11 +02:00
}
2020-09-19 20:49:33 +02:00
resizeImage ( base64 , callback ) {
2020-11-22 15:07:19 +01:00
let type = base64 . split ( "data:" ) . slice ( 1 ) . join ( " " ) . split ( ";" ) [ 0 ] ;
2020-09-19 20:49:33 +02:00
if ( type == "image/gif" ) callback ( base64 ) ;
else {
let img = new Image ( ) ;
img . onload = function ( ) {
let width = 0 , height = 0 ;
if ( this . width >= this . height ) {
width = ( 128 / this . height ) * this . width ;
height = 128 ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
else {
width = 128 ;
height = ( 128 / this . width ) * this . height ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
let canvas = document . createElement ( "canvas" ) ;
let ctx = canvas . getContext ( "2d" ) ;
ctx . canvas . width = width ;
ctx . canvas . height = height ;
document . body . appendChild ( canvas ) ;
ctx . drawImage ( img , 0 , 0 , width , height ) ;
callback ( canvas . toDataURL ( type ) ) ;
} ;
img . onerror = function ( ) {
callback ( base64 ) ;
} ;
img . src = base64 ;
}
}
2021-01-06 12:38:36 +01:00
render ( ) {
2020-09-19 20:49:33 +02:00
return [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : _this . labels . modal _customopen ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TextInput , {
type : "file" ,
filter : "image" ,
value : this . props . open ,
onChange : value => {
this . props . open = value ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
}
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : _this . labels . modal _customclosed ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TextInput , {
type : "file" ,
filter : "image" ,
value : this . props . closed ,
onChange : value => {
this . props . closed = value ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
}
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : _this . labels . modal _custompreview ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex , {
justify : BDFDB . LibraryComponents . Flex . Justify . BETWEEN ,
align : BDFDB . LibraryComponents . Flex . Align . CENTER ,
children : [
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCNS . _serverfoldersiconswatch + BDFDB . disCN . _serverfoldersiconswatchpreview ,
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
style : { background : ` url( ${ this . props . open || redCross } ) center/cover no-repeat ` }
} )
} ) ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCNS . _serverfoldersiconswatch + BDFDB . disCN . _serverfoldersiconswatchpreview ,
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
style : { background : ` url( ${ this . props . closed || redCross } ) center/cover no-repeat ` }
} )
} ) ,
BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCNS . _serverfoldersiconswatch + BDFDB . disCN . _serverfoldersiconswatchpreview ,
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
style : { background : ` url( ${ ( this . props . tick ? this . props . open : this . props . closed ) || redCross } ) center/cover no-repeat ` }
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Button , {
children : BDFDB . LanguageUtils . LanguageStrings . ADD ,
onClick : ( e , instance ) => {
2021-01-20 14:30:38 +01:00
let inputIns = BDFDB . ReactUtils . findOwner ( this , { name : "BDFDB_TextInput" , all : true , unlimited : true } ) ;
2020-09-19 20:49:33 +02:00
if ( inputIns . length == 2 && inputIns [ 0 ] . props . value && inputIns [ 1 ] . props . value ) {
this . checkImage ( inputIns [ 0 ] . props . value , openIcon => {
this . checkImage ( inputIns [ 1 ] . props . value , closedIcon => {
customIcons [ _this . generateId ( "customicon" ) ] = { openicon : openIcon , closedicon : closedIcon } ;
BDFDB . DataUtils . save ( customIcons , _this , "customicons" ) ;
this . props . open = null ;
this . props . closed = null ;
BDFDB . PatchUtils . forceAllUpdates ( _this , "GuildFolderSettingsModal" ) ;
2021-01-20 14:30:38 +01:00
BDFDB . NotificationUtils . toast ( "Custom Icon was added to Selection" , { type : "success" } ) ;
2020-09-19 20:49:33 +02:00
} ) ;
} )
}
2021-01-20 14:30:38 +01:00
else BDFDB . NotificationUtils . toast ( "Add an Image for the open and closed Icon" , { type : "danger" } ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
} )
]
} )
2020-02-08 19:07:33 +01:00
} )
2020-09-19 20:49:33 +02:00
]
}
} ;
2020-10-09 21:09:35 +02:00
return class ServerFolders extends Plugin {
2021-01-06 12:38:36 +01:00
onLoad ( ) {
2020-09-19 20:49:33 +02:00
_this = this ;
2020-03-31 20:46:41 +02:00
2020-09-19 20:49:33 +02:00
folderStates = { } ;
folderReads = { } ;
guildStates = { } ;
this . defaults = {
settings : {
2020-11-19 16:51:14 +01:00
closeOtherFolders : { value : false , description : "Close other folders when opening a folder" } ,
closeTheFolder : { value : false , description : "Close the folder when selecting a server" } ,
closeAllFolders : { value : false , description : "Close all folders when selecting a server" } ,
forceOpenFolder : { value : false , description : "Force a folder to open when switching to a server of that folder" } ,
showCountBadge : { value : true , description : "Display badge for amount of servers in a folder" } ,
extraColumn : { value : true , description : "Move the servers from opened folders in an extra column" } ,
addSeparators : { value : true , description : "Add separators between servers of different folders in extra column" }
2020-09-19 20:49:33 +02:00
}
} ;
2019-12-18 10:55:02 +01:00
2020-09-19 20:49:33 +02:00
this . patchedModules = {
after : {
AppView : "render" ,
GuildFolder : "type" ,
Guilds : "render" ,
Guild : [ "componentDidMount" , "render" ] ,
GuildFolderSettingsModal : [ "componentDidMount" , "render" ]
}
} ;
2020-02-08 19:07:33 +01:00
2020-09-19 20:49:33 +02:00
this . css = `
. $ { this . name } - modal $ { BDFDB . dotCN . _serverfoldersiconswatch } {
position : relative ;
margin : 3 px 3 px ;
padding : 3 px 3 px ;
width : 55 px ;
height : 55 px ;
border - radius : 12 px ;
cursor : pointer ;
}
. $ { this . name } - modal $ { BDFDB . dotCN . _serverfoldersiconswatch + BDFDB . dotCN . _serverfoldersiconswatchpreview } {
width : 95 px ;
height : 95 px ;
cursor : default ;
}
. $ { this . name } - modal $ { BDFDB . dotCN . _serverfoldersiconswatch } : hover {
background - color : var ( -- background - modifier - hover ) ;
}
. $ { this . name } - modal $ { BDFDB . dotCN . _serverfoldersiconswatch + BDFDB . dotCN . _serverfoldersiconswatchselected } {
background - color : var ( -- background - modifier - selected ) ;
}
. $ { this . name } - modal $ { BDFDB . dotCNS . _serverfoldersiconswatch + BDFDB . dotCN . _serverfoldersiconswatchinner } {
width : 100 % ;
height : 100 % ;
border - radius : 12 px ;
background - position : center ;
background - size : cover ;
background - repeat : no - repeat ;
}
. $ { this . name } - modal $ { BDFDB . dotCN . _serverfoldersiconswatch } svg$ { BDFDB . dotCN . _serverfoldersiconswatchinner } {
transform : translateY ( - 2 px ) scale ( 0.8 ) ;
}
. $ { this . name } - modal $ { BDFDB . dotCNS . _serverfoldersiconswatch + BDFDB . dotCN . hovercardbutton } {
position : absolute ;
top : - 10 px ;
right : - 10 px ;
}
$ { BDFDB . dotCN . _serverfoldersdragpreview } {
pointer - events : none ! important ;
position : absolute ! important ;
opacity : 0.5 ! important ;
z - index : 10000 ! important ;
}
$ { BDFDB . dotCN . guildswrapper + BDFDB . dotCN . _serverfoldersfoldercontent } {
transition : width 0.3 s linear ! important ;
}
$ { BDFDB . dotCN . guildswrapper + BDFDB . dotCN . _serverfoldersfoldercontent + BDFDB . dotCN . _serverfoldersfoldercontentclosed } {
width : 0 px ! important ;
}
$ { BDFDB . dotCN . appcontainer } {
display : flex ! important ;
}
$ { BDFDB . dotCN . guildswrapper } {
position : static ! important ;
contain : unset ! important ;
}
$ { BDFDB . dotCN . chatbase } {
position : static ! important ;
contain : unset ! important ;
width : 100 % ! important ;
}
` ;
}
2021-01-06 12:38:36 +01:00
onStart ( ) {
2020-02-08 19:07:33 +01:00
let forceClosing = false ;
2020-09-11 19:31:36 +02:00
BDFDB . PatchUtils . patch ( this , BDFDB . LibraryModules . GuildUtils , "toggleGuildFolderExpand" , { after : e => {
2020-06-08 21:05:22 +02:00
if ( settings . closeOtherFolders && ! forceClosing ) {
2020-02-08 19:07:33 +01:00
forceClosing = true ;
for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( openFolderId != e . methodArguments [ 0 ] ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
forceClosing = false ;
}
} } ) ;
2020-03-30 22:48:55 +02:00
this . forceUpdateAll ( ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
2021-01-06 12:38:36 +01:00
onStop ( ) {
2020-03-30 22:48:55 +02:00
this . forceUpdateAll ( ) ;
2020-02-08 19:07:33 +01:00
BDFDB . DOMUtils . removeClassFromDOM ( BDFDB . disCN . _serverfoldersfoldercontentisopen ) ;
}
2018-10-11 10:21:26 +02:00
2021-01-06 12:38:36 +01:00
onSwitch ( ) {
2020-09-19 20:49:33 +02:00
if ( typeof BDFDB === "object" && settings . forceOpenFolder ) {
let folder = BDFDB . GuildUtils . getFolder ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) ) ;
if ( folder && ! BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
}
}
getSettingsPanel ( collapseStates = { } ) {
let settingsPanel , settingsItems = [ ] ;
for ( let key in settings ) settingsItems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsSaveItem , {
type : "Switch" ,
plugin : this ,
keys : [ "settings" , key ] ,
label : this . defaults . settings [ key ] . description ,
value : settings [ key ]
} ) ) ;
settingsItems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Button" ,
color : BDFDB . LibraryComponents . Button . Colors . RED ,
label : "Reset all Folders" ,
onClick : _ => {
BDFDB . ModalUtils . confirm ( this , "Are you sure you want to reset all folders?" , _ => {
BDFDB . DataUtils . remove ( this , "folders" ) ;
} ) ;
} ,
children : BDFDB . LanguageUtils . LanguageStrings . RESET
} ) ) ;
settingsItems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Button" ,
color : BDFDB . LibraryComponents . Button . Colors . RED ,
label : "Remove all custom Icons" ,
onClick : _ => {
BDFDB . ModalUtils . confirm ( this , "Are you sure you want to remove all custom icons?" , _ => {
BDFDB . DataUtils . remove ( this , "customicons" ) ;
} ) ;
} ,
children : BDFDB . LanguageUtils . LanguageStrings . REMOVE
} ) ) ;
return settingsPanel = BDFDB . PluginUtils . createSettingsPanel ( this , settingsItems ) ;
2020-02-08 19:07:33 +01:00
}
2021-01-06 12:38:36 +01:00
onSettingsClosed ( ) {
2020-09-19 20:49:33 +02:00
if ( this . SettingsUpdated ) {
delete this . SettingsUpdated ;
folderStates = { } ;
this . forceUpdateAll ( ) ;
}
}
2021-01-06 12:38:36 +01:00
forceUpdateAll ( ) {
2020-09-19 20:49:33 +02:00
settings = BDFDB . DataUtils . get ( this , "settings" ) ;
folderConfigs = BDFDB . DataUtils . load ( this , "folders" ) ;
customIcons = BDFDB . DataUtils . load ( this , "customicons" ) ;
BDFDB . ReactUtils . forceUpdate ( folderGuildContent ) ;
BDFDB . PatchUtils . forceAllUpdates ( this ) ;
BDFDB . GuildUtils . rerenderAll ( ) ;
2019-10-08 19:12:48 +02:00
}
2020-02-08 19:07:33 +01:00
2020-09-19 20:49:33 +02:00
onGuildContextMenu ( e ) {
if ( document . querySelector ( BDFDB . dotCN . modalwrapper ) ) return ;
if ( e . instance . props . guild ) {
let folders = BDFDB . LibraryModules . FolderStore . guildFolders . filter ( n => n . folderId ) ;
let folder = BDFDB . GuildUtils . getFolder ( e . instance . props . guild . id ) ;
let unfolderedGuilds = BDFDB . LibraryModules . FolderStore . getSortedGuilds ( ) . filter ( n => ! n . folderId ) . map ( n => n . guilds [ 0 ] ) . filter ( n => n ) ;
let [ children , index ] = BDFDB . ContextMenuUtils . findItem ( e . returnvalue , { id : "devmode-copy-id" , group : true } ) ;
children . splice ( index > - 1 ? index : children . length , 0 , BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuGroup , {
children : BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
2020-12-21 19:56:36 +01:00
label : this . labels . servercontext _serverfolders ,
2020-09-19 20:49:33 +02:00
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "submenu-add" ) ,
children : folder ? [
BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
2020-12-21 19:56:36 +01:00
label : this . labels . serversubmenu _removefromfolder ,
2020-09-19 20:49:33 +02:00
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "remove-from-folder" ) ,
color : BDFDB . LibraryComponents . MenuItems . Colors . DANGER ,
2020-05-19 18:55:16 +02:00
action : _ => {
2020-09-19 20:49:33 +02:00
this . removeGuildFromFolder ( folder . folderId , e . instance . props . guild . id ) ;
2020-05-19 18:55:16 +02:00
}
2020-09-19 20:49:33 +02:00
} )
] : [
BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
2020-12-21 19:56:36 +01:00
label : this . labels . serversubmenu _createfolder ,
2020-09-19 20:49:33 +02:00
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "create-folder" ) ,
disabled : ! unfolderedGuilds . length ,
action : _ => {
this . openFolderCreationMenu ( unfolderedGuilds , e . instance . props . guild . id ) ;
}
} ) ,
BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
2020-12-21 19:56:36 +01:00
label : this . labels . serversubmenu _addtofolder ,
2020-09-19 20:49:33 +02:00
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "submenu-add-to-folder" ) ,
disabled : ! folders . length ,
children : folders . map ( ( folder , i ) => BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
label : folder . folderName || ` ${ BDFDB . LanguageUtils . LanguageStrings . SERVER _FOLDER _PLACEHOLDER } # ${ i + 1 } ` ,
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "add-to-folder" , i + 1 ) ,
action : _ => {
this . addGuildToFolder ( folder . folderId , e . instance . props . guild . id ) ;
}
} ) )
} )
]
} )
} ) ) ;
2019-10-08 19:12:48 +02:00
}
2020-09-19 20:49:33 +02:00
}
onGuildFolderContextMenu ( e ) {
if ( document . querySelector ( BDFDB . dotCN . modalwrapper ) ) return ;
if ( e . instance . props . target && e . instance . props . folderId ) {
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( e . instance . props . folderId ) ;
let data = this . getFolderConfig ( e . instance . props . folderId ) ;
let muted = data . muteFolder && folder . guildIds . every ( guildid => BDFDB . LibraryModules . MutedUtils . isGuildOrCategoryOrChannelMuted ( guildid ) ) ;
if ( data . muteFolder != muted ) {
data . muteFolder = muted ;
2020-05-20 14:40:43 +02:00
BDFDB . DataUtils . save ( data , this , "folders" , e . instance . props . folderId ) ;
2019-10-08 19:12:48 +02:00
}
2020-09-19 20:49:33 +02:00
let [ children , index ] = BDFDB . ContextMenuUtils . findItem ( e . returnvalue , { id : "mark-folder-read" } ) ;
children . splice ( index > - 1 ? index + 1 : children . length , 0 , BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuCheckboxItem , {
2020-12-21 19:56:36 +01:00
label : this . labels . foldercontext _autoreadfolder ,
2020-09-19 20:49:33 +02:00
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "auto-read-folder" ) ,
checked : data . autoRead ,
2020-05-20 14:40:43 +02:00
action : state => {
2020-09-19 20:49:33 +02:00
data . autoRead = state ;
2020-05-20 14:40:43 +02:00
BDFDB . DataUtils . save ( data , this , "folders" , e . instance . props . folderId ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
} ) ) ;
e . returnvalue . props . children . splice ( e . returnvalue . props . children . length - 1 , 0 , BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuGroup , {
children : BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuCheckboxItem , {
2020-12-21 19:56:36 +01:00
label : this . labels . foldercontext _mutefolder ,
2020-09-19 20:49:33 +02:00
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "mute-folder" ) ,
checked : muted ,
action : state => {
data . muteFolder = state ;
BDFDB . DataUtils . save ( data , this , "folders" , e . instance . props . folderId ) ;
2020-11-19 16:51:14 +01:00
for ( let guildId of folder . guildIds ) if ( BDFDB . LibraryModules . MutedUtils . isGuildOrCategoryOrChannelMuted ( guildId ) != state ) BDFDB . LibraryModules . GuildNotificationsUtils . updateGuildNotificationSettings ( guildId , { muted : state , suppress _everyone : state , suppress _roles : state } ) ;
2020-09-19 20:49:33 +02:00
}
} )
} ) ) ;
e . returnvalue . props . children . push ( BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuGroup , {
children : BDFDB . ContextMenuUtils . createItem ( BDFDB . LibraryComponents . MenuItems . MenuItem , {
2020-12-21 19:56:36 +01:00
label : this . labels . foldercontext _removefolder ,
2020-09-19 20:49:33 +02:00
id : BDFDB . ContextMenuUtils . createItemId ( this . name , "remove-folder" ) ,
color : BDFDB . LibraryComponents . MenuItems . Colors . DANGER ,
action : event => {
BDFDB . ModalUtils . confirm ( this , ` Are you sure you want to remove the folder ${ folder . folderName ? ` ' ${ folder . folderName } ' ` : "" } ? ` , _ => {
this . removeFolder ( e . instance . props . folderId ) ;
} ) ;
}
} )
} ) ) ;
}
2020-05-11 14:18:20 +02:00
}
2020-07-15 16:50:10 +02:00
2020-09-19 20:49:33 +02:00
processAppView ( e ) {
if ( settings . extraColumn ) {
let [ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : [ "FluxContainer(Guilds)" , "FluxContainer(NavigableGuilds)" ] } ) ;
if ( index > - 1 ) children . splice ( index + 1 , 0 , BDFDB . ReactUtils . createElement ( folderGuildContentComponent , {
themeOverride : children [ index ] . props . themeOverride
} , true ) ) ;
2020-07-15 16:50:10 +02:00
}
}
2020-09-19 20:49:33 +02:00
processGuilds ( e ) {
if ( settings . extraColumn ) {
2020-11-19 16:51:14 +01:00
let topBar = BDFDB . ReactUtils . findChild ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . guildswrapperunreadmentionsbartop ] ] } ) ;
2020-09-19 20:49:33 +02:00
if ( topBar ) {
let topIsVisible = topBar . props . isVisible ;
topBar . props . isVisible = ( ... args ) => {
let ids = BDFDB . LibraryModules . FolderStore . guildFolders . filter ( n => n . folderId ) . map ( n => n . guildIds ) . flat ( 10 ) ;
args [ 2 ] = args [ 2 ] . filter ( n => ! ids . includes ( n ) ) ;
return topIsVisible ( ... args ) ;
} ;
}
2020-11-19 16:51:14 +01:00
let bottomBar = BDFDB . ReactUtils . findChild ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . guildswrapperunreadmentionsbarbottom ] ] } ) ;
2020-09-19 20:49:33 +02:00
if ( bottomBar ) {
let bottomIsVisible = bottomBar . props . isVisible ;
bottomBar . props . isVisible = ( ... args ) => {
let ids = BDFDB . LibraryModules . FolderStore . guildFolders . filter ( n => n . folderId ) . map ( n => n . guildIds ) . flat ( 10 ) ;
args [ 2 ] = args [ 2 ] . filter ( n => ! ids . includes ( n ) ) ;
return bottomIsVisible ( ... args ) ;
} ;
}
2020-02-08 19:07:33 +01:00
}
2019-01-13 22:53:07 +01:00
}
2020-03-31 20:46:41 +02:00
2020-09-19 20:49:33 +02:00
processGuildFolder ( e ) {
let expandedFolders = BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ;
if ( expandedFolders . size ) BDFDB . DOMUtils . addClass ( document . body , BDFDB . disCN . _serverfoldersfoldercontentisopen ) ;
else BDFDB . DOMUtils . removeClassFromDOM ( BDFDB . disCN . _serverfoldersfoldercontentisopen ) ;
let data = this . getFolderConfig ( e . instance . props . folderId ) ;
2020-11-19 16:51:14 +01:00
if ( data . muteFolder ) for ( let guildId of e . instance . props . guildIds ) if ( ! BDFDB . LibraryModules . MutedUtils . isGuildOrCategoryOrChannelMuted ( guildId ) ) BDFDB . LibraryModules . GuildNotificationsUtils . updateGuildNotificationSettings ( guildId , { muted : true , suppress _everyone : true } ) ;
2020-09-19 20:49:33 +02:00
2020-02-08 19:07:33 +01:00
let state = this . getState ( e . instance ) ;
2020-09-19 20:49:33 +02:00
if ( folderStates [ e . instance . props . folderId ] && ! BDFDB . equals ( state , folderStates [ e . instance . props . folderId ] ) ) {
if ( data . autoRead && ( state . unread || state . badge > 0 ) ) {
BDFDB . TimeUtils . clear ( folderReads [ e . instance . props . folderId ] ) ;
folderReads [ e . instance . props . folderId ] = BDFDB . TimeUtils . timeout ( _ => {
BDFDB . GuildUtils . markAsRead ( e . instance . props . guildIds ) ;
} , 10000 ) ;
}
2020-02-08 19:07:33 +01:00
BDFDB . ReactUtils . forceUpdate ( folderGuildContent ) ;
}
2020-09-19 20:49:33 +02:00
folderStates [ e . instance . props . folderId ] = state ;
let [ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : "ListItemTooltip" } ) ;
if ( index > - 1 ) children [ index ] = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TooltipContainer , {
text : e . instance . props . folderName || BDFDB . FolderUtils . getDefaultName ( e . instance . props . folderId ) ,
tooltipConfig : {
type : "right" ,
list : true ,
offset : 12 ,
backgroundColor : data . color3 ,
fontColor : data . color4
} ,
children : children [ index ] . props . children
} ) ;
if ( e . instance . props . expanded || data . useCloseIcon ) {
let folderIcons = this . loadAllIcons ( ) , icontype = e . instance . props . expanded ? "openicon" : "closedicon" ;
let icon = folderIcons [ data . iconID ] ? ( ! folderIcons [ data . iconID ] . customID ? this . createBase64SVG ( folderIcons [ data . iconID ] [ icontype ] , data . color1 , data . color2 ) : folderIcons [ data . iconID ] [ icontype ] ) : null ;
if ( icon ) {
[ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : "FolderIcon" } ) ;
if ( index > - 1 ) children [ index ] = BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildfoldericonwrapper ,
style : { background : ` url( ${ icon } ) center/cover no-repeat ` }
} ) ;
}
}
if ( settings . showCountBadge ) {
2020-11-19 16:51:14 +01:00
[ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : "BlobMask" } ) ;
2020-09-19 20:49:33 +02:00
if ( index > - 1 ) {
children [ index ] . props . upperLeftBadgeWidth = BDFDB . LibraryComponents . Badges . getBadgeWidthForValue ( e . instance . props . guildIds . length ) ;
children [ index ] . props . upperLeftBadge = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Badges . NumberBadge , {
count : e . instance . props . guildIds . length ,
2020-12-16 16:35:56 +01:00
style : { backgroundColor : "var(--bdfdb-blurple)" }
2020-09-19 20:49:33 +02:00
} ) ;
}
}
if ( settings . extraColumn ) {
e . returnvalue . props . children [ 0 ] = null ;
e . returnvalue . props . children [ 2 ] = BDFDB . ReactUtils . createElement ( "div" , {
children : e . returnvalue . props . children [ 2 ] ,
style : { display : "none" }
2020-05-11 14:18:20 +02:00
} ) ;
}
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
processGuild ( e ) {
2020-02-08 19:07:33 +01:00
let folder = BDFDB . GuildUtils . getFolder ( e . instance . props . guild . id ) ;
2020-09-19 20:49:33 +02:00
if ( folder ) {
let state = this . getState ( e . instance ) ;
if ( guildStates [ e . instance . props . guild . id ] && ! BDFDB . equals ( state , guildStates [ e . instance . props . guild . id ] ) ) {
BDFDB . ReactUtils . forceUpdate ( folderGuildContent ) ;
}
guildStates [ e . instance . props . guild . id ] = state ;
if ( e . returnvalue ) {
let data = this . getFolderConfig ( folder . folderId ) ;
let [ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : [ "GuildTooltip" , "BDFDB_TooltipContainer" ] } ) ;
if ( index > - 1 ) children [ index ] = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TooltipContainer , {
tooltipConfig : Object . assign ( {
type : "right" ,
list : true ,
guild : e . instance . props . guild ,
offset : 12
} , data . copyTooltipColor && {
backgroundColor : data . color3 ,
fontColor : data . color4 ,
} ) ,
children : children [ index ] . props . children
} ) ;
}
}
if ( e . node ) BDFDB . ListenerUtils . add ( this , e . node , "click" , _ => { BDFDB . TimeUtils . timeout ( _ => {
let folder = BDFDB . GuildUtils . getFolder ( e . instance . props . guild . id ) ;
if ( settings . closeAllFolders ) for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( ! folder || openFolderId != folder . folderId || ! settings . forceOpenFolder ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
else if ( folder && settings . closeTheFolder && ! settings . forceOpenFolder && BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
} ) } ) ;
2019-11-28 10:18:29 +01:00
}
2020-09-19 20:49:33 +02:00
processGuildFolderSettingsModal ( e ) {
if ( e . node ) {
let root = e . node . parentElement . querySelector ( BDFDB . dotCN . layermodal ) ;
BDFDB . DOMUtils . addClass ( root , BDFDB . disCN . layermodalmedium , BDFDB . disCN . modalwrapper , ` ${ this . name } -modal ` ) ;
BDFDB . DOMUtils . removeClass ( root , BDFDB . disCN . layermodalsmall ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
if ( e . returnvalue ) {
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( e . instance . props . folderId ) ;
let data = this . getFolderConfig ( e . instance . props . folderId ) ;
let [ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : [ "ModalHeader" , "Header" ] } ) ;
if ( index > - 1 ) {
children [ index ] . props . className = BDFDB . DOMUtils . formatClassName ( children [ index ] . props . className , BDFDB . disCN . modalheaderhassibling ) ,
children . splice ( index + 1 , 0 , BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex , {
grow : 0 ,
shrink : 0 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Flex , {
className : BDFDB . disCN . tabbarcontainer ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TabBar , {
className : BDFDB . disCN . tabbar ,
itemClassName : BDFDB . disCN . tabbaritem ,
type : BDFDB . LibraryComponents . TabBar . Types . TOP ,
items : [
2020-12-21 19:56:36 +01:00
{ value : this . labels . modal _tabheader1 } ,
{ value : this . labels . modal _tabheader2 } ,
{ value : this . labels . modal _tabheader3 } ,
{ value : this . labels . modal _tabheader4 }
2020-09-19 20:49:33 +02:00
] ,
onItemSelect : ( value , instance ) => {
2020-11-19 16:51:14 +01:00
let tabContentInstances = BDFDB . ReactUtils . findOwner ( e . instance , { name : "BDFDB_ModalTabContent" , all : true , unlimited : true } ) ;
2020-09-19 20:49:33 +02:00
for ( let ins of tabContentInstances ) {
if ( ins . props . tab == value ) ins . props . open = true ;
else delete ins . props . open ;
}
BDFDB . ReactUtils . forceUpdate ( tabContentInstances ) ;
}
2020-02-08 19:07:33 +01:00
} )
2019-11-28 10:18:29 +01:00
} )
2020-09-19 20:49:33 +02:00
} ) ) ;
}
[ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : [ "ModalContent" , "Content" ] } ) ;
if ( index > - 1 ) children [ index ] . props . children = [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
2020-12-21 19:56:36 +01:00
tab : this . labels . modal _tabheader1 ,
2020-09-19 20:49:33 +02:00
open : true ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
title : BDFDB . LanguageUtils . LanguageStrings . GUILD _FOLDER _NAME ,
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TextInput , {
inputClassName : "input-foldername" ,
value : folder . folderName ,
placeholder : folder . folderName || BDFDB . LanguageUtils . LanguageStrings . SERVER _FOLDER _PLACEHOLDER ,
autoFocus : true
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : this . labels . modal _iconpicker ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( folderIconPickerComponent , {
selectedIcon : data . iconID
} , true )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
2020-10-14 21:08:41 +02:00
className : "input-usecloseicon" ,
margin : 20 ,
2020-12-21 19:56:36 +01:00
label : this . labels . modal _usecloseicon ,
2020-09-19 20:49:33 +02:00
tag : BDFDB . LibraryComponents . FormComponents . FormTitle . Tags . H5 ,
value : data . useCloseIcon
2020-02-08 19:07:33 +01:00
} )
2020-09-19 20:49:33 +02:00
]
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
2020-12-21 19:56:36 +01:00
tab : this . labels . modal _tabheader2 ,
2020-09-19 20:49:33 +02:00
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : this . labels . modal _colorpicker1 ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color1 ,
defaultFallback : ! data . color1 && ! data . swapColors ,
number : 1
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : this . labels . modal _colorpicker2 ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color2 ,
defaultFallback : ! data . color2 && data . swapColors ,
number : 2
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
2020-10-14 21:08:41 +02:00
className : "input-swapcolors" ,
margin : 20 ,
2020-12-21 19:56:36 +01:00
label : this . labels . modal _swapcolor ,
2020-09-19 20:49:33 +02:00
tag : BDFDB . LibraryComponents . FormComponents . FormTitle . Tags . H5 ,
value : data . swapColors
2020-02-08 19:07:33 +01:00
} )
2020-09-19 20:49:33 +02:00
]
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
2020-12-21 19:56:36 +01:00
tab : this . labels . modal _tabheader3 ,
2020-09-19 20:49:33 +02:00
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : this . labels . modal _colorpicker3 ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color3 ,
number : 3
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
2020-12-21 19:56:36 +01:00
title : this . labels . modal _colorpicker4 ,
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color4 ,
number : 4
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
2020-10-14 21:08:41 +02:00
className : "input-copytooltipcolor" ,
margin : 20 ,
2020-12-21 19:56:36 +01:00
label : this . labels . modal _copytooltipcolor ,
2020-09-19 20:49:33 +02:00
tag : BDFDB . LibraryComponents . FormComponents . FormTitle . Tags . H5 ,
value : data . copyTooltipColor
2020-02-08 19:07:33 +01:00
} )
2020-09-19 20:49:33 +02:00
]
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
2020-12-21 19:56:36 +01:00
tab : this . labels . modal _tabheader4 ,
2020-09-19 20:49:33 +02:00
children : BDFDB . ReactUtils . createElement ( folderIconCustomPreviewComponent , { } , true )
} )
] ;
[ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : [ "ModalFooter" , "Footer" ] } ) ;
if ( index > - 1 ) children [ index ] . props . children = [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Button , {
children : BDFDB . LanguageUtils . LanguageStrings . SAVE ,
onClick : event => {
let oldData = Object . assign ( { } , data ) ;
let root = BDFDB . ReactUtils . findDOMNode ( e . instance ) . parentElement . querySelector ( BDFDB . dotCN . layermodal ) ;
data . iconID = root . querySelector ( BDFDB . dotCN . _serverfoldersiconswatch + BDFDB . dotCN . _serverfoldersiconswatchselected ) . getAttribute ( "iconID" ) ;
2019-11-28 10:18:29 +01:00
2020-09-19 20:49:33 +02:00
data . useCloseIcon = root . querySelector ( ".input-usecloseicon " + BDFDB . dotCN . switchinner ) . checked ;
data . swapColors = root . querySelector ( ".input-swapcolors " + BDFDB . dotCN . switchinner ) . checked ;
data . copyTooltipColor = root . querySelector ( ".input-copytooltipcolor " + BDFDB . dotCN . switchinner ) . checked ;
data . color1 = BDFDB . ColorUtils . getSwatchColor ( root , 1 ) ;
data . color2 = BDFDB . ColorUtils . getSwatchColor ( root , 2 ) ;
data . color3 = BDFDB . ColorUtils . getSwatchColor ( root , 3 ) ;
data . color4 = BDFDB . ColorUtils . getSwatchColor ( root , 4 ) ;
let nativeColor = data . swapColors ? "color2" : "color1" ;
this . updateFolder ( {
folderId : e . instance . props . folderId ,
folderName : root . querySelector ( ".input-foldername" ) . value ,
folderColor : data [ nativeColor ] ? BDFDB . ColorUtils . convert ( data [ nativeColor ] && BDFDB . ObjectUtils . is ( data [ nativeColor ] ) ? data [ nativeColor ] [ Object . keys ( data [ nativeColor ] ) [ 0 ] ] : data [ nativeColor ] , "INT" ) : null
} ) ;
if ( ! BDFDB . equals ( oldData , data ) ) {
BDFDB . DataUtils . save ( data , this , "folders" , e . instance . props . folderId ) ;
this . forceUpdateAll ( ) ;
}
e . instance . close ( ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
} )
]
}
2020-02-08 19:07:33 +01:00
}
2019-01-26 22:45:19 +01:00
2021-01-06 12:38:36 +01:00
loadAllIcons ( ) {
2020-09-19 20:49:33 +02:00
let icons = { } ;
folderIcons . forEach ( ( array , i ) => {
icons [ i ] = {
openicon : array . openicon ,
closedicon : array . closedicon ,
customID : null
} ;
} ) ;
for ( let id in customIcons ) icons [ id ] = Object . assign ( { customID : id } , customIcons [ id ] ) ;
return icons ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
generateId ( prefix ) {
if ( prefix == "folder" ) {
let id = Math . floor ( Math . random ( ) * 4294967296 ) ;
return BDFDB . LibraryModules . FolderStore . guildFolders . every ( n => ! n . folderId || n . folderId != id ) ? id : this . generateId ( prefix ) ;
}
else {
let data = BDFDB . DataUtils . load ( this , prefix + "s" ) ;
let id = prefix + "_" + Math . round ( Math . random ( ) * 10000000000000000 ) ;
return data [ id ] ? this . generateId ( prefix ) : id ;
}
2020-02-08 19:07:33 +01:00
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
getState ( instance ) {
let state = { } ;
for ( let key in instance . props ) {
if ( typeof instance . props [ key ] != "object" && typeof instance . props [ key ] != "function" ) state [ key ] = instance . props [ key ] ;
else if ( Array . isArray ( instance . props [ key ] ) ) state [ key ] = instance . props [ key ] . length ;
}
return state ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
getFolderConfig ( folderId ) {
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( folderId ) || { } ;
let data = folderConfigs [ folderId ] || {
iconID : "-1" ,
muteFolder : false ,
autoRead : false ,
useCloseIcon : true ,
swapColors : false ,
copyTooltipColor : false ,
color1 : null ,
color2 : [ "255" , "255" , "255" ] ,
color3 : null ,
color4 : null
} ;
let nativeColor = data . swapColors ? "color2" : "color1" ;
if ( ! data [ nativeColor ] ) data [ nativeColor ] = BDFDB . ColorUtils . convert ( folder . folderColor , "RGBCOMP" ) ;
else if ( folder . folderColor && ! BDFDB . ColorUtils . compare ( folder . folderColor , BDFDB . ColorUtils . convert ( BDFDB . ObjectUtils . is ( data [ nativeColor ] ) ? data [ nativeColor ] [ Object . keys ( data [ nativeColor ] ) [ 0 ] ] : data [ nativeColor ] , "INT" ) ) ) {
data [ nativeColor ] = BDFDB . ColorUtils . convert ( folder . folderColor , "RGBCOMP" ) ;
BDFDB . DataUtils . save ( data , this , "folders" , folderId ) ;
}
folderConfigs [ folderId ] = data ;
return data ;
2020-02-08 19:07:33 +01:00
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
createBase64SVG ( paths , color1 = "#000000" , color2 = "#FFFFFF" ) {
if ( paths . indexOf ( "<path " ) != 0 ) return paths ;
let isGradient1 = color1 && BDFDB . ObjectUtils . is ( color1 ) ;
let isGradient2 = color2 && BDFDB . ObjectUtils . is ( color2 ) ;
let svg = ` <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1000" viewBox="-60 -50 1100 1100"> ` ;
if ( isGradient1 ) {
color1 = BDFDB . ColorUtils . convert ( color1 , "RGBA" ) ;
svg += ` <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> ` ;
for ( let pos of Object . keys ( color1 ) . sort ( ) ) svg += ` <stop offset=" ${ pos * 100 } %" style="stop-color: ${ color1 [ pos ] } ;"></stop> ` ;
svg += ` </linearGradient> ` ;
}
if ( isGradient2 ) {
color2 = BDFDB . ColorUtils . convert ( color2 , "RGBA" ) ;
svg += ` <linearGradient id="grad2" x1="0%" y1="0%" x2="100%" y2="0%"> ` ;
for ( let pos of Object . keys ( color2 ) . sort ( ) ) svg += ` <stop offset=" ${ pos * 100 } %" style="stop-color: ${ color2 [ pos ] } ;"></stop> ` ;
svg += ` </linearGradient> ` ;
}
svg += ` ${ paths . replace ( "REPLACE_FILL1" , isGradient1 ? "url(#grad1)" : BDFDB . ColorUtils . convert ( color1 , "RGBA" ) ) . replace ( "REPLACE_FILL2" , isGradient2 ? "url(#grad2)" : BDFDB . ColorUtils . convert ( color2 , "RGBA" ) ) } </svg> ` ;
2020-11-19 16:56:08 +01:00
return ` data:image/svg+xml;base64, ${ btoa ( svg ) } ` ;
2020-02-08 19:07:33 +01:00
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
openFolderCreationMenu ( guilds , initGuildId ) {
let targetedGuildIds = [ ] . concat ( initGuildId || [ ] ) ;
BDFDB . ModalUtils . open ( this , {
size : "MEDIUM" ,
2020-12-21 19:56:36 +01:00
header : this . labels . serversubmenu _createfolder ,
2020-09-19 20:49:33 +02:00
subheader : "" ,
contentClassName : BDFDB . disCN . listscroller ,
children : guilds . map ( ( guild , i ) => {
return [
i == 0 ? null : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormDivider , {
className : BDFDB . disCNS . margintop4 + BDFDB . disCN . marginbottom4
2020-02-08 19:07:33 +01:00
} ) ,
2020-09-19 20:49:33 +02:00
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ListRow , {
prefix : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . Guild , {
className : BDFDB . disCN . listavatar ,
guild : guild ,
menu : false ,
tooltip : false
} ) ,
label : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TextScroller , {
children : guild . name
} ) ,
suffix : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Switch , {
value : targetedGuildIds . includes ( guild . id ) ,
onChange : value => {
if ( value ) targetedGuildIds . push ( guild . id ) ;
else BDFDB . ArrayUtils . remove ( targetedGuildIds , guild . id , true ) ;
}
} )
2020-02-08 19:07:33 +01:00
} )
2020-09-19 20:49:33 +02:00
] ;
} ) . flat ( 10 ) . filter ( n => n ) ,
buttons : [ {
contents : BDFDB . LanguageUtils . LanguageStrings . DONE ,
color : "BRAND" ,
close : true ,
click : ( modal , instance ) => {
this . createFolder ( BDFDB . ArrayUtils . removeCopies ( targetedGuildIds ) ) ;
}
} ]
} ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
updateFolder ( folder ) {
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryModules . FolderStore . guildFolders ) , guildFolders = [ ] , guildPositions = [ ] ;
for ( let oldFolder of oldGuildFolders ) {
if ( oldFolder . folderId == folder . folderId ) guildFolders . push ( Object . assign ( { } , oldFolder , folder ) ) ;
else guildFolders . push ( oldFolder ) ;
}
for ( let folder of guildFolders ) for ( let fGuildId of folder . guildIds ) guildPositions . push ( fGuildId ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
}
createFolder ( guildIds ) {
if ( ! guildIds ) return ;
guildIds = [ guildIds ] . flat ( 10 ) ;
if ( ! guildIds . length ) return ;
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryModules . FolderStore . guildFolders ) , guildFolders = [ ] , guildPositions = [ ] , added = false ;
for ( let oldFolder of oldGuildFolders ) {
if ( ! oldFolder . folderId && guildIds . includes ( oldFolder . guildIds [ 0 ] ) ) {
if ( ! added ) {
added = true ;
guildFolders . push ( {
guildIds : guildIds ,
folderId : this . generateId ( "folder" )
} ) ;
}
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
else guildFolders . push ( oldFolder ) ;
2019-10-09 09:40:15 +02:00
}
2020-09-19 20:49:33 +02:00
for ( let folder of guildFolders ) for ( let fGuildId of folder . guildIds ) guildPositions . push ( fGuildId ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
2019-10-09 09:40:15 +02:00
}
2020-09-19 20:49:33 +02:00
removeFolder ( folderId ) {
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryModules . FolderStore . guildFolders ) , guildFolders = [ ] , guildPositions = [ ] ;
for ( let oldFolder of oldGuildFolders ) {
if ( oldFolder . folderId == folderId ) {
2020-11-19 16:51:14 +01:00
for ( let guildId of oldFolder . guildIds ) guildFolders . push ( { guildIds : [ guildId ] } ) ;
2020-09-19 20:49:33 +02:00
}
else guildFolders . push ( oldFolder ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
for ( let folder of guildFolders ) for ( let fGuildId of folder . guildIds ) guildPositions . push ( fGuildId ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
2019-10-08 19:12:48 +02:00
}
2020-09-19 20:49:33 +02:00
addGuildToFolder ( folderId , guildId ) {
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryModules . FolderStore . guildFolders ) , guildFolders = [ ] , guildPositions = [ ] ;
for ( let oldFolder of oldGuildFolders ) {
if ( oldFolder . folderId ) {
let newFolder = Object . assign ( { } , oldFolder ) ;
if ( oldFolder . folderId == folderId ) newFolder . guildIds . push ( guildId ) ;
else BDFDB . ArrayUtils . remove ( newFolder . guildIds , guildId ) ;
guildFolders . push ( newFolder ) ;
}
else if ( oldFolder . guildIds [ 0 ] != guildId ) guildFolders . push ( oldFolder ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
for ( let folder of guildFolders ) for ( let fGuildId of folder . guildIds ) guildPositions . push ( fGuildId ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
2019-10-08 19:12:48 +02:00
}
2020-09-19 20:49:33 +02:00
removeGuildFromFolder ( folderId , guildId ) {
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryModules . FolderStore . guildFolders ) , guildFolders = [ ] , guildPositions = [ ] ;
for ( let oldFolder of oldGuildFolders ) {
if ( oldFolder . folderId == folderId ) {
let newFolder = Object . assign ( { } , oldFolder ) ;
BDFDB . ArrayUtils . remove ( newFolder . guildIds , guildId ) ;
guildFolders . push ( newFolder ) ;
2020-11-19 16:51:14 +01:00
guildFolders . push ( { guildIds : [ guildId ] } ) ;
2020-09-19 20:49:33 +02:00
}
else guildFolders . push ( oldFolder ) ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
for ( let folder of guildFolders ) for ( let fGuildId of folder . guildIds ) guildPositions . push ( fGuildId ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
2019-10-08 19:12:48 +02:00
}
2019-09-04 12:34:02 +02:00
2020-09-19 20:49:33 +02:00
createDragPreview ( div , event ) {
if ( ! Node . prototype . isPrototypeOf ( div ) ) return ;
let dragpreview = div . cloneNode ( true ) ;
BDFDB . DOMUtils . addClass ( dragpreview , BDFDB . disCN . _serverfoldersdragpreview ) ;
BDFDB . DOMUtils . remove ( dragpreview . querySelector ( BDFDB . dotCNC . guildlowerbadge + BDFDB . dotCNC . guildupperbadge + BDFDB . dotCN . guildpillwrapper ) ) ;
BDFDB . DOMUtils . hide ( dragpreview ) ;
dragpreview . style . setProperty ( "pointer-events" , "none" , "important" ) ;
dragpreview . style . setProperty ( "left" , event . clientX - 25 + "px" , "important" ) ;
dragpreview . style . setProperty ( "top" , event . clientY - 25 + "px" , "important" ) ;
document . querySelector ( BDFDB . dotCN . appmount ) . appendChild ( dragpreview ) ;
return dragpreview ;
}
2019-01-26 22:45:19 +01:00
2020-09-19 20:49:33 +02:00
updateDragPreview ( dragpreview , event ) {
if ( ! Node . prototype . isPrototypeOf ( dragpreview ) ) return ;
BDFDB . DOMUtils . show ( dragpreview ) ;
dragpreview . style . setProperty ( "left" , event . clientX - 25 + "px" , "important" ) ;
dragpreview . style . setProperty ( "top" , event . clientY - 25 + "px" , "important" ) ;
2020-02-08 19:07:33 +01:00
}
2020-07-26 17:02:25 +02:00
2021-01-06 12:38:36 +01:00
setLabelsByLanguage ( ) {
2020-09-19 20:49:33 +02:00
switch ( BDFDB . LanguageUtils . getLanguage ( ) . id ) {
2020-12-21 19:56:36 +01:00
case "bg" : // Bulgarian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Авто: Маркиране като прочетено" ,
foldercontext _mutefolder : "Без звук папка" ,
foldercontext _removefolder : "Изтриване на папка" ,
modal _colorpicker1 : "Основен цвят на папката" ,
modal _colorpicker2 : "Вторичен цвят на папката" ,
modal _colorpicker3 : "Цвят на подсказка" ,
modal _colorpicker4 : "Цвят на шрифта" ,
modal _copytooltipcolor : "Използвайте един и същи цвят за всички сървъри в папка" ,
modal _customclosed : "Затворена икона" ,
modal _customopen : "Отворете иконата" ,
modal _custompreview : "Визуализация на иконата" ,
modal _iconpicker : "Избор на папка" ,
modal _swapcolor : "Използвайте втория цвят за оригиналната папка" ,
modal _tabheader1 : "Папка" ,
modal _tabheader2 : "Цвят на папката" ,
modal _tabheader3 : "Цвят на подсказка" ,
modal _tabheader4 : "Собствени символи" ,
modal _usecloseicon : "Използвайте затворена икона вместо минисервъра" ,
servercontext _serverfolders : "Папка на сървъра" ,
serversubmenu _addtofolder : "Добавете сървъра към папката" ,
serversubmenu _createfolder : "Създай папка" ,
serversubmenu _removefromfolder : "Премахнете сървъра от папката"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "da" : // Danish
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: Marker som læst" ,
foldercontext _mutefolder : "Dæmp mappe" ,
foldercontext _removefolder : "Slet mappe" ,
modal _colorpicker1 : "Primær mappefarve" ,
modal _colorpicker2 : "Sekundær mappefarve" ,
modal _colorpicker3 : "Værktøjstipfarve" ,
modal _colorpicker4 : "Skriftfarve" ,
modal _copytooltipcolor : "Brug den samme farve til alle servere i en mappe" ,
modal _customclosed : "Lukket ikon" ,
modal _customopen : "Åbn ikonet" ,
modal _custompreview : "Eksempel på ikon" ,
modal _iconpicker : "Mappevalg" ,
modal _swapcolor : "Brug den anden farve til den originale mappe" ,
modal _tabheader1 : "Folder" ,
modal _tabheader2 : "Mappefarve" ,
modal _tabheader3 : "Værktøjstipfarve" ,
modal _tabheader4 : "Egne symboler" ,
modal _usecloseicon : "Brug et lukket ikon i stedet for miniserver" ,
servercontext _serverfolders : "Servermappe" ,
serversubmenu _addtofolder : "Føj serveren til mappen" ,
serversubmenu _createfolder : "Opret mappe" ,
serversubmenu _removefromfolder : "Fjern serveren fra mappen"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "de" : // German
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: Als gelesen markieren" ,
foldercontext _mutefolder : "Ordner stummschalten" ,
foldercontext _removefolder : "Ordner löschen" ,
modal _colorpicker1 : "Primäre Ordnerfarbe" ,
modal _colorpicker2 : "Sekundäre Ordnerfarbe" ,
modal _colorpicker3 : "Tooltipfarbe" ,
modal _colorpicker4 : "Schriftfarbe" ,
modal _copytooltipcolor : "Dieselbe Farbe für alle Server eines Ordners verwenden" ,
modal _customclosed : "Geschlossenes Icon" ,
modal _customopen : "Geöffnetes Icon" ,
modal _custompreview : "Symbolvorschau" ,
modal _iconpicker : "Ordnerauswahl" ,
modal _swapcolor : "Die zweite Farbe für den ursprünglichen Ordner verwenden" ,
modal _tabheader1 : "Ordner" ,
modal _tabheader2 : "Ordnerfarbe" ,
modal _tabheader3 : "Tooltipfarbe" ,
modal _tabheader4 : "Eigene Symbole" ,
modal _usecloseicon : "Anstelle der Miniserver ein geschlossenes Symbol verwenden" ,
servercontext _serverfolders : "Serverordner" ,
serversubmenu _addtofolder : "Server zum Ordner hinzufügen" ,
serversubmenu _createfolder : "Ordner erzeugen" ,
serversubmenu _removefromfolder : "Server aus Ordner entfernen"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "el" : // Greek
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Αυτόματο: Επισήμανση ως αναγνωσμένου" ,
foldercontext _mutefolder : "Σίγαση φακέλου" ,
foldercontext _removefolder : "Διαγραφή φακέλου" ,
modal _colorpicker1 : "Κύριο χρώμα φακέλου" ,
modal _colorpicker2 : "Χρώμα δευτερεύοντος φακέλου" ,
modal _colorpicker3 : "Χρώμα επεξήγησης εργαλείου" ,
modal _colorpicker4 : "Χρώμα γραμματοσειράς" ,
modal _copytooltipcolor : "Χρησιμοποιήστε το ίδιο χρώμα γ ι α όλους τους διακομιστές σε ένα φάκελο" ,
modal _customclosed : "Κλειστό εικονίδιο" ,
modal _customopen : "Άνοιγμα εικονιδίου" ,
modal _custompreview : "Προεπισκόπηση εικονιδίου" ,
modal _iconpicker : "Επιλογή φακέλου" ,
modal _swapcolor : "Χρησιμοποιήστε το δεύτερο χρώμα γ ι α τον αρχικό φάκελο" ,
modal _tabheader1 : "Ντοσιέ" ,
modal _tabheader2 : "Χρώμα φακέλου" ,
modal _tabheader3 : "Χρώμα επεξήγησης εργαλείου" ,
modal _tabheader4 : "Ίδια σύμβολα" ,
modal _usecloseicon : "Χρησιμοποιήστε ένα κλειστό εικονίδιο αντί γ ι α το miniserver" ,
servercontext _serverfolders : "Φάκελος διακομιστή" ,
serversubmenu _addtofolder : "Προσθέστε το διακομιστή στο φάκελο" ,
serversubmenu _createfolder : "ΔΗΜΙΟΥΡΓΩ φακελο" ,
serversubmenu _removefromfolder : "Κατάργηση διακομιστή από φάκελο"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "es" : // Spanish
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Automático: marcar como leído" ,
foldercontext _mutefolder : "Silenciar carpeta" ,
foldercontext _removefolder : "Eliminar carpeta" ,
modal _colorpicker1 : "Color de carpeta principal" ,
modal _colorpicker2 : "Color de carpeta secundaria" ,
modal _colorpicker3 : "Color de la información sobre herramientas" ,
modal _colorpicker4 : "Color de fuente" ,
modal _copytooltipcolor : "Use el mismo color para todos los servidores de una carpeta" ,
modal _customclosed : "Icono cerrado" ,
modal _customopen : "Abrir icono" ,
modal _custompreview : "Vista previa del icono" ,
modal _iconpicker : "Selección de carpeta" ,
modal _swapcolor : "Use el segundo color para la carpeta original" ,
modal _tabheader1 : "Carpeta" ,
modal _tabheader2 : "Color de la carpeta" ,
modal _tabheader3 : "Color de la información sobre herramientas" ,
modal _tabheader4 : "Símbolos propios" ,
modal _usecloseicon : "Use un icono cerrado en lugar del miniserver" ,
servercontext _serverfolders : "Carpeta del servidor" ,
serversubmenu _addtofolder : "Agrega el servidor a la carpeta" ,
serversubmenu _createfolder : "Crear carpeta" ,
serversubmenu _removefromfolder : "Quitar servidor de carpeta"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "fi" : // Finnish
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Automaattinen: Merkitse luetuksi" ,
foldercontext _mutefolder : "Mykistä kansio" ,
foldercontext _removefolder : "Poista kansio" ,
modal _colorpicker1 : "Ensisijaisen kansion väri" ,
modal _colorpicker2 : "Toissijaisen kansion väri" ,
modal _colorpicker3 : "Työkaluvinkin väri" ,
modal _colorpicker4 : "Fontin väri" ,
modal _copytooltipcolor : "Käytä samaa väriä kaikille kansion palvelimille" ,
modal _customclosed : "Suljettu kuvake" ,
modal _customopen : "Avaa kuvake" ,
modal _custompreview : "Kuvakkeen esikatselu" ,
modal _iconpicker : "Kansion valinta" ,
modal _swapcolor : "Käytä alkuperäisen kansion toista väriä" ,
modal _tabheader1 : "Kansio" ,
modal _tabheader2 : "Kansion väri" ,
modal _tabheader3 : "Työkaluvinkin väri" ,
modal _tabheader4 : "Omat symbolit" ,
modal _usecloseicon : "Käytä suljetun kuvaketta minipalvelimen sijaan" ,
servercontext _serverfolders : "Palvelinkansio" ,
serversubmenu _addtofolder : "Lisää palvelin kansioon" ,
serversubmenu _createfolder : "Luo kansio" ,
serversubmenu _removefromfolder : "Poista palvelin kansiosta"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "fr" : // French
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: marquer comme lu" ,
foldercontext _mutefolder : "Dossier muet" ,
foldercontext _removefolder : "Supprimer le dossier" ,
modal _colorpicker1 : "Couleur du dossier primaire" ,
modal _colorpicker2 : "Couleur du dossier secondaire" ,
modal _colorpicker3 : "Couleur de l'info-bulle" ,
modal _colorpicker4 : "Couleur de la police" ,
modal _copytooltipcolor : "Utilisez la même couleur pour tous les serveurs d'un dossier" ,
modal _customclosed : "Icône fermée" ,
modal _customopen : "Icône ouverte" ,
modal _custompreview : "Aperçu de l'icône" ,
modal _iconpicker : "Sélection de dossier" ,
modal _swapcolor : "Utilisez la deuxième couleur pour le dossier d'origine" ,
modal _tabheader1 : "Dossier" ,
modal _tabheader2 : "Couleur du dossier" ,
modal _tabheader3 : "Couleur de l'info-bulle" ,
modal _tabheader4 : "Propres symboles" ,
modal _usecloseicon : "Utilisez une icône fermée au lieu du miniserver" ,
servercontext _serverfolders : "Dossier du serveur" ,
serversubmenu _addtofolder : "Ajouter le serveur au dossier" ,
serversubmenu _createfolder : "Créer le dossier" ,
serversubmenu _removefromfolder : "Supprimer le serveur du dossier"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "hr" : // Croatian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Automatski: Označi kao pročitano" ,
foldercontext _mutefolder : "Isključi mapu" ,
foldercontext _removefolder : "Izbriši mapu" ,
modal _colorpicker1 : "Boja primarne mape" ,
modal _colorpicker2 : "Boja sekundarne mape" ,
modal _colorpicker3 : "Boja opisa" ,
modal _colorpicker4 : "Boja fonta" ,
modal _copytooltipcolor : "Koristite istu boju za sve poslužitelje u mapi" ,
modal _customclosed : "Zatvorena ikona" ,
modal _customopen : "Otvori ikonu" ,
modal _custompreview : "Pregled ikone" ,
modal _iconpicker : "Odabir mape" ,
modal _swapcolor : "Upotrijebite drugu boju za izvornu mapu" ,
modal _tabheader1 : "Mapu" ,
modal _tabheader2 : "Boja mape" ,
modal _tabheader3 : "Boja opisa" ,
modal _tabheader4 : "Vlastiti simboli" ,
modal _usecloseicon : "Upotrijebite zatvorenu ikonu umjesto miniservera" ,
servercontext _serverfolders : "Mapa poslužitelja" ,
serversubmenu _addtofolder : "Dodajte poslužitelj u mapu" ,
serversubmenu _createfolder : "Stvori mapu" ,
serversubmenu _removefromfolder : "Uklonite poslužitelj iz mape"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "hu" : // Hungarian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Automatikus: Megjelölés olvasottként" ,
foldercontext _mutefolder : "Mappa némítása" ,
foldercontext _removefolder : "Mappa törlése" ,
modal _colorpicker1 : "Elsődleges mappa színe" ,
modal _colorpicker2 : "Másodlagos mappa színe" ,
modal _colorpicker3 : "Eszköztár színe" ,
modal _colorpicker4 : "Betű szín" ,
modal _copytooltipcolor : "Használja ugyanazt a színt egy mappa összes kiszolgálójához" ,
modal _customclosed : "Zárt ikonra" ,
modal _customopen : "Megnyitás ikonra" ,
modal _custompreview : "Ikon előnézet" ,
modal _iconpicker : "Mappa kiválasztása" ,
modal _swapcolor : "Használja az eredeti mappa második színét" ,
modal _tabheader1 : "Mappába" ,
modal _tabheader2 : "Mappa színe" ,
modal _tabheader3 : "Eszköztár színe" ,
modal _tabheader4 : "Saját szimbólumok" ,
modal _usecloseicon : "Használjon zárt ikont a miniszerver helyett" ,
servercontext _serverfolders : "Szerver mappa" ,
serversubmenu _addtofolder : "Adja hozzá a szervert a mappához" ,
serversubmenu _createfolder : "Mappa létrehozás" ,
serversubmenu _removefromfolder : "Távolítsa el a szervert a mappából"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "it" : // Italian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: contrassegna come letto" ,
foldercontext _mutefolder : "Disattiva cartella" ,
foldercontext _removefolder : "Elimina cartella" ,
modal _colorpicker1 : "Colore cartella principale" ,
modal _colorpicker2 : "Colore cartella secondaria" ,
modal _colorpicker3 : "Colore della descrizione comando" ,
modal _colorpicker4 : "Colore del carattere" ,
modal _copytooltipcolor : "Usa lo stesso colore per tutti i server in una cartella" ,
modal _customclosed : "Icona chiusa" ,
modal _customopen : "Icona Apri" ,
modal _custompreview : "Anteprima icona" ,
modal _iconpicker : "Selezione della cartella" ,
modal _swapcolor : "Usa il secondo colore per la cartella originale" ,
modal _tabheader1 : "Cartella" ,
modal _tabheader2 : "Colore cartella" ,
modal _tabheader3 : "Colore della descrizione comando" ,
modal _tabheader4 : "Simboli propri" ,
modal _usecloseicon : "Utilizza un'icona chiusa al posto del miniserver" ,
servercontext _serverfolders : "Cartella del server" ,
serversubmenu _addtofolder : "Aggiungi il server alla cartella" ,
serversubmenu _createfolder : "Creare una cartella" ,
serversubmenu _removefromfolder : "Rimuovi il server dalla cartella"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "ja" : // Japanese
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "自動:既読としてマーク" ,
foldercontext _mutefolder : "ミュートフォルダ" ,
foldercontext _removefolder : "フォルダを削除" ,
modal _colorpicker1 : "プライマリフォルダの色" ,
modal _colorpicker2 : "セカンダリフォルダの色" ,
modal _colorpicker3 : "ツールチップの色" ,
modal _colorpicker4 : "フォントの色" ,
modal _copytooltipcolor : "フォルダ内のすべてのサーバーに同じ色を使用する" ,
modal _customclosed : "閉じたアイコン" ,
modal _customopen : "アイコンを開く" ,
modal _custompreview : "アイコンプレビュー" ,
modal _iconpicker : "フォルダの選択" ,
modal _swapcolor : "元のフォルダに2番目の色を使用します" ,
modal _tabheader1 : "フォルダ" ,
modal _tabheader2 : "フォルダーの色" ,
modal _tabheader3 : "ツールチップの色" ,
modal _tabheader4 : "独自のシンボル" ,
modal _usecloseicon : "ミニサーバーの代わりに閉じたアイコンを使用する" ,
servercontext _serverfolders : "サーバーフォルダ" ,
serversubmenu _addtofolder : "サーバーをフォルダーに追加します" ,
serversubmenu _createfolder : "フォルダーを作る" ,
serversubmenu _removefromfolder : "フォルダからサーバーを削除します"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "ko" : // Korean
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "자동 : 읽은 상태로 표시" ,
foldercontext _mutefolder : "폴더 음소거" ,
foldercontext _removefolder : "폴더 삭제" ,
modal _colorpicker1 : "기본 폴더 색상" ,
modal _colorpicker2 : "보조 폴더 색상" ,
modal _colorpicker3 : "툴팁 색상" ,
modal _colorpicker4 : "글자 색" ,
modal _copytooltipcolor : "폴더의 모든 서버에 동일한 색상 사용" ,
modal _customclosed : "닫힌 아이콘" ,
modal _customopen : "열기 아이콘" ,
modal _custompreview : "아이콘 미리보기" ,
modal _iconpicker : "폴더 선택" ,
modal _swapcolor : "원본 폴더에 두 번째 색상 사용" ,
modal _tabheader1 : "폴더" ,
modal _tabheader2 : "폴더 색상" ,
modal _tabheader3 : "툴팁 색상" ,
modal _tabheader4 : "자신의 기호" ,
modal _usecloseicon : "미니 서버 대신 닫힌 아이콘 사용" ,
servercontext _serverfolders : "서버 폴더" ,
serversubmenu _addtofolder : "폴더에 서버 추가" ,
serversubmenu _createfolder : "폴더 생성" ,
serversubmenu _removefromfolder : "폴더에서 서버 제거"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "lt" : // Lithuanian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Automatinis: pažymėti kaip perskaitytą" ,
foldercontext _mutefolder : "Nutildyti aplanką" ,
foldercontext _removefolder : "Ištrinti aplanką" ,
modal _colorpicker1 : "Pagrindinio aplanko spalva" ,
modal _colorpicker2 : "Antrinio aplanko spalva" ,
modal _colorpicker3 : "Patarimo spalva" ,
modal _colorpicker4 : "Šrifto spalva" ,
modal _copytooltipcolor : "Naudokite tą pačią spalvą visiems aplanko serveriams" ,
modal _customclosed : "Uždaryta piktograma" ,
modal _customopen : "Atidaryti piktogramą" ,
modal _custompreview : "Piktogramos peržiūra" ,
modal _iconpicker : "Aplanko pasirinkimas" ,
modal _swapcolor : "Originalo aplankui naudokite antrą spalvą" ,
modal _tabheader1 : "Aplanką" ,
modal _tabheader2 : "Aplanko spalva" ,
modal _tabheader3 : "Patarimo spalva" ,
modal _tabheader4 : "Savo simbolius" ,
modal _usecloseicon : "Vietoj miniserverio naudokite uždarą piktogramą" ,
servercontext _serverfolders : "Serverio aplankas" ,
serversubmenu _addtofolder : "Pridėkite serverį prie aplanko" ,
serversubmenu _createfolder : "Sukurti aplanką" ,
serversubmenu _removefromfolder : "Pašalinti serverį iš aplanko"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "nl" : // Dutch
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: Markeer als gelezen" ,
foldercontext _mutefolder : "Mute map" ,
foldercontext _removefolder : "Verwijder map" ,
modal _colorpicker1 : "Kleur primaire map" ,
modal _colorpicker2 : "Kleur secundaire map" ,
modal _colorpicker3 : "Tooltipkleur" ,
modal _colorpicker4 : "Letterkleur" ,
modal _copytooltipcolor : "Gebruik dezelfde kleur voor alle servers in een map" ,
modal _customclosed : "Gesloten pictogram" ,
modal _customopen : "Open icoon" ,
modal _custompreview : "Pictogramvoorbeeld" ,
modal _iconpicker : "Map selecteren" ,
modal _swapcolor : "Gebruik de tweede kleur voor de originele map" ,
modal _tabheader1 : "Map" ,
modal _tabheader2 : "Mapkleur" ,
modal _tabheader3 : "Tooltipkleur" ,
modal _tabheader4 : "Eigen symbolen" ,
modal _usecloseicon : "Gebruik een gesloten pictogram in plaats van de miniserver" ,
servercontext _serverfolders : "Servermap" ,
serversubmenu _addtofolder : "Voeg de server toe aan de map" ,
serversubmenu _createfolder : "Map aanmaken" ,
serversubmenu _removefromfolder : "Verwijder de server uit de map"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "no" : // Norwegian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: Merk som lest" ,
foldercontext _mutefolder : "Demp mappe" ,
foldercontext _removefolder : "Slett mappe" ,
modal _colorpicker1 : "Primær mappefarge" ,
modal _colorpicker2 : "Sekundær mappefarge" ,
modal _colorpicker3 : "Verktøytipsfarge" ,
modal _colorpicker4 : "Skriftfarge" ,
modal _copytooltipcolor : "Bruk samme farge for alle servere i en mappe" ,
modal _customclosed : "Lukket ikon" ,
modal _customopen : "Åpne ikonet" ,
modal _custompreview : "Forhåndsvisning av ikon" ,
modal _iconpicker : "Mappevalg" ,
modal _swapcolor : "Bruk den andre fargen for den originale mappen" ,
modal _tabheader1 : "Mappe" ,
modal _tabheader2 : "Mappefarge" ,
modal _tabheader3 : "Verktøytipsfarge" ,
modal _tabheader4 : "Egne symboler" ,
modal _usecloseicon : "Bruk et lukket ikon i stedet for miniserver" ,
servercontext _serverfolders : "Servermappe" ,
serversubmenu _addtofolder : "Legg til serveren i mappen" ,
serversubmenu _createfolder : "Lag mappe" ,
serversubmenu _removefromfolder : "Fjern serveren fra mappen"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "pl" : // Polish
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: oznacz jako przeczytane" ,
foldercontext _mutefolder : "Wycisz folder" ,
foldercontext _removefolder : "Usunięty folder" ,
modal _colorpicker1 : "Główny kolor folderu" ,
modal _colorpicker2 : "Kolor folderu dodatkowego" ,
modal _colorpicker3 : "Kolor podpowiedzi" ,
modal _colorpicker4 : "Kolor czcionki" ,
modal _copytooltipcolor : "Użyj tego samego koloru dla wszystkich serwerów w folderze" ,
modal _customclosed : "Ikona zamknięta" ,
modal _customopen : "Otwórz ikonę" ,
modal _custompreview : "Podgląd ikon" ,
modal _iconpicker : "Wybór folderu" ,
modal _swapcolor : "Użyj drugiego koloru dla oryginalnego folderu" ,
modal _tabheader1 : "Teczka" ,
modal _tabheader2 : "Kolor folderu" ,
modal _tabheader3 : "Kolor podpowiedzi" ,
modal _tabheader4 : "Własne symbole" ,
modal _usecloseicon : "Użyj zamkniętej ikony zamiast miniserwera" ,
servercontext _serverfolders : "Folder serwera" ,
serversubmenu _addtofolder : "Dodaj serwer do folderu" ,
serversubmenu _createfolder : "Utwórz folder" ,
serversubmenu _removefromfolder : "Usuń serwer z folderu"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "pt-BR" : // Portuguese (Brazil)
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: Marcar como lido" ,
foldercontext _mutefolder : "Pasta sem som" ,
foldercontext _removefolder : "Excluir pasta" ,
modal _colorpicker1 : "Cor da pasta primária" ,
modal _colorpicker2 : "Cor secundária da pasta" ,
modal _colorpicker3 : "Cor da dica de ferramenta" ,
modal _colorpicker4 : "Cor da fonte" ,
modal _copytooltipcolor : "Use a mesma cor para todos os servidores em uma pasta" ,
modal _customclosed : "Ícone fechado" ,
modal _customopen : "Ícone aberto" ,
modal _custompreview : "Antevisão do ícone" ,
modal _iconpicker : "Seleção de pasta" ,
modal _swapcolor : "Use a segunda cor para a pasta original" ,
modal _tabheader1 : "Pasta" ,
modal _tabheader2 : "Cor da pasta" ,
modal _tabheader3 : "Cor da dica de ferramenta" ,
modal _tabheader4 : "Símbolos próprios" ,
modal _usecloseicon : "Use um ícone fechado em vez do miniserver" ,
servercontext _serverfolders : "Pasta do servidor" ,
serversubmenu _addtofolder : "Adicione o servidor à pasta" ,
serversubmenu _createfolder : "Criar pasta" ,
serversubmenu _removefromfolder : "Remover servidor da pasta"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "ro" : // Romanian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Automat: marcați ca citit" ,
foldercontext _mutefolder : "Dezactivați folderul" ,
foldercontext _removefolder : "Ștergeți folderul" ,
modal _colorpicker1 : "Culoarea folderului principal" ,
modal _colorpicker2 : "Culoare dosar secundar" ,
modal _colorpicker3 : "Culoarea sfatului de instrumente" ,
modal _colorpicker4 : "Culoarea fontului" ,
modal _copytooltipcolor : "Utilizați aceeași culoare pentru toate serverele dintr-un folder" ,
modal _customclosed : "Pictogramă închisă" ,
modal _customopen : "Pictogramă Deschidere" ,
modal _custompreview : "Previzualizare pictogramă" ,
modal _iconpicker : "Selectarea dosarelor" ,
modal _swapcolor : "Utilizați a doua culoare pentru folderul original" ,
modal _tabheader1 : "Pliant" ,
modal _tabheader2 : "Culoare dosar" ,
modal _tabheader3 : "Culoarea sfatului de instrumente" ,
modal _tabheader4 : "Simboluri proprii" ,
modal _usecloseicon : "Folosiți o pictogramă închisă în locul miniserverului" ,
servercontext _serverfolders : "Dosar server" ,
serversubmenu _addtofolder : "Adăugați serverul în dosar" ,
serversubmenu _createfolder : "Creeaza dosar" ,
serversubmenu _removefromfolder : "Eliminați serverul din dosar"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "ru" : // Russian
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Авто: Отметить как прочитанное" ,
foldercontext _mutefolder : "Отключить папку" ,
foldercontext _removefolder : "Удалить папку" ,
modal _colorpicker1 : "Цвет основной папки" ,
modal _colorpicker2 : "Цвет вторичной папки" ,
modal _colorpicker3 : "Цвет всплывающей подсказки" ,
modal _colorpicker4 : "Цвет шрифта" ,
modal _copytooltipcolor : "Используйте один цвет для всех серверов в папке" ,
modal _customclosed : "Закрытый значок" ,
modal _customopen : "Открыть значок" ,
modal _custompreview : "Предварительный просмотр значков" ,
modal _iconpicker : "Выбор папки" ,
modal _swapcolor : "Используйте второй цвет для исходной папки" ,
modal _tabheader1 : "Папка" ,
modal _tabheader2 : "Цвет папки" ,
modal _tabheader3 : "Цвет всплывающей подсказки" ,
modal _tabheader4 : "Собственные символы" ,
modal _usecloseicon : "Используйте закрытый значок вместо минисервера" ,
servercontext _serverfolders : "Папка сервера" ,
serversubmenu _addtofolder : "Добавьте сервер в папку" ,
serversubmenu _createfolder : "Создать папку" ,
serversubmenu _removefromfolder : "Удалить сервер из папки"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "sv" : // Swedish
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "Auto: Markera som läst" ,
foldercontext _mutefolder : "Tyst mapp" ,
foldercontext _removefolder : "Ta bort mapp" ,
modal _colorpicker1 : "Primär mappfärg" ,
modal _colorpicker2 : "Sekundär mappfärg" ,
modal _colorpicker3 : "Verktygstipsfärg" ,
modal _colorpicker4 : "Fontfärg" ,
modal _copytooltipcolor : "Använd samma färg för alla servrar i en mapp" ,
modal _customclosed : "Stängd ikon" ,
modal _customopen : "Öppna ikonen" ,
modal _custompreview : "Ikonförhandsvisning" ,
modal _iconpicker : "Mappval" ,
modal _swapcolor : "Använd den andra färgen för den ursprungliga mappen" ,
modal _tabheader1 : "Mapp" ,
modal _tabheader2 : "Mappfärg" ,
modal _tabheader3 : "Verktygstipsfärg" ,
modal _tabheader4 : "Egna symboler" ,
modal _usecloseicon : "Använd en stängd ikon istället för miniserver" ,
servercontext _serverfolders : "Servermapp" ,
serversubmenu _addtofolder : "Lägg till servern i mappen" ,
serversubmenu _createfolder : "Skapa mapp" ,
serversubmenu _removefromfolder : "Ta bort servern från mappen"
2020-09-19 20:49:33 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "th" : // Thai
2020-09-19 20:49:33 +02:00
return {
2020-12-21 19:56:36 +01:00
foldercontext _autoreadfolder : "อัตโนมัติ: ทำเครื่องหมายว่าอ่านแล้ว" ,
foldercontext _mutefolder : "ปิดเสียงโฟลเดอร์" ,
foldercontext _removefolder : "ลบโฟลเดอร์" ,
modal _colorpicker1 : "สีโฟลเดอร์หลัก" ,
modal _colorpicker2 : "สีโฟลเดอร์รอง" ,
modal _colorpicker3 : "สีคำแนะนำเครื่องมือ" ,
modal _colorpicker4 : "สีตัวอักษร" ,
modal _copytooltipcolor : "ใช้สีเดียวกันสำหรับเซิร์ฟเวอร์ทั้งหมดในโฟลเดอร์" ,
modal _customclosed : "ไอคอนปิด" ,
modal _customopen : "เปิดไอคอน" ,
modal _custompreview : "ดูตัวอย่างไอคอน" ,
modal _iconpicker : "การเลือกโฟลเดอร์" ,
modal _swapcolor : "ใช้สีที่สองสำหรับโฟลเดอร์เดิม" ,
modal _tabheader1 : "โฟลเดอร์" ,
modal _tabheader2 : "สีโฟลเดอร์" ,
modal _tabheader3 : "สีคำแนะนำเครื่องมือ" ,
modal _tabheader4 : "สัญลักษณ์ของตัวเอง" ,
modal _usecloseicon : "ใช้ไอคอนปิดแทน miniserver" ,
servercontext _serverfolders : "โฟลเดอร์เซิร์ฟเวอร์" ,
serversubmenu _addtofolder : "เพิ่มเซิร์ฟเวอร์ลงในโฟลเดอร์" ,
serversubmenu _createfolder : "สร้างโฟลเดอร์" ,
serversubmenu _removefromfolder : "ลบเซิร์ฟเวอร์ออกจากโฟลเดอร์"
} ;
case "tr" : // Turkish
return {
foldercontext _autoreadfolder : "Otomatik: Okundu olarak işaretle" ,
foldercontext _mutefolder : "Klasörü sessize al" ,
foldercontext _removefolder : "Klasörü sil" ,
modal _colorpicker1 : "Birincil klasör rengi" ,
modal _colorpicker2 : "İkincil klasör rengi" ,
modal _colorpicker3 : "Araç ipucu rengi" ,
modal _colorpicker4 : "Yazı rengi" ,
modal _copytooltipcolor : "Bir klasördeki tüm sunucular için aynı rengi kullanı n" ,
modal _customclosed : "Kapalı simge" ,
modal _customopen : "Aç simgesi" ,
modal _custompreview : "Simge önizlemesi" ,
modal _iconpicker : "Klasör seçimi" ,
modal _swapcolor : "Orijinal klasör için ikinci rengi kullanı n" ,
modal _tabheader1 : "Klasör" ,
modal _tabheader2 : "Klasör rengi" ,
modal _tabheader3 : "Araç ipucu rengi" ,
modal _tabheader4 : "Kendi sembolleri" ,
modal _usecloseicon : "Miniserver yerine kapalı bir simge kullanı n" ,
servercontext _serverfolders : "Sunucu klasörü" ,
serversubmenu _addtofolder : "Sunucuyu klasöre ekleyin" ,
serversubmenu _createfolder : "Klasör oluşturun" ,
serversubmenu _removefromfolder : "Sunucuyu klasörden kaldı r"
} ;
case "uk" : // Ukrainian
return {
foldercontext _autoreadfolder : "Авто: Позначити як прочитане" ,
foldercontext _mutefolder : "Вимкнути папку" ,
foldercontext _removefolder : "Видалити папку" ,
modal _colorpicker1 : "Основний колір папки" ,
modal _colorpicker2 : "Колір вторинної папки" ,
modal _colorpicker3 : "Колір підказки" ,
modal _colorpicker4 : "Колір шрифту" ,
modal _copytooltipcolor : "Використовуйте однаковий колір для всіх серверів у папці" ,
modal _customclosed : "Закритий значок" ,
modal _customopen : "Відкрити значок" ,
modal _custompreview : "Попередній перегляд піктограми" ,
modal _iconpicker : "Вибір папки" ,
modal _swapcolor : "Використовуйте другий колір для вихідної папки" ,
modal _tabheader1 : "Папку" ,
modal _tabheader2 : "Колір папки" ,
modal _tabheader3 : "Колір підказки" ,
modal _tabheader4 : "Власні символи" ,
modal _usecloseicon : "Використовуйте закритий значок замість мінісервера" ,
servercontext _serverfolders : "Папка сервера" ,
serversubmenu _addtofolder : "Додайте сервер до папки" ,
serversubmenu _createfolder : "Створити папку" ,
serversubmenu _removefromfolder : "Видалити сервер з папки"
} ;
case "vi" : // Vietnamese
return {
foldercontext _autoreadfolder : "Tự động: Đánh dấu là đã đọc" ,
foldercontext _mutefolder : "Thư mục ẩn" ,
foldercontext _removefolder : "Xóa thư mục" ,
modal _colorpicker1 : "Màu thư mục chính" ,
modal _colorpicker2 : "Màu thư mục phụ" ,
modal _colorpicker3 : "Màu chú giải công cụ" ,
modal _colorpicker4 : "Màu phông chữ" ,
modal _copytooltipcolor : "Sử dụng cùng một màu cho tất cả các máy chủ trong một thư mục" ,
modal _customclosed : "Biểu tượng đã đóng" ,
modal _customopen : "Mở biểu tượng" ,
modal _custompreview : "Xem trước biểu tượng" ,
modal _iconpicker : "Lựa chọn thư mục" ,
modal _swapcolor : "Sử dụng màu thứ hai cho thư mục gốc" ,
modal _tabheader1 : "Thư mục" ,
modal _tabheader2 : "Màu thư mục" ,
modal _tabheader3 : "Màu chú giải công cụ" ,
modal _tabheader4 : "Ký hiệu riêng" ,
modal _usecloseicon : "Sử dụng biểu tượng đã đóng thay vì trình thu nhỏ" ,
servercontext _serverfolders : "Thư mục máy chủ" ,
serversubmenu _addtofolder : "Thêm máy chủ vào thư mục" ,
serversubmenu _createfolder : "Tạo thư mục" ,
serversubmenu _removefromfolder : "Xóa máy chủ khỏi thư mục"
} ;
2021-01-15 17:54:22 +01:00
case "zh-CN" : // Chinese (China)
2020-12-21 19:56:36 +01:00
return {
foldercontext _autoreadfolder : "自动:标记为已读" ,
foldercontext _mutefolder : "静音文件夹" ,
foldercontext _removefolder : "删除资料夹" ,
modal _colorpicker1 : "主文件夹颜色" ,
modal _colorpicker2 : "辅助文件夹颜色" ,
modal _colorpicker3 : "工具提示颜色" ,
modal _colorpicker4 : "字体颜色" ,
modal _copytooltipcolor : "对文件夹中的所有服务器使用相同的颜色" ,
modal _customclosed : "已关闭图标" ,
modal _customopen : "开启图示" ,
modal _custompreview : "图标预览" ,
modal _iconpicker : "资料夹选择" ,
modal _swapcolor : "将第二种颜色用于原始文件夹" ,
modal _tabheader1 : "夹" ,
modal _tabheader2 : "资料夹颜色" ,
modal _tabheader3 : "工具提示颜色" ,
modal _tabheader4 : "自己的符号" ,
modal _usecloseicon : "使用关闭的图标代替小型服务器" ,
servercontext _serverfolders : "服务器文件夹" ,
serversubmenu _addtofolder : "将服务器添加到文件夹" ,
serversubmenu _createfolder : "创建文件夹" ,
serversubmenu _removefromfolder : "从文件夹中删除服务器"
} ;
2021-01-15 17:54:22 +01:00
case "zh-TW" : // Chinese (Taiwan)
2020-12-21 19:56:36 +01:00
return {
foldercontext _autoreadfolder : "自動:標記為已讀" ,
foldercontext _mutefolder : "靜音文件夾" ,
foldercontext _removefolder : "刪除資料夾" ,
modal _colorpicker1 : "主文件夾顏色" ,
modal _colorpicker2 : "輔助文件夾顏色" ,
modal _colorpicker3 : "工具提示顏色" ,
modal _colorpicker4 : "字體顏色" ,
modal _copytooltipcolor : "對文件夾中的所有服務器使用相同的顏色" ,
modal _customclosed : "已關閉圖標" ,
modal _customopen : "開啟圖示" ,
modal _custompreview : "圖標預覽" ,
modal _iconpicker : "資料夾選擇" ,
modal _swapcolor : "將第二種顏色用於原始文件夾" ,
modal _tabheader1 : "夾" ,
modal _tabheader2 : "資料夾顏色" ,
modal _tabheader3 : "工具提示顏色" ,
modal _tabheader4 : "自己的符號" ,
modal _usecloseicon : "使用關閉的圖標代替小型服務器" ,
servercontext _serverfolders : "服務器文件夾" ,
serversubmenu _addtofolder : "將服務器添加到文件夾" ,
serversubmenu _createfolder : "創建文件夾" ,
serversubmenu _removefromfolder : "從文件夾中刪除服務器"
} ;
default : // English
return {
foldercontext _autoreadfolder : "Auto: Mark As Read" ,
foldercontext _mutefolder : "Mute Folder" ,
foldercontext _removefolder : "Delete Folder" ,
modal _colorpicker1 : "Primary Folder Color" ,
modal _colorpicker2 : "Secondary Folder Color" ,
modal _colorpicker3 : "Tooltip Color" ,
modal _colorpicker4 : "Font Color" ,
2021-01-20 14:30:38 +01:00
modal _copytooltipcolor : "Use the same Color for all Servers in a Folder" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Closed icon" ,
modal _customopen : "Open icon" ,
modal _custompreview : "Icon preview" ,
modal _iconpicker : "Folder selection" ,
modal _swapcolor : "Use the second Color for the original Folder" ,
modal _tabheader1 : "Folder" ,
modal _tabheader2 : "Folder Color" ,
modal _tabheader3 : "Tooltip Color" ,
modal _tabheader4 : "Own symbols" ,
modal _usecloseicon : "Use a closed Icon instead of the Mini-Servers" ,
servercontext _serverfolders : "Server Folder" ,
serversubmenu _addtofolder : "Add the Server to the Folder" ,
serversubmenu _createfolder : "Create Folder" ,
serversubmenu _removefromfolder : "Remove Server from Folder"
2020-09-19 20:49:33 +02:00
} ;
}
}
} ;
2020-10-09 21:09:35 +02:00
} ) ( window . BDFDB _Global . PluginUtils . buildPlugin ( config ) ) ;
2020-09-19 20:49:33 +02:00
} ) ( ) ;