2019-09-20 22:32:52 +02:00
//META{"name":"ServerFolders","website":"https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/ServerFolders","source":"https://raw.githubusercontent.com/mwittrien/BetterDiscordAddons/master/Plugins/ServerFolders/ServerFolders.plugin.js"}*//
2018-10-11 10:21:26 +02:00
class ServerFolders {
2019-01-13 22:53:07 +01:00
getName ( ) { return "ServerFolders" ; }
2019-10-19 19:15:57 +02:00
getVersion ( ) { return "6.5.8" ; }
2019-01-13 22:53:07 +01:00
getAuthor ( ) { return "DevilBro" ; }
2019-10-08 19:12:48 +02:00
getDescription ( ) { return "Patches Discords native Folders in a way to open Servers within a Folder in a new bar to the right. Also adds a bunch of new features to more easily organize, customize and manage your Folders." ; }
2019-01-26 22:45:19 +01:00
2019-09-04 12:34:02 +02:00
constructor ( ) {
2019-02-24 19:52:22 +01:00
this . changelog = {
2019-10-19 19:15:57 +02:00
"fixed" : [ [ "Tooltips" , "Fixed issue where native tooltip wasn't hidden" ] ]
2019-02-24 19:52:22 +01:00
} ;
2019-10-08 19:12:48 +02:00
2018-10-11 10:21:26 +02:00
this . labels = { } ;
2019-10-08 19:12:48 +02:00
2019-01-04 15:39:20 +01:00
this . patchModules = {
2019-05-03 17:49:54 +02:00
"Guilds" : [ "componentDidMount" , "componentDidUpdate" , "componentWillUnmount" ] ,
2019-10-08 19:12:48 +02:00
"GuildFolder" : [ "componentDidMount" , "componentDidUpdate" ] ,
2019-10-09 10:07:11 +02:00
"Guild" : [ "componentDidMount" , "componentDidUpdate" ] ,
2019-10-08 19:12:48 +02:00
"GuildFolderSettingsModal" : "componentDidMount" ,
2019-02-04 11:22:37 +01:00
"StandardSidebarView" : "componentWillUnmount"
2019-01-04 15:39:20 +01:00
} ;
2019-09-04 12:34:02 +02:00
}
initConstructor ( ) {
2019-10-08 19:12:48 +02:00
this . folderStates = { } ;
this . folderReads = { } ;
this . guildStates = { } ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . css = `
2019-01-24 13:37:08 +01:00
. $ { this . name } - modal . ui - icon - picker - icon {
2018-10-11 10:21:26 +02:00
position : relative ;
2019-10-08 19:12:48 +02:00
margin : 3 px 3 px ;
padding : 3 px 3 px ;
width : 55 px ;
height : 55 px ;
2018-10-11 10:21:26 +02:00
border - radius : 12 px ;
}
2019-01-24 13:37:08 +01:00
. $ { this . name } - modal . ui - icon - picker - icon . ui - picker - inner {
2019-10-08 19:12:48 +02:00
width : 100 % ;
height : 100 % ;
2018-10-11 10:21:26 +02:00
border - radius : 12 px ;
2019-10-08 19:12:48 +02:00
background - position : center ;
background - size : cover ;
background - repeat : no - repeat ;
2018-10-11 10:21:26 +02:00
}
2019-01-24 13:37:08 +01:00
. $ { this . name } - modal . ui - icon - picker - icon . selected $ { BDFDB . dotCN . hovercardbutton } {
2018-10-11 10:21:26 +02:00
display : none ! important ;
}
2019-01-24 13:37:08 +01:00
. $ { this . name } - modal . ui - icon - picker - icon $ { BDFDB . dotCN . hovercardbutton } {
2018-10-11 10:21:26 +02:00
position : absolute ;
top : - 10 px ;
right : - 10 px ;
}
2019-01-24 13:37:08 +01:00
. $ { this . name } - modal . ui - icon - picker - icon . preview . nopic . ui - picker - inner {
2019-10-08 19:12:48 +02:00
background : url ( 'data:image/svg+xml; utf8, <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" width="400" height="400"><path d="M40.400 17.178 C 39.850 17.366,38.793 17.538,38.050 17.560 C 33.351 17.699,23.397 24.788,21.381 29.432 C 21.087 30.109,20.566 30.896,20.223 31.181 C 19.880 31.465,19.600 31.866,19.600 32.071 C 19.600 32.276,19.236 33.242,18.792 34.218 C 16.345 39.589,16.345 49.611,18.792 54.982 C 19.236 55.958,19.600 56.918,19.600 57.116 C 19.600 57.314,19.960 57.802,20.400 58.200 C 20.840 58.598,21.200 59.131,21.200 59.385 C 21.200 60.391,25.680 64.942,91.505 130.800 C 128.995 168.310,159.849 199.326,160.068 199.724 C 160.409 200.344,150.950 209.964,93.989 266.924 C 18.798 342.113,19.600 341.292,19.600 343.126 C 19.600 343.283,19.250 344.065,18.822 344.864 C 15.429 351.195,15.958 362.918,19.932 369.440 C 22.094 372.990,27.474 378.800,28.598 378.800 C 28.861 378.800,29.402 379.160,29.800 379.600 C 30.198 380.040,30.703 380.400,30.922 380.400 C 31.141 380.400,32.238 380.831,33.360 381.358 C 34.482 381.886,36.480 382.533,37.800 382.797 C 43.786 383.994,44.323 384.027,47.299 383.386 C 48.895 383.042,51.010 382.619,52.000 382.446 C 52.990 382.274,54.517 381.743,55.394 381.266 C 56.271 380.790,57.188 380.400,57.432 380.400 C 57.676 380.400,58.202 380.040,58.600 379.600 C 58.998 379.160,59.598 378.800,59.932 378.800 C 60.267 378.800,91.725 347.615,129.839 309.500 C 169.057 270.281,199.496 240.145,199.964 240.073 C 200.602 239.975,216.001 255.193,267.495 306.814 C 327.046 366.511,339.531 378.800,340.627 378.800 C 340.798 378.800,341.265 379.097,341.667 379.461 C 345.728 383.136,361.013 384.409,365.685 381.461 C 366.188 381.143,367.024 380.757,367.541 380.602 C 370.583 379.691,376.623 374.200,379.382 369.836 C 385.105 360.785,384.039 346.409,377.039 338.228 C 376.084 337.113,344.846 305.743,307.621 268.517 C 255.329 216.224,239.969 200.647,240.070 200.009 C 240.143 199.545,270.062 169.288,308.216 131.091 C 345.625 93.641,376.723 62.370,377.324 61.600 C 384.286 52.678,385.036 40.621,379.277 30.171 C 376.136 24.469,367.906 18.537,361.668 17.477 C 354.656 16.286,345.095 17.665,341.883 20.331 C 341.567 20.594,340.549 21.318,339.622 21.941 C 338.695 22.563,307.031 53.972,269.259 91.737 C 231.486 129.501,200.330 160.400,200.022 160.400 C 199.714 160.400,168.938 129.869,131.631 92.554 C 56.225 17.131,60.288 21.047,55.200 18.887 C 51.591 17.354,42.836 16.343,40.400 17.178z" fill="rgb(220,43,67)"></path></svg>' ) center / cover no - repeat ;
2018-10-11 10:21:26 +02:00
}
2019-10-09 08:40:29 +02:00
$ { BDFDB . dotCN . guildfolder } [ style *= "background-image" ] {
background - color : transparent ! important ;
background - position : center ! important ;
background - size : cover ! important ;
background - repeat : no - repeat ! important ;
transiton : unset ! important ;
}
$ { BDFDB . dotCN . guildfolder } [ style *= "background-image" ] $ { BDFDB . dotCN . guildfoldericonwrapper } ,
$ { BDFDB . dotCN . guildfolderexpandendbackground } ,
$ { BDFDB . dotCN . guildfolderexpandedguilds } {
display : none ! important ;
2018-10-11 10:21:26 +02:00
}
2019-04-25 21:58:21 +02:00
$ { BDFDB . dotCN . guildupperbadge } . count {
left : 0 px ;
2018-12-07 19:43:19 +01:00
right : unset ;
2018-10-11 10:21:26 +02:00
}
2019-04-25 21:58:21 +02:00
$ { BDFDB . dotCN . guildouter } . serverfolders - dragpreview {
2019-01-04 15:39:20 +01:00
pointer - events : none ! important ;
position : absolute ! important ;
opacity : 0.5 ! important ;
z - index : 10000 ! important ;
2018-10-11 10:21:26 +02:00
}
2019-04-25 21:58:21 +02:00
$ { BDFDB . dotCN . guildouter } . serverfolders - dragpreview ,
$ { BDFDB . dotCN . guildouter } . serverfolders - dragpreview $ { BDFDB . dotCN . guildinner } ,
$ { BDFDB . dotCN . guildouter } . serverfolders - dragpreview $ { BDFDB . dotCNS . guildinner + BDFDB . dotCN . guildiconwrapper } ,
$ { BDFDB . dotCN . guildouter } . serverfolders - dragpreview $ { BDFDB . dotCNS . guildinner + BDFDB . dotCNS . guildiconwrapper + BDFDB . dotCN . guildicon } {
2019-01-04 15:39:20 +01:00
border - radius : 50 % ! important ;
2019-04-26 22:39:14 +02:00
width : 48 px ! important ;
height : 48 px ! important ;
2018-10-11 10:21:26 +02:00
}
2019-10-14 09:20:36 +02:00
$ { BDFDB . dotCN . guildouter } . serverfolders - dragpreview $ { BDFDB . dotCN . guildpillwrapper } {
2019-01-04 15:39:20 +01:00
display : none ! important ;
}
2019-04-25 21:58:21 +02:00
$ { BDFDB . dotCN . guildouter } . serverfolders - dragpreview $ { BDFDB . dotCN . guildiconacronym } {
2019-04-26 22:42:15 +02:00
color : white ! important ;
2019-04-26 22:45:03 +02:00
background - color : # 444 ! important ;
2019-04-26 22:42:15 +02:00
border - radius : 50 % ! important ;
2019-01-04 15:39:20 +01:00
overflow : hidden ! important ;
2018-10-11 10:21:26 +02:00
}
2018-12-06 20:23:32 +01:00
$ { BDFDB . dotCN . guildswrapper } . foldercontent {
2019-01-04 15:39:20 +01:00
transition : width . 3 s linear ! important ;
2019-09-11 12:14:43 +02:00
left : 72 px ;
2018-10-11 10:21:26 +02:00
}
2019-04-25 21:58:21 +02:00
$ { BDFDB . dotCN . guildswrapper } . foldercontent . folderseparatorouter {
2018-10-11 10:21:26 +02:00
margin - top : 10 px ;
}
$ { BDFDB . dotCN . guildswrapper } . foldercontent . foldercontentclosed {
width : 0 px ! important ;
2019-09-11 12:14:43 +02:00
}
$ { BDFDB . dotCN . appcontainer } {
display : flex ! important ;
}
$ { BDFDB . dotCN . guildswrapper } {
position : static ! important ;
contain : unset ! important ;
}
$ { BDFDB . dotCN . chatbase } {
position : static ! important ;
contain : unset ! important ;
width : 100 % ! important ;
2018-10-11 10:21:26 +02:00
} ` ;
2019-01-04 15:39:20 +01:00
this . folderContentMarkup =
2019-09-11 12:14:43 +02:00
` <div class=" ${ BDFDB . disCNS . guildswrapper + BDFDB . disCN . guilds } foldercontent foldercontentclosed">
2019-10-20 21:15:32 +02:00
< div class = "${BDFDB.disCNS.scrollerwrap + BDFDB.disCNS.guildsscrollerwrap + BDFDB.disCNS.scrollerthemed + BDFDB.disCN.scrollerthemeghosthairline}" >
2019-09-11 12:14:43 +02:00
< div class = "${BDFDB.disCNS.guildsscroller + BDFDB.disCN.scroller}" > < / d i v >
2018-10-11 10:21:26 +02:00
< / d i v >
< / d i v > ` ;
2019-01-26 22:45:19 +01:00
2019-04-25 21:58:21 +02:00
this . dragPlaceholderMarkup =
2019-06-05 11:13:12 +02:00
` <div class=" ${ BDFDB . disCNS . guildouter + BDFDB . disCN . _bdguild } foldercopyplaceholder">
2019-04-25 21:58:21 +02:00
< div class = "${BDFDB.disCNS.guildpillwrapper + BDFDB.disCN.guildpill}" >
< span class = "${BDFDB.disCN.guildpillitem}" > < / s p a n >
< / d i v >
< div tabindex = "0" class = "${BDFDB.disCNS.guildcontainer + BDFDB.disCN.guildinner}" role = "button" >
2019-07-17 13:50:04 +02:00
< svg width = "48" height = "48" viewBox = "0 0 48 48" class = "${BDFDB.disCN.guildplaceholdermask}" >
< foreignObject mask = "url(#svg-mask-squircle)" x = "0" y = "0" width = "48" height = "48" >
2019-04-25 21:58:21 +02:00
< div class = "${BDFDB.disCN.guildplaceholder}" > < / d i v >
< / f o r e i g n O b j e c t >
< / s v g >
< / d i v >
2018-10-11 10:21:26 +02:00
< / d i v > ` ;
this . folderIcons = [
2019-08-19 11:17:57 +02: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"/> ` }
2018-10-11 10:21:26 +02:00
] ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . defaults = {
settings : {
closeOtherFolders : { value : false , description : "Close other Folders when opening a Folder." } ,
closeTheFolder : { value : false , description : "Close the Folder when selecting a Server." } ,
closeAllFolders : { value : false , description : "Close All Folders when selecting a Server." } ,
forceOpenFolder : { value : false , description : "Force a Folder to open when switching to a Server of that Folder." } ,
showCountBadge : { value : true , description : "Display Badge for Amount of Servers in a Folder." } ,
addSeparators : { value : true , description : "Adds separators between Servers of different Folders." }
}
} ;
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
getSettingsPanel ( ) {
2019-01-22 11:28:32 +01:00
if ( ! global . BDFDB || typeof BDFDB != "object" || ! BDFDB . loaded || ! this . started ) return ;
2019-10-22 19:49:57 +02:00
let settings = BDFDB . DataUtils . get ( this , "settings" ) ;
2019-10-09 14:18:28 +02:00
let settingshtml = ` <div class=" ${ this . name } -settings BDFDB-settings"><div class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . titlesize18 + BDFDB . disCNS . height24 + BDFDB . disCNS . weightnormal + BDFDB . disCN . marginbottom8 } "> ${ this . name } </div><div class="BDFDB-settings-inner"> ` ;
2018-10-11 10:21:26 +02:00
for ( let key in settings ) {
2019-10-09 14:18:28 +02:00
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="flex: 1 1 auto;"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . titlesize16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;"> ${ this . defaults . settings [ key ] . description } </h3><div class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . switchenabled + BDFDB . disCNS . switch + BDFDB . disCNS . switchvalue + BDFDB . disCNS . switchsizedefault + BDFDB . disCNS . switchsize + BDFDB . disCN . switchthemedefault } " style="flex: 0 0 auto;"><input type="checkbox" value="settings ${ key } " class=" ${ BDFDB . disCNS . switchinnerenabled + BDFDB . disCN . switchinner } settings-switch" ${ settings [ key ] ? " checked" : "" } ></div></div> ` ;
2018-10-11 10:21:26 +02:00
}
2019-10-09 14:18:28 +02:00
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="flex: 0 0 auto;"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . titlesize16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;">Remove all custom Icons.</h3><button type="button" class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorred + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } removecustom-button" style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . buttoncontents } ">Remove</div></button></div> ` ;
2018-10-11 10:21:26 +02:00
settingshtml += ` </div></div> ` ;
2019-01-26 22:45:19 +01:00
2019-10-23 11:10:01 +02:00
let settingspanel = BDFDB . DOMUtils . create ( settingshtml ) ;
2018-10-11 10:21:26 +02:00
2019-01-13 22:53:07 +01:00
BDFDB . initElements ( settingspanel , this ) ;
2019-10-08 19:12:48 +02:00
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . add ( this , settingspanel , "click" , ".removecustom-button" , ( ) => {
2019-01-13 22:53:07 +01:00
BDFDB . openConfirmModal ( this , "Are you sure you want to remove all custom icons?" , ( ) => {
2019-10-22 19:49:57 +02:00
BDFDB . DataUtils . remove ( this , "customicons" ) ;
2019-01-13 22:53:07 +01:00
} ) ;
} ) ;
2018-10-11 10:21:26 +02:00
return settingspanel ;
}
//legacy
load ( ) { }
start ( ) {
2019-02-04 09:13:15 +01:00
if ( ! global . BDFDB ) global . BDFDB = { myPlugins : { } } ;
if ( global . BDFDB && global . BDFDB . myPlugins && typeof global . BDFDB . myPlugins == "object" ) global . BDFDB . myPlugins [ this . getName ( ) ] = this ;
2019-05-26 13:55:26 +02:00
var libraryScript = document . querySelector ( 'head script#BDFDBLibraryScript' ) ;
if ( ! libraryScript || ( performance . now ( ) - libraryScript . getAttribute ( "date" ) ) > 600000 ) {
2018-10-11 10:21:26 +02:00
if ( libraryScript ) libraryScript . remove ( ) ;
libraryScript = document . createElement ( "script" ) ;
2019-05-26 13:55:26 +02:00
libraryScript . setAttribute ( "id" , "BDFDBLibraryScript" ) ;
2018-10-11 10:21:26 +02:00
libraryScript . setAttribute ( "type" , "text/javascript" ) ;
2019-10-18 10:56:41 +02:00
libraryScript . setAttribute ( "src" , "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.min.js" ) ;
2019-01-17 23:48:29 +01:00
libraryScript . setAttribute ( "date" , performance . now ( ) ) ;
2019-05-26 13:55:26 +02:00
libraryScript . addEventListener ( "load" , ( ) => { this . initialize ( ) ; } ) ;
2018-10-11 10:21:26 +02:00
document . head . appendChild ( libraryScript ) ;
2019-05-26 13:55:26 +02:00
}
else if ( global . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) this . initialize ( ) ;
2018-10-11 10:21:26 +02:00
this . startTimeout = setTimeout ( ( ) => { this . initialize ( ) ; } , 30000 ) ;
}
initialize ( ) {
2019-01-17 23:48:29 +01:00
if ( global . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) {
2019-01-22 11:05:54 +01:00
if ( this . started ) return ;
2019-10-22 18:55:25 +02:00
BDFDB . PluginUtils . init ( this ) ;
2019-10-08 19:12:48 +02:00
// REMOVE 08.10.2019
2019-10-22 19:49:57 +02:00
let foldersdata = BDFDB . ObjectUtils . sort ( BDFDB . DataUtils . load ( this , "folders" ) , "position" ) ;
2019-10-08 19:12:48 +02:00
let folders = Object . keys ( foldersdata ) . filter ( n => n . indexOf ( "folder" ) == 0 ) ;
2019-10-19 11:41:39 +02:00
if ( folders . length ) BDFDB . openConfirmModal ( this , ` Old ServerFolders data detected! \n Found ${ folders . length } old custom folders in the ServerFolders.config.json. \n Press the ' ${ BDFDB . LanguageUtils . LanguageStrings . OKAY } ' button to automatically create a native folder for each old folder and to automatically put the servers in them. ` , "Convert?" , ( ) => {
2019-10-08 19:12:48 +02:00
let oldGuildFolders = Object . assign ( { } , BDFDB . LibraryModules . FolderStore . guildFolders ) ;
let guildsInFolders = [ ] ;
let guildFolders = [ ] ;
let guildPositions = [ ] ;
let newfoldersdata = { } ;
for ( let folderid in foldersdata ) {
2019-10-08 21:09:14 +02:00
let newid = this . generateID ( "folder" ) ;
2019-10-08 19:12:48 +02:00
let olddata = foldersdata [ folderid ] ;
2019-10-23 10:03:33 +02:00
let color1 = BDFDB . ColorUtils . convert ( olddata . color1 , "INT" ) ;
2019-10-08 19:12:48 +02:00
guildFolders . push ( {
guildIds : olddata . servers ,
folderId : newid ,
folderName : olddata . folderName ,
2019-10-14 09:20:36 +02:00
folderColor : color1 != null && color1 != undefined ? color1 : 7506394
2019-10-08 19:12:48 +02:00
} ) ;
guildsInFolders = guildsInFolders . concat ( olddata . servers ) ;
newfoldersdata [ newid ] = Object . assign ( { } , olddata ) ;
delete newfoldersdata [ newid ] . position ;
delete newfoldersdata [ newid ] . folderName ;
delete newfoldersdata [ newid ] . folderId ;
delete newfoldersdata [ newid ] . servers ;
delete newfoldersdata [ newid ] . isOpen ;
newfoldersdata [ newid ] . autoRead = newfoldersdata [ newid ] . autounread ;
delete newfoldersdata [ newid ] . autounread ;
newfoldersdata [ newid ] . useCloseIcon = true ;
newfoldersdata [ newid ] . muteFolder = false ;
}
for ( let i in oldGuildFolders ) if ( oldGuildFolders [ i ] . folderId || ! guildsInFolders . includes ( oldGuildFolders [ i ] . guildIds [ 0 ] ) ) guildFolders . push ( Object . assign ( { } , oldGuildFolders [ i ] ) ) ;
for ( let i in guildFolders ) for ( let guildid of guildFolders [ i ] . guildIds ) guildPositions . push ( guildid ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
2019-10-22 19:49:57 +02:00
BDFDB . DataUtils . remove ( this , "folders" ) ;
BDFDB . DataUtils . save ( newfoldersdata , this , "folders" ) ;
2019-10-08 19:12:48 +02:00
} ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ModuleUtils . forceAllUpdates ( this ) ;
2018-10-11 10:21:26 +02:00
}
2019-10-22 18:55:25 +02:00
else console . error ( ` %c[ ${ this . getName ( ) } ]%c ` , 'color: #3a71c1; font-weight: 700;' , '' , 'Fatal Error: Could not load BD functions!' ) ;
2018-10-11 10:21:26 +02:00
}
stop ( ) {
2019-01-17 23:48:29 +01:00
if ( global . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) {
2019-10-22 11:37:23 +02:00
this . stopping = true ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( this . foldercontent , BDFDB . dotCN . guildswrapper + ".foldercontent" ) ;
2019-10-08 19:12:48 +02:00
let modal = document . querySelector ( ` . ${ this . name } -modal ` ) ;
if ( modal ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( modal , ` ${ this . name } -modal ` ) ;
2019-10-08 19:12:48 +02:00
let modalclose = modal . querySelector ( BDFDB . dotCN . modalclose ) ;
if ( modalclose ) modalclose . click ( ) ;
}
for ( let folderinner of document . querySelectorAll ( ` ${ BDFDB . dotCNS . guildfolderwrapper + BDFDB . dotCN . guildfolderexpandendbackground } ~ ${ BDFDB . dotCNS . guildouter + BDFDB . dotCN . guildinner } ` ) ) {
folderinner . removeEventListener ( "mouseenter" , folderinner . ServerFoldersTooltipListener ) ;
folderinner . removeEventListener ( "mousedown" , folderinner . ServerFoldersClickListener ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( folderinner . querySelectorAll ( ` ${ BDFDB . dotCN . guildupperbadge } .count ` ) ) ;
2019-10-08 19:12:48 +02:00
}
for ( let foldericon of document . querySelectorAll ( BDFDB . dotCN . guildfolder ) ) {
foldericon . style . removeProperty ( "background-image" ) ;
foldericon . parentElement . parentElement . style . removeProperty ( "-webkit-mask" ) ;
}
2019-10-22 18:55:25 +02:00
BDFDB . PluginUtils . clear ( this ) ;
2018-10-11 10:21:26 +02:00
}
}
onSwitch ( ) {
2019-10-22 20:16:05 +02:00
if ( typeof BDFDB === "object" && BDFDB . DataUtils . get ( this , "settings" , "forceOpenFolder" ) ) {
2019-10-08 19:12:48 +02:00
let folder = this . getFolderOfGuildId ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) ) ;
if ( folder && ! BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
// begin of own functions
2019-09-11 12:14:43 +02:00
onGuildContextMenu ( instance , menu , returnvalue ) {
2019-04-18 09:28:20 +02:00
if ( document . querySelector ( ".BDFDB-modal" ) ) return ;
2019-10-08 19:12:48 +02:00
if ( instance . props && instance . props . target && instance . props . folderId && instance . props . type == "GUILD_ICON_FOLDER" && ! menu . querySelector ( ` ${ this . name } -contextMenuItem ` ) ) {
let folderid = instance . props . folderId ;
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( folderid ) ;
let data = this . getFolderConfig ( folderid ) ;
let muted = data . muteFolder && folder . guildIds . every ( guildid => BDFDB . LibraryModules . MutedUtils . isGuildOrCategoryOrChannelMuted ( guildid ) ) ;
if ( data . muteFolder != muted ) {
data . muteFolder = muted ;
2019-10-22 20:16:05 +02:00
BDFDB . DataUtils . save ( data , this , "folders" , folderid ) ;
2019-10-08 19:12:48 +02:00
}
2019-10-22 19:38:25 +02:00
let [ children , index ] = BDFDB . ReactUtils . findChildren ( returnvalue , { name : "GuildFolderMarkReadItem" } ) ;
2019-10-22 18:55:25 +02:00
const autoreaditem = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuToggleItem , {
2019-10-08 19:12:48 +02:00
label : this . labels . foldercontext _autoreadfolder _text ,
className : ` BDFDB-contextMenuToggleItem ${ this . name } -contextMenuToggleItem ${ this . name } -autoread-contextMenuToggleItem ` ,
active : data . autoRead ,
action : state => {
data . autoRead = state ;
2019-10-22 20:16:05 +02:00
BDFDB . DataUtils . save ( data , this , "folders" , folderid ) ;
2019-10-08 19:12:48 +02:00
}
} ) ;
if ( index > - 1 ) children . splice ( index + 1 , 0 , autoreaditem ) ;
else children . push ( autoreaditem ) ;
2019-10-22 18:55:25 +02:00
const muteGroup = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuItemGroup , {
2019-10-08 19:12:48 +02:00
className : ` BDFDB-contextMenuItemGroup ${ this . name } -contextMenuItemGroup ` ,
2019-10-22 18:55:25 +02:00
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuToggleItem , {
2019-10-08 19:12:48 +02:00
label : this . labels . foldercontext _mutefolder _text ,
className : ` BDFDB-contextMenuToggleItem ${ this . name } -contextMenuToggleItem ${ this . name } -mutefolder-contextMenuToggleItem ` ,
active : muted ,
action : state => {
data . muteFolder = state ;
2019-10-22 20:16:05 +02:00
BDFDB . DataUtils . save ( data , this , "folders" , folderid ) ;
2019-10-08 19:12:48 +02:00
for ( let guildid of folder . guildIds ) if ( BDFDB . LibraryModules . MutedUtils . isGuildOrCategoryOrChannelMuted ( guildid ) != state ) BDFDB . LibraryModules . GuildSettingsUtils . updateNotificationSettings ( guildid , { muted : state , suppress _everyone : state } ) ;
}
} )
} ) ;
returnvalue . props . children . splice ( returnvalue . props . children . length - 1 , 0 , muteGroup ) ;
2019-10-22 18:55:25 +02:00
const deleteGroup = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuItemGroup , {
2019-10-08 19:12:48 +02:00
className : ` BDFDB-contextMenuItemGroup ${ this . name } -contextMenuItemGroup ` ,
2019-10-22 18:55:25 +02:00
children : BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuItem , {
2019-10-08 19:12:48 +02:00
label : this . labels . foldercontext _removefolder _text ,
className : ` BDFDB-contextMenuItem ${ this . name } -contextMenuItem ${ this . name } -removefolder-contextMenuItem ` ,
danger : true ,
action : e => {
2019-10-23 11:10:01 +02:00
BDFDB . closeContextMenu ( BDFDB . DOMUtils . getParent ( BDFDB . dotCN . contextmenu , e . target ) ) ;
2019-10-08 19:12:48 +02:00
BDFDB . openConfirmModal ( this , ` Are you sure you want to remove the folder ${ folder . folderName ? ( " '" + folder . folderName + '"' ) : "" } ? ` , ( ) => { this . removeFolder ( folderid ) ; } ) ;
}
} )
} ) ;
returnvalue . props . children . push ( deleteGroup ) ;
}
else if ( instance . props && instance . props . target && instance . props . guild && instance . props . type == "GUILD_ICON_BAR" && ! menu . querySelector ( ` ${ this . name } -contextMenuItem ` ) ) {
let guildid = instance . props . guild . id ;
let folders = this . getFolders ( ) ;
let folder = this . getFolderOfGuildId ( guildid ) ;
2019-10-09 09:40:15 +02:00
let addtofolderitems = [ ] , openguilds = BDFDB . LibraryModules . FolderStore . getSortedGuilds ( ) . filter ( n => ! n . folderId ) . map ( n => n . guilds [ 0 ] ) ;
2019-10-22 18:55:25 +02:00
for ( let i = 0 ; i < folders . length ; i ++ ) addtofolderitems . push ( BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuItem , {
2019-10-08 19:12:48 +02:00
label : folders [ i ] . folderName || ( this . labels . modal _tabheader1 _text + " #" + parseInt ( i + 1 ) ) ,
2019-09-11 12:14:43 +02:00
className : ` BDFDB-contextMenuItem ${ this . name } -contextMenuItem ${ this . name } -addtofolder-contextMenuItem ` ,
action : e => {
2019-03-08 11:58:17 +01:00
BDFDB . closeContextMenu ( menu ) ;
2019-10-08 19:12:48 +02:00
this . addGuildToFolder ( folders [ i ] . folderId , guildid ) ;
2019-01-13 22:53:07 +01:00
}
2019-09-11 12:14:43 +02:00
} ) ) ;
2019-10-22 19:38:25 +02:00
let [ children , index ] = BDFDB . ReactUtils . findChildren ( returnvalue , { name : [ "FluxContainer(MessageDeveloperModeGroup)" , "DeveloperModeGroup" ] } ) ;
2019-10-09 09:40:15 +02:00
const addType = ! addtofolderitems . length ? "contextMenuItem" : "contextMenuSubItem" ;
2019-10-22 18:55:25 +02:00
const itemgroup = BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuItemGroup , {
2019-09-11 12:14:43 +02:00
className : ` BDFDB-contextMenuItemGroup ${ this . name } -contextMenuItemGroup ` ,
children : [
2019-10-22 18:55:25 +02:00
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuSubItem , {
2019-09-11 12:14:43 +02:00
label : this . labels . servercontext _serverfolders _text ,
className : ` BDFDB-contextMenuSubItem ${ this . name } -contextMenuSubItem ${ this . name } -guild-contextMenuSubItem ` ,
2019-10-08 21:09:14 +02:00
render : folder ? [
2019-10-22 18:55:25 +02:00
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuItem , {
2019-09-11 12:14:43 +02:00
label : this . labels . serversubmenu _removefromfolder _text ,
2019-10-08 20:25:51 +02:00
className : ` BDFDB-contextMenuItem ${ this . name } -contextMenuItem ${ this . name } -removefromfolder-contextMenuItem ` ,
2019-09-11 12:14:43 +02:00
danger : true ,
action : e => {
BDFDB . closeContextMenu ( menu ) ;
2019-10-08 20:25:51 +02:00
this . removeGuildFromFolder ( folder . folderId , guildid ) ;
2019-09-11 12:14:43 +02:00
}
2019-10-08 21:09:14 +02:00
} )
] : [
2019-10-22 18:55:25 +02:00
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents . ContextMenuItem , {
2019-10-08 21:09:14 +02:00
label : this . labels . serversubmenu _createfolder _text ,
className : ` BDFDB-contextMenuItem ${ this . name } -contextMenuItem ${ this . name } -createfolder-contextMenuItem ` ,
2019-10-09 09:40:15 +02:00
disabled : ! openguilds . length ,
2019-10-08 21:09:14 +02:00
action : e => {
BDFDB . closeContextMenu ( menu ) ;
2019-10-09 09:40:15 +02:00
this . openFolderCreationMenu ( openguilds , guildid ) ;
2019-10-08 21:09:14 +02:00
}
} ) ,
2019-10-22 18:55:25 +02:00
BDFDB . ReactUtils . createElement ( BDFDB . LibraryComponents [ addType . charAt ( 0 ) . toUpperCase ( ) + addType . slice ( 1 ) ] , {
2019-09-11 12:14:43 +02:00
label : this . labels . serversubmenu _addtofolder _text ,
2019-10-09 09:40:15 +02:00
className : ` BDFDB- ${ addType } ${ this . name } - ${ addType } ${ this . name } -addtofolder- ${ addType } ` ,
2019-09-11 12:14:43 +02:00
disabled : ! addtofolderitems . length ,
render : addtofolderitems
} )
]
} )
]
2019-01-13 22:53:07 +01:00
} ) ;
2019-09-11 12:14:43 +02:00
if ( index > - 1 ) children . splice ( index , 0 , itemgroup ) ;
else children . push ( itemgroup ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-09-11 12:14:43 +02:00
processGuilds ( instance , wrapper , returnvalue , methodnames ) {
2019-02-16 11:48:39 +01:00
if ( methodnames . includes ( "componentWillUnmount" ) ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( this . foldercontent , BDFDB . dotCN . guildswrapper + ".foldercontent" ) ;
2019-10-08 19:12:48 +02:00
delete this . foldercontent ;
delete this . foldercontentguilds ;
2019-02-16 11:48:39 +01:00
}
if ( methodnames . includes ( "componentDidMount" ) ) {
let process = ( ) => {
if ( ! wrapper . parentElement . querySelector ( BDFDB . dotCN . guildswrapper + ".foldercontent" ) ) {
2019-10-23 11:10:01 +02:00
this . foldercontent = BDFDB . DOMUtils . create ( this . folderContentMarkup ) ;
2019-02-16 11:48:39 +01:00
wrapper . parentElement . insertBefore ( this . foldercontent , wrapper . nextElementSibling ) ;
2019-09-11 12:14:43 +02:00
this . foldercontentguilds = this . foldercontent . querySelector ( BDFDB . dotCN . guildsscroller ) ;
2019-10-08 19:12:48 +02:00
this . toggleFolderContent ( ) ;
2019-02-16 11:48:39 +01:00
}
} ;
2019-10-08 19:12:48 +02:00
if ( document . querySelector ( BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guildouter + ":not(.copy) " + BDFDB . dotCN . guildiconwrapper ) ) process ( ) ;
2019-02-16 11:48:39 +01:00
else setTimeout ( process , 5000 ) ;
}
2019-10-08 19:12:48 +02:00
}
processGuildFolder ( instance , wrapper , returnvalue , methodnames ) {
if ( ! this . foldercontentguilds ) return ;
let state = this . getState ( instance ) ;
let data = this . getFolderConfig ( state . folderId ) ;
if ( methodnames . includes ( "componentDidMount" ) ) {
if ( data . muteFolder ) for ( let guildid of instance . props . guildIds ) if ( ! BDFDB . LibraryModules . MutedUtils . isGuildOrCategoryOrChannelMuted ( guildid ) ) BDFDB . LibraryModules . GuildSettingsUtils . updateNotificationSettings ( guildid , { muted : true , suppress _everyone : true } ) ;
}
if ( ! BDFDB . equals ( state , this . folderStates [ instance . props . folderId ] ) ) {
if ( data . autoRead && ( state . unread || state . badge > 0 ) ) {
clearTimeout ( this . folderReads [ state . folderId ] ) ;
this . folderReads [ state . folderId ] = setTimeout ( ( ) => {
2019-10-22 18:55:25 +02:00
BDFDB . GuildUtils . markAsRead ( instance . props . guildIds ) ;
2019-10-08 19:12:48 +02:00
} , 10000 ) ;
2019-05-03 17:49:54 +02:00
}
2019-10-08 19:12:48 +02:00
if ( state . expanded ) setImmediate ( ( ) => {
for ( let guildid of instance . props . guildIds ) this . updateGuildInFolderContent ( state . folderId , guildid ) ;
2019-10-22 20:23:43 +02:00
if ( this . clickedFolder == state . folderId && BDFDB . DataUtils . get ( this , "settings" , "closeOtherFolders" ) ) for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( openFolderId != state . folderId ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( this . foldercontent . querySelectorAll ( ` ${ BDFDB . dotCN . guildouter } [folderid=" ${ openFolderId } "] ` ) ) ;
2019-10-08 19:12:48 +02:00
BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
}
this . addSeparator ( state . folderId ) ;
2019-10-12 14:45:12 +02:00
this . toggleFolderContent ( ) ;
2019-10-08 19:12:48 +02:00
} ) ;
else setTimeout ( ( ) => {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( this . foldercontent . querySelectorAll ( ` ${ BDFDB . dotCN . guildouter } [folderid=" ${ state . folderId } "] ` ) ) ;
if ( BDFDB . DOMUtils . containsClass ( this . foldercontentguilds . firstElementChild , "folderseparatorouter" ) ) BDFDB . DOMUtils . remove ( this . foldercontentguilds . firstElementChild ) ;
2019-10-12 14:45:12 +02:00
this . toggleFolderContent ( ) ;
2019-10-08 19:12:48 +02:00
} , BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) . size > 0 ? 0 : 300 ) ;
this . changeFolder ( state . folderId , wrapper ) ;
2019-05-03 17:49:54 +02:00
}
2019-10-08 19:12:48 +02:00
this . folderStates [ state . folderId ] = state ;
2019-01-22 19:39:44 +01:00
}
2019-01-26 22:45:19 +01:00
2019-10-09 10:07:11 +02:00
processGuild ( instance , wrapper , returnvalue , methodnames ) {
2019-10-08 19:12:48 +02:00
if ( ! this . foldercontentguilds ) return ;
2019-05-07 19:42:08 +02:00
if ( instance . props && instance . props . guild ) {
2019-10-09 10:07:11 +02:00
if ( methodnames . includes ( "componentDidMount" ) ) {
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . add ( this , wrapper , "click" , ( ) => { setImmediate ( ( ) => {
2019-10-12 14:45:12 +02:00
let folder = this . getFolderOfGuildId ( instance . props . guild . id ) ;
let folderid = folder ? folder . folderId : null ;
2019-10-22 19:49:57 +02:00
let settings = BDFDB . DataUtils . get ( this , "settings" ) ;
2019-10-12 14:45:12 +02:00
if ( settings . closeAllFolders ) for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( ! folderid || openFolderId != folderid || ! settings . forceOpenFolder ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
else if ( folderid && settings . closeTheFolder && ! settings . forceOpenFolder && BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folderid ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folderid ) ;
2019-10-09 10:07:11 +02:00
if ( settings . closeAllFolders ) for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
else if ( settings . closeTheFolder ) {
let folder = this . getFolderOfGuildId ( instance . props . guild . id ) ;
if ( folder && BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folder . folderId ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folder . folderId ) ;
}
} ) } ) ;
}
if ( methodnames . includes ( "componentDidUpdate" ) ) {
let folder = this . getFolderOfGuildId ( instance . props . guild . id ) ;
if ( folder ) {
let state = this . getState ( instance ) ;
if ( ! BDFDB . equals ( state , this . guildStates [ instance . props . guild . id ] ) ) this . updateGuildInFolderContent ( folder . folderId , instance . props . guild . id ) ;
2019-01-13 22:53:07 +01:00
}
}
2019-10-08 19:12:48 +02:00
}
}
processGuildFolderSettingsModal ( instance , wrapper , returnvalue ) {
if ( instance . props && instance . props . folderId ) {
let folderid = instance . props . folderId ;
let data = this . getFolderConfig ( folderid ) ;
wrapper = wrapper . parentElement ;
let root = wrapper . querySelector ( BDFDB . dotCN . layermodal ) ;
let header = wrapper . querySelector ( BDFDB . dotCN . modalheader ) ;
let form = wrapper . querySelector ( BDFDB . dotCN . modalsubinner + " form" ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( root , "BDFDB-modal" , ` ${ this . name } -modal ` , BDFDB . disCN . layermodalmedium ) ;
BDFDB . DOMUtils . removeClass ( root , BDFDB . disCN . layermodalsmall ) ;
2019-10-08 19:12:48 +02:00
if ( header ) {
clearInterval ( this . settingsModalWait ) ;
2019-10-23 11:10:01 +02:00
header . parentElement . insertBefore ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCNS . marginbottom8 + BDFDB . disCN . tabbarcontainer } " style="flex: 0 0 auto; padding-right: 12px;"><div class=" ${ BDFDB . disCNS . tabbar + BDFDB . disCN . tabbartop } "><div tab="folder" class=" ${ BDFDB . disCNS . settingsitem + BDFDB . disCN . tabbaritem } "> ${ this . labels . modal _tabheader1 _text } </div><div tab="icon" class=" ${ BDFDB . disCNS . settingsitem + BDFDB . disCN . tabbaritem } "> ${ this . labels . modal _tabheader2 _text } </div><div tab="tooltip" class=" ${ BDFDB . disCNS . settingsitem + BDFDB . disCN . tabbaritem } "> ${ this . labels . modal _tabheader3 _text } </div><div tab="custom" class=" ${ BDFDB . disCNS . settingsitem + BDFDB . disCN . tabbaritem } "> ${ this . labels . modal _tabheader4 _text } </div></div></div> ` ) , header . nextElementSibling ) ;
2019-07-03 23:35:52 +02:00
}
2019-10-08 19:12:48 +02:00
if ( root && form ) {
form . setAttribute ( "tab" , "folder" ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( form , "tab-content" , BDFDB . disCN . marginbottom8 ) ;
for ( let child of form . childNodes ) if ( form . firstElementChild != child ) BDFDB . DOMUtils . hide ( child ) ;
form . appendChild ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCN . marginbottom20 } "><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _iconpicker _text } </h5><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } icons" style="flex: 1 1 auto;"></div></div> ` ) ) ;
form . appendChild ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="width: calc(100% - 10px);"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . titlesize16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;"> ${ this . labels . modal _usecloseicon _text } </h3><div class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . switchenabled + BDFDB . disCNS . switch + BDFDB . disCNS . switchvalue + BDFDB . disCNS . switchsizedefault + BDFDB . disCNS . switchsize + BDFDB . disCN . switchthemedefault } " style="flex: 0 0 auto;"><input type="checkbox" class=" ${ BDFDB . disCNS . switchinnerenabled + BDFDB . disCN . switchinner } " id="input-usecloseicon"></div></div> ` ) ) ;
form . parentElement . appendChild ( BDFDB . DOMUtils . create ( ` <div tab="icon" class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . vertical + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } tab-content" style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . marginbottom20 } "><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _colorpicker1 _text } </h5><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } swatches" style="flex: 1 1 auto;"></div></div><div class=" ${ BDFDB . disCN . marginbottom20 } "><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _colorpicker2 _text } </h5><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } swatches" style="flex: 1 1 auto;"></div></div></div> ` ) ) ;
form . parentElement . appendChild ( BDFDB . DOMUtils . create ( ` <div tab="tooltip" class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . vertical + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } tab-content" style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . vertical + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstart + BDFDB . disCN . nowrap } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . marginbottom20 } "><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _colorpicker3 _text } </h5><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } swatches" style="flex: 1 1 auto;"></div></div><div class=" ${ BDFDB . disCN . marginbottom20 } "><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _colorpicker4 _text } </h5><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } swatches" style="flex: 1 1 auto;"></div></div><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="width: calc(100% - 10px);"><h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . titlesize16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;"> ${ this . labels . modal _copytooltipcolor _text } </h3><div class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . switchenabled + BDFDB . disCNS . switch + BDFDB . disCNS . switchvalue + BDFDB . disCNS . switchsizedefault + BDFDB . disCNS . switchsize + BDFDB . disCN . switchthemedefault } " style="flex: 0 0 auto;"><input type="checkbox" class=" ${ BDFDB . disCNS . switchinnerenabled + BDFDB . disCN . switchinner } " id="input-copytooltipcolor"></div></div></div> ` ) ) ;
form . parentElement . appendChild ( BDFDB . DOMUtils . create ( ` <div tab="custom" class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . vertical + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } tab-content" style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCN . marginbottom20 } "><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _customopen _text } </h5><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCNS . inputwrapper + BDFDB . disCNS . vertical + BDFDB . disCNS . flex2 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;"><input type="text" option="open" class=" ${ BDFDB . disCNS . inputdefault + BDFDB . disCNS . input + BDFDB . disCN . titlesize16 } " placeholder="Url or Filepath"></div><button type="button" class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorbrand + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } file-navigator" style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . buttoncontents } "></div><input type="file" option="open" accept="image/*" style="display:none!important;"></button></div></div><div class=" ${ BDFDB . disCN . marginbottom20 } "><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _customclosed _text } </h5><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCNS . inputwrapper + BDFDB . disCNS . vertical + BDFDB . disCNS . flex2 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;"><input type="text" option="closed" class=" ${ BDFDB . disCNS . inputdefault + BDFDB . disCNS . input + BDFDB . disCN . titlesize16 } " placeholder="Url or Filepath"></div><button type="button" class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorbrand + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } file-navigator" style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . buttoncontents } "></div><input type="file" option="closed" accept="image/*" style="display:none!important;"></button></div></div><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . vertical + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } " style="flex: 1 1 auto;"><h5 class=" ${ BDFDB . disCNS . h5 + BDFDB . disCN . h5defaultmargin } "> ${ this . labels . modal _custompreview _text } </h5></div><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . marginbottom8 } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifycenter + BDFDB . disCNS . aligncenter + BDFDB . disCN . nowrap } " style="flex: 1 1 auto;"><div class="ui-icon-picker-icon preview nopic open"><div class="ui-picker-inner"></div></div><div class="ui-icon-picker-icon preview nopic closed" style="margin-left: 25px; margin-right: 25px;"><div class="ui-picker-inner"></div></div><div class="ui-icon-picker-icon preview nopic switching"><div class="ui-picker-inner"></div></div></div><button type="button" class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorbrand + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } btn-add btn-addcustom" style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . buttoncontents } "></div></button></div></div> ` ) ) ;
2019-10-08 19:12:48 +02:00
let usecloseiconinput = root . querySelector ( "#input-usecloseicon" ) ;
let copytooltipcolorinput = root . querySelector ( "#input-copytooltipcolor" ) ;
usecloseiconinput . checked = data . useCloseIcon ;
copytooltipcolorinput . checked = data . copyTooltipColor ;
this . setIcons ( form , data . iconID ) ;
BDFDB . setColorSwatches ( root , data . color1 ) ;
BDFDB . setColorSwatches ( root , data . color2 ) ;
BDFDB . setColorSwatches ( root , data . color3 ) ;
BDFDB . setColorSwatches ( root , data . color4 ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( root , "change" , "input[type='file'][option]" , e => {
2019-10-08 19:12:48 +02:00
let input = e . currentTarget , file = input . files [ 0 ] ;
if ( file ) setImmediate ( ( ) => { this . fetchCustomIcon ( root , input . getAttribute ( "option" ) ) } ) ;
} ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( root , "keyup" , "input[type='text'][option]" , e => {
2019-10-08 19:12:48 +02:00
if ( e . which == 13 ) this . fetchCustomIcon ( root , e . currentTarget . getAttribute ( "option" ) ) ;
} ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( root , "click" , ".btn-addcustom" , ( ) => {
2019-10-08 19:12:48 +02:00
this . saveCustomIcon ( root ) ;
} ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( root , "click" , BDFDB . dotCNS . modalfooter + BDFDB . dotCN . button , e => {
2019-10-08 19:12:48 +02:00
var olddata = Object . assign ( { } , data ) ;
var selectedIcon = root . querySelector ( ".ui-icon-picker-icon.selected" ) ;
data . iconID = selectedIcon . getAttribute ( "value" ) ;
data . useCloseIcon = usecloseiconinput . checked ;
data . copyTooltipColor = copytooltipcolorinput . checked ;
2019-10-23 11:10:01 +02:00
data . color1 = BDFDB . ColorUtils . getSwatchColor ( root , 1 ) ;
data . color2 = BDFDB . ColorUtils . getSwatchColor ( root , 2 ) ;
data . color3 = BDFDB . ColorUtils . getSwatchColor ( root , 3 ) ;
data . color4 = BDFDB . ColorUtils . getSwatchColor ( root , 4 ) ;
2019-10-08 19:12:48 +02:00
if ( ! BDFDB . equals ( olddata , data ) ) {
let folderIcons = this . loadAllIcons ( ) ;
2019-10-23 11:10:01 +02:00
let isCustom = BDFDB . DOMUtils . containsClass ( selectedIcon , "custom" ) ;
2019-10-08 19:12:48 +02:00
data . icons . openicon = folderIcons [ data . iconID ] ? ( ! isCustom ? this . createBase64SVG ( folderIcons [ data . iconID ] . openicon , data . color1 , data . color2 ) : folderIcons [ data . iconID ] . openicon ) : null ;
data . icons . closedicon = folderIcons [ data . iconID ] ? ( ! isCustom ? this . createBase64SVG ( folderIcons [ data . iconID ] . closedicon , data . color1 , data . color2 ) : folderIcons [ data . iconID ] . closedicon ) : null ;
2019-10-22 20:16:05 +02:00
BDFDB . DataUtils . save ( data , this , "folders" , folderid ) ;
2019-10-23 10:03:33 +02:00
instance . handleColorChange ( data . color1 ? parseInt ( BDFDB . ColorUtils . convert ( data . color1 && BDFDB . ObjectUtils . is ( data . color1 ) ? data . color1 [ Object . keys ( data . color1 ) [ 0 ] ] : data . color1 , "HEX" ) . slice ( 1 ) , 16 ) : null ) ;
2019-10-08 19:12:48 +02:00
this . changeFolder ( folderid ) ;
2019-06-24 17:42:31 +02:00
}
2019-10-08 19:12:48 +02:00
} ) ;
2019-01-13 22:53:07 +01:00
}
2019-10-08 19:12:48 +02:00
BDFDB . initElements ( wrapper ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-09-11 12:14:43 +02:00
processStandardSidebarView ( instance , wrapper , returnvalue ) {
2019-02-16 11:48:39 +01:00
if ( this . SettingsUpdated && this . foldercontent ) {
2019-02-04 11:22:37 +01:00
delete this . SettingsUpdated ;
2019-10-08 19:12:48 +02:00
this . folderStates = { } ;
2019-10-22 18:55:25 +02:00
BDFDB . ModuleUtils . forceAllUpdates ( this , "GuildFolder" ) ;
2019-01-13 22:53:07 +01:00
}
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
loadAllIcons ( ) {
2019-01-04 15:39:20 +01:00
let icons = { } ;
this . folderIcons . forEach ( ( array , i ) => { icons [ i ] = { "openicon" : array . openicon , "closedicon" : array . closedicon , "customID" : null } ; } ) ;
2019-10-22 19:49:57 +02:00
Object . assign ( icons , BDFDB . DataUtils . load ( this , "customicons" ) ) ;
2018-10-11 10:21:26 +02:00
return icons ;
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
fetchCustomIcon ( modal , type ) {
2019-01-04 15:39:20 +01:00
let successFetchIcon ;
let url = modal . querySelector ( "input[type='text'][option='" + type + "']" ) . value ;
2018-10-11 10:21:26 +02:00
if ( url . indexOf ( "http" ) == 0 ) {
2019-09-11 12:14:43 +02:00
BDFDB . LibraryRequires . request ( url , ( error , response , result ) => {
2018-10-11 10:21:26 +02:00
if ( response ) {
2019-01-04 15:39:20 +01:00
let type = response . headers [ "content-type" ] ;
2018-10-11 10:21:26 +02:00
if ( type && type . indexOf ( "image" ) > - 1 ) {
successFetchIcon ( ) ;
return ;
}
}
2019-10-22 18:55:25 +02:00
BDFDB . NotificationUtils . toast ( "Use a valid direct link to an image source. They usually end on something like .png, .jpg or .gif." , { type : "danger" } ) ;
2018-10-11 10:21:26 +02:00
} ) ;
}
else {
2019-09-11 12:14:43 +02:00
if ( BDFDB . LibraryRequires . fs . existsSync ( url ) ) {
BDFDB . LibraryRequires . fs . readFile ( url , ( error , response ) => {
2018-10-11 10:21:26 +02:00
if ( ! error ) {
url = ` data:image/png;base64, ${ response . toString ( "base64" ) } ` ;
successFetchIcon ( ) ;
}
} ) ;
}
else {
2019-10-22 18:55:25 +02:00
BDFDB . NotificationUtils . toast ( "Could not fetch file. Please make sure the file exists." , { type : "danger" } ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
successFetchIcon = ( ) => {
2019-01-04 15:39:20 +01:00
let iconpreview = modal . querySelector ( ".ui-icon-picker-icon.preview." + type ) ;
let iconpreviewinner = iconpreview . querySelector ( ".ui-picker-inner" ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( iconpreview , "nopic" ) ;
2018-10-11 10:21:26 +02:00
iconpreview . url = url ;
2019-01-13 22:53:07 +01:00
iconpreviewinner . style . setProperty ( "background-image" , ` url( ${ url } ) ` ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
let iconpreviewopen = modal . querySelector ( ".ui-icon-picker-icon.preview.open" ) ;
let iconpreviewclosed = modal . querySelector ( ".ui-icon-picker-icon.preview.closed" ) ;
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . DOMUtils . containsClass ( iconpreviewopen , "nopic" ) && ! BDFDB . DOMUtils . containsClass ( iconpreviewclosed , "nopic" ) ) {
2019-01-04 15:39:20 +01:00
let iconpreviewswitching = modal . querySelector ( ".ui-icon-picker-icon.preview.switching" ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
let iconpreviewopenimage = iconpreviewopen . querySelector ( ".ui-picker-inner" ) . style . getPropertyValue ( "background-image" ) ;
let iconpreviewclosedimage = iconpreviewclosed . querySelector ( ".ui-picker-inner" ) . style . getPropertyValue ( "background-image" ) ;
2019-01-04 15:39:20 +01:00
let iconpreviewswitchinginner = iconpreviewswitching . querySelector ( ".ui-picker-inner" ) ;
2019-01-26 22:45:19 +01:00
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . removeClass ( iconpreviewswitching , "nopic" ) ;
2019-01-13 22:53:07 +01:00
iconpreviewswitchinginner . style . setProperty ( "background-image" , iconpreviewopenimage ) ;
2019-01-04 15:39:20 +01:00
let switching = true ;
2018-10-11 10:21:26 +02:00
iconpreviewswitching . switchInterval = setInterval ( ( ) => {
2019-09-04 12:34:02 +02:00
switching = ! switching ;
2019-01-13 22:53:07 +01:00
iconpreviewswitchinginner . style . setProperty ( "background-image" , switching ? iconpreviewopenimage : iconpreviewclosedimage ) ;
2018-10-11 10:21:26 +02:00
} , 1000 ) ;
}
} ;
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
saveCustomIcon ( modal ) {
2019-01-04 15:39:20 +01:00
let iconpreviewopen = modal . querySelector ( ".ui-icon-picker-icon.preview.open" ) ;
let iconpreviewclosed = modal . querySelector ( ".ui-icon-picker-icon.preview.closed" ) ;
let iconpreviewswitching = modal . querySelector ( ".ui-icon-picker-icon.preview.switching" ) ;
2019-10-23 11:10:01 +02:00
if ( ! BDFDB . DOMUtils . containsClass ( iconpreviewopen , "nopic" ) && ! BDFDB . DOMUtils . containsClass ( iconpreviewclosed , "nopic" ) && ! BDFDB . DOMUtils . containsClass ( iconpreviewswitching , "nopic" ) ) {
2019-01-04 15:39:20 +01:00
let customID = this . generateID ( "customicon" ) ;
2019-10-22 20:16:05 +02:00
BDFDB . DataUtils . save ( { "openicon" : iconpreviewopen . url , "closedicon" : iconpreviewclosed . url , customID } , this , "customicons" , customID ) ;
2019-01-13 22:53:07 +01:00
modal . querySelectorAll ( "input[type='text'][option]" ) . forEach ( ( input ) => { input . value = "" ; } ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
let iconpreviewopeninner = iconpreviewopen . querySelector ( ".ui-picker-inner" ) ;
let iconpreviewclosedinner = iconpreviewclosed . querySelector ( ".ui-picker-inner" ) ;
let iconpreviewswitchinginner = iconpreviewswitching . querySelector ( ".ui-picker-inner" ) ;
2019-01-26 22:45:19 +01:00
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( iconpreviewopen , "nopic" ) ;
2019-01-13 22:53:07 +01:00
iconpreviewopeninner . style . removeProperty ( "background-image" ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( iconpreviewclosed , "nopic" ) ;
2019-01-13 22:53:07 +01:00
iconpreviewclosedinner . style . removeProperty ( "background-image" ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( iconpreviewswitching , "nopic" ) ;
2019-01-13 22:53:07 +01:00
iconpreviewswitchinginner . style . removeProperty ( "background-image" ) ;
2018-10-11 10:21:26 +02:00
clearInterval ( iconpreviewswitching . switchInterval ) ;
2019-10-22 18:55:25 +02:00
BDFDB . NotificationUtils . toast ( ` Custom Icon was added to selection. ` , { type : "success" } ) ;
2018-12-13 16:48:35 +01:00
this . setIcons ( modal , modal . querySelector ( ".ui-icon-picker-icon.selected" ) . getAttribute ( "value" ) ) ;
2018-10-11 10:21:26 +02:00
}
2019-10-22 18:55:25 +02:00
else BDFDB . NotificationUtils . toast ( ` Add an image for the open and the closed icon. ` , { type : "danger" } ) ;
2019-01-14 09:38:45 +01:00
}
2019-01-26 22:45:19 +01:00
2019-10-08 19:12:48 +02:00
generateID ( prefix ) {
2019-10-08 21:09:14 +02:00
if ( prefix == "folder" ) {
let id = Math . floor ( Math . random ( ) * 4294967296 ) ;
return BDFDB . LibraryModules . FolderStore . guildFolders . every ( n => ! n . folderId || n . folderId != id ) ? id : this . generateID ( prefix ) ;
}
else {
2019-10-22 19:49:57 +02:00
let data = BDFDB . DataUtils . load ( this , prefix + "s" ) ;
2019-10-08 21:09:14 +02:00
let id = prefix + "_" + Math . round ( Math . random ( ) * 10000000000000000 ) ;
return data [ id ] ? this . generateID ( prefix ) : id ;
}
2019-01-14 09:38:45 +01:00
}
2019-01-26 22:45:19 +01:00
2019-10-08 19:12:48 +02:00
setIcons ( modal , selection ) {
let wrapper = modal . querySelector ( ".icons" ) ;
if ( ! wrapper ) return ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( wrapper . childNodes ) ;
2019-01-26 22:45:19 +01:00
2019-10-08 19:12:48 +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 ) ;
}
2019-01-26 22:45:19 +01:00
2019-10-23 11:10:01 +02:00
wrapper . appendChild ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . margintop4 } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifycenter + BDFDB . disCNS . alignstretch + BDFDB . disCN . wrap } ui-icon-picker-row" style="flex: 1 1 auto; display: flex; flex-wrap: wrap; overflow: visible !important;"><div class="ui-icon-picker-icon" value="-1"><div class="ui-picker-inner"><svg aria-hidden="false" width="50" height="50" viewBox="-2 -1 25 25" style="color: black;"><path fill="currentColor" d="M20 7H12L10.553 5.106C10.214 4.428 9.521 4 8.764 4H3C2.447 4 2 4.447 2 5V19C2 20.104 2.895 21 4 21H20C21.104 21 22 20.104 22 19V9C22 7.896 21.104 7 20 7Z"></path></svg></div></div> ${ Object . getOwnPropertyNames ( folderIcons ) . map ( id => ` <div class="ui-icon-picker-icon ${ folderIcons [ id ] . customID ? ' custom' : '' } " value=" ${ id } "><div class="ui-picker-inner" style="background: url( ${ folderIcons [ id ] . closedicon } ) center/cover no-repeat;"></div> ${ folderIcons [ id ] . customID ? '<div value="' + id + '" class="' + BDFDB . disCN . hovercardbutton + '"></div>' : '' } </div> ` ) . join ( "" ) } </div></div> ` ) ) ;
2019-10-08 19:12:48 +02:00
setIcon ( wrapper . querySelector ( ` .ui-icon-picker-icon[value=" ${ folderIcons [ selection ] ? selection : - 1 } "] ` ) , false , true ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( wrapper , "click" , ".ui-icon-picker-icon" , e => {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( e . target , BDFDB . disCN . hovercardbutton ) ) return ;
2019-10-08 19:12:48 +02:00
setIcon ( wrapper . querySelector ( ".ui-icon-picker-icon.selected" ) , false , false ) ;
setIcon ( e . currentTarget , true , true ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( wrapper , "click" , BDFDB . dotCN . hovercardbutton , e => {
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( e . currentTarget . parentElement , "selected" ) ) return ;
2019-10-22 20:16:05 +02:00
BDFDB . DataUtils . remove ( this , "customicons" , e . currentTarget . getAttribute ( "value" ) ) ;
2019-10-08 19:12:48 +02:00
e . currentTarget . parentElement . remove ( ) ;
2019-10-22 18:55:25 +02:00
BDFDB . NotificationUtils . toast ( ` Custom Icon was deleted. ` , { type : "success" } ) ;
2019-01-14 09:38:45 +01:00
} ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( wrapper , "mouseenter" , ".ui-icon-picker-icon" , e => {
2019-10-08 19:12:48 +02:00
setIcon ( e . currentTarget , true ) ;
2019-10-22 18:55:25 +02:00
if ( e . currentTarget . getAttribute ( "value" ) == - 1 ) BDFDB . TooltipUtils . create ( e . currentTarget , BDFDB . LanguageUtils . LanguageStrings . DEFAULT , { type : "top" } ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( wrapper , "mouseleave" , ".ui-icon-picker-icon" , e => {
2019-10-08 19:12:48 +02:00
setIcon ( e . currentTarget , false ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2019-01-26 22:45:19 +01:00
2019-10-08 19:12:48 +02:00
function setIcon ( icon , hover , enable ) {
if ( ! icon ) return ;
let id = icon . getAttribute ( "value" ) ;
2019-10-23 11:10:01 +02:00
if ( enable != undefined ) BDFDB . DOMUtils . toggleClass ( icon , "selected" , enable ) ;
2019-10-08 19:12:48 +02:00
if ( hover ) {
if ( folderIcons [ id ] ) icon . querySelector ( ".ui-picker-inner" ) . style . setProperty ( "background-image" , ` url( ${ folderIcons [ id ] . openicon } ) ` ) ;
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( icon , "selected" ) ) icon . style . setProperty ( "background-color" , "rgb(255,255,255,0.2)" ) ;
2019-10-08 19:12:48 +02:00
else icon . style . setProperty ( "background-color" , "rgb(255,255,255,0.1)" ) ;
}
else {
if ( folderIcons [ id ] ) icon . querySelector ( ".ui-picker-inner" ) . style . setProperty ( "background-image" , ` url( ${ folderIcons [ id ] . closedicon } ) ` ) ;
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( icon , "selected" ) ) icon . style . setProperty ( "background-color" , "rgb(255,255,255,0.2)" ) ;
2019-10-08 19:12:48 +02:00
else icon . style . removeProperty ( "background-color" ) ;
}
2019-05-03 17:49:54 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-10-08 19:12:48 +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 ;
2019-04-25 21:58:21 +02:00
}
2019-10-08 19:12:48 +02:00
return state ;
2019-04-25 21:58:21 +02:00
}
2019-10-08 19:12:48 +02:00
getFolders ( ) {
let found = [ ] , folders = Object . assign ( { } , BDFDB . LibraryModules . FolderStore . guildFolders ) ;
for ( let pos in folders ) if ( folders [ pos ] . folderId ) found . push ( Object . assign ( { } , folders [ pos ] ) ) ;
return found ;
2019-01-04 15:39:20 +01:00
}
2019-10-08 19:12:48 +02:00
getFolderOfGuildId ( guildid ) {
if ( ! guildid ) return null ;
for ( let folder of BDFDB . LibraryModules . FolderStore . guildFolders ) if ( folder . folderId && folder . guildIds . includes ( guildid ) ) return folder ;
2019-01-04 15:39:20 +01:00
}
2019-10-08 19:12:48 +02:00
getFolderConfig ( folderid ) {
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( folderid ) || { } ;
2019-10-22 20:16:05 +02:00
let config = BDFDB . DataUtils . load ( this , "folders" , folderid ) || {
2019-10-08 19:12:48 +02:00
iconID : "-1" ,
icons : { openicon : null , closedicon : null } ,
muteFolder : false ,
autoRead : false ,
copyTooltipColor : false ,
useCloseIcon : true ,
color1 : null ,
color2 : [ "255" , "255" , "255" ] ,
color3 : null ,
color4 : null
} ;
2019-10-23 10:03:33 +02:00
if ( ! config . color1 ) config . color1 = BDFDB . ColorUtils . convert ( folder . folderColor , "RGBCOMP" ) || [ "0" , "0" , "0" ] ;
2019-10-08 19:12:48 +02:00
return config ;
2019-01-04 15:39:20 +01:00
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
toggleFolderContent ( forceOpenClose ) {
2019-10-08 19:12:48 +02:00
if ( ! this . foldercontentguilds ) return ;
forceOpenClose = forceOpenClose === undefined ? BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) . size > 0 : forceOpenClose ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . toggleClass ( this . foldercontent , "foldercontentopen" , forceOpenClose ) ;
BDFDB . DOMUtils . toggleClass ( this . foldercontent , "foldercontentclosed" , ! forceOpenClose ) ;
BDFDB . DOMUtils . toggleClass ( document . body , "foldercontentopened" , forceOpenClose ) ;
2019-01-04 15:39:20 +01:00
}
2019-10-08 19:12:48 +02:00
changeFolder ( folderid , wrapper ) {
2019-10-22 18:55:25 +02:00
wrapper = wrapper || BDFDB . FolderUtils . getDiv ( folderid ) ;
2019-10-08 19:12:48 +02:00
if ( wrapper ) {
let folderinner = wrapper . querySelector ( ` ${ BDFDB . dotCN . guildfolderexpandendbackground } ~ ${ BDFDB . dotCNS . guildouter + BDFDB . dotCN . guildinner } ` ) ;
let foldericon = wrapper . querySelector ( BDFDB . dotCN . guildfolder ) ;
if ( folderinner && foldericon ) {
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( folderid ) ;
let data = this . getFolderConfig ( folderid ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( folderinner . querySelectorAll ( ` ${ BDFDB . dotCN . guildupperbadge } .count ` ) ) ;
2019-10-08 19:12:48 +02:00
foldericon . parentElement . parentElement . style . removeProperty ( "-webkit-mask" ) ;
2019-10-22 20:16:05 +02:00
if ( BDFDB . DataUtils . get ( this , "settings" , "showCountBadge" ) ) {
2019-10-23 11:10:01 +02:00
folderinner . appendChild ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCN . guildupperbadge } count" style="opacity: 1; transform: translate(0px, 0px);"><div class=" ${ BDFDB . disCN . guildbadgenumberbadge } " style="background-color: rgb(114, 137, 218); width: ${ folder . guildIds . length > 99 ? 28 : ( folder . guildIds . length > 9 ? 22 : 16 ) } px; padding-right: ${ folder . guildIds . length > 99 ? 0 : ( folder . guildIds . length > 9 ? 0 : 1 ) } px;"> ${ folder . guildIds . length } </div></div> ` ) ) ;
2019-10-08 19:12:48 +02:00
let width = folder . guildIds . length > 99 ? 36 : ( folder . guildIds . length > 9 ? 30 : 24 ) ;
2019-10-22 18:55:25 +02:00
foldericon . parentElement . parentElement . style . setProperty ( "-webkit-mask" , ` url(data:image/svg+xml;base64, ${ btoa ( ` <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" fill="black" x="0" y="0" width="48" height="48"><path d="M ${ width - 7 } 0 C ${ width - 5 } 2 ${ width - 4 } 5 ${ width - 4 } 8 C ${ width - 4 } ${ width / 1.8 + 3 } 15 20 8 20 C 5 20 2 19 0 17 L 0 50 L 50 50 L 50 0 L 17 0 z"></path></svg> ` ) } ) center/cover no-repeat ` ) ;
2019-02-27 18:35:06 +01:00
}
2019-10-08 19:12:48 +02:00
let icontype = BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folderid ) ? "openicon" : "closedicon" ;
let icon = icontype != "closedicon" || data . useCloseIcon ? data . icons [ icontype ] : null ;
if ( icon ) foldericon . style . setProperty ( "background-image" , ` url( ${ icon } ) ` , "important" ) ;
else foldericon . style . removeProperty ( "background-image" ) ;
folderinner . removeEventListener ( "mouseenter" , folderinner . ServerFoldersTooltipListener ) ;
folderinner . removeEventListener ( "mousedown" , folderinner . ServerFoldersClickListener ) ;
if ( data . color3 || data . color4 ) {
2019-10-22 18:55:25 +02:00
var isgradient3 = data . color3 && BDFDB . ObjectUtils . is ( data . color3 ) ;
var isgradient4 = data . color4 && BDFDB . ObjectUtils . is ( data . color4 ) ;
2019-10-23 10:03:33 +02:00
var bgColor = data . color3 ? ( ! isgradient3 ? BDFDB . ColorUtils . convert ( data . color3 , "RGBA" ) : BDFDB . ColorUtils . createGradient ( data . color3 ) ) : "" ;
var fontColor = data . color4 ? ( ! isgradient4 ? BDFDB . ColorUtils . convert ( data . color4 , "RGBA" ) : BDFDB . ColorUtils . createGradient ( data . color4 ) ) : "" ;
2019-10-22 18:55:25 +02:00
var folderName = folder . folderName || BDFDB . ReactUtils . getValue ( wrapper , "return.stateNode.props.defaultFolderName" ) ;
2019-10-08 19:12:48 +02:00
folderinner . ServerFoldersTooltipListener = ( ) => {
2019-10-23 11:10:01 +02:00
BDFDB . TooltipUtils . create ( folderinner , isgradient4 ? ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ fontColor } !important;"> ${ BDFDB . StringUtils . htmlEscape ( folderName ) } </span> ` : folderName , { type : "right" , selector : "ServerFolders-tooltip" , style : ` ${ isgradient4 ? '' : ` color: ${ fontColor } !important; ` } background: ${ bgColor } !important; border-color: ${ isgradient3 ? BDFDB . ColorUtils . convert ( data . color3 [ 0 ] , "RGBA" ) : bgColor } !important; ` , html : isgradient3 , hide : true } ) ;
2019-10-08 19:12:48 +02:00
} ;
folderinner . addEventListener ( "mouseenter" , folderinner . ServerFoldersTooltipListener ) ;
}
folderinner . ServerFoldersClickListener = ( ) => {
clearTimeout ( this . clickedFolderTimeout ) ;
this . clickedFolder = folderid ;
this . clickedFolderTimeout = setTimeout ( ( ) => {
delete this . clickedFolderTimeout ;
} , 3000 ) ;
} ;
folderinner . addEventListener ( "mousedown" , folderinner . ServerFoldersClickListener ) ;
2019-03-29 19:50:03 +01:00
}
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-10-08 19:12:48 +02:00
updateGuildInFolderContent ( folderid , guildid ) {
if ( ! this . foldercontentguilds || ! folderid || ! guildid ) return ;
let guild = BDFDB . LibraryModules . GuildStore . getGuild ( guildid ) ;
if ( guild ) {
let oldCopy = this . foldercontentguilds . querySelector ( ` .copy[guildid=" ${ guildid } "] ` ) ;
let newCopy = this . createCopyOfServer ( folderid , guildid ) ;
if ( ! newCopy ) return ;
else if ( oldCopy ) {
this . foldercontentguilds . insertBefore ( newCopy , oldCopy ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( oldCopy ) ;
2018-10-11 10:21:26 +02:00
}
else {
2019-10-08 19:12:48 +02:00
let folder = BDFDB . LibraryModules . FolderStore . getGuildFolderById ( folderid ) ;
let position = folder . guildIds . indexOf ( guildid ) ;
let siblingId = position > - 1 ? folder . guildIds [ folder . guildIds . indexOf ( guildid ) + 1 ] : null ;
let insertNode = siblingId ? this . foldercontentguilds . querySelector ( ` [guildid=" ${ siblingId } "][folderid=" ${ folderid } "] ` ) : null ;
if ( ! insertNode ) {
let sameFolderEles = this . foldercontentguilds . querySelectorAll ( ` [folderid=" ${ folderid } "] ` ) ;
insertNode = sameFolderEles . length > 0 ? sameFolderEles [ sameFolderEles . length - 1 ] . nextSibling : null ;
}
this . foldercontentguilds . insertBefore ( newCopy , insertNode ) ;
2018-10-11 10:21:26 +02:00
}
2019-10-23 11:10:01 +02:00
if ( BDFDB . DOMUtils . containsClass ( this . foldercontentguilds . firstElementChild , "folderseparatorouter" ) ) BDFDB . DOMUtils . remove ( this . foldercontentguilds . firstElementChild ) ;
2019-10-08 19:12:48 +02:00
}
}
addSeparator ( folderid ) {
if ( ! this . foldercontentguilds ) return ;
2019-10-23 11:10:01 +02:00
if ( ! this . foldercontent . querySelector ( ` .folderseparatorouter[folderid=" ${ folderid } "] ` ) && BDFDB . DataUtils . get ( this , "settings" , "addSeparators" ) ) this . foldercontentguilds . insertBefore ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . guildouter + BDFDB . disCN . _bdguildseparator } folderseparatorouter" folderid=" ${ folderid } "><div class=" ${ BDFDB . disCN . guildseparator } folderseparator"></div></div> ` ) , this . foldercontentguilds . querySelectorAll ( ` [folderid=" ${ folderid } "] ` ) [ 0 ] ) ;
if ( BDFDB . DOMUtils . containsClass ( this . foldercontentguilds . firstElementChild , "folderseparatorouter" ) ) BDFDB . DOMUtils . remove ( this . foldercontentguilds . firstElementChild ) ;
2019-10-08 19:12:48 +02:00
}
createBase64SVG ( paths , color1 = "#000000" , color2 = "#FFFFFF" ) {
if ( paths . indexOf ( "<path " ) != 0 ) return paths ;
2019-10-22 18:55:25 +02:00
let isgradient1 = color1 && BDFDB . ObjectUtils . is ( color1 ) ;
let isgradient2 = color1 && BDFDB . ObjectUtils . is ( color2 ) ;
2019-10-08 19:12:48 +02:00
let svg = ` <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="1000" viewBox="-60 -50 1100 1100"> ` ;
if ( isgradient1 ) {
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> ` ;
2018-10-11 10:21:26 +02:00
}
2019-10-08 19:12:48 +02:00
if ( isgradient2 ) {
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> ` ;
}
2019-10-23 10:03:33 +02:00
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> ` ;
2019-10-08 19:12:48 +02:00
return ` data:image/svg+xml;base64, ${ btoa ( svg ) } ` ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-10-08 19:12:48 +02:00
createCopyOfServer ( folderid , guildid ) {
if ( ! folderid || ! guildid ) return ;
let guild = BDFDB . LibraryModules . GuildStore . getGuild ( guildid ) ;
2019-10-22 18:55:25 +02:00
let guilddiv = BDFDB . GuildUtils . getDiv ( guildid ) ;
let props = BDFDB . ReactUtils . getValue ( guilddiv , "return.stateNode.props" ) ;
2019-10-08 19:12:48 +02:00
if ( ! guild || ! guilddiv || ! props ) return ;
2019-01-04 15:39:20 +01:00
let guildcopy = guilddiv . cloneNode ( true ) ;
2019-04-25 21:58:21 +02:00
let guildcopyinner = guildcopy . querySelector ( BDFDB . dotCN . guildcontainer ) ;
2019-04-26 22:39:14 +02:00
let guildiconwrapper = guildcopy . querySelector ( BDFDB . dotCN . guildiconwrapper ) ;
2019-06-01 09:59:49 +02:00
let guildicon = guildcopy . querySelector ( BDFDB . dotCN . guildicon ) ;
2019-04-26 22:39:14 +02:00
let guildpillitem = guildcopy . querySelector ( BDFDB . dotCN . guildpillitem ) ;
2019-09-19 12:37:33 +02:00
if ( ! guildpillitem ) {
2019-10-23 11:10:01 +02:00
guildpillitem = BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . guildpillwrapper + BDFDB . disCN . guildpill } "><span class=" ${ BDFDB . disCN . guildpillitem } " style="opacity: 0; height: 8px; transform: translate3d(0px, 0px, 0px);"></span></div> ` ) ;
2019-09-19 12:37:33 +02:00
guildcopy . insertBefore ( guildpillitem , guildcopy . firstElementChild ) ;
guildpillitem = guildpillitem . firstElementChild ;
}
2019-10-08 19:12:48 +02:00
guildcopy . setAttribute ( "guildid" , guildid ) ;
guildcopy . setAttribute ( "folderid" , folderid ) ;
2019-04-26 22:39:14 +02:00
guildiconwrapper . style . setProperty ( "border-radius" , props . selected ? "30%" : "50%" ) ;
guildiconwrapper . style . setProperty ( "overflow" , "hidden" ) ;
2019-10-08 19:12:48 +02:00
2019-04-26 22:39:14 +02:00
guildpillitem . style . setProperty ( "opacity" , props . selected ? 1 : ( props . unread ? 0.7 : 0 ) ) ;
guildpillitem . style . setProperty ( "height" , props . selected ? "40px" : "8px" ) ;
guildpillitem . style . setProperty ( "transform" , "translate3d(0px, 0px, 0px)" ) ;
2019-10-08 19:12:48 +02:00
guildcopy . querySelector ( "mask" ) . setAttribute ( "id" , "SERVERFOLDERSCOPY" + guildid ) ;
2019-04-26 22:39:14 +02:00
guildcopy . querySelector ( "mask path" ) . setAttribute ( "d" , "M0 0 l50 0l0 50l-50 0l0 -50Z" ) ;
2019-10-08 19:12:48 +02:00
guildcopy . querySelector ( "foreignObject" ) . setAttribute ( "mask" , "url(#SERVERFOLDERSCOPY" + guildid + ")" ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( guildcopy , "copy" ) ;
BDFDB . DOMUtils . show ( guildcopy ) ;
2019-10-08 19:12:48 +02:00
let pillvisible = guildpillitem && guildpillitem . style . getPropertyValue ( "opacity" ) != 0 ;
let borderRadius = new BDFDB . LibraryModules . AnimationUtils . Value ( 0 ) ;
borderRadius
. interpolate ( {
inputRange : [ 0 , 1 ] ,
outputRange : [ 50 , 30 ]
} )
. addListener ( ( value ) => {
guildiconwrapper . style . setProperty ( "border-radius" , ` ${ value . value } % ` ) ;
} ) ;
let pillHeight = new BDFDB . LibraryModules . AnimationUtils . Value ( 0 ) ;
pillHeight
. interpolate ( {
inputRange : [ 0 , 1 ] ,
outputRange : [ 8 , 20 ]
} )
. addListener ( ( value ) => {
if ( guildpillitem ) guildpillitem . style . setProperty ( "height" , ` ${ value . value } px ` ) ;
} ) ;
let pillOpacity = new BDFDB . LibraryModules . AnimationUtils . Value ( 0 ) ;
pillOpacity
. interpolate ( {
inputRange : [ 0 , 1 ] ,
outputRange : [ 0 , 0.7 ]
} )
. addListener ( ( value ) => {
if ( guildpillitem ) guildpillitem . style . setProperty ( "opacity" , ` ${ value . value } ` ) ;
} ) ;
let animate = ( v ) => {
BDFDB . LibraryModules . AnimationUtils . parallel ( [
BDFDB . LibraryModules . AnimationUtils . timing ( borderRadius , { toValue : v , duration : 200 } ) ,
BDFDB . LibraryModules . AnimationUtils . spring ( pillHeight , { toValue : v , friction : 5 } )
] ) . start ( ) ;
} ;
let animate2 = ( v ) => {
BDFDB . LibraryModules . AnimationUtils . parallel ( [
BDFDB . LibraryModules . AnimationUtils . timing ( pillOpacity , { toValue : v , duration : 200 } ) ,
] ) . start ( ) ;
} ;
2019-04-25 21:58:21 +02:00
guildcopyinner . addEventListener ( "mouseenter" , ( ) => {
2019-10-23 11:10:01 +02:00
let EditServers = BDFDB . BDUtils . getPlugin ( "EditServers" ) ;
2019-10-08 19:12:48 +02:00
let ESdata = EditServers ? EditServers . getGuildData ( guildid , guildcopyinner ) : null ;
if ( ESdata && ( ESdata . name || ESdata . color3 || ESdata . color4 ) ) EditServers . changeTooltip ( guild , guildcopyinner , "right" ) ;
2019-02-13 19:57:35 +01:00
else {
2019-10-22 20:16:05 +02:00
let folderData = BDFDB . DataUtils . load ( this , "folders" , folderid ) || { } ;
2019-08-19 11:17:57 +02:00
let color3 = folderData . copyTooltipColor ? folderData . color3 : null ;
let color4 = folderData . copyTooltipColor ? folderData . color4 : null ;
2019-10-22 18:55:25 +02:00
let isgradient3 = color3 && BDFDB . ObjectUtils . is ( color3 ) ;
let isgradient4 = color4 && BDFDB . ObjectUtils . is ( color4 ) ;
2019-10-23 10:03:33 +02:00
let bgColor = color3 ? ( ! isgradient3 ? BDFDB . ColorUtils . convert ( color3 , "RGBA" ) : BDFDB . ColorUtils . createGradient ( color3 ) ) : "" ;
let fontColor = color4 ? ( ! isgradient4 ? BDFDB . ColorUtils . convert ( color4 , "RGBA" ) : BDFDB . ColorUtils . createGradient ( color4 ) ) : "" ;
2019-10-23 11:10:01 +02:00
BDFDB . TooltipUtils . create ( guildcopyinner , isgradient4 ? ` <span style="pointer-events: none; -webkit-background-clip: text !important; color: transparent !important; background-image: ${ fontColor } !important;"> ${ BDFDB . StringUtils . htmlEscape ( guild . name ) } </span> ` : guild . name , { type : "right" , selector : "guild-folder-tooltip" , style : ` ${ isgradient4 ? '' : 'color: ' + fontColor + ' !important; ' } background: ${ bgColor } !important; border-color: ${ isgradient3 ? BDFDB . ColorUtils . convert ( color3 [ 0 ] , "RGBA" ) : bgColor } !important; ` , html : isgradient3 , hide : true } ) ;
2019-02-13 19:57:35 +01:00
}
2019-10-08 19:12:48 +02:00
if ( guildicon && guildicon . src && guild . icon && guild . icon . startsWith ( "a_" ) && guild . features . has ( "ANIMATED_ICON" ) && guildicon . src . includes ( "discordapp.com/icons/" ) ) {
2019-06-09 15:38:22 +02:00
guildicon . src = guildicon . src . replace ( ".webp" , ".gif" ) ;
}
2019-10-08 19:12:48 +02:00
pillvisible = guildpillitem && guildpillitem . style . getPropertyValue ( "opacity" ) != 0 ;
if ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) != guildid ) {
animate ( 1 ) ;
if ( ! pillvisible ) animate2 ( 1 ) ;
}
2019-06-01 09:59:49 +02:00
} ) ;
guildcopyinner . addEventListener ( "mouseleave" , ( ) => {
2019-10-23 11:10:01 +02:00
if ( guildicon && guildicon . src && guild . icon && guild . icon . startsWith ( "a_" ) && guild . features . has ( "ANIMATED_ICON" ) && guildicon . src . includes ( "discordapp.com/icons/" ) && ! BDFDB . ReactUtils . getValue ( BDFDB . BDUtils . getPlugin ( "AutoPlayGifs" , true ) , "settings.guildList" ) ) {
2019-06-09 15:38:22 +02:00
guildicon . src = guildicon . src . replace ( ".gif" , ".webp" ) ;
}
2019-10-08 19:12:48 +02:00
if ( BDFDB . LibraryModules . LastGuildStore . getGuildId ( ) != guildid ) {
animate ( 0 ) ;
if ( ! pillvisible ) animate2 ( 0 ) ;
}
2019-01-13 22:53:07 +01:00
} ) ;
guildcopy . addEventListener ( "click" , e => {
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . stopEvent ( e ) ;
2019-10-08 19:12:48 +02:00
if ( BDFDB . pressedKeys . includes ( 46 ) ) this . removeGuildFromFolder ( folderid , guildid ) ;
2019-01-13 22:53:07 +01:00
else {
2019-10-08 19:12:48 +02:00
BDFDB . LibraryModules . GuildUtils . transitionToGuildSync ( guild . id ) ;
2019-10-22 19:49:57 +02:00
let settings = BDFDB . DataUtils . get ( this , "settings" ) ;
2019-10-12 14:45:12 +02:00
if ( settings . closeAllFolders ) for ( let openFolderId of BDFDB . LibraryModules . FolderUtils . getExpandedFolders ( ) ) if ( openFolderId != folderid || ! settings . forceOpenFolder ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( openFolderId ) ;
else if ( settings . closeTheFolder && ! settings . forceOpenFolder && BDFDB . LibraryModules . FolderUtils . isFolderExpanded ( folderid ) ) BDFDB . LibraryModules . GuildUtils . toggleGuildFolderExpand ( folderid ) ;
2019-01-13 22:53:07 +01:00
}
} ) ;
guildcopy . addEventListener ( "contextmenu" , e => {
2019-10-22 18:55:25 +02:00
BDFDB . GuildUtils . openMenu ( guilddiv , e ) ;
2019-01-13 22:53:07 +01:00
} ) ;
guildcopy . addEventListener ( "mousedown" , e => {
2019-01-24 12:09:05 +01:00
let x = e . pageX , y = e . pageY ;
let mousemove = e2 => {
if ( Math . sqrt ( ( x - e2 . pageX ) * * 2 ) > 20 || Math . sqrt ( ( y - e2 . pageY ) * * 2 ) > 20 ) {
document . removeEventListener ( "mousemove" , mousemove ) ;
document . removeEventListener ( "mouseup" , mouseup ) ;
let hovcopy = null ;
2019-10-23 11:10:01 +02:00
let placeholder = BDFDB . DOMUtils . create ( this . dragPlaceholderMarkup ) ;
2019-01-24 12:09:05 +01:00
let dragpreview = this . createDragPreview ( guilddiv , e ) ;
2019-01-26 22:45:19 +01:00
2019-01-24 12:09:05 +01:00
let dragging = e3 => {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( placeholder ) ;
BDFDB . DOMUtils . hide ( guildcopy ) ;
2019-01-24 12:09:05 +01:00
this . updateDragPreview ( dragpreview , e3 ) ;
if ( this . foldercontent . contains ( e3 . target ) ) {
2019-10-23 11:10:01 +02:00
hovcopy = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . guildouter , e3 . target ) ;
2019-10-08 19:12:48 +02:00
if ( hovcopy && hovcopy . getAttribute ( "folderid" ) == folderid ) this . foldercontentguilds . insertBefore ( placeholder , hovcopy . nextSibling ) ;
2019-01-24 12:09:05 +01:00
else hovcopy = null ;
}
} ;
let releasing = e3 => {
document . removeEventListener ( "mousemove" , dragging ) ;
document . removeEventListener ( "mouseup" , releasing ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( placeholder , dragpreview ) ;
BDFDB . DOMUtils . show ( guildcopy ) ;
let dropfolderdiv = BDFDB . DOMUtils . getParent ( BDFDB . dotCN . guildfolderwrapper , e3 . target ) ;
2019-10-22 18:55:25 +02:00
let newfolderid = dropfolderdiv ? BDFDB . FolderUtils . getId ( dropfolderdiv ) : null ;
2019-10-08 19:12:48 +02:00
if ( newfolderid ) {
2019-10-08 19:32:05 +02:00
if ( newfolderid != folderid ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( guildcopy ) ;
2019-10-08 19:32:05 +02:00
this . addGuildToFolder ( newfolderid , guildid ) ;
}
2019-01-24 12:09:05 +01:00
}
else if ( hovcopy ) {
this . foldercontentguilds . insertBefore ( guildcopy , hovcopy . nextSibling ) ;
2019-10-08 19:12:48 +02:00
this . updateGuildPositions ( folderid ) ;
2019-01-24 12:09:05 +01:00
}
} ;
document . addEventListener ( "mousemove" , dragging ) ;
document . addEventListener ( "mouseup" , releasing ) ;
}
} ;
2019-01-22 19:39:44 +01:00
let mouseup = ( ) => {
2019-01-24 12:09:05 +01:00
document . removeEventListener ( "mousemove" , mousemove ) ;
2019-01-22 19:39:44 +01:00
document . removeEventListener ( "mouseup" , mouseup ) ;
} ;
2019-01-24 12:09:05 +01:00
document . addEventListener ( "mousemove" , mousemove ) ;
2019-01-22 19:39:44 +01:00
document . addEventListener ( "mouseup" , mouseup ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
guildcopy . querySelector ( "a" ) . setAttribute ( "draggable" , false ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
return guildcopy ;
}
2019-10-08 19:12:48 +02:00
updateGuildPositions ( folderid ) {
let oldGuildFolders = Object . assign ( { } , BDFDB . LibraryModules . FolderStore . guildFolders ) ;
let guildFolders = [ ] , guildPositions = [ ] ;
for ( let i in oldGuildFolders ) {
if ( oldGuildFolders [ i ] . folderId ) {
let newFolder = Object . assign ( { } , oldGuildFolders [ i ] ) ;
if ( oldGuildFolders [ i ] . folderId == folderid ) {
let sameFolderGuilds = this . foldercontentguilds . querySelectorAll ( ` [guildid][folderid=" ${ folderid } "] ` ) ;
if ( sameFolderGuilds . length > 0 ) {
newFolder . guildIds = [ ] ;
for ( let guilddiv of sameFolderGuilds ) newFolder . guildIds . push ( guilddiv . getAttribute ( "guildid" ) ) ;
}
}
guildFolders . push ( newFolder ) ;
}
else guildFolders . push ( oldGuildFolders [ i ] ) ;
}
for ( let i in guildFolders ) for ( let guildid of guildFolders [ i ] . guildIds ) guildPositions . push ( guildid ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
}
2019-10-09 09:40:15 +02:00
openFolderCreationMenu ( guilds , initguildid ) {
2019-10-23 11:10:01 +02:00
let modal = BDFDB . DOMUtils . create ( ` <span class=" ${ this . name } -modal BDFDB-modal"><div class=" ${ BDFDB . disCN . backdrop } "></div><div class=" ${ BDFDB . disCN . modal } "><div class=" ${ BDFDB . disCN . modalinner } "><div class=" ${ BDFDB . disCNS . modalsub + BDFDB . disCN . modalsizemedium } "><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCN . modalheader } " style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . flexchild } " style="flex: 1 1 auto;"><h4 class=" ${ BDFDB . disCNS . h4 + BDFDB . disCNS . defaultcolor + BDFDB . disCN . h4defaultmargin } "> ${ this . labels . serversubmenu _createfolder _text } </h4><div class=" ${ BDFDB . disCNS . modalguildname + BDFDB . disCNS . small + BDFDB . disCNS . titlesize12 + BDFDB . disCNS . height16 + BDFDB . disCN . primary } "></div></div><button type="button" class=" ${ BDFDB . disCNS . modalclose + BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookblank + BDFDB . disCNS . buttoncolorbrand + BDFDB . disCN . buttongrow } "><div class=" ${ BDFDB . disCN . buttoncontents } "><svg name="Close" width="18" height="18" viewBox="0 0 12 12" style="flex: 0 1 auto;"><g fill="none" fill-rule="evenodd"><path d="M0 0h12v12H0"></path><path class="fill" fill="currentColor" d="M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6"></path></g></svg></div></button></div><div class=" ${ BDFDB . disCNS . scrollerwrap + BDFDB . disCNS . modalcontent + BDFDB . disCNS . scrollerthemed + BDFDB . disCN . scrollerthemeghosthairline } "><div class=" ${ BDFDB . disCNS . scroller + BDFDB . disCN . modalsubinner } entries"></div></div><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontalreverse + BDFDB . disCNS . horizontalreverse2 + BDFDB . disCNS . directionrowreverse + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . modalfooter } "><button type="button" class="btn-done ${ BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorbrand + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } "><div class=" ${ BDFDB . disCN . buttoncontents } "></div></button><button type="button" class="btn-cancel ${ BDFDB . disCNS . button + BDFDB . disCNS . buttonlooklink + BDFDB . disCNS . buttoncolortransparent + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } "><div class=" ${ BDFDB . disCN . buttoncontents } "></div></button></div></div></div></div></span> ` ) ;
2019-10-09 09:40:15 +02:00
let targetedguildsids = { } ;
let container = modal . querySelector ( ".entries" ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ListenerUtils . addToChildren ( modal , "click" , ".btn-done" , ( ) => {
2019-10-09 09:40:15 +02:00
let ids = [ ] ;
for ( let id in targetedguildsids ) if ( targetedguildsids [ id ] ) ids . push ( id ) ;
this . createFolder ( ids ) ;
} ) ;
for ( let guild of guilds ) {
2019-10-23 11:10:01 +02:00
if ( container . firstElementChild ) container . appendChild ( BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCN . divider } "></div> ` ) ) ;
let entry = BDFDB . DOMUtils . create ( ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . horizontal + BDFDB . disCNS . justifystart + BDFDB . disCNS . aligncenter + BDFDB . disCNS . nowrap + BDFDB . disCNS . margintop4 + BDFDB . disCN . marginbottom4 } entry" style="flex: 1 1 auto;"> ${ BDFDB . GuildUtils . createCopy ( guild . id , { size : 48 } ).outerHTML}<h3 class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . titlesize16 + BDFDB . disCNS . height24 + BDFDB . disCNS . flexchild + BDFDB . disCN . overflowellipsis } " style="flex: 1 1 auto; white-space: nowrap;"> ${ BDFDB . StringUtils . htmlEscape ( guild . name ) } </h3><div class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . switchenabled + BDFDB . disCNS . switch + BDFDB . disCNS . switchvalue + BDFDB . disCNS . switchsizedefault + BDFDB . disCNS . switchsize + BDFDB . disCN . switchthemedefault } " style="flex: 0 0 auto;"><input type="checkbox" class=" ${ BDFDB . disCNS . switchinnerenabled + BDFDB . disCN . switchinner } "></div></div> ` ) ;
2019-10-09 09:40:15 +02:00
container . appendChild ( entry ) ;
let switchinput = entry . querySelector ( BDFDB . dotCN . switchinner ) ;
switchinput . checked = guild . id == initguildid ;
targetedguildsids [ guild . id ] = guild . id == initguildid ;
switchinput . addEventListener ( "click" , e => {
targetedguildsids [ guild . id ] = ! targetedguildsids [ guild . id ] ;
} ) ;
}
BDFDB . appendModal ( modal ) ;
}
createFolder ( guildids ) {
if ( ! guildids ) return ;
guildids = Array . isArray ( guildids ) ? guildids : Array . from ( guildids ) ;
if ( ! guildids . length ) return ;
2019-10-08 21:09:14 +02:00
let oldGuildFolders = Object . assign ( { } , BDFDB . LibraryModules . FolderStore . guildFolders ) ;
2019-10-09 09:40:15 +02:00
let guildFolders = [ ] , guildPositions = [ ] , added = false ;
2019-10-08 21:09:14 +02:00
for ( let i in oldGuildFolders ) {
2019-10-09 09:40:15 +02:00
if ( ! oldGuildFolders [ i ] . folderId && guildids . includes ( oldGuildFolders [ i ] . guildIds [ 0 ] ) ) {
if ( ! added ) {
added = true ;
guildFolders . push ( {
guildIds : guildids ,
folderId : this . generateID ( "folder" )
} ) ;
}
}
2019-10-08 21:09:14 +02:00
else guildFolders . push ( oldGuildFolders [ i ] ) ;
}
for ( let i in guildFolders ) for ( let guildid of guildFolders [ i ] . guildIds ) guildPositions . push ( guildid ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
}
2019-10-08 19:12:48 +02:00
removeFolder ( folderid ) {
2019-10-22 20:16:05 +02:00
BDFDB . DataUtils . remove ( this , "folders" , folderid ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( this . foldercontentguilds . querySelector ( ` ${ BDFDB . dotCN . guildouter } [folderid=" ${ folderid } "] ` ) ) ;
2019-10-08 19:12:48 +02:00
let oldGuildFolders = Object . assign ( { } , BDFDB . LibraryModules . FolderStore . guildFolders ) ;
let guildFolders = [ ] , guildPositions = [ ] ;
for ( let i in oldGuildFolders ) {
if ( oldGuildFolders [ i ] . folderId == folderid ) {
for ( let guildid of oldGuildFolders [ i ] . guildIds ) guildFolders . push ( { guildIds : [ guildid ] } ) ;
}
else guildFolders . push ( oldGuildFolders [ i ] ) ;
}
for ( let i in guildFolders ) for ( let guildid of guildFolders [ i ] . guildIds ) guildPositions . push ( guildid ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
this . toggleFolderContent ( ) ;
}
addGuildToFolder ( folderid , guildid ) {
let oldGuildFolders = Object . assign ( { } , BDFDB . LibraryModules . FolderStore . guildFolders ) ;
let guildFolders = [ ] , guildPositions = [ ] ;
for ( let i in oldGuildFolders ) {
if ( oldGuildFolders [ i ] . folderId ) {
let newFolder = Object . assign ( { } , oldGuildFolders [ i ] ) ;
if ( oldGuildFolders [ i ] . folderId == folderid ) newFolder . guildIds . push ( guildid ) ;
2019-10-22 18:55:25 +02:00
else BDFDB . ArrayUtils . remove ( newFolder . guildIds , guildid ) ;
2019-10-08 19:12:48 +02:00
guildFolders . push ( newFolder ) ;
}
else if ( oldGuildFolders [ i ] . guildIds [ 0 ] != guildid ) guildFolders . push ( oldGuildFolders [ i ] ) ;
}
for ( let i in guildFolders ) for ( let guildid of guildFolders [ i ] . guildIds ) guildPositions . push ( guildid ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
}
removeGuildFromFolder ( folderid , guildid ) {
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . remove ( this . foldercontentguilds . querySelector ( ` ${ BDFDB . dotCN . guildouter } [folderid=" ${ folderid } "][guildid=" ${ guildid } "] ` ) ) ;
2019-10-08 19:12:48 +02:00
let sameFolderEles = this . foldercontentguilds . querySelectorAll ( ` [folderid=" ${ folderid } "] ` ) ;
2019-10-23 11:10:01 +02:00
if ( sameFolderEles . length == 1 && BDFDB . DOMUtils . containsClass ( sameFolderEles [ 0 ] , "folderseparatorouter" ) ) BDFDB . DOMUtils . remove ( sameFolderEles [ 0 ] ) ;
2019-10-08 19:12:48 +02:00
let oldGuildFolders = Object . assign ( { } , BDFDB . LibraryModules . FolderStore . guildFolders ) ;
let guildFolders = [ ] , guildPositions = [ ] ;
for ( let i in oldGuildFolders ) {
if ( oldGuildFolders [ i ] . folderId == folderid ) {
let newFolder = Object . assign ( { } , oldGuildFolders [ i ] ) ;
2019-10-22 18:55:25 +02:00
BDFDB . ArrayUtils . remove ( newFolder . guildIds , guildid ) ;
2019-10-08 19:12:48 +02:00
guildFolders . push ( newFolder ) ;
guildFolders . push ( { guildIds : [ guildid ] } ) ;
}
else guildFolders . push ( oldGuildFolders [ i ] ) ;
}
for ( let i in guildFolders ) for ( let guildid of guildFolders [ i ] . guildIds ) guildPositions . push ( guildid ) ;
BDFDB . LibraryModules . SettingsUtils . updateRemoteSettings ( { guildPositions , guildFolders } ) ;
this . toggleFolderContent ( ) ;
}
2019-09-04 12:34:02 +02:00
2019-01-04 15:39:20 +01:00
createDragPreview ( div , e ) {
if ( ! Node . prototype . isPrototypeOf ( div ) ) return ;
let dragpreview = div . cloneNode ( true ) ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . addClass ( dragpreview , "serverfolders-dragpreview" ) ;
BDFDB . DOMUtils . hide ( dragpreview ) ;
2019-01-04 15:39:20 +01:00
dragpreview . style . setProperty ( "pointer-events" , "none" , "important" ) ;
dragpreview . style . setProperty ( "left" , e . clientX - 25 + "px" , "important" ) ;
dragpreview . style . setProperty ( "top" , e . clientY - 25 + "px" , "important" ) ;
document . querySelector ( BDFDB . dotCN . appmount ) . appendChild ( dragpreview ) ;
return dragpreview ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
updateDragPreview ( dragpreview , e ) {
if ( ! Node . prototype . isPrototypeOf ( dragpreview ) ) return ;
2019-10-23 11:10:01 +02:00
BDFDB . DOMUtils . show ( dragpreview ) ;
2019-01-04 15:39:20 +01:00
dragpreview . style . setProperty ( "left" , e . clientX - 25 + "px" , "important" ) ;
dragpreview . style . setProperty ( "top" , e . clientY - 25 + "px" , "important" ) ;
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
setLabelsByLanguage ( ) {
2019-10-22 18:55:25 +02:00
switch ( BDFDB . LanguageUtils . getLanguage ( ) . id ) {
2018-10-11 10:21:26 +02:00
case "hr" : //croatian
return {
servercontext _serverfolders _text : "Poslužitelj mapu" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Izradi mapu" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Dodaj poslužitelj u mapu" ,
serversubmenu _removefromfolder _text : "Ukloni poslužitelj iz mapu" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Označite kao pročitano" ,
foldercontext _mutefolder _text : "Isključite mapu" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Izbriši mapu" ,
modal _tabheader1 _text : "Mape" ,
modal _tabheader2 _text : "Boja mape" ,
modal _tabheader3 _text : "Boja tooltip" ,
2019-01-14 13:58:48 +01:00
modal _tabheader4 _text : "Prilagođeni ikona" ,
2018-10-11 10:21:26 +02:00
modal _iconpicker _text : "Odabir mape" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Koristite zatvorenu ikonu umjesto minisevera" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Koristite iste boje za poslužitelj u mapi" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Boja primarne mape" ,
modal _colorpicker2 _text : "Boja sekundarne mape" ,
modal _colorpicker3 _text : "Boja tooltip" ,
modal _colorpicker4 _text : "Boja fonta" ,
modal _customopen _text : "Otvori ikona" ,
modal _customclosed _text : "Zatvorena ikona" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Pregled ikona"
2018-10-11 10:21:26 +02:00
} ;
case "da" : //danish
return {
servercontext _serverfolders _text : "Servermapper" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Opret mappe" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Tilføj server til mappe" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Fjern server fra mappe" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Markér som læst" ,
foldercontext _mutefolder _text : "Dæmp mappe" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Slet mappe" ,
modal _tabheader1 _text : "Mappe" ,
modal _tabheader2 _text : "Mappefarve" ,
modal _tabheader3 _text : "Tooltipfarve" ,
modal _tabheader4 _text : "Brugerdefinerede ikoner" ,
modal _iconpicker _text : "Mappevalg" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Brug et lukket ikon i stedet for miniserverne" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Brug de samme farver til server på mappen" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Primær mappefarve" ,
modal _colorpicker2 _text : "Sekundær mappefarve" ,
modal _colorpicker3 _text : "Tooltipfarve" ,
modal _colorpicker4 _text : "Skriftfarve" ,
modal _customopen _text : "Åbn ikon" ,
modal _customclosed _text : "Lukket ikon" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Ikon forhåndsvisning"
2018-10-11 10:21:26 +02:00
} ;
case "de" : //german
return {
servercontext _serverfolders _text : "Serverordner" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Ordner erzeugen" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Server zum Ordner hinzufügen" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Server aus Ordner entfernen" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Als gelesen markieren" ,
foldercontext _mutefolder _text : "Ordner stummschalten" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Ordner löschen" ,
modal _tabheader1 _text : "Ordner" ,
modal _tabheader2 _text : "Ordnerfarbe" ,
modal _tabheader3 _text : "Tooltipfarbe" ,
modal _tabheader4 _text : "Eigene Icons" ,
modal _iconpicker _text : "Ordnerauswahl" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Verwende anstelle der Miniserver ein geschlossenes Symbol" ,
modal _copytooltipcolor _text : "Verwende dieselbe Farbe für alle Server eines Ordners" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Primäre Ordnerfarbe" ,
modal _colorpicker2 _text : "Sekundäre Ordnerfarbe" ,
modal _colorpicker3 _text : "Tooltipfarbe" ,
modal _colorpicker4 _text : "Schriftfarbe" ,
modal _customopen _text : "Geöffnetes Icon" ,
modal _customclosed _text : "Geschlossenes Icon" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Iconvorschau"
2018-10-11 10:21:26 +02:00
} ;
case "es" : //spanish
return {
servercontext _serverfolders _text : "Carpetas de servidor" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Crear carpeta" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Añadir servidor a la carpeta" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Eliminar servidor de la carpeta" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Marcar como leído" ,
foldercontext _mutefolder _text : "Silenciar carpeta" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Eliminar carpeta" ,
modal _tabheader1 _text : "Carpeta" ,
modal _tabheader2 _text : "Color de carpeta" ,
modal _tabheader3 _text : "Color de tooltip" ,
modal _tabheader4 _text : "Iconos personalizados" ,
modal _iconpicker _text : "Selección de carpeta" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Use un icono cerrado en lugar de los miniservidores" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Usa los mismos colores para el servidor de la carpeta" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Color primaria de carpeta" ,
modal _colorpicker2 _text : "Color secundario de la carpeta" ,
modal _colorpicker3 _text : "Color de tooltip" ,
modal _colorpicker4 _text : "Color de fuente" ,
modal _customopen _text : "Ícono abierto" ,
modal _customclosed _text : "Icono cerrado" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Vista previa del icono"
2018-10-11 10:21:26 +02:00
} ;
case "fr" : //french
return {
servercontext _serverfolders _text : "Dossiers du serveur" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Créer le dossier" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Ajouter le serveur à un dossier" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Supprimer le serveur du dossier" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Marquer comme lu" ,
2019-10-09 09:53:30 +02:00
foldercontext _mutefolder _text : "Rendre muet le dossier" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Supprimer le dossier" ,
modal _tabheader1 _text : "Dossier" ,
modal _tabheader2 _text : "Couleur du dossier" ,
modal _tabheader3 _text : "Couleur de tooltip" ,
modal _tabheader4 _text : "Icônes personnalisées" ,
modal _iconpicker _text : "Choix du dossier" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Utilisez une icône fermée à la place des mini-serveurs" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Utilisez les mêmes couleurs pour le serveur du dossier" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Couleur primaire du dossier" ,
modal _colorpicker2 _text : "Couleur secondaire du dossier" ,
modal _colorpicker3 _text : "Couleur de tooltip" ,
modal _colorpicker4 _text : "Couleur de la police" ,
modal _customopen _text : "Icône ouverte" ,
modal _customclosed _text : "Icône fermée" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Aperçu de l'icône"
2018-10-11 10:21:26 +02:00
} ;
case "it" : //italian
return {
servercontext _serverfolders _text : "Cartelle del server" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Aggiungi il server alla cartella" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Creare una cartella" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "Rimuovi il server dalla cartella" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Contrassegna come letto" ,
foldercontext _mutefolder _text : "Disattiva cartella" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Elimina cartella" ,
modal _tabheader1 _text : "Cartella" ,
modal _tabheader2 _text : "Colore della cartella" ,
modal _tabheader3 _text : "Colore della tooltip" ,
modal _tabheader4 _text : "Icone personalizzate" ,
modal _iconpicker _text : "Selezione della cartella" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Utilizzare un'icona chiusa anziché i mini server" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Usa gli stessi colori per il server della cartella" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Colore primaria della cartella" ,
modal _colorpicker2 _text : "Colore secondaria della cartella" ,
modal _colorpicker3 _text : "Colore della tooltip" ,
modal _colorpicker4 _text : "Colore del carattere" ,
modal _customopen _text : "Icona aperta" ,
modal _customclosed _text : "Icona chiusa" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Icona anteprima"
2018-10-11 10:21:26 +02:00
} ;
case "nl" : //dutch
return {
servercontext _serverfolders _text : "Servermappen" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Voeg server toe aan de map" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Map aanmaken" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "Verwijder de server uit de map" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Markeren als gelezen" ,
foldercontext _mutefolder _text : "Demp map" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Verwijder map" ,
modal _tabheader1 _text : "Map" ,
modal _tabheader2 _text : "Mapkleur" ,
modal _tabheader3 _text : "Tooltipkleur" ,
modal _tabheader4 _text : "Aangepaste keuze" ,
modal _iconpicker _text : "Map keuze" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Gebruik een gesloten keuze in plaats van de miniservers" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Gebruik dezelfde kleuren voor de server van de map" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Primaire mapkleur" ,
modal _colorpicker2 _text : "Tweede mapkleur" ,
modal _colorpicker3 _text : "Tooltipkleur" ,
modal _colorpicker4 _text : "Doopvontkleur" ,
modal _customopen _text : "Geopende keuze" ,
modal _customclosed _text : "Gesloten keuze" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Voorbeeld van keuze"
2018-10-11 10:21:26 +02:00
} ;
case "no" : //norwegian
return {
servercontext _serverfolders _text : "Servermapper" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Legg til server i mappe" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Lag mappe" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Fjern server fra mappe" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Merk som les" ,
foldercontext _mutefolder _text : "Demp mappe" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Slett mappe" ,
modal _tabheader1 _text : "Mappe" ,
modal _tabheader2 _text : "Mappefarge" ,
modal _tabheader3 _text : "Tooltipfarge" ,
modal _tabheader4 _text : "Tilpassede ikoner" ,
modal _iconpicker _text : "Mappevalg" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Bruk et lukket ikon i stedet for minitjenerne" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Bruk de samme fargene til serveren til mappen" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Primær mappefarge" ,
modal _colorpicker2 _text : "Sekundær mappefarge" ,
modal _colorpicker3 _text : "Tooltipfarge" ,
modal _colorpicker4 _text : "Skriftfarge" ,
modal _customopen _text : "Åpnet ikon" ,
modal _customclosed _text : "Lukket ikon" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Ikon forhåndsvisning"
2018-10-11 10:21:26 +02:00
} ;
case "pl" : //polish
return {
servercontext _serverfolders _text : "Foldery serwera" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Dodaj serwer do folderu" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Utwórz folder" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "Usuń serwer z folderu" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Oznacz jako przeczytane" ,
foldercontext _mutefolder _text : "Wycisz folder" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "Usuń folder" ,
2018-10-11 10:21:26 +02:00
modal _tabheader1 _text : "Folder" ,
modal _tabheader2 _text : "Kolor folderu" ,
modal _tabheader3 _text : "Kolor podpowiedzi" ,
modal _tabheader4 _text : "Niestandardowe ikony" ,
modal _iconpicker _text : "Wybór folderu" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Użyj zamkniętej ikony zamiast mini serwerów" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Użyj tych samych kolorów dla serwera folderu" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Podstawowy kolor folderu" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker2 _text : "Drugorzędny kolor folderu" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker3 _text : "Kolor podpowiedzi" ,
modal _colorpicker4 _text : "Kolor czcionki" ,
modal _customopen _text : "Otwarta ikona" ,
2019-01-14 13:58:48 +01:00
modal _customclosed _text : "Zamknięta ikona" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Podgląd ikony"
2018-10-11 10:21:26 +02:00
} ;
case "pt-BR" : //portuguese (brazil)
return {
servercontext _serverfolders _text : "Pastas de servidores" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Adicionar servidor à pasta" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Criar pasta" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Remover servidor da pasta" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Marcar como lido" ,
foldercontext _mutefolder _text : "Silenciar pasta" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Excluir pasta" ,
modal _tabheader1 _text : "Pasta" ,
modal _tabheader2 _text : "Cor da pasta" ,
modal _tabheader3 _text : "Cor da tooltip" ,
modal _tabheader4 _text : "Ícones personalizados" ,
modal _iconpicker _text : "Escolha da pasta" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Use um ícone fechado em vez dos mini servidores" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Use as mesmas cores para o servidor da pasta" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Cor primária da pasta" ,
modal _colorpicker2 _text : "Cor secundária da pasta" ,
modal _colorpicker3 _text : "Cor da tooltip" ,
modal _colorpicker4 _text : "Cor da fonte" ,
modal _customopen _text : "Ícone aberto" ,
modal _customclosed _text : "Ícone fechado" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Pré-visualização de ícones"
2018-10-11 10:21:26 +02:00
} ;
case "fi" : //finnish
return {
servercontext _serverfolders _text : "Palvelinkansiot" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Lisää palvelin kansioon" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Luo kansio" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "Poista palvelin kansioon" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: merkitse luettavaksi" ,
foldercontext _mutefolder _text : "Mykistä kansio" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Poista kansio" ,
modal _tabheader1 _text : "Kansio" ,
modal _tabheader2 _text : "Kansionväri" ,
modal _tabheader3 _text : "Tooltipväri" ,
modal _tabheader4 _text : "Mukautetut kuvakkeet" ,
modal _iconpicker _text : "Kansion valinta" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Käytä suljettua kuvaketta minipalvelimien sijasta" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Käytä samoja värejä kansion palvelimelle" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Ensisijainen kansionväri" ,
modal _colorpicker2 _text : "Toissijainen kansionväri" ,
modal _colorpicker3 _text : "Tooltipväri" ,
modal _colorpicker4 _text : "Fontinväri" ,
modal _customopen _text : "Avattu kuvake" ,
modal _customclosed _text : "Suljettu kuvake" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Kuvakkeen esikatselu"
2018-10-11 10:21:26 +02:00
} ;
case "sv" : //swedish
return {
servercontext _serverfolders _text : "Servermappar" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Lägg till server i mapp" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Skapa mapp" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Ta bort servern från mappen" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Markera som Läs" ,
foldercontext _mutefolder _text : "Stäng mapp" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Ta bort mapp" ,
modal _tabheader1 _text : "Mapp" ,
modal _tabheader2 _text : "Mappfärg" ,
modal _tabheader3 _text : "Tooltipfärg" ,
modal _tabheader4 _text : "Anpassade ikoner" ,
modal _iconpicker _text : "Mappval" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Använd en stängd ikon istället för miniservrarna" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Använd samma färger för mappen på mappen" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Primär mappfärg" ,
modal _colorpicker2 _text : "Sekundär mappfärg" ,
modal _colorpicker3 _text : "Tooltipfärg" ,
modal _colorpicker4 _text : "Fontfärg" ,
modal _customopen _text : "Öppnad ikon" ,
modal _customclosed _text : "Closed Icon" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Ikon förhandsvisning"
2018-10-11 10:21:26 +02:00
} ;
case "tr" : //turkish
return {
servercontext _serverfolders _text : "Sunucu klasörleri" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Klasöre sunucu ekle" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Klasör oluşturun" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "Sunucuyu klasörden kaldı r" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Oto: Okundu Olarak İşaretle" ,
foldercontext _mutefolder _text : "Klasörü kapat" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Klasörü sil" ,
modal _tabheader1 _text : "Klasör" ,
modal _tabheader2 _text : "Klasör rengi" ,
modal _tabheader3 _text : "Tooltip rengi" ,
modal _tabheader4 _text : "Özel simgeler" ,
modal _iconpicker _text : "Klasör seçimi" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Mini sunucular yerine kapalı bir simge kullanı n" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Klasörün sunucusu için aynı renkleri kullanı n" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Birincil klasör rengi" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker2 _text : "İkincil klasör rengi" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker3 _text : "Tooltip rengi" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker4 _text : "Yazı rengi" ,
modal _customopen _text : "Açı lmı ş simge" ,
modal _customclosed _text : "Kapalı simge" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Simge önizleme"
2018-10-11 10:21:26 +02:00
} ;
case "cs" : //czech
return {
servercontext _serverfolders _text : "Složky serveru" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Přidat server do složky" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Vytvořit složky" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "Odebrat server ze složky" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Označit jako přečtené" ,
foldercontext _mutefolder _text : "Ztlumte složky" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Smazat složky" ,
modal _tabheader1 _text : "Složky" ,
modal _tabheader2 _text : "Barva složky" ,
modal _tabheader3 _text : "Barva tooltip" ,
modal _tabheader4 _text : "Vlastní ikony" ,
modal _iconpicker _text : "Volba složky" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Místo mini serverů použijte uzavřenou ikonu" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Použijte stejné barvy pro server složky" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Primární barva složky" ,
modal _colorpicker2 _text : "Sekundární barva složky" ,
modal _colorpicker3 _text : "Barva tooltip" ,
modal _colorpicker4 _text : "Barva fontu" ,
2019-01-14 13:58:48 +01:00
modal _customopen _text : "Otevřená ikona" ,
modal _customclosed _text : "Uzavřená ikona" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Náhled ikony"
2018-10-11 10:21:26 +02:00
} ;
case "bg" : //bulgarian
return {
2019-01-14 13:58:48 +01:00
servercontext _serverfolders _text : "Сървърни папки" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Добавяне на сървър в папка" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Създай папка" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "Премахване на сървър от папка" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Авто: Маркиране като четене" ,
foldercontext _mutefolder _text : "Заглушаване на папката" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "Изтриване на папка" ,
modal _tabheader1 _text : "Папка" ,
modal _tabheader2 _text : "Цвят на папка" ,
modal _tabheader3 _text : "Цвят на подсказка" ,
modal _tabheader4 _text : "Персонализирани икони" ,
modal _iconpicker _text : "Избор на папки" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Използвайте затворена икона вместо мини сървърите" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Използвайте същите цветове за сървъра на папката" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker1 _text : "Цвят основнен на папка" ,
modal _colorpicker2 _text : "цвят вторичен на папка" ,
modal _colorpicker3 _text : "Цвят на подсказка" ,
modal _colorpicker4 _text : "Цвят на шрифта" ,
modal _customopen _text : "Отворена икона" ,
modal _customclosed _text : "Затворена икона" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Икона Преглед"
2018-10-11 10:21:26 +02:00
} ;
case "ru" : //russian
return {
2019-01-14 13:58:48 +01:00
servercontext _serverfolders _text : "Папки сервера" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Добавить сервер в папку" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Создать папки" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "Удалить сервер из папки" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Авто: Отметить как прочитанное" ,
foldercontext _mutefolder _text : "Отключить папки" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "Удалить папки" ,
modal _tabheader1 _text : "Папка" ,
modal _tabheader2 _text : "Цвет папки" ,
modal _tabheader3 _text : "Цвет подсказка" ,
modal _tabheader4 _text : "Пользовательские значки" ,
modal _iconpicker _text : "Выбор папки" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Используйте закрытую иконку вместо мини-серверов" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Используйте те же цвета для сервера папки" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker1 _text : "Цвет основной папки" ,
modal _colorpicker2 _text : "Цвет вторичной папки" ,
modal _colorpicker3 _text : "Цвет подсказка" ,
modal _colorpicker4 _text : "Цвет шрифта" ,
modal _customopen _text : "Открытая иконка" ,
modal _customclosed _text : "Закрытая иконка" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Иконка Просмотр"
2018-10-11 10:21:26 +02:00
} ;
case "uk" : //ukrainian
return {
2019-01-14 13:58:48 +01:00
servercontext _serverfolders _text : "Папки сервера" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Додати сервер до папки" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Створити папки" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "Видалити папку з папки" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Авто: Позначити як прочитане" ,
foldercontext _mutefolder _text : "Відключення папки" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "Видалити папки" ,
modal _tabheader1 _text : "Папки" ,
modal _tabheader2 _text : "Колір папки" ,
modal _tabheader3 _text : "Колір підказка" ,
modal _tabheader4 _text : "Користувальницькі іконки" ,
modal _iconpicker _text : "Вибір папки" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Використовуйте закритий значок замість міні-серверів" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Використовуйте ті ж кольори для сервера папки" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker1 _text : "Колір основної папки" ,
modal _colorpicker2 _text : "Колір вторинного папки" ,
modal _colorpicker3 _text : "Колір підказка" ,
modal _colorpicker4 _text : "Колір шрифту" ,
modal _customopen _text : "Відкрита ікона" ,
modal _customclosed _text : "Закрита ікона" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Піктограма попереднього перегляду"
2018-10-11 10:21:26 +02:00
} ;
case "ja" : //japanese
return {
2019-01-14 13:58:48 +01:00
servercontext _serverfolders _text : "サーバーフォルダ" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "サーバーをフォルダに追加する" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "フォルダーを作る" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "サーバーをフォルダから削除する" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "自動: 読み取りとしてマークする" ,
foldercontext _mutefolder _text : "ミュートフォルダー" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "フォルダを削除する" ,
modal _tabheader1 _text : "フォルダ" ,
modal _tabheader2 _text : "フォルダの色" ,
modal _tabheader3 _text : "ツールチップの色" ,
modal _tabheader4 _text : "カスタムアイコン" ,
modal _iconpicker _text : "フォルダの選択" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "ミニサーバーの代わりに閉じたアイコンを使用する" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "フォルダのサーバーに同じ色を使う" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker1 _text : "プライマリフォルダの色" ,
modal _colorpicker2 _text : "セカンダリフォルダの色" ,
modal _colorpicker3 _text : "ツールチップの色" ,
modal _colorpicker4 _text : "フォントの色" ,
modal _customopen _text : "開いたアイコン" ,
modal _customclosed _text : "クローズドアイコン" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "アイコンのプレビュー"
2018-10-11 10:21:26 +02:00
} ;
case "zh-TW" : //chinese (traditional)
return {
2019-01-14 13:58:48 +01:00
servercontext _serverfolders _text : "服務器文件夾" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "添加服務器到文件夾" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "創建文件夾" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "從文件夾中刪除服務器" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "自動: 標記為已讀" ,
foldercontext _mutefolder _text : "靜音文件夾" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "刪除文件夾" ,
modal _tabheader1 _text : "夾" ,
modal _tabheader2 _text : "文件夾顏色" ,
modal _tabheader3 _text : "工具提示顏色" ,
modal _tabheader4 _text : "自定義圖標" ,
modal _iconpicker _text : "文件夾選擇" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "使用關閉的圖標代替迷你服務器" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "對文件夾的服務器使用相同的顏色" ,
2019-01-14 13:58:48 +01:00
modal _colorpicker1 _text : "主文件夾顏色" ,
modal _colorpicker2 _text : "輔助文件夾顏色" ,
modal _colorpicker3 _text : "工具提示顏色" ,
modal _colorpicker4 _text : "字體顏色" ,
modal _customopen _text : "打開的圖標" ,
modal _customclosed _text : "封閉的圖標" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "圖標預覽"
2018-10-11 10:21:26 +02:00
} ;
case "ko" : //korean
return {
2019-01-14 13:58:48 +01:00
servercontext _serverfolders _text : "서버 폴더" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "폴더에 서버 추가" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "폴더 만들기" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "폴더에서 서버 제거" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "자동: 읽은 상태로 표시" ,
foldercontext _mutefolder _text : "폴더 음소거" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "폴더 삭제" ,
modal _tabheader1 _text : "폴더" ,
modal _tabheader2 _text : "폴더 색" ,
modal _tabheader3 _text : "툴팁 색깔" ,
modal _tabheader4 _text : "사용자 정의 아이콘" ,
modal _iconpicker _text : "폴더 선택" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "미니 서버 대신 닫힌 아이콘을 사용하십시오" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "폴더의 서버에 대해 동일한 색상을 사용하십시오." ,
2019-01-14 13:58:48 +01:00
modal _colorpicker1 _text : "기본 폴더 색" ,
modal _colorpicker2 _text : "보조 폴더 색" ,
modal _colorpicker3 _text : "툴팁 색깔" ,
modal _colorpicker4 _text : "글꼴 색깔" ,
modal _customopen _text : "열린 아이콘" ,
modal _customclosed _text : "닫힌 아이콘" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "아이콘 미리보기"
2018-10-11 10:21:26 +02:00
} ;
default : //default: english
return {
servercontext _serverfolders _text : "Serverfolders" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Add Server to Folder" ,
2019-10-08 21:09:14 +02:00
serversubmenu _createfolder _text : "Create Folder" ,
2019-02-20 21:31:00 +01:00
serversubmenu _removefromfolder _text : "Remove Server from Folder" ,
2019-10-08 19:12:48 +02:00
foldercontext _autoreadfolder _text : "Auto: Mark As Read" ,
foldercontext _mutefolder _text : "Mute Folder" ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Delete Folder" ,
modal _tabheader1 _text : "Folder" ,
modal _tabheader2 _text : "Foldercolor" ,
modal _tabheader3 _text : "Tooltipcolor" ,
modal _tabheader4 _text : "Custom Icons" ,
modal _iconpicker _text : "Folderchoice" ,
2019-10-08 19:12:48 +02:00
modal _usecloseicon _text : "Use a closed Icon instead of the Mini-Servers" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Use same Colors for Servers of the Folder" ,
2018-10-11 10:21:26 +02:00
modal _colorpicker1 _text : "Primary Foldercolor" ,
modal _colorpicker2 _text : "Secondary Foldercolor" ,
modal _colorpicker3 _text : "Tooltipcolor" ,
modal _colorpicker4 _text : "Fontcolor" ,
modal _customopen _text : "Open Icon" ,
modal _customclosed _text : "Closed Icon" ,
2019-01-15 15:24:39 +01:00
modal _custompreview _text : "Iconpreview"
2018-10-11 10:21:26 +02:00
} ;
}
}
2018-10-26 12:33:17 +02:00
}