2020-10-20 23:25:34 +02:00
/ * *
* @ name ServerFolders
2021-03-05 13:26:41 +01:00
* @ author DevilBro
2020-10-20 23:25:34 +02:00
* @ authorId 278543574059057154
2021-04-28 16:08:22 +02:00
* @ version 6.9 . 1
2021-03-05 13:26:41 +01:00
* @ description Changes Discord ' s Folders , Servers open in a new Container , also adds extra Features to more easily organize , customize and manage your Folders
2020-10-20 23:25:34 +02:00
* @ invite Jx3TjNS
* @ donate https : //www.paypal.me/MircoWittrien
* @ patreon https : //www.patreon.com/MircoWittrien
2021-03-09 15:10:55 +01:00
* @ website https : //mwittrien.github.io/
* @ source https : //github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/ServerFolders/
2021-03-10 09:17:37 +01:00
* @ updateUrl https : //mwittrien.github.io/BetterDiscordAddons/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-04-28 16:08:22 +02:00
"version" : "6.9.1" ,
2021-03-05 11:21:21 +01:00
"description" : "Changes Discord's Folders, Servers open in a new Container, also adds extra Features to more easily organize, customize and manage your Folders"
2021-04-24 14:27:23 +02:00
} ,
"changeLog" : {
"fixed" : {
2021-04-28 16:08:22 +02:00
"Full Screen" : "Extra Column is no longer visible in Full Screen Voice Mode" ,
"Settings" : "Fixed Settings resetting after reloading"
2021-04-24 14:27:23 +02:00
} ,
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-02-01 17:13:13 +01:00
getDescription ( ) { return ` The Library Plugin needed for ${ config . info . name } is missing. Open the Plugin Settings to download it. \n \n ${ config . info . description } ` ; }
downloadLibrary ( ) {
require ( "request" ) . get ( "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js" , ( e , r , b ) => {
2021-03-05 13:14:18 +01:00
if ( ! e && b && r . statusCode == 200 ) require ( "fs" ) . writeFile ( require ( "path" ) . join ( BdApi . Plugins . folder , "0BDFDB.plugin.js" ) , b , _ => BdApi . showToast ( "Finished downloading BDFDB Library" , { type : "success" } ) ) ;
2021-03-06 14:59:48 +01:00
else BdApi . alert ( "Error" , "Could not download BDFDB Library Plugin. Try again later or download it manually from GitHub: https://mwittrien.github.io/downloader/?library" ) ;
2021-02-01 17:13:13 +01:00
} ) ;
}
2020-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 ;
2021-02-01 17:13:13 +01:00
this . downloadLibrary ( ) ;
2020-09-20 08:15:13 +02:00
}
2020-09-19 20:49:33 +02:00
} ) ;
}
if ( ! window . BDFDB _Global . pluginQueue . includes ( config . info . name ) ) window . BDFDB _Global . pluginQueue . push ( config . info . name ) ;
2020-10-09 21:09:35 +02:00
}
2021-01-06 12:38:36 +01:00
start ( ) { this . load ( ) ; }
stop ( ) { }
getSettingsPanel ( ) {
2020-11-28 23:12:09 +01:00
let template = document . createElement ( "template" ) ;
2021-01-14 16:14:44 +01:00
template . innerHTML = ` <div style="color: var(--header-primary); font-size: 16px; font-weight: 300; white-space: pre; line-height: 22px;">The Library Plugin needed for ${ config . info . name } is missing. \n Please click <a style="font-weight: 500;">Download Now</a> to install it.</div> ` ;
2021-02-01 17:13:13 +01:00
template . content . firstElementChild . querySelector ( "a" ) . addEventListener ( "click" , this . downloadLibrary ) ;
2020-11-28 23:12:09 +01:00
return template . content . firstElementChild ;
}
2020-10-09 21:09:35 +02:00
} : ( ( [ Plugin , BDFDB ] ) => {
2020-09-19 20:49:33 +02:00
var _this ;
var folderStates , folderReads , guildStates ;
2021-04-24 14:27:23 +02:00
var folderConfigs = { } , customIcons = { } ;
2020-09-19 20:49:33 +02:00
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 ;
2021-04-24 14:27:23 +02:00
const FolderGuildContentComponent = class FolderGuildContent extends BdApi . React . Component {
2021-01-20 16:00:29 +01:00
componentDidMount ( ) {
2020-09-19 20:49:33 +02:00
folderGuildContent = this ;
}
2021-01-20 16:00:29 +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" , {
2021-04-24 14:27:23 +02:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . guildswrapper , BDFDB . disCN . guilds , this . props . isAppFullscreen && BDFDB . disCN . guildswrapperhidden , 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 {
2021-04-24 14:27:23 +02:00
if ( _this . settings . general . closeAllFolders ) {
for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( openFolderId != folder . folderId || ! _this . settings . general . forceOpenFolder ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
2020-10-30 17:20:33 +01:00
}
2021-04-24 14:27:23 +02:00
else if ( _this . settings . general . closeTheFolder && ! _this . settings . general . forceOpenFolder && BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
2020-10-30 17:20:33 +01:00
else BDFDB . ReactUtils . forceUpdate ( this ) ;
}
} ,
onMouseDown : ( event , instance ) => {
event = event . nativeEvent || event ;
2021-01-20 16:33:44 +01:00
let mouseMove = event2 => {
2020-10-30 17:20:33 +01:00
if ( Math . sqrt ( ( event . pageX - event2 . pageX ) * * 2 ) > 20 || Math . sqrt ( ( event . pageY - event2 . pageY ) * * 2 ) > 20 ) {
BDFDB . ListenerUtils . stopEvent ( event ) ;
this . draggedGuild = guildId ;
2021-01-20 16:57:41 +01:00
let dragPreview = _this . createDragPreview ( BDFDB . ReactUtils . findDOMNode ( instance ) . cloneNode ( true ) , event2 ) ;
2020-10-30 17:20:33 +01:00
BDFDB . ReactUtils . forceUpdate ( this ) ;
2021-01-20 16:33:44 +01:00
document . removeEventListener ( "mousemove" , mouseMove ) ;
document . removeEventListener ( "mouseup" , mouseUp ) ;
2020-10-30 17:20:33 +01:00
let dragging = event3 => {
2021-01-20 16:57:41 +01:00
_this . updateDragPreview ( dragPreview , event3 ) ;
2020-10-30 17:20:33 +01:00
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 ) ;
2021-01-20 16:57:41 +01:00
BDFDB . DOMUtils . remove ( dragPreview ) ;
2020-10-30 17:20:33 +01:00
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 ) ;
}
} ;
2021-01-20 16:33:44 +01:00
let mouseUp = _ => {
document . removeEventListener ( "mousemove" , mouseMove ) ;
document . removeEventListener ( "mouseup" , mouseUp ) ;
2020-10-30 17:20:33 +01:00
} ;
2021-01-20 16:33:44 +01:00
document . addEventListener ( "mousemove" , mouseMove ) ;
document . addEventListener ( "mouseup" , mouseUp ) ;
2020-10-30 17:20:33 +01:00
}
} ) ,
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
]
} ) ;
2021-04-24 14:27:23 +02:00
} ) . filter ( n => n ) . reduce ( ( r , a ) => r . concat ( a , _this . settings . general . addSeparators ? BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildComponents . Items . Separator , { } ) : null ) , [ 0 ] ) . slice ( 1 , - 1 ) . flat ( 10 ) . filter ( n => n )
2020-10-30 17:20:33 +01:00
} )
2020-09-19 20:49:33 +02:00
} )
} ) ;
}
} ;
2021-04-24 14:27:23 +02:00
const FolderIconPickerComponent = class FolderIconPicker extends BdApi . React . Component {
2021-01-20 16:00:29 +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 ;
2021-01-29 19:09:11 +01:00
this . props . onSelect ( this . props . selectedIcon ) ;
2020-09-19 20:49:33 +02:00
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
} ;
2021-04-24 14:27:23 +02:00
const FolderIconCustomPreviewComponent = class FolderIconCustomPreview extends BdApi . React . Component {
2021-01-20 16:00:29 +01:00
componentDidMount ( ) {
2020-09-19 20:49:33 +02:00
this . _previewInterval = BDFDB . TimeUtils . interval ( _ => {
this . props . tick = ! this . props . tick ;
2021-03-02 17:55:45 +01:00
if ( this . props . open || this . props . closed ) BDFDB . ReactUtils . forceUpdate ( this ) ;
2020-09-19 20:49:33 +02:00
} , 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-20 16:00:29 +01:00
render ( ) {
2021-01-29 19:09:11 +01:00
let openInput , closeInput ;
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 ,
2021-01-29 19:09:11 +01:00
ref : instance => { if ( instance ) openInput = instance ; } ,
2020-09-19 20:49:33 +02:00
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 ,
2021-01-29 19:09:11 +01:00
ref : instance => { if ( instance ) closeInput = instance ; } ,
2020-09-19 20:49:33 +02:00
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" , {
2021-03-02 17:55:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . _serverfoldersiconswatch , BDFDB . disCN . _serverfoldersiconswatchpreview , ! this . props . open && BDFDB . disCN . _serverfoldersiconswatchnopreview ) ,
2020-09-19 20:49:33 +02:00
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
2021-03-02 17:55:45 +01:00
style : this . props . open && { background : ` url( ${ this . props . open } ) center/cover no-repeat ` }
2020-09-19 20:49:33 +02:00
} )
} ) ,
BDFDB . ReactUtils . createElement ( "div" , {
2021-03-02 17:55:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . _serverfoldersiconswatch , BDFDB . disCN . _serverfoldersiconswatchpreview , ! this . props . closed && BDFDB . disCN . _serverfoldersiconswatchnopreview ) ,
2020-09-19 20:49:33 +02:00
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
2021-03-02 17:55:45 +01:00
style : this . props . closed && { background : ` url( ${ this . props . closed } ) center/cover no-repeat ` }
2020-09-19 20:49:33 +02:00
} )
} ) ,
BDFDB . ReactUtils . createElement ( "div" , {
2021-03-02 17:55:45 +01:00
className : BDFDB . DOMUtils . formatClassName ( BDFDB . disCN . _serverfoldersiconswatch , BDFDB . disCN . _serverfoldersiconswatchpreview , ! ( this . props . tick ? this . props . open : this . props . closed ) && BDFDB . disCN . _serverfoldersiconswatchnopreview ) ,
2020-09-19 20:49:33 +02:00
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . _serverfoldersiconswatchinner ,
2021-03-02 17:55:45 +01:00
style : ( this . props . tick ? this . props . open : this . props . closed ) && { background : ` url( ${ ( this . props . tick ? this . props . open : this . props . closed ) } ) center/cover no-repeat ` }
2020-09-19 20:49:33 +02:00
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Button , {
children : BDFDB . LanguageUtils . LanguageStrings . ADD ,
2021-01-29 19:09:11 +01:00
onClick : _ => {
if ( openInput . props . value && closeInput . props . value ) {
this . checkImage ( openInput . props . value , openIcon => {
this . checkImage ( closeInput . props . value , closedIcon => {
2020-09-19 20:49:33 +02:00
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 = {
2021-04-24 14:27:23 +02:00
general : {
closeOtherFolders : { value : false , description : "Closes other Folders when opening a Folder" } ,
closeTheFolder : { value : false , description : "Closes the Folder when selecting a Server" } ,
closeAllFolders : { value : false , description : "Closes all Folders when selecting a Server" } ,
forceOpenFolder : { value : false , description : "Forces a Folder to open when switching to a Server of that Folder" } ,
showCountBadge : { value : true , description : "Displays Badge for Amount of Servers in a Folder" } ,
extraColumn : { value : true , description : "Moves the Servers from opened Folders in an extra Column" } ,
addSeparators : { value : true , description : "Adds 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 : {
2021-01-30 12:36:34 +01:00
AppView : "default" ,
2020-09-19 20:49:33 +02:00
Guilds : "render" ,
2021-04-24 14:27:23 +02:00
GuildFolder : "render" ,
2020-09-19 20:49:33 +02:00
Guild : [ "componentDidMount" , "render" ] ,
GuildFolderSettingsModal : [ "componentDidMount" , "render" ]
}
} ;
2020-02-08 19:07:33 +01:00
2020-09-19 20:49:33 +02:00
this . css = `
2021-03-02 17:55:45 +01:00
$ { BDFDB . dotCN . _serverfoldersiconswatch } {
2020-09-19 20:49:33 +02:00
position : relative ;
margin : 3 px 3 px ;
padding : 3 px 3 px ;
width : 55 px ;
height : 55 px ;
border - radius : 12 px ;
cursor : pointer ;
}
2021-03-02 17:55:45 +01:00
$ { BDFDB . dotCN . _serverfoldersiconswatch + BDFDB . dotCN . _serverfoldersiconswatchpreview } {
2020-09-19 20:49:33 +02:00
width : 95 px ;
height : 95 px ;
cursor : default ;
}
2021-03-02 17:55:45 +01:00
$ { BDFDB . dotCN . _serverfoldersiconswatch } : hover {
2020-09-19 20:49:33 +02:00
background - color : var ( -- background - modifier - hover ) ;
}
2021-03-02 17:55:45 +01:00
$ { BDFDB . dotCN . _serverfoldersiconswatch + BDFDB . dotCN . _serverfoldersiconswatchselected } {
2020-09-19 20:49:33 +02:00
background - color : var ( -- background - modifier - selected ) ;
}
2021-03-02 17:55:45 +01:00
$ { BDFDB . dotCNS . _serverfoldersiconswatch + BDFDB . dotCN . _serverfoldersiconswatchinner } {
2020-09-19 20:49:33 +02:00
width : 100 % ;
height : 100 % ;
border - radius : 12 px ;
background - position : center ;
background - size : cover ;
background - repeat : no - repeat ;
}
2021-03-02 17:55:45 +01:00
$ { BDFDB . dotCN . _serverfoldersiconswatchnopreview } ,
$ { BDFDB . dotCN . _serverfoldersiconswatchnopreview } : hover {
background - color : transparent ;
}
$ { BDFDB . dotCNS . _serverfoldersiconswatchnopreview + BDFDB . dotCN . _serverfoldersiconswatchinner } {
background - image : url ( 'data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><g fill="none" stroke="rgb(240,71,71)" stroke-width="2.63295174" stroke-linecap="round"><path d="M 2.3297741,2.3297744 17.669885,17.670227"/><path d="M 17.66721,2.3327927 2.3327902,17.667207"/></g></svg>' ) ;
}
$ { BDFDB . dotCN . _serverfoldersiconswatch } svg$ { BDFDB . dotCN . _serverfoldersiconswatchinner } {
2020-09-19 20:49:33 +02:00
transform : translateY ( - 2 px ) scale ( 0.8 ) ;
}
2021-03-02 17:55:45 +01:00
$ { BDFDB . dotCNS . _serverfoldersiconswatch + BDFDB . dotCN . hovercardbutton } {
2020-09-19 20:49:33 +02:00
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 ;
}
2021-04-24 14:27:23 +02:00
$ { BDFDB . dotCN . _serverfoldersfoldercontent + BDFDB . notCN . guildswrapperhidden } {
2020-09-19 20:49:33 +02:00
transition : width 0.3 s linear ! important ;
}
2021-04-24 14:27:23 +02:00
$ { BDFDB . dotCN . _serverfoldersfoldercontent + BDFDB . dotCN . _serverfoldersfoldercontentclosed } {
width : 0 ! important ;
2020-09-19 20:49:33 +02:00
}
` ;
}
2021-01-06 12:38:36 +01:00
onStart ( ) {
2021-04-24 14:27:23 +02:00
// REMOVE 24.04.2021
let oldData = BDFDB . DataUtils . load ( this ) ;
if ( oldData . settings ) {
this . settings . general = oldData . settings ;
BDFDB . DataUtils . save ( this . settings . general , this , "general" ) ;
BDFDB . DataUtils . remove ( this , "settings" ) ;
}
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 => {
2021-04-24 14:27:23 +02:00
if ( this . settings . general . 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 ( ) {
2021-04-24 14:27:23 +02:00
if ( typeof BDFDB === "object" && this . settings . general . forceOpenFolder ) {
2020-09-19 20:49:33 +02:00
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 = { } ) {
2021-04-24 14:27:23 +02:00
let settingsPanel ;
return settingsPanel = BDFDB . PluginUtils . createSettingsPanel ( this , {
collapseStates : collapseStates ,
children : _ => {
let settingsItems = [ ] ;
for ( let key in this . defaults . general ) settingsItems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsSaveItem , {
type : "Switch" ,
plugin : this ,
2021-04-28 16:08:22 +02:00
keys : [ "general" , key ] ,
2021-04-24 14:27:23 +02:00
label : this . defaults . general [ key ] . description ,
value : this . settings . general [ 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 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
folderConfigs = BDFDB . DataUtils . load ( this , "folders" ) ;
customIcons = BDFDB . DataUtils . load ( this , "customicons" ) ;
BDFDB . ReactUtils . forceUpdate ( folderGuildContent ) ;
BDFDB . PatchUtils . forceAllUpdates ( this ) ;
2021-01-30 12:36:34 +01:00
BDFDB . DiscordUtils . 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 ) {
2021-04-24 14:27:23 +02:00
if ( this . settings . general . extraColumn ) {
2021-01-30 12:36:34 +01:00
let [ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . guilds ] ] } ) ;
2021-04-24 14:27:23 +02:00
if ( index > - 1 ) children . splice ( index + 1 , 0 , BDFDB . ReactUtils . createElement ( FolderGuildContentComponent , {
isAppFullscreen : BDFDB . LibraryModules . VoiceChannelUtils . isFullscreenInContext ( ) ,
themeOverride : BDFDB . LibraryModules . LocalSettingsStore . darkSidebar
2020-09-19 20:49:33 +02:00
} , true ) ) ;
2020-07-15 16:50:10 +02:00
}
}
2020-09-19 20:49:33 +02:00
processGuilds ( e ) {
2021-04-24 14:27:23 +02:00
if ( this . settings . general . extraColumn ) {
if ( folderGuildContent && ( e . instance . props . isAppFullscreen != folderGuildContent . props . isAppFullscreen || e . instance . props . themeOverride != folderGuildContent . props . themeOverride ) ) {
folderGuildContent . props . isAppFullscreen = e . instance . props . isAppFullscreen ;
folderGuildContent . props . themeOverride = e . instance . props . themeOverride ;
BDFDB . ReactUtils . forceUpdate ( folderGuildContent ) ;
}
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 ) ;
2021-03-02 17:55:45 +01:00
args [ 2 ] = args [ 2 ] . filter ( id => ! ids . includes ( id ) ) ;
2020-09-19 20:49:33 +02:00
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 ) ;
2021-03-02 17:55:45 +01:00
args [ 2 ] = args [ 2 ] . filter ( id => ! ids . includes ( id ) ) ;
2020-09-19 20:49:33 +02:00
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 ;
2021-04-27 14:43:18 +02:00
let [ tooltipParent , tooltipIndex ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : [ "ListItemTooltip" , "BDFDB_TooltipContainer" ] } ) ;
if ( tooltipIndex > - 1 ) tooltipParent [ tooltipIndex ] = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TooltipContainer , {
2020-09-19 20:49:33 +02:00
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
} ,
2021-04-27 14:43:18 +02:00
children : tooltipParent [ tooltipIndex ] . props . children
2020-09-19 20:49:33 +02:00
} ) ;
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 ) {
2021-04-27 14:43:18 +02:00
let [ folderIconParent , folderIconIndex ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : "FolderIcon" } ) ;
if ( folderIconIndex > - 1 ) folderIconParent [ folderIconIndex ] = BDFDB . ReactUtils . createElement ( "div" , {
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . guildfoldericonwrapper ,
style : { background : ` url( ${ icon } ) center/cover no-repeat ` }
} ) ;
}
}
2021-04-24 14:27:23 +02:00
if ( this . settings . general . showCountBadge ) {
2021-04-27 14:43:18 +02:00
let mask = BDFDB . ReactUtils . findChild ( e . returnvalue , { name : "BlobMask" } ) ;
if ( mask ) {
mask . props . upperLeftBadgeWidth = BDFDB . LibraryComponents . Badges . getBadgeWidthForValue ( e . instance . props . guildIds . length ) ;
mask . props . upperLeftBadge = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Badges . NumberBadge , {
2020-09-19 20:49:33 +02:00
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
} ) ;
}
}
2021-04-24 14:27:23 +02:00
if ( this . settings . general . extraColumn ) {
2020-09-19 20:49:33 +02:00
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 ) ;
2021-04-24 14:27:23 +02:00
if ( this . settings . general . closeAllFolders ) for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( ! folder || openFolderId != folder . folderId || ! this . settings . general . forceOpenFolder ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
else if ( folder && this . settings . general . closeTheFolder && ! this . settings . general . forceOpenFolder && BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
2020-09-19 20:49:33 +02:00
} ) } ) ;
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 ) ;
2021-01-29 19:09:11 +01:00
let newData = Object . assign ( { } , data , { folderName : folder . folderName } ) ;
let tabs = { } ;
2020-09-19 20:49:33 +02:00
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 ) => {
2021-01-29 19:09:11 +01:00
let tabsArray = BDFDB . ObjectUtils . toArray ( tabs ) ;
for ( let ins of tabsArray ) {
2020-09-19 20:49:33 +02:00
if ( ins . props . tab == value ) ins . props . open = true ;
else delete ins . props . open ;
}
2021-01-29 19:09:11 +01:00
BDFDB . ReactUtils . forceUpdate ( tabsArray ) ;
2020-09-19 20:49:33 +02:00
}
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 ,
2021-01-29 19:09:11 +01:00
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader1 ] = instance ; } ,
2020-09-19 20:49:33 +02:00
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 , {
value : folder . folderName ,
placeholder : folder . folderName || BDFDB . LanguageUtils . LanguageStrings . SERVER _FOLDER _PLACEHOLDER ,
2021-01-29 19:09:11 +01:00
autoFocus : true ,
2021-01-29 20:04:13 +01:00
onChange : value => { newData . folderName = value ; }
2020-09-19 20:49:33 +02:00
} )
} ) ,
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 ,
2021-04-24 14:27:23 +02:00
children : BDFDB . ReactUtils . createElement ( FolderIconPickerComponent , {
2021-01-29 19:09:11 +01:00
selectedIcon : data . iconID ,
2021-01-29 20:04:13 +01:00
onSelect : value => { newData . iconID = value ; }
2020-09-19 20:49:33 +02:00
} , true )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
2020-10-14 21:08:41 +02:00
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 ,
2021-01-29 19:09:11 +01:00
value : data . useCloseIcon ,
2021-01-29 20:04:13 +01:00
onChange : value => { newData . useCloseIcon = value ; }
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 ,
2021-01-29 19:09:11 +01:00
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader2 ] = instance ; } ,
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 ,
2021-01-29 20:04:13 +01:00
onColorChange : value => { newData . color1 = value ; }
2020-09-19 20:49:33 +02:00
} )
} ) ,
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 ,
2021-01-29 20:04:13 +01:00
onColorChange : value => { newData . color2 = value ; }
2020-09-19 20:49:33 +02:00
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
2020-10-14 21:08:41 +02:00
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 ,
2021-01-29 19:09:11 +01:00
value : data . swapColors ,
2021-01-29 20:04:13 +01:00
onChange : value => { newData . swapColors = value ; }
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 ,
2021-01-29 19:09:11 +01:00
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader3 ] = instance ; } ,
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 ,
2021-01-29 20:04:13 +01:00
onColorChange : value => { newData . color3 = value ; }
2020-09-19 20:49:33 +02:00
} )
} ) ,
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 ,
2021-01-29 20:04:13 +01:00
onColorChange : value => { newData . color4 = value ; }
2020-09-19 20:49:33 +02:00
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
2020-10-14 21:08:41 +02:00
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 ,
2021-01-29 19:09:11 +01:00
value : data . copyTooltipColor ,
2021-01-29 20:04:13 +01:00
onChange : value => { newData . copyTooltipColor = value ; }
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 ,
2021-01-29 19:09:11 +01:00
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader4 ] = instance ; } ,
2021-04-24 14:27:23 +02:00
children : BDFDB . ReactUtils . createElement ( FolderIconCustomPreviewComponent , { } , true )
2020-09-19 20:49:33 +02:00
} )
] ;
[ 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 ,
2021-01-29 19:09:11 +01:00
onClick : _ => {
let folderColor = newData [ newData . swapColors ? "color2" : "color1" ] ;
2020-09-19 20:49:33 +02:00
this . updateFolder ( {
folderId : e . instance . props . folderId ,
2021-01-29 19:09:11 +01:00
folderName : newData . folderName ,
folderColor : folderColor ? BDFDB . ColorUtils . convert ( folderColor && BDFDB . ObjectUtils . is ( folderColor ) ? folderColor [ Object . keys ( folderColor ) [ 0 ] ] : folderColor , "INT" ) : null
2020-09-19 20:49:33 +02:00
} ) ;
2021-01-29 19:09:11 +01:00
if ( ! BDFDB . equals ( newData , data ) ) {
BDFDB . DataUtils . save ( newData , this , "folders" , e . instance . props . folderId ) ;
2020-09-19 20:49:33 +02:00
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 ,
2021-01-23 18:50:24 +01:00
subHeader : "" ,
2020-09-19 20:49:33 +02:00
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 ,
2021-01-23 18:50:24 +01:00
onClick : ( modal , instance ) => {
2020-09-19 20:49:33 +02:00
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 ;
2021-01-20 16:57:41 +01:00
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 ;
2020-09-19 20:49:33 +02:00
}
2019-01-26 22:45:19 +01:00
2021-01-20 16:57:41 +01: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 : "静音文件夹" ,
2021-04-15 14:36:47 +02:00
foldercontext _removefolder : "删除文件夹" ,
modal _colorpicker1 : "文件夹主色" ,
modal _colorpicker2 : "文件夹辅色" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker3 : "工具提示颜色" ,
modal _colorpicker4 : "字体颜色" ,
2021-04-15 14:36:47 +02:00
modal _copytooltipcolor : "对文件夹中的所有服务器使用相同颜色" ,
modal _customclosed : "文件夹收起图标" ,
modal _customopen : "文件夹展开图标" ,
2020-12-21 19:56:36 +01:00
modal _custompreview : "图标预览" ,
2021-04-15 14:36:47 +02:00
modal _iconpicker : "文件夹选择" ,
modal _swapcolor : "将文件夹副色应用于原始文件夹" ,
modal _tabheader1 : "文件夹" ,
modal _tabheader2 : "文件夹颜色" ,
2020-12-21 19:56:36 +01:00
modal _tabheader3 : "工具提示颜色" ,
2021-04-15 14:36:47 +02:00
modal _tabheader4 : "自定义图标" ,
modal _usecloseicon : "使用文件夹收起图标代替服务器缩略图" ,
2020-12-21 19:56:36 +01:00
servercontext _serverfolders : "服务器文件夹" ,
serversubmenu _addtofolder : "将服务器添加到文件夹" ,
serversubmenu _createfolder : "创建文件夹" ,
2021-04-15 14:36:47 +02:00
serversubmenu _removefromfolder : "从文件夹中移除服务器"
2020-12-21 19:56:36 +01:00
} ;
2021-01-15 17:54:22 +01:00
case "zh-TW" : // Chinese (Taiwan)
2020-12-21 19:56:36 +01:00
return {
foldercontext _autoreadfolder : "自動:標記為已讀" ,
2021-04-15 14:36:47 +02:00
foldercontext _mutefolder : "靜音資料夾" ,
2020-12-21 19:56:36 +01:00
foldercontext _removefolder : "刪除資料夾" ,
2021-04-15 14:36:47 +02:00
modal _colorpicker1 : "資料夾主色" ,
modal _colorpicker2 : "資料夾輔色" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker3 : "工具提示顏色" ,
modal _colorpicker4 : "字體顏色" ,
2021-04-15 14:36:47 +02:00
modal _copytooltipcolor : "對資料夾中的所有伺服器使用相同顏色" ,
modal _customclosed : "資料夾收起圖標" ,
modal _customopen : "資料夾展開圖標" ,
2020-12-21 19:56:36 +01:00
modal _custompreview : "圖標預覽" ,
modal _iconpicker : "資料夾選擇" ,
2021-04-15 14:36:47 +02:00
modal _swapcolor : "將文件夾輔色應用於原始資料夾" ,
modal _tabheader1 : "資料夾" ,
2020-12-21 19:56:36 +01:00
modal _tabheader2 : "資料夾顏色" ,
modal _tabheader3 : "工具提示顏色" ,
2021-04-15 14:36:47 +02:00
modal _tabheader4 : "客製化圖標" ,
modal _usecloseicon : "使用資料夾收起圖標代替伺服器縮略圖" ,
servercontext _serverfolders : "伺服器資料夾" ,
serversubmenu _addtofolder : "將伺服器添加到資料夾" ,
serversubmenu _createfolder : "創建資料夾" ,
serversubmenu _removefromfolder : "從資料夾中移除伺服器"
2020-12-21 19:56:36 +01:00
} ;
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" ,
2021-03-02 17:55:45 +01:00
modal _customclosed : "Closed Icon" ,
modal _customopen : "Open Icon" ,
modal _custompreview : "Icon Preview" ,
modal _iconpicker : "Folder Selection" ,
2020-12-21 19:56:36 +01:00
modal _swapcolor : "Use the second Color for the original Folder" ,
modal _tabheader1 : "Folder" ,
modal _tabheader2 : "Folder Color" ,
modal _tabheader3 : "Tooltip Color" ,
2021-03-02 17:55:45 +01:00
modal _tabheader4 : "Custom Icons" ,
2020-12-21 19:56:36 +01:00
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
} ) ( ) ;