2019-01-31 17:06:48 +01: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-03-29 19:50:03 +01:00
getVersion ( ) { return "6.1.6" ; }
2019-01-13 22:53:07 +01:00
getAuthor ( ) { return "DevilBro" ; }
getDescription ( ) { return "Adds the feature to create folders to organize your servers. Right click a server > 'Serverfolders' > 'Create Server' to create a server. To add servers to a folder hold 'Ctrl' and drag the server onto the folder, this will add the server to the folderlist and hide it in the serverlist. To open a folder click the folder. A folder can only be opened when it has at least one server in it. To remove a server from a folder, open the folder and either right click the server > 'Serverfolders' > 'Remove Server from Folder' or hold 'Del' and click the server in the folderlist." ; }
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
initConstructor ( ) {
2019-02-24 19:52:22 +01:00
this . changelog = {
2019-03-29 19:50:03 +01:00
"fixed" : [ [ "Separator Issue" , "Separator would sometimes duplicate at the end of the server list on start up" ] ]
2019-02-24 19:52:22 +01:00
} ;
2018-10-11 10:21:26 +02:00
this . labels = { } ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
this . patchModules = {
2019-03-29 19:50:03 +01:00
"Guilds" : [ "componentDidMount" , "componentWillUnmount" ] ,
2019-03-29 19:50:39 +01:00
"Guild" : [ "componentDidMount" , "componentWillUnmount" ] ,
2019-02-04 11:22:37 +01:00
"StandardSidebarView" : "componentWillUnmount"
2019-01-04 15:39:20 +01:00
} ;
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 ;
width : 70 px ;
height : 70 px ;
border : 4 px solid transparent ;
border - radius : 12 px ;
margin : 0 ;
}
2019-01-24 13:37:08 +01:00
. $ { this . name } - modal . ui - icon - picker - icon . ui - picker - inner {
2018-10-11 10:21:26 +02:00
margin : 5 px 5 px ;
width : 60 px ;
height : 60 px ;
background - repeat : no - repeat ;
background - clip : padding - box ;
background - position : 50 % ;
background - size : cover ;
border - radius : 12 px ;
}
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-01-13 22:53:07 +01:00
background - image : 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>' ) ;
2018-10-11 10:21:26 +02:00
}
$ { BDFDB . dotCN . guild } . folder $ { BDFDB . dotCN . avataricon } {
2019-01-04 15:39:20 +01:00
background - clip : padding - box ! important ;
background - position : center ! important ;
2018-10-11 10:21:26 +02:00
background - size : cover ! important ;
}
$ { BDFDB . dotCN . guild } . folder $ { BDFDB . dotCN . badge } . folder . count {
background : # 7289 DA ;
2018-12-07 19:43:19 +01:00
top : - 2 px ;
left : - 2 px ;
right : unset ;
2018-10-25 09:48:10 +02:00
bottom : unset ;
2018-10-11 10:21:26 +02:00
}
2019-01-04 15:39:20 +01:00
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview {
pointer - events : none ! important ;
position : absolute ! important ;
opacity : 0.5 ! important ;
z - index : 10000 ! important ;
2018-10-11 10:21:26 +02:00
}
2019-01-04 15:39:20 +01:00
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview ,
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview $ { BDFDB . dotCN . guildinner } ,
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview $ { BDFDB . dotCN . guildinner } a ,
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview $ { BDFDB . dotCNS . guildinner + BDFDB . dotCN . guildicon } {
border - radius : 50 % ! important ;
width : 50 px ! important ;
height : 50 px ! important ;
2018-10-11 10:21:26 +02:00
}
2019-01-04 15:39:20 +01:00
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview : before ,
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview : after ,
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview $ { BDFDB . dotCN . badge } {
display : none ! important ;
}
$ { BDFDB . dotCN . guild } . serverfolders - dragpreview $ { BDFDB . dotCN . avataricon } {
2018-10-11 10:21:26 +02:00
background - color : transparent ! 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 ;
2018-10-11 10:21:26 +02:00
}
2018-12-06 20:23:32 +01:00
$ { BDFDB . dotCN . guildswrapper } . foldercontent . folderseparator {
2018-10-11 10:21:26 +02:00
margin - top : 10 px ;
}
$ { BDFDB . dotCN . guildswrapper } . foldercontent . foldercontentclosed {
width : 0 px ! important ;
} ` ;
this . serverContextEntryMarkup =
` <div class=" ${ BDFDB . disCN . contextmenuitemgroup } ">
< div class = "${BDFDB.disCN.contextmenuitem} serverfolders-item ${BDFDB.disCN.contextmenuitemsubmenu}" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _servercontext _serverfolders _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< / d i v > ` ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . serverContextSubMenuMarkup =
` <div class=" ${ BDFDB . disCN . contextmenu } serverfolders-submenu">
< div class = "${BDFDB.disCN.contextmenuitemgroup}" >
< div class = "${BDFDB.disCN.contextmenuitem} createfolder-item" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _serversubmenu _createfolder _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
2019-02-20 21:31:00 +01:00
< div class = "${BDFDB.disCN.contextmenuitem} addtofolder-item ${BDFDB.disCN.contextmenuitemsubmenu}" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _serversubmenu _addtofolder _text < / d i v > < / s p a n >
2019-02-20 21:31:00 +01:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCN.contextmenuitem} removefromfolder-item" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _serversubmenu _removefromfolder _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< / d i v >
< / d i v > ` ;
2019-01-26 22:45:19 +01:00
2019-02-20 21:31:00 +01:00
this . serverContextSubFolderMenuMarkup =
` <div class=" ${ BDFDB . disCN . contextmenu } serverfolders-foldersubmenu">
< div class = "${BDFDB.disCNS.scrollerwrap + BDFDB.disCNS.scrollerthemed + BDFDB.disCN.themeghosthairline}" >
< div class = "${BDFDB.disCNS.scroller + BDFDB.disCN.contextmenuscroller}" > < / d i v >
< / d i v >
< / d i v > ` ;
2018-10-11 10:21:26 +02:00
this . folderContextMarkup =
2019-01-13 22:53:07 +01:00
` <div class=" ${ BDFDB . disCN . contextmenu } serverfolder-contextmenu">
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuitemgroup}" >
< div class = "${BDFDB.disCN.contextmenuitem} unreadfolder-item ${BDFDB.disCN.contextmenuitemdisabled}" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _foldercontext _unreadfolder _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCN.contextmenuitem} autounreadfolder-item ${BDFDB.disCN.contextmenuitemtoggle}" >
2019-04-18 09:28:20 +02:00
< div class = "${BDFDB.disCN.contextmenulabel} BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _foldercontext _autounreadfolder _text < / d i v > < / d i v >
2019-01-08 14:12:44 +01:00
< div class = "${BDFDB.disCNS.contextmenucheckbox + BDFDB.disCN.contextmenucheckbox2}" >
< div class = "${BDFDB.disCN.contextmenucheckboxinner}" >
< input class = "${BDFDB.disCN.contextmenucheckboxelement}" type = "checkbox" >
2018-10-11 10:21:26 +02:00
< span > < / s p a n >
< / d i v >
< span > < / s p a n >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCN.contextmenuitem} foldersettings-item" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _foldercontext _foldersettings _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCN.contextmenuitem} createfolder-item" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _foldercontext _createfolder _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCN.contextmenuitem} removefolder-item ${BDFDB.disCN.contextmenuitemdanger}" >
2019-04-18 09:28:20 +02:00
< span class = "BDFDB-textscrollwrapper" speed = 3 > < div class = "BDFDB-textscroll" > REPLACE _foldercontext _removefolder _text < / d i v > < / s p a n >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.contextmenuhint}" > < / d i v >
< / d i v >
< / d i v >
< / d i v > ` ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
this . folderContentMarkup =
2018-10-11 10:21:26 +02:00
` <div class=" ${ BDFDB . disCN . guildswrapper } foldercontent foldercontentclosed">
2019-01-13 22:53:07 +01:00
< div class = "${BDFDB.disCNS.scrollerwrap + BDFDB.disCNS.firefoxfixscrollflex + BDFDB.disCNS.guildsscrollerwrap + BDFDB.disCNS.scrollerthemed + BDFDB.disCN.themeghosthairline}" >
< div class = "${BDFDB.disCNS.guilds + 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
2018-10-11 10:21:26 +02:00
this . folderIconMarkup =
` <div class=" ${ BDFDB . disCN . guild } folder">
2019-03-11 15:05:15 +01:00
< div class = "${BDFDB.disCN.guilddragfix}" draggable = "true" >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.guildinner}" draggable = "false" style = "border-radius: 25px;" >
< a >
< div class = "${BDFDB.disCNS.avataricon + BDFDB.disCNS.guildicon + BDFDB.disCNS.avatariconsizelarge + BDFDB.disCN.avatariconinactive}" > < / d i v >
< / a >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.badgewrapper + BDFDB.disCN.badge} folder notifications" > < / d i v >
< div class = "${BDFDB.disCNS.badgewrapper + BDFDB.disCN.badge} folder count" > < / d i v >
2019-02-24 19:52:22 +01:00
< div class = "${BDFDB.disCNS.badgewrapper + BDFDB.disCN.badge} folder unread-count-badge" > < / d i v >
2018-10-11 10:21:26 +02:00
< / d i v > ` ;
this . folderSettingsModalMarkup =
2019-04-18 09:28:20 +02:00
` <span class=" ${ this . name } -modal BDFDB-modal">
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.backdrop}" > < / d i v >
< div class = "${BDFDB.disCN.modal}" >
< div class = "${BDFDB.disCN.modalinner}" >
< div class = "${BDFDB.disCNS.modalsub + BDFDB.disCN.modalsizemedium}" >
2019-01-13 22:53:07 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.modalheader}" style = "flex: 0 0 auto; padding-bottom: 10px;" >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" >
< h4 class = "${BDFDB.disCNS.h4 + BDFDB.disCNS.headertitle + BDFDB.disCNS.size16 + BDFDB.disCNS.height20 + BDFDB.disCNS.weightsemibold + BDFDB.disCNS.defaultcolor + BDFDB.disCNS.h4defaultmargin + BDFDB.disCN.marginreset}" > REPLACE _modal _header _text < / h 4 >
< div class = "${BDFDB.disCNS.modalguildname + BDFDB.disCNS.small + BDFDB.disCNS.size12 + BDFDB.disCNS.height16 + BDFDB.disCN.primary}" > < / d i v >
< / d i v >
2019-01-22 20:15:31 +01:00
< 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" > < / p a t h >
< 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" > < / p a t h >
< / g >
< / s v g >
< / d i v >
< / b u t t o n >
2018-10-11 10:21:26 +02:00
< / d i v >
2019-01-13 22:53:07 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + 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}" >
2019-04-23 08:26:48 +02:00
< div tab = "folder" class = "${BDFDB.disCNS.settingsitem + BDFDB.disCN.tabbaritem}" > REPLACE _modal _tabheader1 _text < / d i v >
< div tab = "icon" class = "${BDFDB.disCNS.settingsitem + BDFDB.disCN.tabbaritem}" > REPLACE _modal _tabheader2 _text < / d i v >
< div tab = "tooltip" class = "${BDFDB.disCNS.settingsitem + BDFDB.disCN.tabbaritem}" > REPLACE _modal _tabheader3 _text < / d i v >
< div tab = "custom" class = "${BDFDB.disCNS.settingsitem + BDFDB.disCN.tabbaritem}" > REPLACE _modal _tabheader4 _text < / d i v >
2019-01-13 22:53:07 +01:00
< / d i v >
2018-10-11 10:21:26 +02:00
< / d i v >
< div class = "${BDFDB.disCNS.scrollerwrap + BDFDB.disCNS.modalcontent + BDFDB.disCNS.scrollerthemed + BDFDB.disCN.themeghosthairline}" >
< div class = "${BDFDB.disCNS.scroller + BDFDB.disCN.modalsubinner}" >
< div tab = "folder" class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom20} tab-content" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + 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.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _foldername _text < / h 3 >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.inputwrapper + BDFDB.disCNS.vertical + BDFDB.disCNS.flex + BDFDB.disCNS.directioncolumn + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" > < input type = "text" class = "${BDFDB.disCNS.inputdefault + BDFDB.disCNS.input + BDFDB.disCN.size16}" id = "input-foldername" > < / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _iconpicker _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} icons" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< / d i v >
< div tab = "icon" class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom20} tab-content" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker1 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker2 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< / d i v >
< div tab = "tooltip" class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom20} tab-content" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker3 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2018-10-11 10:21:26 +02:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstart + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _colorpicker4 _text < / h 3 >
< / d i v >
2018-12-13 16:48:35 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style = "flex: 1 1 auto;" > < / d i v >
2019-01-15 15:24:39 +01:00
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + 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.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" > REPLACE _modal _copytooltipcolor _text < / h 3 >
< 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" >
< / d i v >
< / d i v >
2018-10-11 10:21:26 +02:00
< / d i v >
< div tab = "custom" class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom20} tab-content" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + 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.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _customopen _text < / h 3 >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.inputwrapper + BDFDB.disCNS.vertical + BDFDB.disCNS.flex + BDFDB.disCNS.directioncolumn + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" >
< input type = "text" option = "open" class = "${BDFDB.disCNS.inputdefault + BDFDB.disCNS.input + BDFDB.disCN.size16}" placeholder = "Url or Filepath" >
< / d i v >
< 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}" > < / d i v >
< input type = "file" option = "open" accept = "image/*" style = "display:none!important;" >
< / b u t t o n >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + 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.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _customclosed _text < / h 3 >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.inputwrapper + BDFDB.disCNS.vertical + BDFDB.disCNS.flex + BDFDB.disCNS.directioncolumn + BDFDB.disCN.flexchild}" style = "flex: 1 1 auto;" >
< input type = "text" option = "closed" class = "${BDFDB.disCNS.inputdefault + BDFDB.disCNS.input + BDFDB.disCN.size16}" placeholder = "Url or Filepath" >
< / d i v >
< 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}" > < / d i v >
< input type = "file" option = "closed" accept = "image/*" style = "display:none!important;" >
< / b u t t o n >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.vertical + BDFDB.disCNS.directioncolumn + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCN.nowrap}" style = "flex: 1 1 auto;" >
< h3 class = "${BDFDB.disCNS.titledefault + BDFDB.disCNS.title + BDFDB.disCNS.marginreset + BDFDB.disCNS.weightmedium + BDFDB.disCNS.size16 + BDFDB.disCNS.height24 + BDFDB.disCN.flexchild}" style = "flex: 0 0 auto;" > REPLACE _modal _custompreview _text < / h 3 >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8}" style = "flex: 1 1 auto;" >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifycenter + BDFDB.disCN.aligncenter + BDFDB.disCNS.nowrap}" style = "flex: 1 1 auto;" >
< div class = "ui-icon-picker-icon preview nopic open" >
< div class = "ui-picker-inner" > < / d i v >
< / d i v >
< div class = "ui-icon-picker-icon preview nopic closed" style = "margin-left: 25px; margin-right: 25px;" >
< div class = "ui-picker-inner" > < / d i v >
< / d i v >
< div class = "ui-icon-picker-icon preview nopic switching" >
< div class = "ui-picker-inner" > < / d i v >
< / d i v >
< / d i v >
< 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}" > < / d i v >
< / b u t t o n >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< div class = "${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + 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-save ${BDFDB.disCNS.button + BDFDB.disCNS.buttonlookfilled + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCNS.buttonsizemedium + BDFDB.disCN.buttongrow}" >
< div class = "${BDFDB.disCN.buttoncontents}" > REPLACE _btn _save _text < / d i v >
< / b u t t o n >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
2019-01-26 22:45:19 +01:00
< / s p a n > ` ;
2018-10-11 10:21:26 +02:00
this . folderIcons = [
{ "openicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAB2ElEQVR4Xu2Z4W6DMAwG4f0fmqloq0YJw0dIhLPb7y+qfT0Hr8yTf2ECczhpcBIWkEBYwgIEQFSzhAUIgKhmCQsQAFHNEhYgAKKaJSxAAETvMGsBn1eK3lFDZQmx4zWF1kL6rLCmlli3lamrBd4N6qeNq/VUYogdv1JcK1CPByasmFRrisJqbdWj7RLWAGaBFi5FqSSPHsNLBOAhDIwe6HVnwb4vx1H/KDxN02iw0ENOWGAjEJaw0B0WFiYc/P547yzwPYwI66j9nUiadW7Km5GwzmG91wthCStGAKRWqbqatSw5ng/zXL7bu8FKDKr/nSWs4NAnB9XXLGEFrXrFksPqt5QmB7XZGJo/DZPD2vBpCis5qN0eKqzXZr5fQosLezNYo1nV9N8dYYG3O8lhFSeuyRgmB3U4ccLaL9eHTG6HNapVTS745LD+lEeztmPYD9bIVt0+hsLaanr4I3pyUCFxbruzksMKcQiFfsk1qlkhDqHQGaz/YFVoTj8W3Bwv/sBP3uTdKTVr/Umd1fLoNOofhc/G8dFYysWh/lF4sJHEveMDhS8o01hW9Vt1OOHYVZUsLIBPWMICBEBUs4QFCICoZgkLEABRzRIWIACimiUsQABENQvA+gLIy3lMlnMoMQAAAABJRU5ErkJggg==" ,
"closedicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABkElEQVR4Xu3a6xKCIABEYXz/h7bpOl1M94CWMqffywRfK1I2FF+xwBAnDRaxQAnEEgsIgKjNEgsIgKjNEgsIgKjNEgsIgKjNEgsIgOgazRrB+01F15hD4xSy4S0TbUV6n2HLXLLVNqZqJ7g21H0ZtfNpZMiG10xuK6jdg4mVleqSolhbt2rX7RKrg2aBJVRFaUl2fRlWCcBBGIwO+NWeBdddHUfrR+FSSm9Y6CYnFjgRNGON43HKNgyTy40N4uBtV3iRORLU4wD3CRYbxEGxwPUqlli/uxu6Z82f79zgwflXLLEyAY8O4CYnlljfL6uJrzxxYeKgh1JQQbHE8gQ/dxBwz8qOSdeHDv5Ek2uJlVvZLGAlllhEAGTds8QCAiBqs8QCAiBqs8QCAiBqs8QCAiD6t2ad53ikB61//ReNWOCJNGj/nqPxc4g4+LTa4/x7bfkjQutH4c7A8NrxgE7AqtZdNWi53X0mxAKfq1hiAQEQtVliAQEQtVliAQEQtVliAQEQtVliAQEQtVliAQEQPQHGLZBMBnSlGQAAAABJRU5ErkJggg==" } ,
{ "openicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAB5ElEQVR4Xu3b0XaDIBBFUfz/j7YraZqooM4dxljg9HkU2dwh6rJT4s8sMJkrKUxgCSEACyxBQCglWWAJAkIpyQJLEBBKSRZYgoBQSrLAEgSEUm+yZmGMZal3POdwsYd5Lt4L9XflnjFjZ+08m3rhtVBNg1VhzbPdbpqyodSxnXmIO0y94LeOAvWOUw4WNxP9TOrc5fdZVViP+RQSpk8z7ggJTCpOKVVjtQx2C1ZcMPQz1eydw2EVkm02MBe+1jCkDfU8xB6xSZfZwFwIVrru1/Cf/erVRvMZqkuS1RnU5zZRJDftWWD9qrqwPHf74iKGl5duMb7ShmDtPERvV6QXqEs2eLA+O8LpngWWE6vFFjx6HArd4HtOVfieBdb6DuZwzwLLiNU7VGgbgpU/ROy2IVhGrBGgwtoQrPJzfLENwTJijQIV0oZg7b9Ky9oQLCPWSFDVbQjW8dvsVRuC5cTq7d1VicH9Pmt7shax1I9EwFqv+qEHWN/GGqEFq24dlgsC1smzIVjnXwxk33KPkqqQNgTL8Gx4HsKmKkx3BaaixbTt/1LRjpXZwFz4mjtY7YTg3itVk3Xv1d48OljCAoAFliAglJIssAQBoZRkgSUICKUkCyxBQCglWWAJAkIpyQJLEBBKfwAHhexMOBnKeAAAAABJRU5ErkJggg==" ,
"closedicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABj0lEQVR4Xu3b2w6CMBBF0fb/PxpDgsQAMbOnExtw+3zoZfUoxGhvvsICPZw02MQCJRBLLCAAojZLLCAAojZLLCAAojZLLCAAojZLLCAAotlmLWCOz2h2vuR0tZdlFp+Feq88M2ftrpOj0YWPQt0abAhrWeJ2vZ+monMn+1B3GV3wrkOg9jqdwep2wkeie8ffZw1hrfu5aBjfZt0VCAyFW2vDWHcGm4JVVww+0shn599hXTQ7bBAObmdY8jbkfai94tCusEE4KFbL3w1rz3rqaOHChIPHZk3dXu3kYYNwUKzBt2HmKb62FHw0Hx2gmXdDACaWWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARH/erHVt/jDk+wnF/yUATnpyNPyzq3Bw25BY8GSfBIbKgsIQ9XFxscCRiiUWEABRmyUWEABRmyUWEABRmyUWEABRmyUWEABRmyUWEABRmwWwXiH/oUz3h3vUAAAAAElFTkSuQmCC" } ,
{ "openicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABsElEQVR4Xu3Z4XLCIBBFYfP+D52OjbXGxmQPQgrr6b/OrAKfdwnidPEvLDCFKy28iAVCIJZYQACUmiyxgAAoNVliAQFQarLEAgKg1GSJBQRAaWmyZjDGY2npeIXD1X1ZyeRLoX5mXjJm3VUXvhud+LtQQ4P9F9YVjY5dmId6L6MTrpWseisofye6dvzpZsLC6aa62bAQmFhg7xRLLLTrhwMTLrwN754FPoeMWJHlf4fKZEWolppJrN6w5nm87p3+5uicZIkVjG8WqFM2eLGCqbqWiRXEGhFqOSOsDgn3f5oeHUbE2noKll7vojOAWMEWzLZfNX0aZkuVWE9dsrdfidUDVsYWbJYssZbIho4OYgWxskI1aUOxfp8ah20oVhArM1T1NhRrfXDbbUOxglgjQu3dXW3dF1S7zxoR6+i74DOYWGuRXQ+xzsb6hBasdnQQa/v6ePPoIFYQ61OgqrShWK9/wTn8Ig1+/OmpNHQqCBU9rCojVtggXHgDE6unfuh5LjRZPa+l+dzEAsRiiQUEQKnJEgsIgFKTJRYQAKUmSywgAEpNllhAAJSaLLGAACj9AiC1iUwkZlXyAAAAAElFTkSuQmCC" ,
"closedicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABgElEQVR4Xu3a7a6CMBREUXj/h8aQKEGMMvvYACX7/r2jLatDrR/j4F8sMMZJg4NYoARiiQUEQNRmiQUEQNRmiQUEQNRmiQUEQNRmiQUEQLTarAmMsY5WxysO1/ZhlclXoV4zr4zZ9qqLz0Yn/i9U12BnYc1odOxiH9o9jE64VbPaXUH9mei149W9ExZuN9W9GxYCEwvsnWKJhXb9uDBx8Dm8exZYB7HEygS8DY/a4Kepv7tyHD/6ERcmDm43+B6hlnfx72CxQRwUC9yvYol1zHtD96z948by8ieWWD8FfDUE+7ZYYv3eTzan+LgwcdBzFqigWGJ5KN07Abln7Qmt/i+WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG2WWEAARG3WlbHmufX4ddgpPwwBC3n1aPzRehzcfqx8dQEwv9ggDq4G7+9HWd/l0PWjMFitW0bFAssqllhAAERtllhAAERtllhAAERtllhAAERtllhAAERtllhAAERtFsB6ACnIiUxdpMfOAAAAAElFTkSuQmCC" } ,
{ "openicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAByUlEQVR4Xu3a4XKCMBBFYXj/h6bTakEFYU+yjJic/r4Y+LwLNOM4+BcWGMNJg4NYoARiiQUEQNRmiQUEQNRmiQUEQNRmiQUEQNRmiQUEQLS0WRNY4zFaul7hcrmHlZx8KdT/mZesmXvVhZ9GT7wW6qvBqrCmKW43jqul6NqFfcg7jJ7wrEOg5jqtwfKuhH8SvXa8n1WF9Xs9Gw3jl5l3BAJD4WEYqrG+GewjWHnF4J9Uc+/sDmuj2WGDcPD+HaaMIe9D7hEv7QobhINiDec9DS/21Kut5l+pTmlWY1DLayIkD92zxLqpigXaJVYmVqsjeMoNXqyleodjKFbfWPPrVep7VsutSr9nifX8qNy9Z4kVxGodKnUMxVq/rb4dQ7GCWD1ApY2hWNv/MG6OoVhBrF6gUsZQrPd7NqsxFCuI1RNU9RiKtb9t+jSGYvWNtbtlVbyfBfbtvykqFvi2xBILCASjh7ekw8DLQvFf3AbP8EKxQ4vDgFiLgFg3i5BDKPTQrlbHMOQQCokF6tc4Vrgw4eAdrMUxDBuEgxd6xH/sVMQC9GKJBQRA1GaJBQRA1GaJBQRA1GaJBQRA1GaJBQRA1GaJBQRA1GYBrB8F4ZJMlK2iwQAAAABJRU5ErkJggg==" ,
"closedicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABkklEQVR4Xu2bywrCQBAEN///0RFFg6iHrtmRNVieK/uo9LQguA0/sYEtJgWHskAIlKUsYACgJktZwABATZaygAGAmixlAQMANVnKAgYAWk3WDvZ4Rqv7Fbfrfaxy+Kqox8kre/beurgaPfisqFMLm5K177m7bXvbiu5dzEPfY/TAhx0i6ojTu7C+m/CV6N3x71lTsq73+ZAwfs2+J5AwBI8xpmWdWdgSWX3B4CvNdOffyfqQ7NhBDN7fYcsY8jz0PvGSrthBDCpr1L8Ne9/10tXiwMTga7KWXq9389hBDCrLMbx9OaZBjUGTBawqS1mOYdpBdy6uohh0DB1Dx9AxhAYAHldRDNpZdpadBUZQWcqCBgAe93YMWvAWvJ0FRlBZyoIGAB73dgxa8Ba8nQVGUFnKggYAHvd2DFrwFrydBUZQWcqCBgAe93YMWvAWvJ0FRvCrsq6L5/9BgadegKMaQvCCy/zUlsoCr0NZygIGAGqylAUMANRkKQsYAKjJUhYwAFCTpSxgAKAmS1nAAEBNFpB1ARZcR0zScgj8AAAAAElFTkSuQmCC" } ,
{ "openicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAB4ElEQVR4Xu2Z0XWDMAxFxWdH6A6docN3hu7QEfpJT9NAQwJIz0duQefm+8WY6yvZwGD8wgSGcJKgAUuQAFjAEggIUcwClkBAiGIWsAQCQhSzgCUQEKKYBSyBgBDFrA6wRmHMaPR0CxWZcA9QE9DI9aPwu+cikwXWdRn+G9b3NCJz6G5N5AKRifY0C1iRVbrLRBatYdjcv0Qm2dus09h1FFi5CuijRTiEmutfmKXfXv4/XGBuwMyAdaCjQ74jbSO64riBW7PGsa5kwzC4LNwAsH41BdbUjzAr3rwowzgrA9bRYQVKX7iFw0QvvT29wQPrusDeOasoqFmqVLOAdfNsiFl+D52fcfZgVbcqtcED68c6zGp5RbNVhoWtWlRfym5YGNaCD7D2N7hcWIWtetgAW8x6M7PXaUEKw3pg0wLr3cxegLVev/dHhw8ze7446r+29o+8x02kmPVpZk/Aipk1pwqbtdqeWnrWBVZhUJuPgcBarybMEvaSPFjFSzC3DIvD2mxNUs8SND5zFFjC6gELWAIBIYpZQVi7PZwGv6QIrKBV7teuiFmLLzzChc8WdVm4gbPdcc/5AkugCyxgCQSEKGYBSyAgRDELWAIBIYpZwBIICFHMApZAQIhiFrAEAkL0C09hh0yOgU58AAAAAElFTkSuQmCC" ,
"closedicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABv0lEQVR4Xu2aYW7CMBSDX26ChHabXZfbTJN2kqKCNpCg+Jk0axp9/MVpky+220JL8EkTKGklwgCWYQJgAcsgYEhxFrAMAoYUZwHLIGBIcRawDAKGFGcByyBgSHFWA1iTccys9BARP1lxD7qMs1qA+l175vw9cLrMITPZlrA+I+LUDQ0xka1hZTesC57AMrahB1i7cVdPsOa5tOxHw0PPpb3Aql5I5QEyHDa/GlaucdXhx4j4fnXEDNGuo7EiLnmTDKwb7Y+I+FrNWdM0rslKKdI4UnB/hQKWDv2fnYAFrOtD8n/EMHEOvR0bK+bENIc1Aqi7fZL9LQWvCh5Yj5FYLHhgAWuxQYnhDY1kIQV0lkETWMB61ksyZVKAs3AWzqp8apIpkwJiSAyJITGsJGAMl5UkBXQWnUVnGZEDFrAqCRjDZX9LwVLBD/Yr6eUPHgVWCnp/DUgt0PhespACYL1562Ds0h6l0jhSgLNwVvv7rD1my5izTJkUEENiSAyNyDWDNR943Pcjr9gydZQTVe7YMMNTRIdZbeVCgGUABBawDAKGFGcByyBgSHEWsAwChhRnAcsgYEhxFrAMAoYUZxmwzq8phkz4oCrBAAAAAElFTkSuQmCC" } ,
{ "openicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAByElEQVR4Xu3Z0XaDIBCE4fj+D21OepqkWnRnZPUA/rntxuDnsICdHnxkgUmupPABlhECsMAyBIxSkgWWIWCUkiywDAGjlGSBZQgYpSQLLEPAKCVZJ2PNxvWV0m4emDvQbKg3pjsO5SGk1ziDPAuqGzAV62yoLsBaw3qhqWNKn2bRBdWBXZWsphPWKlb0kDP+rt7757fUL1ydrAwM9RqqgdwfRsaS+6SqCpax8oyOJaWLZH07W2gRFvxei2QxDRcLZhicsKAmWfPcdiCnaXH7oUVYcASrdaStDdi00lvXpWP1CvU5Z+2AgVWI2VbCUrF6T1WULrBIlnqGLtcxDQ2/07FG6Vc/h8SNFTGtZ4H1jW64FQfrhlh7u3im4arxg5WwEkpvB5WD9B36FVjG7h0ssIwGZTR3knU11l2ae0qywPo/7TePO2CBVVwlqo87oyQr+s9Odc8aBWrvHdbfiFUlC6zynq7Y4MG6IZbSr6p61t1S5WC9ahdTEaz9M+iQWOoUdJO1SNcIyXKgjmC9szf3juVC1WAdf2nU8TfVTWnHt5g3dLAMS7DAMgSMUpIFliFglJIssAwBo5RkgWUIGKUkCyxDwCglWQbWE/kykkzUi2UWAAAAAElFTkSuQmCC" ,
"closedicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABZklEQVR4Xu3awZKCMBQFUfL/Hx0rKizccNtKKHjVs/WKeGh0FrbNv1igxUuHm1ggArHEAgJgalliAQEwtSyxgACYWpZYQABMLUssIACmlrUYq4PjJ9PHXDB6orOhdkx6HslFmL4hJ7kK6jFgKdZqqEeA3Q1roKXnNP02OztgemJXlXXrwv7C6v1qu7Nrzh9vraXv/Th4+oS3TgWkX1aCFmNVhDru+bAyscY3ykysXjmrb14JWFSWWB9RsSxrzb8SlmVZlsUFwDP8NhQLCICpZYkFBMDUssQCAmBqWWIBATC1LLGAAJhallhAAEwtSywgAKaWJRYQAFPLEgsIgKlliQUEwNSyxAICYGpZYgEBMLUssYAAmE4ra7xm5d9oJVDDIPoVjVifRGOsqmBpVRhr/wiocEsSpP19o7LA52XJqVjgsoolFhAAU8sSCwiAqWWJBQTA1LLEAgJgalliAQEwtSyxgACYvgCckKpMkaN7zAAAAABJRU5ErkJggg==" } ,
{ "openicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABrklEQVR4Xu3ayZLCMAxFUfz/H50upnQanFjXdi8SXba8TAdJGBfl5issUMJJgzexQBGIJRYQAFErSywgAKJWllhAAEStLLGAAIhaWWIBARC1ssQCAiDaU1kLOH8t2nPNwUvOOZze+CjU+67pdec87eBZ6E3PwrrfNr324KOOH05veCbW6cCGsJZltt34p986QymFPvN6SnrgqnNGqHVgdoJ1YZ0Z6tH7YrUa8Pd9seJWj2QPWMo2fGHhb+PsWAhMLLA4Fkus9rTfrB7CBXMUPN/yvG0USeya7L2RFepwV6SGlR1qF0ys/cb8shFLrMgcb2asrCbR5vf2Z9Y2tA1B/Qxi3Q/Pvnyorj9dlNYrSyzQnGL9F1bmuYV/SItVKUO3aL5RrKzReRXZrM+23jrcNW1tqYq1KUmx/vanlTVjXkVmVqYlRKvLQv++yzK3xJrVgrYhGO5RrAxzq9mCYh3st9faNySaYOc05BAKifWssyjWledW2CAcvHB1hQ3CQbBeuWxULPDRiiUWEABRK0ssIACiVpZYQABErSyxgACIWlliAQEQtbLEAgIgamUBrB+JEUtMl61hQwAAAABJRU5ErkJggg==" ,
"closedicon" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAABhUlEQVR4Xu3YwQqDMBBF0eT/P9oiVAji4l1rIh1u1w8zHifTaG/+YoEeJw02sUATiCUWEABRO0ssIACidpZYQABE7SyxgACI2lliAQEQtbPEAgIgeqezNnD9q+idNa+us7wOWvivBR43Tdc9Y71SBy36qSL3m6drH2BP1oDqoAW/VuhX6un112Ft24zarydi7/S5xpM1vnAcPD/ZIlDzO6sQVB2siVtv3KPx7oqD4zZc0VmLoOZ3Vjw6/yMYN0wcnPjX/TZpbBAHW2vrzglr+WKDOCgWe+Wws0DHiyVW/kLvzAKjSCyxwHARSywkAMLxKIqDHkrBfhVLrGmfaDzBg0Eolli+7oAeEEssIgCy8VkzDnrO8pzlOQtsQbHEggIgHs/tOOiAd8A7s8AWFEssKADi8dyOgw54B7wzC2zBaVj7hat9LSVjKP/wNTytKmAICrUgbO2ScaxbUiG8KbFCKLchgBJLLCgA4s4ssYAAiNpZYgEBELWzxAICIGpniQUEQNTOAlgf/fBATBZ555AAAAAASUVORK5CYII=" }
] ;
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." } ,
2019-02-24 19:52:22 +01:00
showUnreadBadge : { value : true , description : "Display Badge for Sum of Unread Message of Servers in a Folder (needs UnreadCountBadges plugin)." } ,
2018-10-11 10:21:26 +02:00
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-01-04 15:39:20 +01:00
let settings = BDFDB . getAllData ( this , "settings" ) ;
2019-04-18 09:28:20 +02:00
let settingshtml = ` <div class=" ${ this . name } -settings BDFDB-settings"><div class=" ${ BDFDB . disCNS . titledefault + BDFDB . disCNS . title + BDFDB . disCNS . size18 + 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-01-13 22:53:07 +01:00
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + 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 . title + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . size16 + 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
}
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + 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 . title + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . size16 + BDFDB . disCNS . height24 + BDFDB . disCN . flexchild } " style="flex: 1 1 auto;">Reset all Folders.</h3><button type="button" class=" ${ BDFDB . disCNS . flexchild + BDFDB . disCNS . button + BDFDB . disCNS . buttonlookfilled + BDFDB . disCNS . buttoncolorred + BDFDB . disCNS . buttonsizemedium + BDFDB . disCN . buttongrow } reset-button" style="flex: 0 0 auto;"><div class=" ${ BDFDB . disCN . buttoncontents } ">Reset</div></button></div> ` ;
settingshtml += ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + 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 . title + BDFDB . disCNS . marginreset + BDFDB . disCNS . weightmedium + BDFDB . disCNS . size16 + 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> ` ;
settingshtml += ` </div></div> ` ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
let settingspanel = BDFDB . htmlToElement ( settingshtml ) ;
2018-10-11 10:21:26 +02:00
2019-01-13 22:53:07 +01:00
BDFDB . initElements ( settingspanel , this ) ;
2018-10-11 10:21:26 +02:00
2019-01-17 23:48:29 +01:00
BDFDB . addEventListener ( this , settingspanel , "click" , ".reset-button" , ( ) => {
2019-01-13 22:53:07 +01:00
BDFDB . openConfirmModal ( this , "Are you sure you want to delete all folders?" , ( ) => {
BDFDB . removeAllData ( this , "folders" ) ;
this . resetAllElements ( ) ;
2019-01-04 15:39:20 +01:00
} ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2019-01-17 23:48:29 +01:00
BDFDB . addEventListener ( 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?" , ( ) => {
BDFDB . removeAllData ( this , "customicons" ) ;
} ) ;
} ) ;
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-01-17 23:48:29 +01:00
var libraryScript = document . querySelector ( 'head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]' ) ;
if ( ! libraryScript || performance . now ( ) - libraryScript . getAttribute ( "date" ) > 600000 ) {
2018-10-11 10:21:26 +02:00
if ( libraryScript ) libraryScript . remove ( ) ;
libraryScript = document . createElement ( "script" ) ;
libraryScript . setAttribute ( "type" , "text/javascript" ) ;
libraryScript . setAttribute ( "src" , "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js" ) ;
2019-01-17 23:48:29 +01:00
libraryScript . setAttribute ( "date" , performance . now ( ) ) ;
2019-01-30 21:23:49 +01:00
libraryScript . addEventListener ( "load" , ( ) => { if ( global . BDFDB && typeof BDFDB === "object" && BDFDB . loaded ) this . initialize ( ) ; } ) ;
2018-10-11 10:21:26 +02:00
document . head . appendChild ( libraryScript ) ;
}
2019-01-17 23:48:29 +01: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 ;
2018-10-11 10:21:26 +02:00
BDFDB . loadMessage ( this ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
this . GuildUtils = BDFDB . WebModules . findByProperties ( "getGuilds" , "getGuild" ) ;
2018-12-20 22:54:42 +01:00
this . DiscordConstants = BDFDB . WebModules . findByProperties ( "Permissions" , "ActivityTypes" , "StatusTypes" ) ;
this . Animations = BDFDB . WebModules . findByProperties ( "spring" ) ;
2019-01-26 22:45:19 +01:00
2019-01-22 19:39:44 +01:00
BDFDB . WebModules . forceAllUpdates ( this , "Guilds" ) ;
2018-10-11 10:21:26 +02:00
}
else {
2019-02-12 22:05:22 +01:00
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 ) {
2018-10-11 10:21:26 +02:00
this . resetAllElements ( ) ;
2019-01-22 19:39:44 +01:00
BDFDB . removeEles ( this . foldercontent , BDFDB . dotCN . guildswrapper + ".foldercontent" , ".serverfolder-contextmenu" ) ;
2018-10-11 10:21:26 +02:00
BDFDB . unloadMessage ( this ) ;
}
}
onSwitch ( ) {
2019-01-04 15:39:20 +01:00
if ( typeof BDFDB === "object" && BDFDB . getData ( "forceOpenFolder" , this , "settings" ) ) {
let serverObj = BDFDB . getSelectedServer ( ) ;
if ( ! serverObj ) return ;
let folderdiv = this . getFolderOfServer ( serverObj ) ;
2019-01-15 15:24:39 +01:00
if ( ! folderdiv || BDFDB . containsClass ( folderdiv , "open" ) ) return ;
2019-01-04 15:39:20 +01:00
this . openCloseFolder ( folderdiv ) ;
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
changeLanguageStrings ( ) {
this . serverContextEntryMarkup = this . serverContextEntryMarkup . replace ( "REPLACE_servercontext_serverfolders_text" , this . labels . servercontext _serverfolders _text ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . serverContextSubMenuMarkup = this . serverContextSubMenuMarkup . replace ( "REPLACE_serversubmenu_createfolder_text" , this . labels . serversubmenu _createfolder _text ) ;
2019-02-20 21:31:00 +01:00
this . serverContextSubMenuMarkup = this . serverContextSubMenuMarkup . replace ( "REPLACE_serversubmenu_addtofolder_text" , this . labels . serversubmenu _addtofolder _text ) ;
2018-10-11 10:21:26 +02:00
this . serverContextSubMenuMarkup = this . serverContextSubMenuMarkup . replace ( "REPLACE_serversubmenu_removefromfolder_text" , this . labels . serversubmenu _removefromfolder _text ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . folderContextMarkup = this . folderContextMarkup . replace ( "REPLACE_foldercontext_unreadfolder_text" , this . labels . foldercontext _unreadfolder _text ) ;
this . folderContextMarkup = this . folderContextMarkup . replace ( "REPLACE_foldercontext_autounreadfolder_text" , this . labels . foldercontext _autounreadfolder _text ) ;
this . folderContextMarkup = this . folderContextMarkup . replace ( "REPLACE_foldercontext_foldersettings_text" , this . labels . foldercontext _foldersettings _text ) ;
this . folderContextMarkup = this . folderContextMarkup . replace ( "REPLACE_foldercontext_createfolder_text" , this . labels . serversubmenu _createfolder _text ) ;
this . folderContextMarkup = this . folderContextMarkup . replace ( "REPLACE_foldercontext_removefolder_text" , this . labels . foldercontext _removefolder _text ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_header_text" , this . labels . modal _header _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_foldername_text" , this . labels . modal _foldername _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_tabheader1_text" , this . labels . modal _tabheader1 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_tabheader2_text" , this . labels . modal _tabheader2 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_tabheader3_text" , this . labels . modal _tabheader3 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_tabheader4_text" , this . labels . modal _tabheader4 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_iconpicker_text" , this . labels . modal _iconpicker _text ) ;
2019-01-15 15:24:39 +01:00
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_copytooltipcolor_text" , this . labels . modal _copytooltipcolor _text ) ;
2018-10-11 10:21:26 +02:00
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker1_text" , this . labels . modal _colorpicker1 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker2_text" , this . labels . modal _colorpicker2 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker3_text" , this . labels . modal _colorpicker3 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_colorpicker4_text" , this . labels . modal _colorpicker4 _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_customopen_text" , this . labels . modal _customopen _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_customclosed_text" , this . labels . modal _customclosed _text ) ;
this . folderSettingsModalMarkup = this . folderSettingsModalMarkup . replace ( "REPLACE_modal_custompreview_text" , this . labels . modal _custompreview _text ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
onGuildContextMenu ( instance , menu ) {
2019-04-18 09:28:20 +02:00
if ( document . querySelector ( ".BDFDB-modal" ) ) return ;
2019-01-17 23:48:29 +01:00
if ( instance . props && instance . props . target && instance . props . guild && instance . props . type == "GUILD_ICON_BAR" && ! menu . querySelector ( ".serverfolders-item" ) ) {
2019-01-13 22:53:07 +01:00
let serverContextEntry = BDFDB . htmlToElement ( this . serverContextEntryMarkup ) ;
2019-03-09 20:17:49 +01:00
let devgroup = BDFDB . React . findDOMNodeSafe ( BDFDB . getOwnerInstance ( { node : menu , name : [ "DeveloperModeGroup" , "MessageDeveloperModeGroup" ] } ) ) ;
if ( devgroup ) devgroup . parentElement . insertBefore ( serverContextEntry , devgroup ) ;
else menu . appendChild ( serverContextEntry , menu ) ;
2019-01-13 22:53:07 +01:00
let folderitem = serverContextEntry . querySelector ( ".serverfolders-item" ) ;
folderitem . addEventListener ( "mouseenter" , ( ) => {
let serverContextSubMenu = BDFDB . htmlToElement ( this . serverContextSubMenuMarkup ) ;
let createitem = serverContextSubMenu . querySelector ( ".createfolder-item" ) ;
2019-02-20 21:31:00 +01:00
let additem = serverContextSubMenu . querySelector ( ".addtofolder-item" ) ;
let removeitem = serverContextSubMenu . querySelector ( ".removefromfolder-item" ) ;
2019-01-13 22:53:07 +01:00
createitem . addEventListener ( "click" , ( ) => {
2019-03-08 11:58:17 +01:00
BDFDB . closeContextMenu ( menu ) ;
2019-01-13 22:53:07 +01:00
this . createNewFolder ( instance . props . target ) ;
2018-10-11 10:21:26 +02:00
} ) ;
2019-01-13 22:53:07 +01:00
let folderdiv = this . getFolderOfServer ( instance . props . guild ) ;
2019-02-20 21:31:00 +01:00
if ( ! folderdiv ) {
BDFDB . removeEles ( removeitem ) ;
let folders = document . querySelectorAll ( BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guild + ".folder" ) ;
if ( folders ) {
BDFDB . removeClass ( additem , BDFDB . disCN . contextmenuitemdisabled ) ;
additem . addEventListener ( "mouseenter" , ( ) => {
let serverContextSubFolderMenu = BDFDB . htmlToElement ( this . serverContextSubFolderMenuMarkup ) ;
for ( let i = 0 ; i < folders . length ; i ++ ) {
let foundfolderdiv = folders [ i ] ;
let name = foundfolderdiv . getAttribute ( "foldername" ) ;
2019-04-18 09:28:20 +02:00
let folderentry = BDFDB . htmlToElement ( ` <div class=" ${ BDFDB . disCN . contextmenuitem } addtospecificfolder-item"><span class="BDFDB-textscrollwrapper" speed=3><div class="BDFDB-textscroll"> ${ name ? BDFDB . encodeToHTML ( name ) : ( this . labels . modal _tabheader1 _text + " #" + ( i + 1 ) ) } </div></span><div class=" ${ BDFDB . disCN . contextmenuhint } "></div></div> ` ) ;
2019-02-20 21:31:00 +01:00
folderentry . addEventListener ( "click" , ( ) => {
2019-03-08 11:58:17 +01:00
BDFDB . closeContextMenu ( menu ) ;
2019-02-20 21:31:00 +01:00
this . addServerToFolder ( instance . props . guild , foundfolderdiv ) ;
} ) ;
serverContextSubFolderMenu . firstElementChild . firstElementChild . appendChild ( folderentry ) ;
}
BDFDB . appendSubMenu ( additem , serverContextSubFolderMenu ) ;
} ) ;
}
else BDFDB . removeEles ( additem ) ;
}
else {
BDFDB . removeEles ( additem ) ;
2019-01-13 22:53:07 +01:00
removeitem . addEventListener ( "click" , ( ) => {
2019-03-08 11:58:17 +01:00
BDFDB . closeContextMenu ( menu ) ;
2019-01-13 22:53:07 +01:00
this . removeServerFromFolder ( instance . props . guild , folderdiv ) ;
} ) ;
}
2019-01-14 13:25:19 +01:00
BDFDB . appendSubMenu ( folderitem , serverContextSubMenu ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-02-16 11:48:39 +01:00
processGuilds ( instance , wrapper , methodnames ) {
if ( methodnames . includes ( "componentWillUnmount" ) ) {
BDFDB . removeEles ( this . foldercontent , BDFDB . dotCN . guildswrapper + ".foldercontent" , ".serverfolder-contextmenu" , BDFDB . dotCN . guild + ".folder" ) ;
this . foldercontent = null ;
}
if ( methodnames . includes ( "componentDidMount" ) ) {
let process = ( ) => {
if ( ! wrapper . parentElement . querySelector ( BDFDB . dotCN . guildswrapper + ".foldercontent" ) ) {
this . foldercontent = BDFDB . htmlToElement ( this . folderContentMarkup ) ;
wrapper . parentElement . insertBefore ( this . foldercontent , wrapper . nextElementSibling ) ;
this . foldercontentguilds = this . foldercontent . querySelector ( BDFDB . dotCN . guilds ) ;
}
let folders = BDFDB . loadAllData ( this , "folders" ) , sortedFolders = [ ] ;
for ( let id in folders ) sortedFolders [ folders [ id ] . position ] = folders [ id ] ;
for ( let data of sortedFolders ) if ( data && ! wrapper . querySelector ( BDFDB . dotCN . guild + ".folder#" + data . folderID ) ) {
let folderdiv = this . createFolderDiv ( data ) ;
this . readIncludedServerList ( folderdiv ) . forEach ( guilddiv => { this . hideServer ( guilddiv , folderdiv ) ; } ) ;
}
BDFDB . WebModules . forceAllUpdates ( this , "Guild" ) ;
} ;
if ( document . querySelector ( BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guild + ":not(.folder):not(.copy) " + BDFDB . dotCN . guildicon ) ) process ( ) ;
else setTimeout ( process , 5000 ) ;
}
2019-01-22 19:39:44 +01:00
}
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
processGuild ( instance , wrapper , methodnames ) {
2019-02-22 20:35:27 +01:00
if ( instance . currentType = "GUILD" && instance . props && instance . props . guild ) {
2019-01-13 22:53:07 +01:00
if ( methodnames . includes ( "componentDidMount" ) ) {
let folderdiv = this . getFolderOfServer ( instance . props . guild ) ;
if ( folderdiv && ! wrapper . getAttribute ( "folder" ) ) {
this . hideServer ( wrapper , folderdiv ) ;
this . updateCopyInFolderContent ( wrapper , folderdiv ) ;
this . updateFolderNotifications ( folderdiv ) ;
}
BDFDB . addEventListener ( this , wrapper , "click" , ( ) => {
2019-02-16 11:30:31 +01:00
if ( BDFDB . getData ( "closeAllFolders" , this , "settings" ) ) document . querySelectorAll ( BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guild + ".folder.open" ) . forEach ( openFolder => { this . openCloseFolder ( openFolder ) ; } ) ;
2019-01-13 22:53:07 +01:00
} ) ;
BDFDB . addEventListener ( this , wrapper , "mousedown" , e => {
2019-01-04 15:39:20 +01:00
if ( BDFDB . pressedKeys . includes ( 17 ) ) {
2019-02-04 11:22:37 +01:00
BDFDB . stopEvent ( e ) ;
2019-01-04 15:39:20 +01:00
let dragpreview = this . createDragPreview ( wrapper , e ) ;
2019-01-13 22:53:07 +01:00
let updatePreview = e2 => {
this . updateDragPreview ( dragpreview , e2 ) ;
} ;
let droppedPreview = e2 => {
let dropfolderdiv = BDFDB . getParentEle ( BDFDB . dotCN . guild + ".folder" , e2 . target ) ;
if ( dropfolderdiv ) this . addServerToFolder ( instance . props . guild , dropfolderdiv ) ;
document . removeEventListener ( "mousemove" , updatePreview ) ;
document . removeEventListener ( "mouseup" , droppedPreview ) ;
BDFDB . removeEles ( dragpreview ) ;
} ;
2019-01-13 23:17:35 +01:00
document . addEventListener ( "mousemove" , updatePreview ) ;
document . addEventListener ( "mouseup" , droppedPreview ) ;
2018-10-11 10:21:26 +02:00
}
2019-01-04 15:39:20 +01:00
} ) ;
2019-01-13 22:53:07 +01:00
}
if ( methodnames . includes ( "componentWillUnmount" ) ) {
let folderdiv = this . getFolderOfServer ( instance . props . guild ) ;
if ( folderdiv ) {
BDFDB . removeEles ( this . foldercontent . querySelectorAll ( ` [guild=" ${ instance . props . guild . id } "] ` ) ) ;
this . updateFolderNotifications ( folderdiv ) ;
}
}
2018-10-11 10:21:26 +02:00
}
}
2019-01-26 22:45:19 +01:00
2019-02-04 11:22:37 +01:00
processStandardSidebarView ( instance , wrapper ) {
2019-02-16 11:48:39 +01:00
if ( this . SettingsUpdated && this . foldercontent ) {
2019-02-04 11:22:37 +01:00
delete this . SettingsUpdated ;
this . foldercontent . querySelectorAll ( BDFDB . dotCN . guild + ".folder" ) . forEach ( folderdiv => { this . updateFolderNotifications ( folderdiv ) ; } ) ;
}
}
2019-01-04 15:39:20 +01:00
showFolderSettings ( folderdiv ) {
if ( ! folderdiv ) return ;
2019-01-15 15:24:39 +01:00
let { folderID , folderName , position , iconID , icons , copyTooltipColor , color1 , color2 , color3 , color4 , servers } = BDFDB . loadData ( folderdiv . id , this , "folders" ) || { } ;
2019-01-04 15:39:20 +01:00
if ( ! folderID ) return ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
let folderSettingsModal = BDFDB . htmlToElement ( this . folderSettingsModalMarkup ) ;
let foldernameinput = folderSettingsModal . querySelector ( "#input-foldername" ) ;
2019-01-15 15:24:39 +01:00
let copytooltipcolorinput = folderSettingsModal . querySelector ( "#input-copytooltipcolor" ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
folderSettingsModal . querySelector ( BDFDB . dotCN . modalguildname ) . innerText = folderName || "" ;
foldernameinput . value = folderName || "" ;
foldernameinput . setAttribute ( "placeholder" , folderName || "" ) ;
2019-01-15 15:24:39 +01:00
copytooltipcolorinput . checked = copyTooltipColor ;
2019-01-04 15:39:20 +01:00
this . setIcons ( folderSettingsModal , iconID ) ;
BDFDB . setColorSwatches ( folderSettingsModal , color1 ) ;
BDFDB . setColorSwatches ( folderSettingsModal , color2 ) ;
BDFDB . setColorSwatches ( folderSettingsModal , color3 ) ;
BDFDB . setColorSwatches ( folderSettingsModal , color4 ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
BDFDB . appendModal ( folderSettingsModal ) ;
2019-01-26 22:45:19 +01:00
2019-01-14 15:00:06 +01:00
BDFDB . addChildEventListener ( folderSettingsModal , "change" , "input[type='file'][option]" , e => {
let file = e . currentTarget . files [ 0 ] ;
if ( file ) this . fetchCustomIcon ( folderSettingsModal , e . currentTarget . getAttribute ( "option" ) ) ;
2019-01-13 22:53:07 +01:00
} ) ;
BDFDB . addChildEventListener ( folderSettingsModal , "keyup" , "input[type='text'][option]" , e => {
if ( e . which == 13 ) this . fetchCustomIcon ( folderSettingsModal , e . currentTarget . getAttribute ( "option" ) ) ;
} ) ;
BDFDB . addChildEventListener ( folderSettingsModal , "click" , ".btn-addcustom" , ( ) => {
this . saveCustomIcon ( folderSettingsModal ) ;
} ) ;
BDFDB . addChildEventListener ( folderSettingsModal , "click" , ".btn-save" , e => {
folderName = foldernameinput . value . trim ( ) ;
folderName = folderName ? folderName : null ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
var oldIconID = iconID ;
var selectedIcon = folderSettingsModal . querySelector ( ".ui-icon-picker-icon.selected" ) ;
iconID = selectedIcon . getAttribute ( "value" ) ;
2019-01-26 22:45:19 +01:00
2019-01-15 15:24:39 +01:00
copyTooltipColor = copytooltipcolorinput . checked ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
var oldColor1 = color1 ;
var oldColor2 = color2 ;
color1 = BDFDB . getSwatchColor ( folderSettingsModal , 1 ) ;
color2 = BDFDB . getSwatchColor ( folderSettingsModal , 2 ) ;
color3 = BDFDB . getSwatchColor ( folderSettingsModal , 3 ) ;
color4 = BDFDB . getSwatchColor ( folderSettingsModal , 4 ) ;
2019-02-20 21:31:00 +01:00
if ( folderName ) folderdiv . setAttribute ( "foldername" , folderName ) ;
else folderdiv . removeAttribute ( "foldername" ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
if ( iconID != oldIconID || ! BDFDB . equals ( color1 , oldColor1 ) || ! BDFDB . equals ( color2 , oldColor2 ) ) {
let folderIcons = this . loadAllIcons ( ) ;
2019-01-15 15:24:39 +01:00
let isOpen = BDFDB . containsClass ( folderdiv , "open" ) ;
if ( ! BDFDB . containsClass ( selectedIcon , "custom" ) ) {
2019-01-13 22:53:07 +01:00
this . changeImgColor ( color1 , color2 , folderIcons [ iconID ] . openicon , ( openicon ) => {
icons . openicon = openicon ;
this . changeImgColor ( color1 , color2 , folderIcons [ iconID ] . closedicon , ( closedicon ) => {
icons . closedicon = closedicon ;
folderdiv . querySelector ( BDFDB . dotCN . avataricon ) . style . setProperty ( "background-image" , ` url( ${ isOpen ? icons . openicon : icons . closedicon } ) ` ) ;
2019-01-15 15:24:39 +01:00
BDFDB . saveData ( folderID , { folderID , folderName , position , iconID , icons , copyTooltipColor , color1 , color2 , color3 , color4 , servers } , this , "folders" ) ;
2019-01-04 15:39:20 +01:00
} ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2019-01-04 15:39:20 +01:00
}
2019-01-13 22:53:07 +01:00
else {
icons . openicon = folderIcons [ iconID ] . openicon ;
icons . closedicon = folderIcons [ iconID ] . closedicon ;
folderdiv . querySelector ( BDFDB . dotCN . avataricon ) . style . setProperty ( "background-image" , ` url( ${ isOpen ? icons . openicon : icons . closedicon } ) ` ) ;
2019-01-15 15:24:39 +01:00
BDFDB . saveData ( folderID , { folderID , folderName , position , iconID , icons , copyTooltipColor , color1 , color2 , color3 , color4 , servers } , this , "folders" ) ;
2019-01-13 22:53:07 +01:00
}
}
2019-01-15 15:24:39 +01:00
else BDFDB . saveData ( folderID , { folderID , folderName , position , iconID , icons , copyTooltipColor , color1 , color2 , color3 , color4 , servers } , this , "folders" ) ;
2019-01-13 22:53:07 +01:00
} ) ;
foldernameinput . focus ( ) ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2018-10-22 20:47:47 +02:00
changeImgColor ( color1 , color2 , icon , callback ) {
2018-12-14 11:07:51 +01:00
color1 = BDFDB . colorCONVERT ( color1 , "RGBCOMP" ) ;
color2 = BDFDB . colorCONVERT ( color2 , "RGBCOMP" ) ;
2018-10-22 20:47:47 +02:00
if ( ! color1 || ! color2 || ! icon ) return ;
2019-01-04 15:39:20 +01:00
let img = new Image ( ) ;
2018-10-22 20:47:47 +02:00
img . src = icon ;
img . onload = ( ) => {
if ( icon . indexOf ( "data:image" ) == 0 && img . width < 200 && img . height < 200 ) {
2019-01-04 15:39:20 +01:00
let can = document . createElement ( "canvas" ) ;
2018-10-22 20:47:47 +02:00
can . width = img . width ;
can . height = img . height ;
2019-01-04 15:39:20 +01:00
let ctx = can . getContext ( "2d" ) ;
2018-10-22 20:47:47 +02:00
ctx . drawImage ( img , 0 , 0 ) ;
2019-01-04 15:39:20 +01:00
let imageData = ctx . getImageData ( 0 , 0 , img . width , img . height ) ;
let data = imageData . data ;
for ( let i = 0 ; i < data . length ; i += 4 ) {
2018-10-22 20:47:47 +02:00
if ( data [ i ] == 0 && data [ i + 1 ] == 0 && data [ i + 2 ] == 0 ) {
data [ i ] = color1 [ 0 ] ;
data [ i + 1 ] = color1 [ 1 ] ;
data [ i + 2 ] = color1 [ 2 ] ;
}
else if ( data [ i ] == 255 && data [ i + 1 ] == 255 && data [ i + 2 ] == 255 ) {
data [ i ] = color2 [ 0 ] ;
data [ i + 1 ] = color2 [ 1 ] ;
data [ i + 2 ] = color2 [ 2 ] ;
}
ctx . putImageData ( imageData , 0 , 0 ) ;
}
callback ( can . toDataURL ( "image/png" ) ) ;
}
else {
callback ( img . src ) ;
}
} ;
}
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
setIcons ( modal , selection ) {
let wrapper = modal . querySelector ( ".icons" ) ;
if ( ! wrapper ) return ;
BDFDB . removeEles ( wrapper . childNodes ) ;
2019-01-26 22:45:19 +01:00
2018-12-13 16:48:35 +01:00
let folderIcons = this . loadAllIcons ( ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
wrapper . appendChild ( BDFDB . htmlToElement ( ` <div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCNS . nowrap + BDFDB . disCN . margintop4 } " style="flex: 1 1 auto;"><div class=" ${ BDFDB . disCNS . flex + BDFDB . disCNS . flex2 + BDFDB . disCNS . horizontal + BDFDB . disCNS . horizontal2 + BDFDB . disCNS . directionrow + BDFDB . disCNS . justifystart + BDFDB . disCNS . alignstretch + BDFDB . disCN . wrap } ui-icon-picker-row" style="flex: 1 1 auto; display: flex; flex-wrap: wrap; overflow: visible !important;"> ${ Object . getOwnPropertyNames ( folderIcons ) . map ( id => ` <div class="ui-icon-picker-icon ${ folderIcons [ id ] . customID ? ' custom' : '' } " value=" ${ id } "><div class="ui-picker-inner" style="background-image: url( ${ folderIcons [ id ] . closedicon } );"></div> ${ folderIcons [ id ] . customID ? '<div value="' + id + '" class="' + BDFDB . disCN . hovercardbutton + '"></div>' : '' } </div> ` ) . join ( "" ) } </div></div> ` ) ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
setIcon ( wrapper . querySelector ( ` .ui-icon-picker-icon[value=" ${ folderIcons [ selection ] ? selection : 0 } "] ` ) , false , true ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
BDFDB . addChildEventListener ( wrapper , "click" , ".ui-icon-picker-icon" , e => {
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( e . target , BDFDB . disCN . hovercardbutton ) ) return ;
2019-01-13 22:53:07 +01:00
setIcon ( wrapper . querySelector ( ".ui-icon-picker-icon.selected" ) , false , false ) ;
setIcon ( e . currentTarget , true , true ) ;
} ) ;
BDFDB . addChildEventListener ( wrapper , "click" , BDFDB . dotCN . hovercardbutton , e => {
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( e . currentTarget . parentElement , "selected" ) ) return ;
2019-01-13 22:53:07 +01:00
BDFDB . removeData ( e . currentTarget . getAttribute ( "value" ) , this , "customicons" ) ;
e . currentTarget . parentElement . remove ( ) ;
BDFDB . showToast ( ` Custom Icon was deleted. ` , { type : "success" } ) ;
} ) ;
BDFDB . addChildEventListener ( wrapper , "mouseenter" , ".ui-icon-picker-icon" , e => {
setIcon ( e . currentTarget , true ) ;
} ) ;
BDFDB . addChildEventListener ( wrapper , "mouseleave" , ".ui-icon-picker-icon" , e => {
setIcon ( e . currentTarget , false ) ;
} ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
function setIcon ( icon , hover , enable ) {
if ( ! icon ) return ;
2019-01-15 15:24:39 +01:00
if ( enable != undefined ) BDFDB . toggleClass ( icon , "selected" , enable ) ;
2019-01-13 22:53:07 +01:00
if ( hover ) {
icon . querySelector ( ".ui-picker-inner" ) . style . setProperty ( "background-image" , ` url( ${ folderIcons [ icon . getAttribute ( "value" ) ] . openicon } ) ` ) ;
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( icon , "selected" ) ) icon . style . setProperty ( "background-color" , "rgb(255,255,255,0.2)" ) ;
2019-01-13 22:53:07 +01:00
else icon . style . setProperty ( "background-color" , "rgb(255,255,255,0.1)" ) ;
}
else {
icon . querySelector ( ".ui-picker-inner" ) . style . setProperty ( "background-image" , ` url( ${ folderIcons [ icon . getAttribute ( "value" ) ] . closedicon } ) ` ) ;
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( icon , "selected" ) ) icon . style . setProperty ( "background-color" , "rgb(255,255,255,0.2)" ) ;
2019-01-13 22:53:07 +01:00
else icon . style . removeProperty ( "background-color" ) ;
}
}
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 } ; } ) ;
2018-10-11 10:21:26 +02:00
Object . assign ( icons , BDFDB . loadAllData ( this , "customicons" ) ) ;
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 ) {
let request = require ( "request" ) ;
request ( url , ( error , response , result ) => {
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 ;
}
}
BDFDB . showToast ( "Use a valid direct link to an image source. They usually end on something like .png, .jpg or .gif." , { type : "danger" } ) ;
} ) ;
}
else {
let fs = require ( "fs" )
if ( fs . existsSync ( url ) ) {
fs . readFile ( url , ( error , response ) => {
if ( ! error ) {
url = ` data:image/png;base64, ${ response . toString ( "base64" ) } ` ;
successFetchIcon ( ) ;
}
} ) ;
}
else {
BDFDB . showToast ( "Could not fetch file. Please make sure the file exists." , { type : "danger" } ) ;
}
}
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-01-15 15:24:39 +01:00
BDFDB . 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-01-15 15:24:39 +01:00
if ( ! BDFDB . containsClass ( iconpreviewopen , "nopic" ) && ! BDFDB . 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-01-15 15:24:39 +01:00
BDFDB . 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 ( ( ) => {
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-01-15 15:24:39 +01:00
if ( ! BDFDB . containsClass ( iconpreviewopen , "nopic" ) && ! BDFDB . containsClass ( iconpreviewclosed , "nopic" ) && ! BDFDB . containsClass ( iconpreviewswitching , "nopic" ) ) {
2019-01-04 15:39:20 +01:00
let customID = this . generateID ( "customicon" ) ;
2018-10-11 10:21:26 +02:00
BDFDB . saveData ( customID , { "openicon" : iconpreviewopen . url , "closedicon" : iconpreviewclosed . url , customID } , this , "customicons" ) ;
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-01-15 15:24:39 +01:00
BDFDB . addClass ( iconpreviewopen , "nopic" ) ;
2019-01-13 22:53:07 +01:00
iconpreviewopeninner . style . removeProperty ( "background-image" ) ;
2019-01-15 15:24:39 +01:00
BDFDB . addClass ( iconpreviewclosed , "nopic" ) ;
2019-01-13 22:53:07 +01:00
iconpreviewclosedinner . style . removeProperty ( "background-image" ) ;
2019-01-15 15:24:39 +01:00
BDFDB . 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 ) ;
BDFDB . showToast ( ` 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
}
else {
BDFDB . showToast ( ` 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-01-14 09:38:45 +01:00
resetAllElements ( ) {
this . toggleFolderContent ( false ) ;
BDFDB . removeEles ( BDFDB . dotCN . guild + ".folder" , ".serverfolders-dragpreview" ) ;
BDFDB . readServerList ( ) . forEach ( info => { this . unhideServer ( info . div ) ; } ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
createNewFolder ( ankerdiv ) {
if ( ! Node . prototype . isPrototypeOf ( ankerdiv ) ) return ;
2019-01-05 01:34:43 +01:00
let guilddiv = BDFDB . getParentEle ( BDFDB . dotCN . guild , ankerdiv ) ;
if ( ! guilddiv ) return ;
2019-01-04 15:39:20 +01:00
let folderID = this . generateID ( "folder" ) ;
let folderName = "" ;
2019-01-13 22:53:07 +01:00
let position = Array . from ( document . querySelectorAll ( ` div ${ BDFDB . dotCN . guildseparator } :not(.folderseparator) ~ div ${ BDFDB . dotCN . guild } ` ) ) . indexOf ( guilddiv ) ;
2019-01-04 15:39:20 +01:00
let iconID = 0 ;
let icons = Object . assign ( { } , this . folderIcons [ 0 ] ) ;
let autounread = false ;
2019-02-16 11:30:31 +01:00
let isOpen = false ;
2019-01-04 15:39:20 +01:00
let color1 = [ "0" , "0" , "0" ] ;
let color2 = [ "255" , "255" , "255" ] ;
let color3 = null ;
let color4 = null ;
let servers = [ ] ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
this . showFolderSettings ( this . createFolderDiv ( { folderID , folderName , position , iconID , icons , autounread , color1 , color2 , color3 , color4 , servers } ) ) ;
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
this . updateFolderPositions ( ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
createFolderDiv ( data ) {
2019-01-13 22:53:07 +01:00
let folderdiv = BDFDB . htmlToElement ( this . folderIconMarkup ) ;
let serversandfolders = document . querySelectorAll ( ` div ${ BDFDB . dotCN . guildseparator } :not(.folderseparator) ~ div ${ BDFDB . dotCN . guild } ` ) ;
let insertnode = serversandfolders [ data . position > serversandfolders . length - 1 ? serversandfolders . length - 1 : data . position ] ;
2019-02-12 22:06:14 +01:00
if ( insertnode ) insertnode . parentElement . insertBefore ( folderdiv , insertnode ) ;
2019-03-08 11:58:17 +01:00
else {
insertnode = document . querySelector ( ` div ${ BDFDB . dotCN . guildseparator } :not(.folderseparator) ~ * ${ BDFDB . dotCN . guildsadd } ` ) ;
if ( insertnode ) insertnode . parentElement . parentElement . insertBefore ( folderdiv , insertnode . parentElement ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
folderdiv . id = data . folderID ;
2019-02-20 21:31:00 +01:00
folderdiv . setAttribute ( "foldername" , data . folderName ) ;
2019-01-15 15:24:39 +01:00
BDFDB . addClass ( folderdiv , "closed" ) ;
2019-01-13 22:53:07 +01:00
folderdiv . querySelector ( BDFDB . dotCN . avataricon ) . style . setProperty ( "background-image" , ` url( ${ data . icons . closedicon } ) ` ) ;
folderdiv . addEventListener ( "click" , ( ) => {
if ( BDFDB . getData ( "closeOtherFolders" , this , "settings" ) ) {
2019-02-16 11:30:31 +01:00
document . querySelectorAll ( BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guild + ".folder.open" ) . forEach ( folder => {
2019-01-13 22:53:07 +01:00
if ( folder != folderdiv ) this . openCloseFolder ( folder ) ;
} ) ;
}
2019-02-16 13:26:30 +01:00
this . openCloseFolder ( folderdiv ) ;
2019-01-13 22:53:07 +01:00
} ) ;
2019-01-14 09:38:45 +01:00
folderdiv . addEventListener ( "mouseenter" , ( ) => {
let newdata = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
if ( ! newdata || ! newdata . folderName ) return ;
let bgColor = BDFDB . colorCONVERT ( newdata . color3 , "RGB" ) ;
let fontColor = BDFDB . colorCONVERT ( newdata . color4 , "RGB" ) ;
BDFDB . createTooltip ( newdata . folderName , folderdiv , { type : "right" , selector : "guild-folder-tooltip" , style : ` color: ${ fontColor } !important; background-color: ${ bgColor } !important; border-color: ${ bgColor } !important; ` } ) ;
} ) ;
2019-01-13 22:53:07 +01:00
folderdiv . addEventListener ( "contextmenu" , e => {
let newdata = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
if ( ! newdata ) return ;
let folderContext = BDFDB . htmlToElement ( this . folderContextMarkup ) ;
let autounreadinput = folderContext . querySelector ( ".autounreadfolder-item input" ) ;
autounreadinput . checked = newdata . autounread ;
folderContext . querySelector ( ".autounreadfolder-item" ) . addEventListener ( "click" , ( ) => {
autounreadinput . checked = ! autounreadinput . checked ;
newdata . autounread = autounreadinput . checked ;
BDFDB . saveData ( newdata . folderID , newdata , this , "folders" ) ;
} ) ;
folderContext . querySelector ( ".foldersettings-item" ) . addEventListener ( "click" , ( ) => {
folderContext . remove ( ) ;
this . showFolderSettings ( folderdiv ) ;
} ) ;
folderContext . querySelector ( ".createfolder-item" ) . addEventListener ( "click" , ( ) => {
folderContext . remove ( ) ;
this . createNewFolder ( folderdiv ) ;
} ) ;
folderContext . querySelector ( ".removefolder-item" ) . addEventListener ( "click" , ( ) => {
folderContext . remove ( ) ;
this . removeFolder ( folderdiv ) ;
} ) ;
2019-01-26 22:45:19 +01:00
2019-01-13 22:53:07 +01:00
let unreadServers = BDFDB . readUnreadServerList ( this . readIncludedServerList ( folderdiv ) ) ;
if ( unreadServers . length > 0 ) {
let unreaditem = folderContext . querySelector ( ".unreadfolder-item" ) ;
2019-01-15 15:24:39 +01:00
BDFDB . removeClass ( unreaditem , BDFDB . disCN . contextmenuitemdisabled ) ;
2019-01-13 22:53:07 +01:00
unreaditem . addEventListener ( "click" , ( ) => {
folderContext . remove ( ) ;
2019-02-04 11:22:37 +01:00
BDFDB . markGuildAsRead ( unreadServers ) ;
2019-01-13 22:53:07 +01:00
} ) ;
}
BDFDB . appendContextMenu ( folderContext , e ) ;
} ) ;
folderdiv . 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 guildswrap = document . querySelector ( ` ${ BDFDB . dotCN . guildswrapper } :not(.foldercontent) ${ BDFDB . dotCN . guilds } ` ) ;
if ( ! guildswrap ) return ;
let hovele = null ;
let placeholder = BDFDB . htmlToElement ( ` <div class=" ${ BDFDB . disCNS . guild + BDFDB . disCN . guildplaceholder } folderplaceholder"></div> ` ) ;
let dragpreview = this . createDragPreview ( folderdiv , e ) ;
let dragging = e3 => {
BDFDB . removeEles ( placeholder ) ;
BDFDB . toggleEles ( folderdiv , false ) ;
this . updateDragPreview ( dragpreview , e3 ) ;
hovele = BDFDB . getParentEle ( BDFDB . dotCN . guild + ".folder" , e3 . target ) ;
if ( hovele ) guildswrap . insertBefore ( placeholder , hovele . nextSibling ) ;
else {
hovele = BDFDB . getParentEle ( BDFDB . dotCN . guild , e3 . target ) ;
if ( hovele && BDFDB . getReactValue ( hovele , "return.memoizedProps.guild" ) && guildswrap . contains ( hovele ) ) {
guildswrap . insertBefore ( placeholder , hovele . nextSibling ) ;
}
2018-10-11 10:21:26 +02:00
}
2019-01-24 12:09:05 +01:00
} ;
let releasing = e3 => {
document . removeEventListener ( "mousemove" , dragging ) ;
document . removeEventListener ( "mouseup" , releasing ) ;
BDFDB . removeEles ( placeholder , dragpreview ) ;
BDFDB . toggleEles ( folderdiv , true ) ;
if ( hovele ) {
guildswrap . insertBefore ( folderdiv , hovele . nextSibling ) ;
this . updateFolderPositions ( folderdiv ) ;
}
} ;
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
this . addHoverBehaviour ( folderdiv ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
BDFDB . saveData ( data . folderID , data , this , "folders" ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
this . updateFolderNotifications ( folderdiv ) ;
2019-02-16 11:30:31 +01:00
if ( data . isOpen ) folderdiv . click ( ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
return folderdiv ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
generateID ( prefix ) {
let data = BDFDB . loadAllData ( this , prefix + "s" ) ;
let id = prefix + "_" + Math . round ( Math . random ( ) * 10000000000000000 ) ;
return data [ id ] ? this . generateID ( prefix ) : id ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
addServerToFolder ( info , folderdiv ) {
if ( ! info || ! folderdiv ) return ;
let guilddiv = BDFDB . getServerDiv ( info ) ;
let data = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
if ( ! guilddiv || ! data || data . servers . includes ( info . id ) ) return ;
data . servers . push ( info . id ) ;
BDFDB . saveData ( folderdiv . id , data , this , "folders" ) ;
this . hideServer ( guilddiv , folderdiv ) ;
this . updateCopyInFolderContent ( guilddiv , folderdiv ) ;
this . updateFolderNotifications ( folderdiv ) ;
BDFDB . showToast ( this . labels . toast _addserver _text . replace ( "${servername}" , info . name ) . replace ( "${foldername}" , data . folderName ? " " + data . folderName : "" ) , { type : "success" } ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
removeServerFromFolder ( info , folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! info || ! folderdiv || ! this . foldercontent ) return ;
2019-01-04 15:39:20 +01:00
let data = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
if ( ! data ) return ;
BDFDB . removeFromArray ( data . servers , info . id ) ;
BDFDB . saveData ( folderdiv . id , data , this , "folders" ) ;
2019-02-24 19:38:05 +01:00
BDFDB . removeEles ( this . foldercontent . querySelectorAll ( ` ${ BDFDB . dotCN . guild } .copy[guild=" ${ info . id } "] ` ) ) ;
if ( ! this . foldercontent . querySelector ( ` ${ BDFDB . dotCN . guild } .copy[folder=" ${ folderdiv . id } "] ` ) ) BDFDB . removeEles ( this . foldercontent . querySelectorAll ( ` ${ BDFDB . dotCN . guildseparator } .folderseparator[folder=" ${ folderdiv . id } "] ` ) ) ;
2019-01-04 15:39:20 +01:00
this . unhideServer ( BDFDB . getServerDiv ( info ) ) ;
this . updateFolderNotifications ( folderdiv ) ;
BDFDB . showToast ( this . labels . toast _removeserver _text . replace ( "${servername}" , info . name ) . replace ( "${foldername}" , data . folderName ? " " + data . folderName : "" ) , { type : "danger" } ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
removeFolder ( folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! folderdiv || ! this . foldercontent ) return ;
2019-01-04 15:39:20 +01:00
this . readIncludedServerList ( folderdiv ) . forEach ( guilddiv => { this . unhideServer ( guilddiv ) ; } ) ;
BDFDB . removeData ( folderdiv . id , this , "folders" ) ;
this . closeFolderContent ( folderdiv ) ;
folderdiv . remove ( ) ;
this . updateFolderPositions ( ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
getFolderOfServer ( idOrInfoOrEle ) {
2019-02-16 11:48:39 +01:00
if ( ! idOrInfoOrEle || ! this . foldercontent ) return ;
2019-01-04 15:39:20 +01:00
let id = Node . prototype . isPrototypeOf ( idOrInfoOrEle ) ? BDFDB . getServerID ( idOrInfoOrEle ) : ( typeof idOrInfoOrEle == "object" ? idOrInfoOrEle . id : idOrInfoOrEle ) ;
if ( ! id ) return ;
let folders = BDFDB . loadAllData ( this , "folders" ) ;
for ( let folderid in folders ) for ( let serverid of folders [ folderid ] . servers ) if ( serverid == id ) return document . querySelector ( "#" + folderid ) ;
return null ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
hideServer ( guilddiv , folderdiv ) {
if ( ! Node . prototype . isPrototypeOf ( guilddiv ) || ! folderdiv ) return ;
guilddiv . setAttribute ( "folder" , folderdiv . id ) ;
2019-01-15 15:24:39 +01:00
BDFDB . toggleEles ( guilddiv , false ) ;
2019-01-04 15:39:20 +01:00
if ( guilddiv . ServerFoldersChangeObserver && typeof guilddiv . ServerFoldersChangeObserver . disconnect == "function" ) guilddiv . ServerFoldersChangeObserver . disconnect ( ) ;
2019-02-22 23:10:56 +01:00
guilddiv . ServerFoldersChangeObserver = new MutationObserver ( changes => { changes . forEach ( change => {
2019-03-29 19:50:03 +01:00
if ( change . type == "attributes" && change . attributeName == "draggable" || change . attributeName == "source" ) return ;
2019-02-22 23:10:56 +01:00
let updatefolder = false ;
if ( change . type == "attributes" && change . attributeName == "class" && BDFDB . containsClass ( change . target , BDFDB . disCN . guild ) ) updatefolder = true ;
if ( change . type == "characterData" && change . target . parentElement && BDFDB . containsClass ( change . target . parentElement , BDFDB . disCN . badge ) ) updatefolder = true ;
else if ( change . addedNodes . length ) change . addedNodes . forEach ( node => { if ( node . tagName && BDFDB . containsClass ( node , BDFDB . disCN . badge ) ) updatefolder = true ; } ) ;
else if ( change . removedNodes . length ) change . removedNodes . forEach ( node => { if ( node . tagName && BDFDB . containsClass ( node , BDFDB . disCN . badge ) ) updatefolder = true ; } ) ;
this . updateCopyInFolderContent ( guilddiv , folderdiv ) ;
if ( updatefolder ) this . updateFolderNotifications ( folderdiv ) ;
} ) ; } ) ;
2019-01-04 15:39:20 +01:00
guilddiv . ServerFoldersChangeObserver . observe ( guilddiv , { attributes : true , childList : true , characterData : true , subtree : true } ) ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
unhideServer ( guilddiv ) {
if ( ! Node . prototype . isPrototypeOf ( guilddiv ) ) return ;
guilddiv . removeAttribute ( "folder" ) ;
2019-01-15 15:24:39 +01:00
BDFDB . toggleEles ( guilddiv , true ) ;
2019-01-04 15:39:20 +01:00
if ( guilddiv . ServerFoldersChangeObserver && typeof guilddiv . ServerFoldersChangeObserver . disconnect == "function" ) guilddiv . ServerFoldersChangeObserver . disconnect ( ) ;
delete guilddiv . ServerFoldersChangeObserver ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
toggleFolderContent ( forceOpenClose ) {
if ( ! this . foldercontent ) return ;
2019-01-15 15:24:39 +01:00
forceOpenClose = forceOpenClose === undefined ? BDFDB . containsClass ( this . foldercontent , "foldercontentclosed" ) : forceOpenClose ;
BDFDB . toggleClass ( this . foldercontent , "foldercontentopen" , forceOpenClose ) ;
BDFDB . toggleClass ( this . foldercontent , "foldercontentclosed" , ! forceOpenClose ) ;
2019-01-04 15:39:20 +01:00
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
openCloseFolder ( folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! folderdiv || ! this . foldercontent ) return ;
2019-01-04 15:39:20 +01:00
let data = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
if ( ! data ) return ;
2019-01-15 15:24:39 +01:00
let isClosed = ! BDFDB . containsClass ( folderdiv , "open" ) ;
2019-01-04 15:39:20 +01:00
if ( isClosed ) {
let includedServers = this . readIncludedServerList ( folderdiv ) ;
if ( includedServers . length == 0 ) return ;
2019-01-15 15:24:39 +01:00
BDFDB . addClass ( folderdiv , "open" ) ;
BDFDB . removeClass ( folderdiv , "closed" ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
this . toggleFolderContent ( true ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
let settings = BDFDB . getAllData ( this , "settings" ) ;
2019-03-29 19:50:03 +01:00
let open = ( ) => {
2019-02-27 18:35:06 +01:00
if ( this . foldercontent ) {
if ( settings . addSeparators && this . foldercontent . querySelectorAll ( BDFDB . dotCN . guild ) . length ) this . foldercontentguilds . appendChild ( BDFDB . htmlToElement ( ` <div class=" ${ BDFDB . disCN . guildseparator } folderseparator" folder=" ${ folderdiv . id } "></div> ` ) ) ;
includedServers . forEach ( guilddiv => { this . updateCopyInFolderContent ( guilddiv , folderdiv ) ; } ) ;
}
2019-03-29 19:50:03 +01:00
}
if ( settings . closeOtherFolders && this . foldercontent . querySelectorAll ( BDFDB . dotCN . guild ) . length ) setTimeout ( open , 300 ) ;
else open ( ) ;
2018-10-11 10:21:26 +02:00
}
2019-01-04 15:39:20 +01:00
else this . closeFolderContent ( folderdiv ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
folderdiv . querySelector ( BDFDB . dotCN . avataricon ) . style . setProperty ( "background-image" , ` url( ${ isClosed ? data . icons . openicon : data . icons . closedicon } ) ` ) ;
2019-02-16 11:30:31 +01:00
2019-02-16 13:26:30 +01:00
data . isOpen = isClosed ;
BDFDB . saveData ( folderdiv . id , data , this , "folders" ) ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
closeFolderContent ( folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! folderdiv || ! this . foldercontent ) return ;
2019-01-15 15:24:39 +01:00
BDFDB . removeClass ( folderdiv , "open" ) ;
BDFDB . addClass ( folderdiv , "closed" ) ;
2019-01-04 15:39:20 +01:00
let includedCopies = this . foldercontent . querySelectorAll ( ` [folder=" ${ folderdiv . id } "] ` ) ;
for ( let copy of includedCopies ) copy . removeAttribute ( "folder" ) ;
if ( ! this . foldercontent . querySelector ( "[folder]" ) ) {
this . toggleFolderContent ( false ) ;
2018-10-11 10:21:26 +02:00
setTimeout ( ( ) => {
2019-01-04 15:39:20 +01:00
let settings = BDFDB . getAllData ( this , "settings" ) ;
if ( settings . closeOtherFolders ) BDFDB . removeEles ( includedCopies ) ;
2019-02-16 13:26:30 +01:00
else if ( ! settings . closeOtherFolders && ! document . querySelector ( BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guild + ".folder.open" ) ) BDFDB . removeEles ( includedCopies ) ;
2018-10-11 10:21:26 +02:00
} , 300 ) ;
}
2019-01-04 15:39:20 +01:00
else BDFDB . removeEles ( includedCopies ) ;
2019-01-26 22:45:19 +01:00
2019-01-22 19:39:44 +01:00
let firstchild = this . foldercontentguilds . firstElementChild ;
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( firstchild , "folderseparator" ) ) BDFDB . removeEles ( firstchild ) ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
updateCopyInFolderContent ( guilddiv , folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! guilddiv || ! folderdiv || ! this . foldercontent ) return ;
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( folderdiv , "open" ) ) {
2019-01-04 15:39:20 +01:00
let info = this . GuildUtils . getGuild ( BDFDB . getServerID ( guilddiv ) ) ;
if ( ! info ) return ;
2019-01-22 19:39:44 +01:00
let oldCopy = this . foldercontent . querySelector ( ` [guild=" ${ info . id } "] ` ) ;
2018-10-11 10:21:26 +02:00
if ( oldCopy ) {
2019-01-22 19:39:44 +01:00
this . foldercontentguilds . insertBefore ( this . createCopyOfServer ( guilddiv , folderdiv ) , oldCopy ) ;
2019-01-04 15:39:20 +01:00
BDFDB . removeEles ( oldCopy ) ;
2018-10-11 10:21:26 +02:00
}
else {
2019-01-22 19:39:44 +01:00
let sameFolderCopies = this . foldercontent . querySelectorAll ( ` [folder=" ${ folderdiv . id } "] ` ) ;
2019-01-04 15:39:20 +01:00
let insertNode = sameFolderCopies . length > 0 ? sameFolderCopies [ sameFolderCopies . length - 1 ] . nextSibling : null ;
2019-01-22 19:39:44 +01:00
this . foldercontentguilds . insertBefore ( this . createCopyOfServer ( guilddiv , folderdiv ) , insertNode ) ;
2018-10-11 10:21:26 +02:00
}
}
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
createCopyOfServer ( guilddiv , folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! guilddiv || ! folderdiv || ! this . foldercontent ) return ;
2019-01-04 15:39:20 +01:00
let info = this . GuildUtils . getGuild ( BDFDB . getServerID ( guilddiv ) ) ;
if ( ! info ) return ;
let guildcopy = guilddiv . cloneNode ( true ) ;
guildcopy . setAttribute ( "guild" , info . id ) ;
2019-03-29 19:50:03 +01:00
guildcopy . setAttribute ( "folder" , folderdiv . id ) ;
2019-01-15 15:24:39 +01:00
BDFDB . addClass ( guildcopy , "copy" ) ;
BDFDB . toggleEles ( guildcopy , true ) ;
2019-01-13 22:53:07 +01:00
guildcopy . addEventListener ( "mouseenter" , ( ) => {
2019-02-13 19:57:35 +01:00
let EditServersData = BDFDB . isPluginEnabled ( "EditServers" ) ? BDFDB . loadData ( info . id , "EditServers" , "servers" ) : null ;
if ( EditServersData ) bdplugins . EditServers . plugin . changeTooltip ( info , guildcopy , "right" ) ;
else {
let folderData = BDFDB . loadData ( folderdiv . id , this , "folders" ) || { } ;
let bgColor = BDFDB . colorCONVERT ( folderData . copyTooltipColor ? folderData . color3 : null , "RGB" ) ;
let fontColor = BDFDB . colorCONVERT ( folderData . copyTooltipColor ? folderData . color4 : null , "RGB" ) ;
BDFDB . createTooltip ( info . name , guildcopy , { type : "right" , style : ` color: ${ fontColor } !important; background-color: ${ bgColor } !important; border-color: ${ bgColor } !important; ` } ) ;
}
2019-01-13 22:53:07 +01:00
} ) ;
guildcopy . addEventListener ( "click" , e => {
2019-02-04 11:22:37 +01:00
BDFDB . stopEvent ( e ) ;
2019-01-13 22:53:07 +01:00
if ( BDFDB . pressedKeys . includes ( 46 ) ) this . removeServerFromFolder ( info , folderdiv ) ;
else {
let settings = BDFDB . getAllData ( this , "settings" ) ;
2019-02-16 11:30:31 +01:00
if ( settings . closeAllFolders ) document . querySelectorAll ( BDFDB . dotCNS . guildswrapper + BDFDB . dotCN . guild + ".folder.open" ) . forEach ( openFolder => { this . openCloseFolder ( openFolder ) ; } ) ;
2019-01-13 22:53:07 +01:00
else if ( settings . closeTheFolder ) this . openCloseFolder ( folderdiv ) ;
guilddiv . querySelector ( "a" ) . click ( ) ;
}
} ) ;
guildcopy . addEventListener ( "contextmenu" , e => {
BDFDB . openGuildContextMenu ( guilddiv , e ) ;
} ) ;
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 ;
let placeholder = BDFDB . htmlToElement ( ` <div class=" ${ BDFDB . disCNS . guild + BDFDB . disCN . guildplaceholder } copyplaceholder"></div> ` ) ;
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 => {
BDFDB . removeEles ( placeholder ) ;
BDFDB . toggleEles ( guildcopy , false ) ;
this . updateDragPreview ( dragpreview , e3 ) ;
if ( this . foldercontent . contains ( e3 . target ) ) {
hovcopy = BDFDB . containsClass ( e3 . target , "folderseparator" ) ? e3 . target : BDFDB . getParentEle ( BDFDB . dotCN . guild + ".copy" , e3 . target ) ;
if ( hovcopy && hovcopy . getAttribute ( "folder" ) == folderdiv . id ) this . foldercontentguilds . insertBefore ( placeholder , hovcopy . nextSibling ) ;
else hovcopy = null ;
}
} ;
let releasing = e3 => {
document . removeEventListener ( "mousemove" , dragging ) ;
document . removeEventListener ( "mouseup" , releasing ) ;
BDFDB . removeEles ( placeholder , dragpreview ) ;
BDFDB . toggleEles ( guildcopy , true ) ;
let dropfolderdiv = BDFDB . getParentEle ( BDFDB . dotCN . guild + ".folder" , e3 . target ) ;
if ( dropfolderdiv && dropfolderdiv != folderdiv ) {
this . removeServerFromFolder ( info , folderdiv ) ;
this . addServerToFolder ( info , dropfolderdiv ) ;
}
else if ( hovcopy ) {
this . foldercontentguilds . insertBefore ( guildcopy , hovcopy . nextSibling ) ;
this . updateServerPositions ( folderdiv ) ;
}
} ;
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
let copyinner = guildcopy . querySelector ( BDFDB . dotCN . guildinner ) ;
2019-01-15 15:24:39 +01:00
let isselected = BDFDB . containsClass ( guildcopy , BDFDB . disCN . guildselected ) ;
let hasicon = ! BDFDB . containsClass ( guildcopy . querySelector ( BDFDB . dotCN . guildicon ) , BDFDB . disCN . avatarnoicon ) ;
2019-01-04 15:39:20 +01:00
guildcopy . querySelector ( "a" ) . setAttribute ( "draggable" , false ) ;
2018-12-07 14:17:43 +01:00
copyinner . style . setProperty ( "border-radius" , isselected ? "15px" : "25px" ) ;
2018-12-14 11:07:51 +01:00
copyinner . style . setProperty ( "background-color" , hasicon ? null : BDFDB . colorCONVERT ( this . DiscordConstants . Colors [ isselected ? "BRAND_PURPLE" : "CHANNELS_GREY" ] , "RGB" ) ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
this . addHoverBehaviour ( guildcopy ) ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
return guildcopy ;
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
createDragPreview ( div , e ) {
if ( ! Node . prototype . isPrototypeOf ( div ) ) return ;
let dragpreview = div . cloneNode ( true ) ;
2019-01-15 15:24:39 +01:00
BDFDB . addClass ( dragpreview , "serverfolders-dragpreview" ) ;
BDFDB . toggleEles ( dragpreview , false ) ;
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-01-15 15:24:39 +01:00
BDFDB . toggleEles ( dragpreview , true ) ;
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
2019-01-04 15:39:20 +01:00
updateFolderPositions ( ) {
2019-02-16 11:48:39 +01:00
if ( ! this . foldercontent ) return ;
2019-01-13 22:53:07 +01:00
let serverAndFolders = document . querySelectorAll ( ` div ${ BDFDB . dotCN . guildseparator } :not(.folderseparator) ~ div ${ BDFDB . dotCN . guild } ` ) ;
2019-01-04 15:39:20 +01:00
for ( let i = 0 ; i < serverAndFolders . length ; i ++ ) {
let folderdiv = BDFDB . getParentEle ( BDFDB . dotCN . guild + ".folder" , serverAndFolders [ i ] ) ;
if ( folderdiv ) {
let data = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
if ( data ) {
data . position = i ;
BDFDB . saveData ( folderdiv . id , data , this , "folders" ) ;
}
}
}
2019-01-26 22:45:19 +01:00
}
2019-01-04 15:39:20 +01:00
updateServerPositions ( folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! this . foldercontent ) return ;
2019-01-04 15:39:20 +01:00
let data = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
if ( data ) {
2019-01-22 19:39:44 +01:00
let servers = Array . from ( this . foldercontent . querySelectorAll ( ` ${ BDFDB . dotCN . guild } .copy[folder=" ${ folderdiv . id } "] ` ) ) . map ( div => { return div . getAttribute ( "guild" ) ; } ) ;
2019-01-04 15:39:20 +01:00
for ( let serverid of servers ) BDFDB . removeFromArray ( data . servers , serverid ) ;
2019-01-22 19:39:44 +01:00
data . servers = BDFDB . removeCopiesFromArray ( servers . concat ( data . servers ) ) ;
2019-01-04 15:39:20 +01:00
BDFDB . saveData ( folderdiv . id , data , this , "folders" ) ;
}
2019-01-26 22:45:19 +01:00
}
2019-01-04 15:39:20 +01:00
updateFolderNotifications ( folderdiv ) {
2019-02-16 11:48:39 +01:00
if ( ! this . foldercontent ) return ;
2019-01-04 15:39:20 +01:00
let data = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
var a = performance . now ( ) ;
if ( ! data ) return ;
let includedServers = this . readIncludedServerList ( folderdiv ) ;
let unreadServers = BDFDB . readUnreadServerList ( includedServers ) ;
2019-02-04 11:22:37 +01:00
if ( unreadServers . length > 0 && data . autounread ) BDFDB . markGuildAsRead ( unreadServers ) ;
2019-01-04 15:39:20 +01:00
else {
2019-02-24 19:52:22 +01:00
let mentionAmount = 0 , unreadAmount = 0 , audioEnabled = false , videoEnabled = false ;
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
includedServers . forEach ( div => {
2019-02-24 19:52:22 +01:00
let mentionbadge = div . querySelector ( BDFDB . dotCN . badgewrapper + ":not(.unread-count-badge)" ) ;
if ( mentionbadge ) mentionAmount += parseInt ( mentionbadge . innerText ) ;
let unreadbadge = div . querySelector ( BDFDB . dotCN . badgewrapper + ".unread-count-badge" ) ;
if ( unreadbadge ) unreadAmount += parseInt ( unreadbadge . innerText ) ;
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( div , BDFDB . disCN . guildaudio ) ) audioEnabled = true ;
if ( BDFDB . containsClass ( div , BDFDB . disCN . guildvideo ) ) videoEnabled = true ;
2019-01-04 15:39:20 +01:00
} ) ;
2019-01-26 22:45:19 +01:00
2019-01-15 15:24:39 +01:00
BDFDB . toggleClass ( folderdiv , BDFDB . disCN . guildunread , unreadServers . length > 0 ) ;
BDFDB . toggleClass ( folderdiv , BDFDB . disCN . guildaudio , audioEnabled ) ;
BDFDB . toggleClass ( folderdiv , BDFDB . disCN . guildvideo , videoEnabled ) ;
2019-01-13 22:53:07 +01:00
let notifications = folderdiv . querySelector ( ".folder" + BDFDB . dotCN . badge + ".notifications" ) ;
2019-02-24 19:52:22 +01:00
notifications . innerText = mentionAmount ;
BDFDB . toggleEles ( notifications , mentionAmount > 0 ) ;
let count = folderdiv . querySelector ( ".folder" + BDFDB . dotCN . badge + ".count" ) ;
count . innerText = includedServers . length ;
BDFDB . toggleEles ( count , includedServers . length > 0 && BDFDB . getData ( "showCountBadge" , this , "settings" ) ) ;
let unreads = folderdiv . querySelector ( ".folder" + BDFDB . dotCN . badge + ".unread-count-badge" ) ;
unreads . innerText = unreadAmount ;
BDFDB . toggleEles ( unreads , unreadAmount > 0 && BDFDB . getData ( "showUnreadBadge" , this , "settings" ) ) ;
2019-02-16 11:30:31 +01:00
2019-02-24 19:38:05 +01:00
if ( document . contains ( folderdiv ) && BDFDB . containsClass ( folderdiv , "open" ) && ! this . foldercontent . querySelector ( ` [folder=" ${ folderdiv . id } "] ` ) ) this . openCloseFolder ( folderdiv ) ;
2019-01-04 15:39:20 +01:00
}
}
2019-01-26 22:45:19 +01:00
2019-01-04 15:39:20 +01:00
readIncludedServerList ( folderdiv ) {
let data = BDFDB . loadData ( folderdiv . id , this , "folders" ) ;
let includedServers = [ ] ;
if ( data ) for ( let id of data . servers ) {
let div = BDFDB . getServerDiv ( id ) ;
2019-01-21 12:17:39 +01:00
if ( div && includedServers . indexOf ( div ) == - 1 ) includedServers . push ( div ) ;
2019-01-04 15:39:20 +01:00
}
return includedServers ;
2018-10-11 10:21:26 +02:00
}
2019-01-26 22:45:19 +01:00
2018-12-07 13:16:18 +01:00
addHoverBehaviour ( div ) {
/* based on stuff from Zerebos */
let divinner = div . querySelector ( BDFDB . dotCN . guildinner ) ;
let divicon = div . querySelector ( BDFDB . dotCN . guildicon ) ;
let backgroundColor = new this . Animations . Value ( 0 ) ;
backgroundColor
. interpolate ( {
inputRange : [ 0 , 1 ] ,
outputRange : [ this . DiscordConstants . Colors . CHANNELS _GREY , this . DiscordConstants . Colors . BRAND _PURPLE ]
} )
. addListener ( ( value ) => {
2019-01-15 15:24:39 +01:00
if ( BDFDB . containsClass ( divicon , BDFDB . disCN . avatarnoicon ) ) {
2018-12-14 11:07:51 +01:00
let comp = BDFDB . colorCONVERT ( value . value , "RGBCOMP" ) ;
if ( comp ) divinner . style . setProperty ( "background-color" , ` rgb( ${ comp [ 0 ] } , ${ comp [ 1 ] } , ${ comp [ 2 ] } ) ` ) ;
2018-12-07 13:16:18 +01:00
}
} ) ;
let borderRadius = new this . Animations . Value ( 0 ) ;
borderRadius
. interpolate ( {
inputRange : [ 0 , 1 ] ,
outputRange : [ 25 , 15 ]
} )
. addListener ( ( value ) => {
divinner . style . setProperty ( "border-radius" , ` ${ value . value } px ` ) ;
} ) ;
let animate = ( v ) => {
this . Animations . parallel ( [
this . Animations . timing ( backgroundColor , { toValue : v , duration : 200 } ) ,
this . Animations . spring ( borderRadius , { toValue : v , friction : 3 } )
] ) . start ( ) ;
} ;
2019-01-13 22:53:07 +01:00
div . addEventListener ( "mouseenter" , ( ) => { animate ( 1 ) ; } )
2019-01-15 15:24:39 +01:00
div . addEventListener ( "mouseleave" , ( ) => { if ( ! BDFDB . containsClass ( div , BDFDB . disCN . guildselected ) ) animate ( 0 ) ; } ) ;
2018-12-07 13:16:18 +01:00
}
2019-01-26 22:45:19 +01:00
2018-10-11 10:21:26 +02:00
setLabelsByLanguage ( ) {
switch ( BDFDB . getDiscordLanguage ( ) . id ) {
case "hr" : //croatian
return {
toast _addserver _text : "${servername} je dodan u mapu${foldername}." ,
toast _removeserver _text : "${servername} je uklonjena iz mape${foldername}." ,
servercontext _serverfolders _text : "Poslužitelj mapu" ,
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-01-14 13:58:48 +01:00
foldercontext _unreadfolder _text : "Označi sve kao pročitano" ,
foldercontext _autounreadfolder _text : "Auto: Označite kao pročitano" ,
2018-10-11 10:21:26 +02:00
foldercontext _foldersettings _text : "Postavke map" ,
foldercontext _removefolder _text : "Izbriši mapu" ,
modal _header _text : "Postavke mapa" ,
modal _foldername _text : "Naziv mape" ,
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-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 {
toast _addserver _text : "${servername} er blevet tilføjet til mappe${foldername}." ,
toast _removeserver _text : "${servername} er blevet fjernet fra mappen${foldername}." ,
servercontext _serverfolders _text : "Servermapper" ,
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" ,
foldercontext _unreadfolder _text : "Markér alle som læst" ,
foldercontext _autounreadfolder _text : "Auto: Markér som læst" ,
foldercontext _foldersettings _text : "Mappeindstillinger" ,
foldercontext _removefolder _text : "Slet mappe" ,
modal _header _text : "Mappindstillinger" ,
modal _foldername _text : "Mappenavn" ,
modal _tabheader1 _text : "Mappe" ,
modal _tabheader2 _text : "Mappefarve" ,
modal _tabheader3 _text : "Tooltipfarve" ,
modal _tabheader4 _text : "Brugerdefinerede ikoner" ,
modal _iconpicker _text : "Mappevalg" ,
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 {
toast _addserver _text : "${servername} wurde dem Ordner${foldername} hinzugefügt." ,
toast _removeserver _text : "${servername} wurde aus dem Ordner${foldername} entfernt." ,
servercontext _serverfolders _text : "Serverordner" ,
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" ,
foldercontext _unreadfolder _text : "Alle als gelesen markieren" ,
foldercontext _autounreadfolder _text : "Auto: Als gelesen markieren" ,
foldercontext _foldersettings _text : "Ordnereinstellungen" ,
foldercontext _removefolder _text : "Ordner löschen" ,
modal _header _text : "Ordnereinstellungen" ,
modal _foldername _text : "Ordnername" ,
modal _tabheader1 _text : "Ordner" ,
modal _tabheader2 _text : "Ordnerfarbe" ,
modal _tabheader3 _text : "Tooltipfarbe" ,
modal _tabheader4 _text : "Eigene Icons" ,
modal _iconpicker _text : "Ordnerauswahl" ,
2019-01-15 15:24:39 +01:00
modal _copytooltipcolor _text : "Benutze dieselben Farben für alle Server des 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 {
toast _addserver _text : "${servername} ha sido agregado a la carpeta${foldername}." ,
toast _removeserver _text : "${servername} ha sido eliminado de la carpeta${foldername}." ,
servercontext _serverfolders _text : "Carpetas de servidor" ,
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" ,
foldercontext _unreadfolder _text : "Marcar todo como leido" ,
foldercontext _autounreadfolder _text : "Auto: Marcar como leído" ,
foldercontext _foldersettings _text : "Ajustes de carpeta" ,
foldercontext _removefolder _text : "Eliminar carpeta" ,
modal _header _text : "Ajustes de carpeta" ,
modal _foldername _text : "Nombre de la 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-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 {
toast _addserver _text : "${servername} a été ajouté au dossier${foldername}." ,
toast _removeserver _text : "${servername} a été supprimé du dossier${foldername}." ,
servercontext _serverfolders _text : "Dossiers du serveur" ,
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" ,
foldercontext _unreadfolder _text : "Tout marquer comme lu" ,
foldercontext _autounreadfolder _text : "Auto: Marquer comme lu" ,
foldercontext _foldersettings _text : "Paramètres du dossier" ,
foldercontext _removefolder _text : "Supprimer le dossier" ,
modal _header _text : "Paramètres du dossier" ,
modal _foldername _text : "Nom de 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-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 {
toast _addserver _text : "${servername} è stato aggiunto alla cartella${foldername}." ,
toast _removeserver _text : "${servername} è stato rimosso dalla cartella${foldername}." ,
servercontext _serverfolders _text : "Cartelle del server" ,
serversubmenu _createfolder _text : "Creare una cartella" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Aggiungi il server alla cartella" ,
serversubmenu _removefromfolder _text : "Rimuovi il server dalla cartella" ,
2018-10-11 10:21:26 +02:00
foldercontext _unreadfolder _text : "Segna tutti come letti" ,
foldercontext _autounreadfolder _text : "Auto: Contrassegna come letto" ,
foldercontext _foldersettings _text : "Impostazioni cartella" ,
foldercontext _removefolder _text : "Elimina cartella" ,
modal _header _text : "Impostazioni cartella" ,
modal _foldername _text : "Nome della 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-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 {
toast _addserver _text : "${servername} is toegevoegd aan de map${foldername}." ,
toast _removeserver _text : "${servername} is verwijderd uit de map${foldername}." ,
servercontext _serverfolders _text : "Servermappen" ,
serversubmenu _createfolder _text : "Map aanmaken" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Voeg server toe aan de map" ,
serversubmenu _removefromfolder _text : "Verwijder de server uit de map" ,
2018-10-11 10:21:26 +02:00
foldercontext _unreadfolder _text : "Alles als gelezen markeren" ,
foldercontext _autounreadfolder _text : "Auto: Markeren als gelezen" ,
foldercontext _foldersettings _text : "Mapinstellingen" ,
foldercontext _removefolder _text : "Verwijder map" ,
modal _header _text : "Mapinstellingen" ,
modal _foldername _text : "Mapnaam" ,
modal _tabheader1 _text : "Map" ,
modal _tabheader2 _text : "Mapkleur" ,
modal _tabheader3 _text : "Tooltipkleur" ,
modal _tabheader4 _text : "Aangepaste keuze" ,
modal _iconpicker _text : "Map keuze" ,
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 {
toast _addserver _text : "${servername} er lagt til i mappe${foldername}." ,
toast _removeserver _text : "${servername} er fjernet fra mappen${foldername}." ,
servercontext _serverfolders _text : "Servermapper" ,
serversubmenu _createfolder _text : "Lag mappe" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Legg til server i mappe" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Fjern server fra mappe" ,
foldercontext _unreadfolder _text : "Marker alle som lest" ,
foldercontext _autounreadfolder _text : "Auto: Merk som les" ,
foldercontext _foldersettings _text : "Mappinnstillinger" ,
foldercontext _removefolder _text : "Slett mappe" ,
modal _header _text : "Mappinnstillinger" ,
modal _foldername _text : "Mappenavn" ,
modal _tabheader1 _text : "Mappe" ,
modal _tabheader2 _text : "Mappefarge" ,
modal _tabheader3 _text : "Tooltipfarge" ,
modal _tabheader4 _text : "Tilpassede ikoner" ,
modal _iconpicker _text : "Mappevalg" ,
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 {
2019-01-14 13:58:48 +01:00
toast _addserver _text : "${servername} został dodany do folderu${foldername}." ,
toast _removeserver _text : "${servername} został usunięty z folderu${foldername}." ,
2018-10-11 10:21:26 +02:00
servercontext _serverfolders _text : "Foldery serwera" ,
serversubmenu _createfolder _text : "Utwórz folder" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Dodaj serwer do folderu" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "Usuń serwer z folderu" ,
2018-10-11 10:21:26 +02:00
foldercontext _unreadfolder _text : "Oznacz wszystkie jako przeczytane" ,
foldercontext _autounreadfolder _text : "Auto: Oznacz jako przeczytane" ,
foldercontext _foldersettings _text : "Ustawienia folderu" ,
2019-01-14 13:58:48 +01:00
foldercontext _removefolder _text : "Usuń folder" ,
2018-10-11 10:21:26 +02:00
modal _header _text : "Ustawienia folderu" ,
modal _foldername _text : "Nazwa folderu" ,
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-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 {
toast _addserver _text : "${servername} foi adicionado à pasta${foldername}." ,
toast _removeserver _text : "${servername} foi removido da pasta${foldername}." ,
servercontext _serverfolders _text : "Pastas de servidores" ,
serversubmenu _createfolder _text : "Criar pasta" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Adicionar servidor à pasta" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Remover servidor da pasta" ,
foldercontext _unreadfolder _text : "Marcar tudo como lido" ,
foldercontext _autounreadfolder _text : "Auto: Marcar como lido" ,
foldercontext _foldersettings _text : "Configurações da pasta" ,
foldercontext _removefolder _text : "Excluir pasta" ,
modal _header _text : "Configurações da pasta" ,
modal _foldername _text : "Nome da 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-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 {
toast _addserver _text : "${servername} on lisätty kansioon${foldername}." ,
toast _removeserver _text : "${servername} on poistettu kansioon${foldername}." ,
servercontext _serverfolders _text : "Palvelinkansiot" ,
serversubmenu _createfolder _text : "Luo kansio" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Lisää palvelin kansioon" ,
serversubmenu _removefromfolder _text : "Poista palvelin kansioon" ,
2018-10-11 10:21:26 +02:00
foldercontext _unreadfolder _text : "Merkitse kaikki luetuksi" ,
foldercontext _autounreadfolder _text : "Auto: merkitse luettavaksi" ,
foldercontext _foldersettings _text : "Kansion kansio" ,
foldercontext _removefolder _text : "Poista kansio" ,
modal _header _text : "Kansion kansio" ,
modal _foldername _text : "Kansion nimi" ,
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-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 {
toast _addserver _text : "${servername} har lagts till i mapp${foldername}." ,
toast _removeserver _text : "${servername} har tagits bort från mappen${foldername}." ,
servercontext _serverfolders _text : "Servermappar" ,
serversubmenu _createfolder _text : "Skapa mapp" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Lägg till server i mapp" ,
2018-10-11 10:21:26 +02:00
serversubmenu _removefromfolder _text : "Ta bort servern från mappen" ,
foldercontext _unreadfolder _text : "Markera allt som läst" ,
foldercontext _autounreadfolder _text : "Auto: Markera som Läs" ,
foldercontext _foldersettings _text : "Mappinställningar" ,
foldercontext _removefolder _text : "Ta bort mapp" ,
modal _header _text : "Mappinställningar" ,
modal _foldername _text : "Mappnamn" ,
modal _tabheader1 _text : "Mapp" ,
modal _tabheader2 _text : "Mappfärg" ,
modal _tabheader3 _text : "Tooltipfärg" ,
modal _tabheader4 _text : "Anpassade ikoner" ,
modal _iconpicker _text : "Mappval" ,
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 {
toast _addserver _text : "${servername} klasörü${foldername} eklendi." ,
2019-01-14 13:58:48 +01:00
toast _removeserver _text : "${servername} klasörü${foldername} kaldı rı ldı " ,
2018-10-11 10:21:26 +02:00
servercontext _serverfolders _text : "Sunucu klasörleri" ,
2019-01-14 13:58:48 +01:00
serversubmenu _createfolder _text : "Klasör oluşturun" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Klasöre sunucu ekle" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "Sunucuyu klasörden kaldı r" ,
foldercontext _unreadfolder _text : "Tümünü Oku olarak işaretle" ,
foldercontext _autounreadfolder _text : "Oto: Okundu Olarak İşaretle" ,
foldercontext _foldersettings _text : "Klasör Ayarları " ,
2018-10-11 10:21:26 +02:00
foldercontext _removefolder _text : "Klasörü sil" ,
2019-01-14 13:58:48 +01:00
modal _header _text : "Klasör Ayarları " ,
modal _foldername _text : "Klasör adı " ,
2018-10-11 10:21:26 +02:00
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-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 {
2019-01-14 13:58:48 +01:00
toast _addserver _text : "${servername} byl přidán do složky${foldername}." ,
toast _removeserver _text : "${servername} byl odstraněn ze složky${foldername}." ,
2018-10-11 10:21:26 +02:00
servercontext _serverfolders _text : "Složky serveru" ,
2019-01-14 13:58:48 +01:00
serversubmenu _createfolder _text : "Vytvořit složky" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Přidat server do složky" ,
serversubmenu _removefromfolder _text : "Odebrat server ze složky" ,
2019-01-14 13:58:48 +01:00
foldercontext _unreadfolder _text : "Označit vše jako přečtené" ,
foldercontext _autounreadfolder _text : "Auto: Označit jako přečtené" ,
2018-10-11 10:21:26 +02:00
foldercontext _foldersettings _text : "Nastavení složky" ,
foldercontext _removefolder _text : "Smazat složky" ,
modal _header _text : "Nastavení složky" ,
modal _foldername _text : "Název 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-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
toast _addserver _text : "${servername} е добавен към папката${foldername}." ,
toast _removeserver _text : "${servername} е премахнат от папката${foldername}." ,
servercontext _serverfolders _text : "Сървърни папки" ,
serversubmenu _createfolder _text : "Създай папка" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Добавяне на сървър в папка" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "Премахване на сървър от папка" ,
foldercontext _unreadfolder _text : "Маркирай всички като прочетени" ,
foldercontext _autounreadfolder _text : "Авто: Маркиране като четене" ,
foldercontext _foldersettings _text : "Настройки папка" ,
foldercontext _removefolder _text : "Изтриване на папка" ,
modal _header _text : "Настройки папка" ,
modal _foldername _text : "Име на папка" ,
modal _tabheader1 _text : "Папка" ,
modal _tabheader2 _text : "Цвят на папка" ,
modal _tabheader3 _text : "Цвят на подсказка" ,
modal _tabheader4 _text : "Персонализирани икони" ,
modal _iconpicker _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
toast _addserver _text : "${servername} добавлен в папку${foldername}." ,
toast _removeserver _text : "${servername} был удален из папки${foldername}." ,
servercontext _serverfolders _text : "Папки сервера" ,
serversubmenu _createfolder _text : "Создать папки" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Добавить сервер в папку" ,
serversubmenu _removefromfolder _text : "Удалить сервер из папки" ,
2019-01-14 13:58:48 +01:00
foldercontext _unreadfolder _text : "Отметить все как прочитанное" ,
foldercontext _autounreadfolder _text : "Авто: Отметить как прочитанное" ,
foldercontext _foldersettings _text : "Настройки папки" ,
foldercontext _removefolder _text : "Удалить папки" ,
modal _header _text : "Настройки папки" ,
modal _foldername _text : "Имя папки" ,
modal _tabheader1 _text : "Папка" ,
modal _tabheader2 _text : "Цвет папки" ,
modal _tabheader3 _text : "Цвет подсказка" ,
modal _tabheader4 _text : "Пользовательские значки" ,
modal _iconpicker _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
toast _addserver _text : "${servername} було додано до папки${foldername}." ,
toast _removeserver _text : "${servername} був вилучений з папки${foldername}." ,
servercontext _serverfolders _text : "Папки сервера" ,
serversubmenu _createfolder _text : "Створити папки" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Додати сервер до папки" ,
serversubmenu _removefromfolder _text : "Видалити папку з папки" ,
2019-01-14 13:58:48 +01:00
foldercontext _unreadfolder _text : "Позначити як прочитане" ,
foldercontext _autounreadfolder _text : "Авто: Позначити як прочитане" ,
foldercontext _foldersettings _text : "Параметри папки" ,
foldercontext _removefolder _text : "Видалити папки" ,
modal _header _text : "Параметри папки" ,
modal _foldername _text : "Ім'я папки" ,
modal _tabheader1 _text : "Папки" ,
modal _tabheader2 _text : "Колір папки" ,
modal _tabheader3 _text : "Колір підказка" ,
modal _tabheader4 _text : "Користувальницькі іконки" ,
modal _iconpicker _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
toast _addserver _text : "${servername} がフォルダ${foldername} に追加されました。" ,
toast _removeserver _text : "${servername} がフォルダ${foldername} から削除されました。" ,
servercontext _serverfolders _text : "サーバーフォルダ" ,
serversubmenu _createfolder _text : "フォルダーを作る" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "サーバーをフォルダに追加する" ,
serversubmenu _removefromfolder _text : "サーバーをフォルダから削除する" ,
2019-01-14 13:58:48 +01:00
foldercontext _unreadfolder _text : "すべてを読むようにマークする" ,
foldercontext _autounreadfolder _text : "自動: 読み取りとしてマークする" ,
foldercontext _foldersettings _text : "フォルダ設定" ,
foldercontext _removefolder _text : "フォルダを削除する" ,
modal _header _text : "フォルダ設定" ,
modal _foldername _text : "フォルダ名" ,
modal _tabheader1 _text : "フォルダ" ,
modal _tabheader2 _text : "フォルダの色" ,
modal _tabheader3 _text : "ツールチップの色" ,
modal _tabheader4 _text : "カスタムアイコン" ,
modal _iconpicker _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
toast _addserver _text : "${servername} 已被添加到文件夾${foldername}." ,
toast _removeserver _text : "${servername} 已從文件夾${foldername} 中刪除." ,
servercontext _serverfolders _text : "服務器文件夾" ,
serversubmenu _createfolder _text : "創建文件夾" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "添加服務器到文件夾" ,
serversubmenu _removefromfolder _text : "從文件夾中刪除服務器" ,
2019-01-14 13:58:48 +01:00
foldercontext _unreadfolder _text : "標記為已讀" ,
foldercontext _autounreadfolder _text : "自動: 標記為已讀" ,
foldercontext _foldersettings _text : "文件夾設置" ,
foldercontext _removefolder _text : "刪除文件夾" ,
modal _header _text : "文件夾設置" ,
modal _foldername _text : "文件夾名稱" ,
modal _tabheader1 _text : "夾" ,
modal _tabheader2 _text : "文件夾顏色" ,
modal _tabheader3 _text : "工具提示顏色" ,
modal _tabheader4 _text : "自定義圖標" ,
modal _iconpicker _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
toast _addserver _text : "${servername} 가 폴더${foldername} 에 추가되었습니다." ,
toast _removeserver _text : "${servername} 가 폴더${foldername} 에서 제거되었습니다." ,
servercontext _serverfolders _text : "서버 폴더" ,
serversubmenu _createfolder _text : "폴더 만들기" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "폴더에 서버 추가" ,
2019-01-14 13:58:48 +01:00
serversubmenu _removefromfolder _text : "폴더에서 서버 제거" ,
foldercontext _unreadfolder _text : "모두 읽은 상태로 표시" ,
foldercontext _autounreadfolder _text : "자동: 읽은 상태로 표시" ,
foldercontext _foldersettings _text : "폴더 설정" ,
foldercontext _removefolder _text : "폴더 삭제" ,
modal _header _text : "폴더 설정" ,
modal _foldername _text : "폴더 이름" ,
modal _tabheader1 _text : "폴더" ,
modal _tabheader2 _text : "폴더 색" ,
modal _tabheader3 _text : "툴팁 색깔" ,
modal _tabheader4 _text : "사용자 정의 아이콘" ,
modal _iconpicker _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 {
toast _addserver _text : "${servername} has been added to the folder${foldername}." ,
toast _removeserver _text : "${servername} has been removed from the folder${foldername}." ,
servercontext _serverfolders _text : "Serverfolders" ,
serversubmenu _createfolder _text : "Create Folder" ,
2019-02-20 21:31:00 +01:00
serversubmenu _addtofolder _text : "Add Server to Folder" ,
serversubmenu _removefromfolder _text : "Remove Server from Folder" ,
2018-10-11 10:21:26 +02:00
foldercontext _unreadfolder _text : "Mark All As Read" ,
foldercontext _autounreadfolder _text : "Auto: Mark As Read" ,
foldercontext _foldersettings _text : "Foldersettings" ,
foldercontext _removefolder _text : "Delete Folder" ,
modal _header _text : "Foldersettings" ,
modal _foldername _text : "Foldername" ,
modal _tabheader1 _text : "Folder" ,
modal _tabheader2 _text : "Foldercolor" ,
modal _tabheader3 _text : "Tooltipcolor" ,
modal _tabheader4 _text : "Custom Icons" ,
modal _iconpicker _text : "Folderchoice" ,
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
}