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
2024-04-19 14:45:22 +02:00
* @ version 7.2 . 3
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 = ( _ => {
2022-09-01 14:40:11 +02:00
const changeLog = {
2023-06-06 08:48:41 +02:00
2020-09-19 20:49:33 +02:00
} ;
2022-12-01 17:11:39 +01:00
2022-02-05 21:14:17 +01:00
return ! window . BDFDB _Global || ( ! window . BDFDB _Global . loaded && ! window . BDFDB _Global . started ) ? class {
2022-09-01 14:55:22 +02:00
constructor ( meta ) { for ( let key in meta ) this [ key ] = meta [ key ] ; }
getName ( ) { return this . name ; }
getAuthor ( ) { return this . author ; }
getVersion ( ) { return this . version ; }
getDescription ( ) { return ` The Library Plugin needed for ${ this . name } is missing. Open the Plugin Settings to download it. \n \n ${ this . description } ` ; }
2021-02-01 17:13:13 +01:00
downloadLibrary ( ) {
2023-11-18 18:31:04 +01:00
BdApi . Net . fetch ( "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js" ) . then ( r => {
if ( ! r || r . status != 200 ) throw new Error ( ) ;
else return r . text ( ) ;
} ) . then ( b => {
if ( ! b ) throw new Error ( ) ;
else return require ( "fs" ) . writeFile ( require ( "path" ) . join ( BdApi . Plugins . folder , "0BDFDB.plugin.js" ) , b , _ => BdApi . showToast ( "Finished downloading BDFDB Library" , { type : "success" } ) ) ;
} ) . catch ( error => {
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 ;
2022-09-01 14:55:22 +02:00
BdApi . showConfirmationModal ( "Library Missing" , ` The Library Plugin needed for ${ this . 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
} ) ;
}
2022-09-01 14:55:22 +02:00
if ( ! window . BDFDB _Global . pluginQueue . includes ( this . name ) ) window . BDFDB _Global . pluginQueue . push ( this . 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" ) ;
2022-09-01 14:55:22 +02: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 ${ this . 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 ;
}
2022-12-01 17:11:39 +01:00
} : ( ( [ Plugin , BDFDB , meta ] ) => {
2020-09-19 20:49:33 +02:00
var _this ;
2021-09-24 17:31:41 +02:00
var folderStates , folderReads , guildStates , currentGuild , forceCloseTimeout ;
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 ;
2023-06-06 08:48:41 +02:00
let folders = Array . from ( BDFDB . LibraryStores . ExpandedGuildFolderStore . getExpandedFolders ( ) ) . map ( folderId => BDFDB . LibraryStores . SortedGuildStore . getGuildFolderById ( folderId ) ) . filter ( folder => folder && folder . guildIds ) ;
2020-09-19 20:49:33 +02:00
this . props . folders = folders . length || closing ? folders : ( this . props . folders || [ ] ) ;
BDFDB . TimeUtils . clear ( this . _rerenderTimeout ) ;
2023-11-02 11:57:54 +01:00
if ( ! folders . length && this . props . folders . length && ! closing ) this . _rerenderTimeout = BDFDB . TimeUtils . timeout ( _ => {
2020-09-19 20:49:33 +02:00
this . props . closing = true ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
} , 300 ) ;
2022-12-02 12:41:03 +01:00
BDFDB . DOMUtils . toggleClass ( document . body , BDFDB . disCN . _serverfoldersfoldercontentisopen , ! ( ! folders . length || closing ) ) ;
2020-09-19 20:49:33 +02:00
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 ,
2022-12-03 15:54:12 +01:00
children : BDFDB . ReactUtils . createElement ( "div" , {
"aria-label" : BDFDB . LanguageUtils . LanguageStrings . SERVERS ,
2023-11-02 11:57:54 +01:00
children : BDFDB . LibraryComponents . GuildItem && this . props . folders . map ( folder => {
2022-12-03 15:54:12 +01:00
let data = _this . getFolderConfig ( folder . folderId ) ;
let folderIcon = null ;
if ( _this . settings . general . addFolderIcon ) {
let folderIcons = _this . loadAllIcons ( ) ;
folderIcon = folderIcons [ data . iconID ] ? ( ! folderIcons [ data . iconID ] . customID ? _this . createBase64SVG ( folderIcons [ data . iconID ] . openicon , data . color1 , data . color2 ) : folderIcons [ data . iconID ] . openicon ) : null ;
folderIcon = folderIcon ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildfoldericonwrapper ,
style : { background : ` url( ${ folderIcon } ) center/cover no-repeat ` }
} ) : BDFDB . ReactUtils . createElement ( "div" , {
2022-12-10 11:15:13 +01:00
className : BDFDB . disCN . guildfoldericonwrapper ,
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildfoldericonwrapperexpanded ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SvgIcon , {
name : BDFDB . LibraryComponents . SvgIcon . Names . FOLDER ,
style : { color : BDFDB . ColorUtils . convert ( folder . folderColor || BDFDB . DiscordConstants . Colors . BRAND , "RGB" ) }
} )
2022-12-03 15:54:12 +01:00
} )
} ) ;
}
return BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildfolderwrapper ,
style : { "--folder-color" : folder . folderColor ? BDFDB . ColorUtils . convert ( folder . folderColor , "RGB" ) : null } ,
children : [
_this . settings . general . addFolderBackground && BDFDB . ReactUtils . createElement ( "span" , {
className : BDFDB . disCN . guildfolderexpandedbackground
} ) ,
folderIcon && BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildouter ,
2022-07-27 11:07:44 +02:00
children : BDFDB . ReactUtils . createElement ( "div" , {
2022-12-03 15:54:12 +01:00
className : BDFDB . disCN . guildfolder ,
2023-04-15 17:56:20 +02:00
"data-folder-name" : folder . folderName || BDFDB . LanguageUtils . LanguageStrings . SERVER _FOLDER _PLACEHOLDER ,
2022-12-02 12:41:03 +01:00
children : folderIcon
2022-07-27 11:07:44 +02:00
} )
2022-12-03 15:54:12 +01:00
} ) ,
BDFDB . ReactUtils . createElement ( "ul" , {
role : "group" ,
children : folder . guildIds . map ( guildId => {
let guildIstance ;
return [
this . draggedGuild == guildId ? null : BDFDB . ReactUtils . createElement ( "div" , {
ref : instance => guildIstance = instance ,
2023-11-02 11:57:54 +01:00
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildItem , {
2022-12-03 15:54:12 +01:00
guildNode : {
children : [ ] ,
id : guildId ,
parentId : folder . folderId ,
type : "guild" ,
unavailable : false
2022-07-27 11:07:44 +02:00
}
2022-12-03 15:54:12 +01:00
} ) ,
onClick : event => {
if ( BDFDB . ListenerUtils . isPressed ( 46 ) ) {
BDFDB . ListenerUtils . stopEvent ( event ) ;
_this . removeGuildFromFolder ( folder . folderId , guildId ) ;
2022-07-27 11:07:44 +02:00
}
2022-12-03 15:54:12 +01:00
else {
if ( _this . settings . general . closeAllFolders ) {
for ( let openFolderId of BDFDB . LibraryStores . ExpandedGuildFolderStore . getExpandedFolders ( ) ) if ( openFolderId != folder . folderId || ! _this . settings . general . forceOpenFolder ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
}
else if ( _this . settings . general . closeTheFolder && ! _this . settings . general . forceOpenFolder && BDFDB . LibraryStores . ExpandedGuildFolderStore . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
else BDFDB . ReactUtils . forceUpdate ( this ) ;
}
} ,
onMouseDown : event => {
event = event . nativeEvent || event ;
let mouseMove = event2 => {
if ( Math . sqrt ( ( event . pageX - event2 . pageX ) * * 2 ) > 20 || Math . sqrt ( ( event . pageY - event2 . pageY ) * * 2 ) > 20 ) {
BDFDB . ListenerUtils . stopEvent ( event ) ;
this . draggedGuild = guildId ;
let dragPreview = _this . createDragPreview ( BDFDB . ReactUtils . findDOMNode ( guildIstance ) . cloneNode ( true ) , event2 ) ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
document . removeEventListener ( "mousemove" , mouseMove ) ;
document . removeEventListener ( "mouseup" , mouseUp ) ;
let dragging = event3 => {
_this . updateDragPreview ( dragPreview , event3 ) ;
let placeholder = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . _serverfoldersguildplaceholder , event3 . target ) ;
let hoveredGuild = ( BDFDB . ReactUtils . findValue ( BDFDB . DOMUtils . getParent ( BDFDB . dotCNS . _serverfoldersfoldercontent + BDFDB . dotCN . guildouter , placeholder ? placeholder . previousSibling : event3 . target ) , "guild" , { up : true } ) || { } ) . id ;
if ( hoveredGuild ) {
let hoveredGuildFolder = BDFDB . GuildUtils . getFolder ( hoveredGuild ) ;
if ( ! hoveredGuildFolder || hoveredGuildFolder . folderId != folder . folderId ) hoveredGuild = null ;
}
let update = hoveredGuild != this . hoveredGuild ;
if ( hoveredGuild ) this . hoveredGuild = hoveredGuild ;
else delete this . hoveredGuild ;
if ( update ) BDFDB . ReactUtils . forceUpdate ( this ) ;
} ;
let releasing = event3 => {
BDFDB . ListenerUtils . stopEvent ( event3 ) ;
BDFDB . DOMUtils . remove ( dragPreview ) ;
if ( this . hoveredGuild ) {
let guildIds = [ ] . concat ( folder . guildIds ) ;
BDFDB . ArrayUtils . remove ( guildIds , this . draggedGuild , true ) ;
guildIds . splice ( guildIds . indexOf ( this . hoveredGuild ) + 1 , 0 , this . draggedGuild ) ;
_this . updateFolder ( Object . assign ( { } , folder , { guildIds } ) ) ;
}
delete this . draggedGuild ;
delete this . hoveredGuild ;
BDFDB . ReactUtils . forceUpdate ( this ) ;
document . removeEventListener ( "mousemove" , dragging ) ;
document . removeEventListener ( "mouseup" , releasing ) ;
} ;
document . addEventListener ( "mousemove" , dragging ) ;
document . addEventListener ( "mouseup" , releasing ) ;
}
} ;
let mouseUp = _ => {
document . removeEventListener ( "mousemove" , mouseMove ) ;
document . removeEventListener ( "mouseup" , mouseUp ) ;
} ;
document . addEventListener ( "mousemove" , mouseMove ) ;
document . addEventListener ( "mouseup" , mouseUp ) ;
}
} ) ,
this . hoveredGuild != guildId ? null : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCNS . guildouter + BDFDB . disCN . _serverfoldersguildplaceholder ,
children : BDFDB . ReactUtils . createElement ( "div" , {
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Mask , {
mask : BDFDB . LibraryComponents . Mask . Masks . SQUIRCLE ,
className : BDFDB . disCN . guildplaceholdermask ,
width : 48 ,
height : 48 ,
style : { display : "block" } ,
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildplaceholder
} )
} )
} )
2022-12-01 17:11:39 +01:00
} )
2022-12-03 15:54:12 +01:00
]
2022-07-27 11:07:44 +02:00
} )
2020-10-30 17:20:33 +01:00
} )
2022-07-27 11:07:44 +02:00
]
} )
2022-12-03 15:54:12 +01:00
} ) . filter ( n => n ) . reduce ( ( r , a ) => r . concat ( a , _this . settings . general . addSeparators ? BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildouter ,
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildseparator
} )
} ) : 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 ) {
2023-11-04 20:00:57 +01:00
if ( base64OrUrl . indexOf ( "https://" ) == 0 || base64OrUrl . indexOf ( "http://" ) == 0 ) BDFDB . LibraryRequires . request ( base64OrUrl . trim ( ) , ( error , response , body ) => {
2020-09-19 20:49:33 +02:00
if ( response && response . headers [ "content-type" ] && response . headers [ "content-type" ] . indexOf ( "image" ) != - 1 && response . headers [ "content-type" ] != "image/gif" ) {
2023-11-04 20:00:57 +01:00
this . resizeImage ( "data:" + response . headers [ "content-type" ] + ";base64," + btoa ( body ) , 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 ;
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-05-03 19:20:03 +02: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-05-03 19:20:03 +02: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-05-03 19:20:03 +02: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 ;
2022-12-01 17:11:39 +01:00
BDFDB . PatchUtils . forceAllUpdates ( _this , "FolderSettingsModal" ) ;
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 : {
2022-12-03 15:54:12 +01:00
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" } ,
2024-04-02 19:14:42 +02:00
addFolderBackground : { value : false , description : "Adds a Folder Background behind a Group of Servers" } ,
2022-12-03 15:54:12 +01:00
extraColumn : { value : true , description : "Moves the Servers from opened Folders into an extra Column" } ,
addSeparators : { value : true , description : "Adds Separators between Servers of different Folders in extra Column" } ,
2024-04-02 19:14:42 +02:00
addFolderIcon : { value : false , description : "Adds the Folder Icon on the top of the Server List in the extra Column" }
2020-09-19 20:49:33 +02:00
}
} ;
2019-12-18 10:55:02 +01:00
2022-12-01 17:11:39 +01:00
this . modulePatches = {
before : [
2022-12-02 12:41:03 +01:00
"FolderItem" ,
2023-11-02 11:57:54 +01:00
"FolderSettingsModal" ,
2022-12-10 11:15:13 +01:00
"GuildsBar" ,
2023-11-02 11:57:54 +01:00
"ModalRoot" ,
2022-12-10 11:15:13 +01:00
"TooltipContainer"
2022-12-01 17:11:39 +01:00
] ,
after : [
"FolderHeader" ,
2024-04-02 19:14:42 +02:00
"FolderItemWrapper" ,
2022-12-01 17:11:39 +01:00
"FolderSettingsModal" ,
"GuildItem" ,
2022-12-10 11:15:13 +01:00
"GuildsBar"
2022-12-01 17:11:39 +01:00
] ,
componentDidMount : [
"FolderSettingsModal"
]
2020-09-19 20:49:33 +02:00
} ;
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 } {
2023-05-08 09:22:27 +02:00
transition : width 0.25 s cubic - bezier ( . 44 , 1.04 , 1 , 1.01 ) ! important ;
2020-09-19 20:49:33 +02:00
}
2023-05-08 09:20:09 +02:00
$ { BDFDB . dotCN . guildswrapper } [ style *= "width: 0px" ] ~ $ { BDFDB . dotCN . _serverfoldersfoldercontent } ,
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
}
2022-12-03 17:26:24 +01:00
$ { BDFDB . dotCNS . _serverfoldershassidebar + BDFDB . dotCN . guildfolderwrapper } > [ role = "group" ] ,
$ { BDFDB . dotCNS . _serverfoldershassidebar + BDFDB . dotCN . guildfolderexpandedbackground } {
display : none ! important ;
}
2022-12-02 12:41:03 +01:00
$ { BDFDB . dotCNS . _serverfoldersfoldercontent + BDFDB . dotCN . guildfolder } {
cursor : default ;
border - radius : 100 % ;
}
2020-09-19 20:49:33 +02:00
` ;
}
2021-01-06 12:38:36 +01:00
onStart ( ) {
2022-09-27 16:53:10 +02:00
currentGuild = BDFDB . LibraryStores . SelectedGuildStore . getGuildId ( ) ;
2021-04-24 14:27:23 +02:00
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 ;
2022-09-27 16:53:10 +02:00
for ( let openFolderId of BDFDB . LibraryStores . ExpandedGuildFolderStore . getExpandedFolders ( ) ) if ( openFolderId != e . methodArguments [ 0 ] ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
2020-02-08 19:07:33 +01:00
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-09-27 21:41:48 +02:00
if ( typeof BDFDB === "object" && BDFDB . loaded && this . settings . general . forceOpenFolder ) {
2022-09-27 16:53:10 +02:00
let folder = BDFDB . GuildUtils . getFolder ( BDFDB . LibraryStores . SelectedGuildStore . getGuildId ( ) ) ;
if ( folder && ! BDFDB . LibraryStores . ExpandedGuildFolderStore . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
2020-09-19 20:49:33 +02:00
}
}
getSettingsPanel ( collapseStates = { } ) {
2021-04-24 14:27:23 +02:00
let settingsPanel ;
return settingsPanel = BDFDB . PluginUtils . createSettingsPanel ( this , {
collapseStates : collapseStates ,
children : _ => {
let settingsItems = [ ] ;
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 ) {
2023-06-06 08:48:41 +02:00
let folders = BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) . filter ( n => n . folderId ) ;
2020-09-19 20:49:33 +02:00
let folder = BDFDB . GuildUtils . getFolder ( e . instance . props . guild . id ) ;
2023-06-06 08:48:41 +02:00
let unfolderedGuilds = BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) . filter ( n => ! n . folderId ) . map ( n => BDFDB . LibraryStores . GuildStore . getGuild ( n . guildIds [ 0 ] ) ) ;
2020-09-19 20:49:33 +02:00
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" ) ,
2022-09-30 14:18:20 +02:00
color : BDFDB . DiscordConstants . MenuItemColors . DANGER ,
2022-07-11 14:00:45 +02:00
action : _ => this . removeGuildFromFolder ( folder . folderId , e . instance . props . guild . id )
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 ,
2022-07-11 14:00:45 +02:00
action : _ => this . openFolderCreationMenu ( unfolderedGuilds , e . instance . props . guild . id )
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 _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 ) ,
2022-07-11 14:00:45 +02:00
action : _ => this . addGuildToFolder ( folder . folderId , e . instance . props . guild . id )
2020-09-19 20:49:33 +02:00
} ) )
} )
]
} )
} ) ) ;
2019-10-08 19:12:48 +02:00
}
2020-09-19 20:49:33 +02:00
if ( e . instance . props . target && e . instance . props . folderId ) {
2023-06-06 08:48:41 +02:00
let folder = BDFDB . LibraryStores . SortedGuildStore . getGuildFolderById ( e . instance . props . folderId ) ;
2020-09-19 20:49:33 +02:00
let data = this . getFolderConfig ( e . instance . props . folderId ) ;
2022-09-27 16:53:10 +02:00
let muted = data . muteFolder && folder . guildIds . every ( guildid => BDFDB . LibraryStores . UserGuildSettingsStore . isGuildOrCategoryOrChannelMuted ( guildid ) ) ;
2020-09-19 20:49:33 +02:00
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 ) ;
2022-09-27 16:53:10 +02:00
for ( let guildId of folder . guildIds ) if ( BDFDB . LibraryStores . UserGuildSettingsStore . 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" ) ,
2022-09-30 14:18:20 +02:00
color : BDFDB . DiscordConstants . MenuItemColors . DANGER ,
2020-09-19 20:49:33 +02:00
action : event => {
2022-08-15 13:29:46 +02:00
BDFDB . ModalUtils . confirm ( this , this . labels . foldercontext _removefolder _confirm . replace ( "{{var0}}" , folder . folderName ? ` " ${ folder . folderName } " ` : "" ) . trim ( ) , _ => {
2020-09-19 20:49:33 +02:00
this . removeFolder ( e . instance . props . folderId ) ;
} ) ;
}
} )
} ) ) ;
}
2020-05-11 14:18:20 +02:00
}
2020-07-15 16:50:10 +02:00
2022-12-01 17:11:39 +01:00
processGuildsBar ( e ) {
2022-12-02 12:41:03 +01:00
if ( ! this . settings . general . extraColumn ) return ;
if ( ! e . returnvalue ) e . instance . props . className = BDFDB . DOMUtils . formatClassName ( e . instance . props . className , BDFDB . disCN . _serverfoldershassidebar ) ;
else {
2022-09-27 16:53:10 +02:00
let fullscreen = BDFDB . LibraryStores . ChannelRTCStore . isFullscreenInContext ( ) ;
2022-07-10 00:08:03 +02:00
if ( folderGuildContent && ( fullscreen != folderGuildContent . props . isAppFullscreen || e . instance . props . themeOverride != folderGuildContent . props . themeOverride ) ) {
folderGuildContent . props . isAppFullscreen = fullscreen ;
2021-04-24 14:27:23 +02:00
folderGuildContent . props . themeOverride = e . instance . props . themeOverride ;
BDFDB . ReactUtils . forceUpdate ( folderGuildContent ) ;
}
2021-10-18 21:38:28 +02:00
let topBar = BDFDB . ReactUtils . findChild ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . guildswrapperunreadmentionsbartop ] ] } ) ;
if ( topBar ) {
let topIsVisible = topBar . props . isVisible ;
2022-07-11 14:00:45 +02:00
topBar . props . isVisible = BDFDB . TimeUtils . suppress ( ( ... args ) => {
2023-06-06 08:48:41 +02:00
let ids = BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) . filter ( n => n . folderId ) . map ( n => n . guildIds ) . flat ( 10 ) ;
2021-10-18 21:38:28 +02:00
args [ 2 ] = args [ 2 ] . filter ( id => ! ids . includes ( id ) ) ;
2023-04-01 12:55:09 +02:00
return topIsVisible ( ... args ) || ids . includes ( args [ 0 ] ) && BDFDB . LibraryStores . GuildReadStateStore . getMentionCount ( args [ 0 ] ) == 0 ;
2022-08-15 13:29:46 +02:00
} , "Error in isVisible of Top Bar in Guild List!" ) ;
2021-10-18 21:38:28 +02:00
}
let bottomBar = BDFDB . ReactUtils . findChild ( e . returnvalue , { props : [ [ "className" , BDFDB . disCN . guildswrapperunreadmentionsbarbottom ] ] } ) ;
if ( bottomBar ) {
let bottomIsVisible = bottomBar . props . isVisible ;
2022-07-11 14:00:45 +02:00
bottomBar . props . isVisible = BDFDB . TimeUtils . suppress ( ( ... args ) => {
2023-06-06 08:48:41 +02:00
let ids = BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) . filter ( n => n . folderId ) . map ( n => n . guildIds ) . flat ( 10 ) ;
2021-10-18 21:38:28 +02:00
args [ 2 ] = args [ 2 ] . filter ( id => ! ids . includes ( id ) ) ;
2023-04-01 12:55:09 +02:00
return bottomIsVisible ( ... args ) || ids . includes ( args [ 0 ] ) && BDFDB . LibraryStores . GuildReadStateStore . getMentionCount ( args [ 0 ] ) == 0 ;
2022-08-15 13:29:46 +02:00
} , "Error in isVisible of Bottom Bar in Guild List!" ) ;
2020-09-19 20:49:33 +02:00
}
2022-12-01 17:11:39 +01:00
e . returnvalue = [
e . returnvalue ,
BDFDB . ReactUtils . createElement ( FolderGuildContentComponent , {
isAppFullscreen : BDFDB . LibraryStores . ChannelRTCStore . isFullscreenInContext ( ) ,
2023-02-22 15:34:45 +01:00
themeOverride : BDFDB . LibraryStores . ThemeStore . darkSidebar
2022-12-01 17:11:39 +01:00
} , true )
] . flat ( 10 ) ;
2020-02-08 19:07:33 +01:00
}
2019-01-13 22:53:07 +01:00
}
2020-03-31 20:46:41 +02:00
2021-11-03 11:49:38 +01:00
processFolderItem ( e ) {
if ( ! e . instance . props . folderNode ) return ;
2020-09-19 20:49:33 +02:00
2021-11-03 11:49:38 +01:00
let data = this . getFolderConfig ( e . instance . props . folderNode . id ) ;
2022-12-02 12:41:03 +01:00
2022-09-27 16:53:10 +02:00
if ( data . muteFolder ) for ( let guildId of e . instance . props . folderNode . children . map ( n => n . id ) ) if ( ! BDFDB . LibraryStores . UserGuildSettingsStore . 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 ) ;
2021-11-03 11:49:38 +01:00
if ( folderStates [ e . instance . props . folderNode . id ] && ! BDFDB . equals ( state , folderStates [ e . instance . props . folderNode . id ] ) ) {
2020-09-19 20:49:33 +02:00
if ( data . autoRead && ( state . unread || state . badge > 0 ) ) {
2021-11-03 11:49:38 +01:00
BDFDB . TimeUtils . clear ( folderReads [ e . instance . props . folderNode . id ] ) ;
folderReads [ e . instance . props . folderNode . id ] = BDFDB . TimeUtils . timeout ( _ => {
2022-01-10 13:28:46 +01:00
BDFDB . GuildUtils . markAsRead ( e . instance . props . folderNode . children . map ( n => n . id ) ) ;
2020-09-19 20:49:33 +02:00
} , 10000 ) ;
}
2020-02-08 19:07:33 +01:00
BDFDB . ReactUtils . forceUpdate ( folderGuildContent ) ;
}
2021-11-03 11:49:38 +01:00
folderStates [ e . instance . props . folderNode . id ] = state ;
}
2024-04-02 19:14:42 +02:00
processFolderItemWrapper ( e ) {
if ( ! e . instance . props . folderNode && e . returnvalue . props . style [ "--folder-color" ] ) return ;
let folderColor = this . settings . general . addFolderBackground && BDFDB . LibraryStores . ExpandedGuildFolderStore . isFolderExpanded ( e . instance . props . folderNode . id ) && ( BDFDB . ColorUtils . convert ( e . instance . props . folderNode . color , "HEX" ) || BDFDB . ColorUtils . convert ( BDFDB . DiscordConstants . Colors . BRAND , "RGB" ) ) ;
if ( folderColor ) e . returnvalue = BDFDB . ReactUtils . createElement ( "div" , {
style : { "--folder-color" : folderColor } ,
children : e . returnvalue
} ) ;
}
2021-11-03 11:49:38 +01:00
processFolderHeader ( e ) {
if ( ! e . instance . props . folderNode ) return ;
let data = this . getFolderConfig ( e . instance . props . folderNode . id ) ;
2022-12-02 12:41:03 +01:00
2022-12-10 11:15:13 +01:00
let [ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : "FolderIcon" } ) ;
if ( index > - 1 ) {
2023-03-23 19:48:16 +01:00
if ( parseInt ( data . iconID ) == - 1 && ( e . instance . props . expanded || data . useClosedIcon && ! e . instance . props . expanded ) ) children [ index ] = BDFDB . ReactUtils . createElement ( "div" , {
2022-12-10 11:15:13 +01:00
className : BDFDB . disCN . guildfoldericonwrapper ,
children : BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildfoldericonwrapperexpanded ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SvgIcon , {
name : BDFDB . LibraryComponents . SvgIcon . Names . FOLDER ,
2023-03-23 19:48:16 +01:00
style : { color : BDFDB . ColorUtils . convert ( data . color1 || BDFDB . DiscordConstants . Colors . BRAND , "RGB" ) }
2022-12-10 11:15:13 +01:00
} )
} )
} ) ;
2022-12-10 20:21:45 +01:00
else if ( e . instance . props . expanded || data . useClosedIcon ) {
2022-12-10 11:15:13 +01:00
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 ;
2024-04-19 14:45:22 +02:00
if ( icon ) {
children [ index ] = BDFDB . ReactUtils . createElement ( "div" , {
className : BDFDB . disCN . guildfoldericonwrapper ,
style : { background : ` url( ${ icon } ) center/cover no-repeat ` }
} ) ;
BDFDB . ReactUtils . forceStyle ( children [ index ] , [ "background" ] ) ;
}
2020-09-19 20:49:33 +02:00
}
2022-12-10 11:15:13 +01:00
if ( this . settings . general . showCountBadge ) {
let mask = BDFDB . ReactUtils . findChild ( e . returnvalue , { name : "BlobMask" } ) ;
if ( mask ) {
mask . props . upperLeftBadgeWidth = BDFDB . LibraryComponents . Badges . NumberBadge . prototype . getBadgeWidthForValue ( e . instance . props . folderNode . children . length ) ;
mask . props . upperLeftBadge = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Badges . NumberBadge , {
count : e . instance . props . folderNode . children . length ,
style : { backgroundColor : "var(--bdfdb-blurple)" }
} ) ;
}
2020-09-19 20:49:33 +02:00
}
}
2020-02-08 19:07:33 +01:00
}
2021-11-03 11:49:38 +01:00
2022-12-10 11:15:13 +01:00
processTooltipContainer ( e ) {
if ( ! e . instance . props . tooltipClassName || e . instance . props . tooltipClassName . indexOf ( BDFDB . disCN . guildlistitemtooltip ) == - 1 ) return ;
let child = e . instance . props . children ( { } ) ;
if ( ! child || ! child . props || ! child . props . children || ! child . props . children . props || ! child . props . children . props . folderNode ) return ;
2022-12-02 12:41:03 +01:00
2022-12-10 11:15:13 +01:00
e . instance . props . shouldShow = false ;
let data = this . getFolderConfig ( child . props . children . props . folderNode . id ) ;
let childrenRender = e . instance . props . children ;
e . instance . props . children = BDFDB . TimeUtils . suppress ( ( ... args ) => BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . TooltipContainer , {
text : child . props . children . props . folderNode . name || e . instance . props . text ,
2022-12-02 12:41:03 +01:00
tooltipConfig : {
2022-12-13 20:18:25 +01:00
className : BDFDB . disCN . guildlistitemtooltip ,
2022-12-02 12:41:03 +01:00
type : "right" ,
list : true ,
offset : 12 ,
backgroundColor : data . color3 ,
fontColor : data . color4
} ,
2022-12-10 11:15:13 +01:00
children : childrenRender ( ... args )
} ) , "Error in children Render of Guild Folder Tooltip!" ) ;
2022-12-02 12:41:03 +01:00
}
2021-11-03 11:49:38 +01:00
processGuildItem ( e ) {
2021-09-24 17:31:41 +02:00
BDFDB . TimeUtils . clear ( forceCloseTimeout ) ;
forceCloseTimeout = BDFDB . TimeUtils . timeout ( _ => {
2022-09-27 16:53:10 +02:00
let newCurrentGuild = BDFDB . LibraryStores . SelectedGuildStore . getGuildId ( ) ;
2021-09-24 17:31:41 +02:00
if ( newCurrentGuild != currentGuild && newCurrentGuild ) {
let folder = BDFDB . GuildUtils . getFolder ( newCurrentGuild ) ;
2022-09-27 16:53:10 +02:00
if ( this . settings . general . closeAllFolders ) for ( let openFolderId of BDFDB . LibraryStores . ExpandedGuildFolderStore . 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 . LibraryStores . ExpandedGuildFolderStore . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
2021-09-24 17:31:41 +02:00
}
currentGuild = newCurrentGuild ;
} , 1000 ) ;
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
} ) ;
}
}
2019-11-28 10:18:29 +01:00
}
2020-09-19 20:49:33 +02:00
2023-11-02 11:57:54 +01:00
processModalRoot ( e ) {
if ( e . instance . props [ "aria-label" ] != BDFDB . LanguageUtils . LanguageStrings . SERVER _FOLDER _SETTINGS ) return ;
e . instance . props . size = BDFDB . LibraryComponents . ModalComponents . ModalSize . LARGE ;
}
2022-12-01 17:11:39 +01:00
processFolderSettingsModal ( e ) {
2023-11-02 11:57:54 +01:00
let folder = BDFDB . LibraryStores . SortedGuildStore . getGuildFolderById ( e . instance . props . folderId ) ;
let data = this . getFolderConfig ( e . instance . props . folderId ) ;
let newData = Object . assign ( { } , data , { folderName : folder . folderName } ) ;
let tabs = { } ;
let [ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : "ModalHeader" } ) ;
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 : [
{ value : this . labels . modal _tabheader1 } ,
{ value : this . labels . modal _tabheader2 } ,
{ value : this . labels . modal _tabheader3 } ,
{ value : this . labels . modal _tabheader4 }
] ,
onItemSelect : ( value , instance ) => {
let tabsArray = BDFDB . ObjectUtils . toArray ( tabs ) ;
for ( let ins of tabsArray ) {
if ( ins . props . tab == value ) ins . props . open = true ;
else delete ins . props . open ;
2020-09-19 20:49:33 +02:00
}
2023-11-02 11:57:54 +01:00
BDFDB . ReactUtils . forceUpdate ( tabsArray ) ;
}
} )
} )
} ) ) ;
}
[ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { filter : n => n && n . props && n . props . children && n . props . children . type == "form" } ) ;
if ( index > - 1 ) children [ index ] . props . children = [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
tab : this . labels . modal _tabheader1 ,
open : true ,
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader1 ] = instance ; } ,
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 ,
autoFocus : true ,
onChange : value => newData . folderName = value
2020-02-08 19:07:33 +01:00
} )
2023-11-02 11:57:54 +01:00
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
title : this . labels . modal _iconpicker ,
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( FolderIconPickerComponent , {
selectedIcon : data . iconID ,
onSelect : value => newData . iconID = value
} , true )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
margin : 20 ,
label : this . labels . modal _useclosedicon ,
tag : BDFDB . LibraryComponents . FormComponents . FormTags . H5 ,
value : data . useClosedIcon ,
onChange : value => newData . useClosedIcon = value
2019-11-28 10:18:29 +01:00
} )
2023-11-02 11:57:54 +01:00
]
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
tab : this . labels . modal _tabheader2 ,
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader2 ] = instance ; } ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
title : this . labels . modal _colorpicker1 ,
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color1 ,
defaultFallback : ! data . color1 && ! data . swapColors ,
onColorChange : value => newData . color1 = value
2020-02-08 19:07:33 +01:00
} )
2023-11-02 11:57:54 +01:00
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
title : this . labels . modal _colorpicker2 ,
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color2 ,
defaultFallback : ! data . color2 && data . swapColors ,
onColorChange : value => newData . color2 = value
2020-02-08 19:07:33 +01:00
} )
2023-11-02 11:57:54 +01:00
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
margin : 20 ,
label : this . labels . modal _swapcolor ,
tag : BDFDB . LibraryComponents . FormComponents . FormTags . H5 ,
value : data . swapColors ,
onChange : value => newData . swapColors = value
} )
]
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
tab : this . labels . modal _tabheader3 ,
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader3 ] = instance ; } ,
children : [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
title : this . labels . modal _colorpicker3 ,
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color3 ,
onColorChange : value => newData . color3 = value
2020-02-08 19:07:33 +01:00
} )
2023-11-02 11:57:54 +01:00
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . FormComponents . FormItem , {
title : this . labels . modal _colorpicker4 ,
className : BDFDB . disCN . marginbottom20 ,
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ColorSwatches , {
color : data . color4 ,
onColorChange : value => newData . color4 = value
} )
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . SettingsItem , {
type : "Switch" ,
margin : 20 ,
label : this . labels . modal _copytooltipcolor ,
tag : BDFDB . LibraryComponents . FormComponents . FormTags . H5 ,
value : data . copyTooltipColor ,
onChange : value => newData . copyTooltipColor = value
} )
]
} ) ,
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ModalComponents . ModalTabContent , {
tab : this . labels . modal _tabheader4 ,
ref : instance => { if ( instance ) tabs [ this . labels . modal _tabheader4 ] = instance ; } ,
children : BDFDB . ReactUtils . createElement ( FolderIconCustomPreviewComponent , { } , true )
} )
] ;
[ children , index ] = BDFDB . ReactUtils . findParent ( e . returnvalue , { name : "ModalFooter" } ) ;
if ( index > - 1 ) children [ index ] . props . children = [
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . Button , {
children : BDFDB . LanguageUtils . LanguageStrings . SAVE ,
onClick : _ => {
let folderColor = newData [ newData . swapColors ? "color2" : "color1" ] ;
this . updateFolder ( {
folderId : e . instance . props . folderId ,
folderName : newData . folderName ,
folderColor : folderColor ? BDFDB . ColorUtils . convert ( folderColor && BDFDB . ObjectUtils . is ( folderColor ) ? folderColor [ Object . keys ( folderColor ) [ 0 ] ] : folderColor , "INT" ) : null
} ) ;
if ( ! BDFDB . equals ( newData , data ) ) {
BDFDB . DataUtils . save ( newData , this , "folders" , e . instance . props . folderId ) ;
this . forceUpdateAll ( ) ;
2020-02-08 19:07:33 +01:00
}
2023-11-02 11:57:54 +01:00
e . instance . close ( ) ;
}
} )
] ;
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 ) ;
2023-06-06 08:48:41 +02:00
return BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) . every ( n => ! n . folderId || n . folderId != id ) ? id : this . generateId ( prefix ) ;
2020-09-19 20:49:33 +02:00
}
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 ;
2021-11-03 11:49:38 +01:00
else if ( key == "mediaState" ) Object . assign ( state , instance . props [ key ] ) ;
2020-09-19 20:49:33 +02:00
}
return state ;
2020-02-08 19:07:33 +01:00
}
2020-09-19 20:49:33 +02:00
getFolderConfig ( folderId ) {
2023-06-06 08:48:41 +02:00
let folder = BDFDB . LibraryStores . SortedGuildStore . getGuildFolderById ( folderId ) || { } ;
2020-09-19 20:49:33 +02:00
let data = folderConfigs [ folderId ] || {
iconID : "-1" ,
muteFolder : false ,
autoRead : false ,
2022-12-10 20:21:45 +01:00
useClosedIcon : false ,
2020-09-19 20:49:33 +02:00
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 , {
2023-11-02 11:57:54 +01:00
prefix : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . GuildIcon , {
2020-09-19 20:49:33 +02:00
className : BDFDB . disCN . listavatar ,
guild : guild ,
2023-11-02 11:57:54 +01:00
size : BDFDB . LibraryComponents . GuildIcon . Sizes . MEDIUM
2020-09-19 20:49:33 +02:00
} ) ,
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 ) {
2023-06-06 08:48:41 +02:00
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) ) , guildFolders = [ ] , guildPositions = [ ] ;
2020-09-19 20:49:33 +02:00
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 ) ;
2022-08-15 13:29:46 +02:00
BDFDB . LibraryModules . FolderSettingsUtils . saveGuildFolders ( guildFolders ) ;
2020-09-19 20:49:33 +02:00
}
createFolder ( guildIds ) {
if ( ! guildIds ) return ;
guildIds = [ guildIds ] . flat ( 10 ) ;
if ( ! guildIds . length ) return ;
2023-06-06 08:48:41 +02:00
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) ) , guildFolders = [ ] , guildPositions = [ ] , added = false ;
2020-09-19 20:49:33 +02:00
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 ) ;
2022-08-15 13:29:46 +02:00
BDFDB . LibraryModules . FolderSettingsUtils . saveGuildFolders ( guildFolders ) ;
2019-10-09 09:40:15 +02:00
}
2020-09-19 20:49:33 +02:00
removeFolder ( folderId ) {
2023-06-06 08:48:41 +02:00
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) ) , guildFolders = [ ] , guildPositions = [ ] ;
2020-09-19 20:49:33 +02:00
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 ) ;
2022-08-15 13:29:46 +02:00
BDFDB . LibraryModules . FolderSettingsUtils . saveGuildFolders ( guildFolders ) ;
2019-10-08 19:12:48 +02:00
}
2020-09-19 20:49:33 +02:00
addGuildToFolder ( folderId , guildId ) {
2023-06-06 08:48:41 +02:00
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) ) , guildFolders = [ ] , guildPositions = [ ] ;
2020-09-19 20:49:33 +02:00
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 ) ;
2022-08-15 13:29:46 +02:00
BDFDB . LibraryModules . FolderSettingsUtils . saveGuildFolders ( guildFolders ) ;
2019-10-08 19:12:48 +02:00
}
2020-09-19 20:49:33 +02:00
removeGuildFromFolder ( folderId , guildId ) {
2023-06-06 08:48:41 +02:00
let oldGuildFolders = [ ] . concat ( BDFDB . LibraryStores . SortedGuildStore . getGuildFolders ( ) ) , guildFolders = [ ] , guildPositions = [ ] ;
2020-09-19 20:49:33 +02:00
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 ) ;
2022-08-15 13:29:46 +02:00
BDFDB . LibraryModules . FolderSettingsUtils . saveGuildFolders ( 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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Авто: Маркиране като прочетено" ,
foldercontext _mutefolder : "Без звук папка" ,
foldercontext _removefolder : "Изтриване на папка" ,
foldercontext _removefolder _confirm : "Сигурни ли сте, че искате да изтриете папката {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Основен цвят на папката" ,
modal _colorpicker2 : "Вторичен цвят на папката" ,
modal _colorpicker3 : "Цвят на подсказка" ,
modal _colorpicker4 : "Цвят на шрифта" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Използвайте един и същи цвят за всички сървъри в папка" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Затворена икона" ,
modal _customopen : "Отворете иконата" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Визуализация на иконата" ,
2020-12-21 19:56:36 +01:00
modal _iconpicker : "Избор на папка" ,
modal _swapcolor : "Използвайте втория цвят за оригиналната папка" ,
modal _tabheader1 : "Папка" ,
modal _tabheader2 : "Цвят на папката" ,
modal _tabheader3 : "Цвят на подсказка" ,
modal _tabheader4 : "Собствени символи" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Използвайте затворена икона вместо минисервъра" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "Папка на сървъра" ,
serversubmenu _addtofolder : "Добавете сървъра към папката" ,
serversubmenu _createfolder : "Създай папка" ,
serversubmenu _removefromfolder : "Премахнете сървъра от папката"
2020-09-19 20:49:33 +02:00
} ;
2022-08-15 13:29:46 +02:00
case "cs" : // Czech
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Označit jako přečtené" ,
foldercontext _mutefolder : "Ztlumit složku" ,
foldercontext _removefolder : "Smazat složku" ,
foldercontext _removefolder _confirm : "Opravdu chcete smazat složku {{var0}}" ,
2022-08-15 13:29:46 +02:00
modal _colorpicker1 : "Barva primární složky" ,
modal _colorpicker2 : "Barva sekundární složky" ,
modal _colorpicker3 : "Barva popisku" ,
modal _colorpicker4 : "Barva fontu" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Použijte stejnou barvu pro všechny servery ve složce" ,
2022-08-15 13:29:46 +02:00
modal _customclosed : "Uzavřená ikona" ,
modal _customopen : "Otevřít ikonu" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Náhled ikony" ,
2022-08-15 13:29:46 +02:00
modal _iconpicker : "Výběr složky" ,
modal _swapcolor : "Pro původní složku použijte druhou barvu" ,
modal _tabheader1 : "Složka" ,
modal _tabheader2 : "Barva složky" ,
modal _tabheader3 : "Barva popisku" ,
modal _tabheader4 : "Vlastní ikony" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Místo miniserverů použijte uzavřenou ikonu" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "Složka serveru" ,
serversubmenu _addtofolder : "Přidejte server do složky" ,
serversubmenu _createfolder : "Vytvořit složku" ,
serversubmenu _removefromfolder : "Odebrat server ze složky"
2022-08-15 13:29:46 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "da" : // Danish
2020-09-19 20:49:33 +02:00
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Marker som læst" ,
foldercontext _mutefolder : "Dæmp mappe" ,
foldercontext _removefolder : "Slet mappe" ,
foldercontext _removefolder _confirm : "Er du sikker på, at du vil slette mappen {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Primær mappefarve" ,
modal _colorpicker2 : "Sekundær mappefarve" ,
modal _colorpicker3 : "Værktøjstipfarve" ,
modal _colorpicker4 : "Skriftfarve" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Brug den samme farve til alle servere i en mappe" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Lukket ikon" ,
modal _customopen : "Åbn ikonet" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Eksempel på ikon" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Brug et lukket ikon i stedet for miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Als gelesen markieren" ,
foldercontext _mutefolder : "Ordner stummschalten" ,
foldercontext _removefolder : "Ordner löschen" ,
foldercontext _removefolder _confirm : "Möchtest du den Ordner {{var0}} wirklich löschen?" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Primäre Ordnerfarbe" ,
modal _colorpicker2 : "Sekundäre Ordnerfarbe" ,
modal _colorpicker3 : "Tooltipfarbe" ,
modal _colorpicker4 : "Schriftfarbe" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Dieselbe Farbe für alle Server eines Ordners verwenden" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Geschlossenes Icon" ,
modal _customopen : "Geöffnetes Icon" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Symbolvorschau" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Anstelle der Miniserver ein geschlossenes Symbol verwenden" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Αυτόματο: Επισήμανση ως αναγνωσμένου" ,
foldercontext _mutefolder : "Σίγαση φακέλου" ,
foldercontext _removefolder : "Διαγραφή φακέλου" ,
foldercontext _removefolder _confirm : "Είστε βέβαιοι ότι θέλετε ν α διαγράψετε τον φάκελο {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Κύριο χρώμα φακέλου" ,
modal _colorpicker2 : "Χρώμα δευτερεύοντος φακέλου" ,
modal _colorpicker3 : "Χρώμα επεξήγησης εργαλείου" ,
modal _colorpicker4 : "Χρώμα γραμματοσειράς" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Χρησιμοποιήστε το ίδιο χρώμα γ ι α όλους τους διακομιστές σε ένα φάκελο" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Κλειστό εικονίδιο" ,
modal _customopen : "Άνοιγμα εικονιδίου" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Προεπισκόπηση εικονιδίου" ,
2020-12-21 19:56:36 +01:00
modal _iconpicker : "Επιλογή φακέλου" ,
modal _swapcolor : "Χρησιμοποιήστε το δεύτερο χρώμα γ ι α τον αρχικό φάκελο" ,
modal _tabheader1 : "Ντοσιέ" ,
modal _tabheader2 : "Χρώμα φακέλου" ,
modal _tabheader3 : "Χρώμα επεξήγησης εργαλείου" ,
modal _tabheader4 : "Ίδια σύμβολα" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Χρησιμοποιήστε ένα κλειστό εικονίδιο αντί γ ι α το miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Automático: marcar como leído" ,
foldercontext _mutefolder : "Silenciar carpeta" ,
foldercontext _removefolder : "Eliminar carpeta" ,
foldercontext _removefolder _confirm : "¿Está seguro de que desea eliminar la carpeta {{var0}}?" ,
2020-12-21 19:56:36 +01:00
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" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Use el mismo color para todos los servidores de una carpeta" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Icono cerrado" ,
modal _customopen : "Abrir icono" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Vista previa del icono" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Use un icono cerrado en lugar del miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Automaattinen: Merkitse luetuksi" ,
foldercontext _mutefolder : "Mykistä kansio" ,
foldercontext _removefolder : "Poista kansio" ,
foldercontext _removefolder _confirm : "Haluatko varmasti poistaa kansion {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Ensisijaisen kansion väri" ,
modal _colorpicker2 : "Toissijaisen kansion väri" ,
modal _colorpicker3 : "Työkaluvinkin väri" ,
modal _colorpicker4 : "Fontin väri" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Käytä samaa väriä kaikille kansion palvelimille" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Suljettu kuvake" ,
modal _customopen : "Avaa kuvake" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Kuvakkeen esikatselu" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Käytä suljetun kuvaketta minipalvelimen sijaan" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: marquer comme lu" ,
foldercontext _mutefolder : "Dossier muet" ,
foldercontext _removefolder : "Supprimer le dossier" ,
foldercontext _removefolder _confirm : "Êtes-vous sûr de vouloir supprimer le dossier {{var0}}" ,
2020-12-21 19:56:36 +01:00
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" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Utilisez la même couleur pour tous les serveurs d'un dossier" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Icône fermée" ,
modal _customopen : "Icône ouverte" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Aperçu de l'icône" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Utilisez une icône fermée au lieu du miniserver" ,
2024-04-02 19:14:42 +02:00
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
} ;
2022-08-15 13:29:46 +02:00
case "hi" : // Hindi
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "ऑटो: पढ़ें के रूप में चिह्नित करें" ,
foldercontext _mutefolder : "मूक फ़ोल्डर" ,
foldercontext _removefolder : "फोल्डर हटा दें" ,
foldercontext _removefolder _confirm : "क्या आप वाकई फ़ोल्डर को हटाना चाहते हैं {{var0}}" ,
2022-08-15 13:29:46 +02:00
modal _colorpicker1 : "प्राथमिक फ़ोल्डर रंग" ,
modal _colorpicker2 : "माध्यमिक फ़ोल्डर रंग" ,
modal _colorpicker3 : "टूलटिप रंग" ,
modal _colorpicker4 : "लिपि का रंग" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "एक फ़ोल्डर में सभी सर्वरों के लिए एक ही रंग का प्रयोग करें" ,
2022-08-15 13:29:46 +02:00
modal _customclosed : "बंद चिह्न" ,
modal _customopen : "खुला चिह्न" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "आइकन पूर्वावलोकन" ,
2022-08-15 13:29:46 +02:00
modal _iconpicker : "फ़ोल्डर चयन" ,
modal _swapcolor : "मूल फ़ोल्डर के लिए दूसरे रंग का प्रयोग करें" ,
modal _tabheader1 : "फ़ोल्डर" ,
modal _tabheader2 : "फ़ोल्डर का रंग" ,
modal _tabheader3 : "टूलटिप रंग" ,
modal _tabheader4 : "कस्टम चिह्न" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "मिनी-सर्वर के बजाय बंद चिह्न का उपयोग करें" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "सर्वर फ़ोल्डर" ,
serversubmenu _addtofolder : "सर्वर को फ़ोल्डर में जोड़ें" ,
serversubmenu _createfolder : "फोल्डर बनाएं" ,
serversubmenu _removefromfolder : "फ़ोल्डर से सर्वर निकालें"
2022-08-15 13:29:46 +02:00
} ;
2020-12-21 19:56:36 +01:00
case "hr" : // Croatian
2020-09-19 20:49:33 +02:00
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Automatski: Označi kao pročitano" ,
foldercontext _mutefolder : "Isključi mapu" ,
foldercontext _removefolder : "Izbriši mapu" ,
foldercontext _removefolder _confirm : "Jeste li sigurni da želite izbrisati mapu {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Boja primarne mape" ,
modal _colorpicker2 : "Boja sekundarne mape" ,
modal _colorpicker3 : "Boja opisa" ,
modal _colorpicker4 : "Boja fonta" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Koristite istu boju za sve poslužitelje u mapi" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Zatvorena ikona" ,
modal _customopen : "Otvori ikonu" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Pregled ikone" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Upotrijebite zatvorenu ikonu umjesto miniservera" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Automatikus: Megjelölés olvasottként" ,
foldercontext _mutefolder : "Mappa némítása" ,
foldercontext _removefolder : "Mappa törlése" ,
foldercontext _removefolder _confirm : "Biztosan törli a(z) {{var0}} mappát?" ,
2020-12-21 19:56:36 +01:00
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" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Használja ugyanazt a színt egy mappa összes kiszolgálójához" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Zárt ikonra" ,
modal _customopen : "Megnyitás ikonra" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Ikon előnézet" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Használjon zárt ikont a miniszerver helyett" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: contrassegna come letto" ,
foldercontext _mutefolder : "Disattiva cartella" ,
foldercontext _removefolder : "Elimina cartella" ,
foldercontext _removefolder _confirm : "Sei sicuro di voler eliminare la cartella {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Colore cartella principale" ,
modal _colorpicker2 : "Colore cartella secondaria" ,
modal _colorpicker3 : "Colore della descrizione comando" ,
modal _colorpicker4 : "Colore del carattere" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Usa lo stesso colore per tutti i server in una cartella" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Icona chiusa" ,
modal _customopen : "Icona Apri" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Anteprima icona" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Utilizza un'icona chiusa al posto del miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "自動:既読としてマーク" ,
foldercontext _mutefolder : "ミュートフォルダ" ,
foldercontext _removefolder : "フォルダを削除" ,
foldercontext _removefolder _confirm : "本当にフォルダ {{var0}} を削除しますか?" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "プライマリフォルダの色" ,
modal _colorpicker2 : "セカンダリフォルダの色" ,
modal _colorpicker3 : "ツールチップの色" ,
modal _colorpicker4 : "フォントの色" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "フォルダ内のすべてのサーバーに同じ色を使用する" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "閉じたアイコン" ,
modal _customopen : "アイコンを開く" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "アイコンプレビュー" ,
2020-12-21 19:56:36 +01:00
modal _iconpicker : "フォルダの選択" ,
modal _swapcolor : "元のフォルダに2番目の色を使用します" ,
modal _tabheader1 : "フォルダ" ,
modal _tabheader2 : "フォルダーの色" ,
modal _tabheader3 : "ツールチップの色" ,
modal _tabheader4 : "独自のシンボル" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "ミニサーバーの代わりに閉じたアイコンを使用する" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "자동 : 읽은 상태로 표시" ,
foldercontext _mutefolder : "폴더 음소거" ,
foldercontext _removefolder : "폴더 삭제" ,
foldercontext _removefolder _confirm : "{{var0}} 폴더를 삭제하시겠습니까?" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "기본 폴더 색상" ,
modal _colorpicker2 : "보조 폴더 색상" ,
modal _colorpicker3 : "툴팁 색상" ,
modal _colorpicker4 : "글자 색" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "폴더의 모든 서버에 동일한 색상 사용" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "닫힌 아이콘" ,
modal _customopen : "열기 아이콘" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "아이콘 미리보기" ,
2020-12-21 19:56:36 +01:00
modal _iconpicker : "폴더 선택" ,
modal _swapcolor : "원본 폴더에 두 번째 색상 사용" ,
modal _tabheader1 : "폴더" ,
modal _tabheader2 : "폴더 색상" ,
modal _tabheader3 : "툴팁 색상" ,
modal _tabheader4 : "자신의 기호" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "미니 서버 대신 닫힌 아이콘 사용" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Automatinis: pažymėti kaip perskaitytą" ,
foldercontext _mutefolder : "Nutildyti aplanką" ,
foldercontext _removefolder : "Ištrinti aplanką" ,
foldercontext _removefolder _confirm : "Ar tikrai norite ištrinti aplanką {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Pagrindinio aplanko spalva" ,
modal _colorpicker2 : "Antrinio aplanko spalva" ,
modal _colorpicker3 : "Patarimo spalva" ,
modal _colorpicker4 : "Šrifto spalva" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Naudokite tą pačią spalvą visiems aplanko serveriams" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Uždaryta piktograma" ,
modal _customopen : "Atidaryti piktogramą" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Piktogramos peržiūra" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Vietoj miniserverio naudokite uždarą piktogramą" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Markeer als gelezen" ,
foldercontext _mutefolder : "Mute map" ,
foldercontext _removefolder : "Verwijder map" ,
foldercontext _removefolder _confirm : "Weet u zeker dat u de map {{var0}} wilt verwijderen" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Kleur primaire map" ,
modal _colorpicker2 : "Kleur secundaire map" ,
modal _colorpicker3 : "Tooltipkleur" ,
modal _colorpicker4 : "Letterkleur" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Gebruik dezelfde kleur voor alle servers in een map" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Gesloten pictogram" ,
modal _customopen : "Open icoon" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Pictogramvoorbeeld" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Gebruik een gesloten pictogram in plaats van de miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Merk som lest" ,
foldercontext _mutefolder : "Demp mappe" ,
foldercontext _removefolder : "Slett mappe" ,
foldercontext _removefolder _confirm : "Er du sikker på at du vil slette mappen {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Primær mappefarge" ,
modal _colorpicker2 : "Sekundær mappefarge" ,
modal _colorpicker3 : "Verktøytipsfarge" ,
modal _colorpicker4 : "Skriftfarge" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Bruk samme farge for alle servere i en mappe" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Lukket ikon" ,
modal _customopen : "Åpne ikonet" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Forhåndsvisning av ikon" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Bruk et lukket ikon i stedet for miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: oznacz jako przeczytane" ,
foldercontext _mutefolder : "Wycisz folder" ,
foldercontext _removefolder : "Usunięty folder" ,
foldercontext _removefolder _confirm : "Czy na pewno chcesz usunąć folder {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Główny kolor folderu" ,
modal _colorpicker2 : "Kolor folderu dodatkowego" ,
modal _colorpicker3 : "Kolor podpowiedzi" ,
modal _colorpicker4 : "Kolor czcionki" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Użyj tego samego koloru dla wszystkich serwerów w folderze" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Ikona zamknięta" ,
modal _customopen : "Otwórz ikonę" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Podgląd ikon" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Użyj zamkniętej ikony zamiast miniserwera" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Marcar como lido" ,
foldercontext _mutefolder : "Pasta sem som" ,
foldercontext _removefolder : "Excluir pasta" ,
foldercontext _removefolder _confirm : "Tem certeza de que deseja excluir a pasta {{var0}}" ,
2020-12-21 19:56:36 +01:00
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" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Use a mesma cor para todos os servidores em uma pasta" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Ícone fechado" ,
modal _customopen : "Ícone aberto" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Antevisão do ícone" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Use um ícone fechado em vez do miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Automat: marcați ca citit" ,
foldercontext _mutefolder : "Dezactivați folderul" ,
foldercontext _removefolder : "Ștergeți folderul" ,
foldercontext _removefolder _confirm : "Sigur doriți să ștergeți dosarul {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Culoarea folderului principal" ,
modal _colorpicker2 : "Culoare dosar secundar" ,
modal _colorpicker3 : "Culoarea sfatului de instrumente" ,
modal _colorpicker4 : "Culoarea fontului" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Utilizați aceeași culoare pentru toate serverele dintr-un folder" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Pictogramă închisă" ,
modal _customopen : "Pictogramă Deschidere" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Previzualizare pictogramă" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Folosiți o pictogramă închisă în locul miniserverului" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Авто: Отметить как прочитанное" ,
foldercontext _mutefolder : "Отключить папку" ,
foldercontext _removefolder : "Удалить папку" ,
foldercontext _removefolder _confirm : "Вы уверены, что хотите удалить папку {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Цвет основной папки" ,
modal _colorpicker2 : "Цвет вторичной папки" ,
modal _colorpicker3 : "Цвет всплывающей подсказки" ,
modal _colorpicker4 : "Цвет шрифта" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Используйте один цвет для всех серверов в папке" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Закрытый значок" ,
modal _customopen : "Открыть значок" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Предварительный просмотр значков" ,
2020-12-21 19:56:36 +01:00
modal _iconpicker : "Выбор папки" ,
modal _swapcolor : "Используйте второй цвет для исходной папки" ,
modal _tabheader1 : "Папка" ,
modal _tabheader2 : "Цвет папки" ,
modal _tabheader3 : "Цвет всплывающей подсказки" ,
modal _tabheader4 : "Собственные символы" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Используйте закрытый значок вместо минисервера" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Markera som läst" ,
foldercontext _mutefolder : "Tyst mapp" ,
foldercontext _removefolder : "Ta bort mapp" ,
foldercontext _removefolder _confirm : "Är du säker på att du vill ta bort mappen {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Primär mappfärg" ,
modal _colorpicker2 : "Sekundär mappfärg" ,
modal _colorpicker3 : "Verktygstipsfärg" ,
modal _colorpicker4 : "Fontfärg" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Använd samma färg för alla servrar i en mapp" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Stängd ikon" ,
modal _customopen : "Öppna ikonen" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Ikonförhandsvisning" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Använd en stängd ikon istället för miniserver" ,
2024-04-02 19:14:42 +02:00
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "อัตโนมัติ: ทำเครื่องหมายว่าอ่านแล้ว" ,
foldercontext _mutefolder : "ปิดเสียงโฟลเดอร์" ,
foldercontext _removefolder : "ลบโฟลเดอร์" ,
foldercontext _removefolder _confirm : "คุณแน่ใจหรือว่าต้องการลบโฟลเดอร์ {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "สีโฟลเดอร์หลัก" ,
modal _colorpicker2 : "สีโฟลเดอร์รอง" ,
modal _colorpicker3 : "สีคำแนะนำเครื่องมือ" ,
modal _colorpicker4 : "สีตัวอักษร" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "ใช้สีเดียวกันสำหรับเซิร์ฟเวอร์ทั้งหมดในโฟลเดอร์" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "ไอคอนปิด" ,
modal _customopen : "เปิดไอคอน" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "ดูตัวอย่างไอคอน" ,
2020-12-21 19:56:36 +01:00
modal _iconpicker : "การเลือกโฟลเดอร์" ,
modal _swapcolor : "ใช้สีที่สองสำหรับโฟลเดอร์เดิม" ,
modal _tabheader1 : "โฟลเดอร์" ,
modal _tabheader2 : "สีโฟลเดอร์" ,
modal _tabheader3 : "สีคำแนะนำเครื่องมือ" ,
modal _tabheader4 : "สัญลักษณ์ของตัวเอง" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "ใช้ไอคอนปิดแทน miniserver" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "โฟลเดอร์เซิร์ฟเวอร์" ,
serversubmenu _addtofolder : "เพิ่มเซิร์ฟเวอร์ลงในโฟลเดอร์" ,
serversubmenu _createfolder : "สร้างโฟลเดอร์" ,
serversubmenu _removefromfolder : "ลบเซิร์ฟเวอร์ออกจากโฟลเดอร์"
2020-12-21 19:56:36 +01:00
} ;
case "tr" : // Turkish
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Otomatik: Okundu olarak işaretle" ,
foldercontext _mutefolder : "Klasörü sessize al" ,
foldercontext _removefolder : "Klasörü sil" ,
foldercontext _removefolder _confirm : "{{var0}} Klasörünü silmek istediğinizden emin misiniz?" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Birincil klasör rengi" ,
modal _colorpicker2 : "İkincil klasör rengi" ,
modal _colorpicker3 : "Araç ipucu rengi" ,
modal _colorpicker4 : "Yazı rengi" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Bir klasördeki tüm sunucular için aynı rengi kullanı n" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Kapalı simge" ,
modal _customopen : "Aç simgesi" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Simge önizlemesi" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Miniserver yerine kapalı bir simge kullanı n" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "Sunucu klasörü" ,
serversubmenu _addtofolder : "Sunucuyu klasöre ekleyin" ,
serversubmenu _createfolder : "Klasör oluşturun" ,
serversubmenu _removefromfolder : "Sunucuyu klasörden kaldı r"
2020-12-21 19:56:36 +01:00
} ;
case "uk" : // Ukrainian
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Авто: Позначити як прочитане" ,
foldercontext _mutefolder : "Вимкнути папку" ,
foldercontext _removefolder : "Видалити папку" ,
foldercontext _removefolder _confirm : "Ви впевнені, що хочете видалити папку {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Основний колір папки" ,
modal _colorpicker2 : "Колір вторинної папки" ,
modal _colorpicker3 : "Колір підказки" ,
modal _colorpicker4 : "Колір шрифту" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "Використовуйте однаковий колір для всіх серверів у папці" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Закритий значок" ,
modal _customopen : "Відкрити значок" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Попередній перегляд піктограми" ,
2020-12-21 19:56:36 +01:00
modal _iconpicker : "Вибір папки" ,
modal _swapcolor : "Використовуйте другий колір для вихідної папки" ,
modal _tabheader1 : "Папку" ,
modal _tabheader2 : "Колір папки" ,
modal _tabheader3 : "Колір підказки" ,
modal _tabheader4 : "Власні символи" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Використовуйте закритий значок замість мінісервера" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "Папка сервера" ,
serversubmenu _addtofolder : "Додайте сервер до папки" ,
serversubmenu _createfolder : "Створити папку" ,
serversubmenu _removefromfolder : "Видалити сервер з папки"
2020-12-21 19:56:36 +01:00
} ;
case "vi" : // Vietnamese
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Tự động: Đánh dấu là đã đọc" ,
foldercontext _mutefolder : "Thư mục ẩn" ,
foldercontext _removefolder : "Xóa thư mục" ,
foldercontext _removefolder _confirm : "Bạn có chắc chắn muốn xóa Thư mục {{var0}} không" ,
2020-12-21 19:56:36 +01:00
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ữ" ,
2024-04-02 19:14:42 +02:00
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" ,
2020-12-21 19:56:36 +01:00
modal _customclosed : "Biểu tượng đã đóng" ,
modal _customopen : "Mở biểu tượng" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Xem trước biểu tượng" ,
2020-12-21 19:56:36 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Sử dụng biểu tượng đã đóng thay vì trình thu nhỏ" ,
2024-04-02 19:14:42 +02:00
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"
2020-12-21 19:56:36 +01:00
} ;
2021-01-15 17:54:22 +01:00
case "zh-CN" : // Chinese (China)
2020-12-21 19:56:36 +01:00
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "自动:标记为已读" ,
foldercontext _mutefolder : "静音文件夹" ,
foldercontext _removefolder : "删除文件夹" ,
foldercontext _removefolder _confirm : "您确定要删除文件夹 {{var0}}" ,
2021-04-15 14:36:47 +02:00
modal _colorpicker1 : "文件夹主色" ,
modal _colorpicker2 : "文件夹辅色" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker3 : "工具提示颜色" ,
modal _colorpicker4 : "字体颜色" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "对文件夹中的所有服务器使用相同颜色" ,
2021-04-15 14:36:47 +02:00
modal _customclosed : "文件夹收起图标" ,
modal _customopen : "文件夹展开图标" ,
2024-04-02 19:14:42 +02: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 : "自定义图标" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "使用文件夹收起图标代替服务器缩略图" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "服务器文件夹" ,
serversubmenu _addtofolder : "将服务器添加到文件夹" ,
serversubmenu _createfolder : "创建文件夹" ,
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 {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "自動:標記為已讀" ,
foldercontext _mutefolder : "靜音資料夾" ,
foldercontext _removefolder : "刪除資料夾" ,
foldercontext _removefolder _confirm : "您確定要刪除文件夾 {{var0}}" ,
2021-04-15 14:36:47 +02:00
modal _colorpicker1 : "資料夾主色" ,
modal _colorpicker2 : "資料夾輔色" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker3 : "工具提示顏色" ,
modal _colorpicker4 : "字體顏色" ,
2024-04-02 19:14:42 +02:00
modal _copytooltipcolor : "對資料夾中的所有伺服器使用相同顏色" ,
2021-04-15 14:36:47 +02:00
modal _customclosed : "資料夾收起圖標" ,
modal _customopen : "資料夾展開圖標" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "圖標預覽" ,
2020-12-21 19:56:36 +01:00
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 : "客製化圖標" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "使用資料夾收起圖標代替伺服器縮略圖" ,
2024-04-02 19:14:42 +02:00
servercontext _serverfolders : "伺服器資料夾" ,
serversubmenu _addtofolder : "將伺服器添加到資料夾" ,
serversubmenu _createfolder : "創建資料夾" ,
serversubmenu _removefromfolder : "從資料夾中移除伺服器"
2020-12-21 19:56:36 +01:00
} ;
default : // English
return {
2024-04-02 19:14:42 +02:00
foldercontext _autoreadfolder : "Auto: Mark As Read" ,
foldercontext _mutefolder : "Mute Folder" ,
foldercontext _removefolder : "Delete Folder" ,
foldercontext _removefolder _confirm : "Are you sure you want to delete the Folder {{var0}}" ,
2020-12-21 19:56:36 +01:00
modal _colorpicker1 : "Primary Folder Color" ,
modal _colorpicker2 : "Secondary Folder Color" ,
modal _colorpicker3 : "Tooltip Color" ,
modal _colorpicker4 : "Font Color" ,
2024-04-02 19:14:42 +02: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" ,
2024-04-02 19:14:42 +02:00
modal _custompreview : "Icon Preview" ,
2021-03-02 17:55:45 +01:00
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" ,
2022-12-10 20:21:45 +01:00
modal _useclosedicon : "Use a closed Icon instead of the Mini-Servers" ,
2024-04-02 19:14:42 +02:00
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
} ;
}
}
} ;
2022-09-01 14:40:11 +02:00
} ) ( window . BDFDB _Global . PluginUtils . buildPlugin ( changeLog ) ) ;
2022-03-19 05:14:49 +01:00
} ) ( ) ;