BetterDiscordAddons/PluginsV2/ServerFolders/index.js

2074 lines
129 KiB
JavaScript
Raw Normal View History

2018-10-11 10:21:26 +02:00
module.exports = (Plugin, Api, Vendor) => {
if (typeof BDFDB !== "object") global.BDFDB = {$: Vendor.$, BDv2Api: Api};
const {$} = Vendor;
return class extends Plugin {
initConstructor () {
this.labels = {};
this.updateFolders = false;
this.css = `
${BDFDB.dotCN.guild}.folder ${BDFDB.dotCN.avataricon} {
background-clip: padding-box;
background-position: 50%;
background-size: cover !important;
}
2019-01-01 22:30:57 +01:00
.${this.name}-modal .ui-icon-picker-icon {
2018-10-11 10:21:26 +02:00
position: relative;
width: 70px;
height: 70px;
border: 4px solid transparent;
border-radius: 12px;
margin: 0;
}
2019-01-01 22:30:57 +01:00
.${this.name}-modal .ui-icon-picker-icon .ui-picker-inner {
2018-10-11 10:21:26 +02:00
margin: 5px 5px;
width: 60px;
height: 60px;
background-repeat: no-repeat;
background-clip: padding-box;
background-position: 50%;
background-size: cover;
border-radius: 12px;
}
2019-01-01 22:30:57 +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-01 22:30:57 +01:00
.${this.name}-modal .ui-icon-picker-icon ${BDFDB.dotCN.hovercardbutton} {
2018-10-11 10:21:26 +02:00
position: absolute;
top: -10px;
right: -10px;
}
2019-01-01 22:30:57 +01:00
.${this.name}-modal .ui-icon-picker-icon.preview.nopic .ui-picker-inner {
2018-10-11 10:21:26 +02:00
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAz40lEQVR4Xu3d+5ed5X2m+ev77r1LEojz+SRUVRI6HjgZHwgHVUkC7La7nUzSjuOkVzrpnsYxMU5Pklkz8cTunqyZTK+JcRvb6SS9ZrqTtJ3E2I7tGINUEuAOjmGMpNIJnYU4GYzBMkIIae/3mcVCtazFWsGI2rvqeeu9Pv8Bix++t56991VMUZ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A4KY11R0Al25YDcDATkaBPwZKJpOC+MmvA46c/DL1JOnRhRnmfXUU+ExK7GICBBNgz9IVAOck+CIwxGRTAv4iEr8FPDewaQ31IWnb/CH6+gpI5n0z83USvwwc6PW//gEKJkAqj5DgBwGfAJ5mUshssKQNA8vHjr+Rn7zsBT5JjOP45zgABjc/QACQvg38AXCYCSezwZJOObkBiQuM/GTlIPDJTll+L5g4MfG/MU3TIf4QuA0I6suPAyQZ+VEb+L9S4hMBR8ee/idCwQQaHF0DKQ6T+HfAl5CxIElGfvwH2B9O9PEHiMmpTQ0DXATxx8A/ISvGgqbiS4Bk3jfDZ3/9dcBtCZ4dC/5MpIJJEimeJPER4G6y5HcC9i68iWqTLPyNtf2zO/66C7j9uONfjwEwODpClAUBj0XiVlJuI8BOAHB2anTYt+Bmqkiy8Jdx3ldfAm4Dnk7NkslSMEn6t9xLpALgsSC3EWA2eGwEdJpt9i+s0giQtCP3vK/H/zeBp1ORmPPIWiZLMMn2Ll5FihLg0gSfJ7iFHCgBfxmJjxE8N+PwDC7Y8XXyJmnHq4W/Ru7H3+NPJAY3jjCZggzsWbwSIuU3ApTguC8Gjq4hX5IeXTBMq+nx9/
}
${BDFDB.dotCN.guild}.folder ${BDFDB.dotCN.badge}.folder.count {
background: grey;
height: 12px;
top: -3px;
right: 30px;
}
${BDFDB.dotCN.guild}.serverFoldersPreview {
position: absolute;
opacity: 0.5;
width: 50px;
height: 50px;
}
${BDFDB.dotCN.guild}.serverFoldersPreview ${BDFDB.dotCN.badge} {
display: none;
}
${BDFDB.dotCN.guild}.serverFoldersPreview ${BDFDB.dotCN.avataricon} {
background-color: transparent !important;
overflow: hidden;
}
${BDFDB.dotCN.guildswrapper}.folderopen ${BDFDB.dotCN.guilds} {
position: static !important;
}
${BDFDB.dotCN.guildswrapper}.folderopen ${BDFDB.dotCN.guilds}::-webkit-scrollbar {
display: none !important;
}
.foldercontainer {
max-height: 98%;
max-width: 98%;
position: absolute;
top: 0px;
left: 0px;
z-index: 1000;
}
.foldercontainer::-webkit-scrollbar {
display: none;
}
.foldercontainer ${BDFDB.dotCN.guild}:not(${BDFDB.dotCN.guildselected}) ${BDFDB.dotCN.guildinner} {
border-radius: 25px !important;
transition: border-radius 1s;
}
.foldercontainer ${BDFDB.dotCN.guild + BDFDB.dotCN.guildselected} ${BDFDB.dotCN.guildinner},
.foldercontainer ${BDFDB.dotCN.guild}:not(${BDFDB.dotCN.guildselected}) ${BDFDB.dotCN.guildinner}:hover {
border-radius: 15px !important;
transition: border-radius 1s;
}
.foldercontainer ${BDFDB.dotCN.guild}:not(.selected) .guild-inner[style*="background-color:"] {
background-color: rgb(47, 49, 54);
}
.foldercontainer ${BDFDB.dotCN.guild + BDFDB.dotCN.guildselected} ${BDFDB.dotCN.guildinner}[style*="background-color:"] {
background-color: rgb(114, 137, 218);
}`;
this.serverContextEntryMarkup =
`<div class="${BDFDB.disCN.contextmenuitemgroup}">
<div class="${BDFDB.disCN.contextmenuitem} serverfolders-item ${BDFDB.disCN.contextmenuitemsubmenu}">
2019-01-02 22:08:55 +01:00
<span class="DevilBro-textscrollwrapper" speed=3><div class="DevilBro-textscroll">REPLACE_servercontext_serverfolders_text</div></span>
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.contextmenuhint}"></div>
</div>
</div>`;
this.serverContextSubMenuMarkup =
`<div class="${BDFDB.disCN.contextmenu} serverfolders-submenu">
<div class="${BDFDB.disCN.contextmenuitemgroup}">
<div class="${BDFDB.disCN.contextmenuitem} createfolder-item">
2019-01-02 22:08:55 +01:00
<span class="DevilBro-textscrollwrapper" speed=3><div class="DevilBro-textscroll">REPLACE_serversubmenu_createfolder_text</div></span>
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.contextmenuhint}"></div>
</div>
<div class="${BDFDB.disCN.contextmenuitem} removefromfolder-item ${BDFDB.disCN.contextmenuitemdisabled}">
2019-01-02 22:08:55 +01:00
<span class="DevilBro-textscrollwrapper" speed=3><div class="DevilBro-textscroll">REPLACE_serversubmenu_removefromfolder_text</div></span>
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.contextmenuhint}"></div>
</div>
</div>
</div>`;
this.folderContextMarkup =
`<div class="${BDFDB.disCN.contextmenu} folderSettings">
<div class="${BDFDB.disCN.contextmenuitemgroup}">
<div class="${BDFDB.disCN.contextmenuitem} unreadfolder-item ${BDFDB.disCN.contextmenuitemdisabled}">
2019-01-02 22:08:55 +01:00
<span class="DevilBro-textscrollwrapper" speed=3><div class="DevilBro-textscroll">REPLACE_foldercontext_unreadfolder_text</div></span>
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.contextmenuhint}"></div>
</div>
<div class="${BDFDB.disCN.contextmenuitem} autounreadfolder-item ${BDFDB.disCN.contextmenuitemtoggle}">
<div class="${BDFDB.disCN.contextmenulabel}">REPLACE_foldercontext_autounreadfolder_text</div>
<div class="checkbox">
<div class="checkbox-inner">
<input type="checkbox" value="on">
<span></span>
</div>
<span></span>
</div>
</div>
<div class="${BDFDB.disCN.contextmenuitem} foldersettings-item">
2019-01-02 22:08:55 +01:00
<span class="DevilBro-textscrollwrapper" speed=3><div class="DevilBro-textscroll">REPLACE_foldercontext_foldersettings_text</div></span>
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.contextmenuhint}"></div>
</div>
<div class="${BDFDB.disCN.contextmenuitem} createfolder-item">
2019-01-02 22:08:55 +01:00
<span class="DevilBro-textscrollwrapper" speed=3><div class="DevilBro-textscroll">REPLACE_foldercontext_createfolder_text</div></span>
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.contextmenuhint}"></div>
</div>
<div class="${BDFDB.disCN.contextmenuitem} removefolder-item ${BDFDB.disCN.contextmenuitem}">
2019-01-02 22:08:55 +01:00
<span class="DevilBro-textscrollwrapper" speed=3><div class="DevilBro-textscroll">REPLACE_foldercontext_removefolder_text</div></span>
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.contextmenuhint}"></div>
</div>
</div>
</div>`;
this.folderIconMarkup =
`<div class="${BDFDB.disCN.guild} folder">
<div draggable="true">
<div class="${BDFDB.disCN.guildinner}" draggable="false" style="border-radius: 25px;">
<a draggable="false" class="${BDFDB.disCN.avataricon}"></a>
</div>
</div>
<div class="${BDFDB.disCN.badge} folder notifications"></div>
<div class="${BDFDB.disCN.badge} folder count"></div>
</div>`;
this.folderSettingsModalMarkup =
2019-01-01 22:30:57 +01:00
`<span class=""${this.name}-modal DevilBro-modal"">
2018-10-11 10:21:26 +02:00
<div class="${BDFDB.disCN.backdrop}"></div>
<div class="${BDFDB.disCN.modal}">
<div class="${BDFDB.disCN.modalinner}">
<div class="${BDFDB.disCNS.modalsub + BDFDB.disCN.modalsizemedium}">
<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.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;">
<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</h4>
<div class="${BDFDB.disCNS.modalguildname + BDFDB.disCNS.small + BDFDB.disCNS.size12 + BDFDB.disCNS.height16 + BDFDB.disCN.primary}"></div>
</div>
<svg class="${BDFDB.disCNS.modalclose + BDFDB.disCN.flexchild}" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 12 12">
<g fill="none" fill-rule="evenodd">
<path d="M0 0h12v12H0"></path>
<path class="fill" fill="currentColor" d="M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6"></path>
</g>
</svg>
</div>
<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.modalsubinner}" style="flex: 0 0 auto;">
<div tab="folder" class="tab">REPLACE_modal_tabheader1_text</div>
<div tab="icon" class="tab">REPLACE_modal_tabheader2_text</div>
<div tab="tooltip" class="tab">REPLACE_modal_tabheader3_text</div>
<div tab="custom" class="tab">REPLACE_modal_tabheader4_text</div>
</div>
<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</h3>
</div>
<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"></div>
</div>
<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</h3>
</div>
<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="icons"></div>
</div>
</div>
<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</h3>
</div>
<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="swatches1"></div>
</div>
<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</h3>
</div>
<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="swatches2"></div>
</div>
</div>
<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</h3>
</div>
<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="swatches3"></div>
</div>
<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</h3>
</div>
<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="swatches4"></div>
</div>
</div>
<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</h3>
</div>
<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">
</div>
<button type="button" class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.button + BDFDB.disCNS.buttonlookfilled + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCNS.buttonsizemedium + BDFDB.disCN.buttongrow} file-navigator" style="flex: 0 0 auto;">
<div class="${BDFDB.disCN.buttoncontents}"></div>
<input type="file" option="open" accept="image/*" style="display:none!important;">
</button>
</div>
<div 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</h3>
</div>
<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">
</div>
<button type="button" class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.button + BDFDB.disCNS.buttonlookfilled + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCNS.buttonsizemedium + BDFDB.disCN.buttongrow} file-navigator" style="flex: 0 0 auto;">
<div class="${BDFDB.disCN.buttoncontents}"></div>
<input type="file" option="closed" accept="image/*" style="display:none!important;">
</button>
</div>
<div 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</h3>
</div>
<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"></div>
</div>
<div class="ui-icon-picker-icon preview nopic closed" style="margin-left: 25px; margin-right: 25px;">
<div class="ui-picker-inner"></div>
</div>
<div class="ui-icon-picker-icon preview nopic switching">
<div class="ui-picker-inner"></div>
</div>
</div>
<button type="button" class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.button + BDFDB.disCNS.buttonlookfilled + BDFDB.disCNS.buttoncolorbrand + BDFDB.disCNS.buttonsizemedium + BDFDB.disCN.buttongrow} btn-add btn-addcustom" style="flex: 0 0 auto;">
<div class="${BDFDB.disCN.buttoncontents}"></div>
</button>
</div>
</div>
</div>
</div>
<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</div>
</button>
</div>
</div>
</div>
</div>
</span>`;
this.folderIcons = [
{"openicon":"data:image/png;base64,iVBORw0KGgoAAAAN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6unfuh5LjRZPa+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+pTmlWY1DLayIkD92zxLqpigXaJVY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5UkBXQWnUVnGZEDFrAqCRjDZX9LwVLBD/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="}
];
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."}
}
};
}
onStart () {
var libraryScript = null;
if (typeof BDFDB !== "object" || typeof BDFDB.isLibraryOutdated !== "function" || BDFDB.isLibraryOutdated()) {
libraryScript = document.querySelector('head script[src="https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js"]');
if (libraryScript) libraryScript.remove();
libraryScript = document.createElement("script");
libraryScript.setAttribute("type", "text/javascript");
libraryScript.setAttribute("src", "https://mwittrien.github.io/BetterDiscordAddons/Plugins/BDFDB.js");
document.head.appendChild(libraryScript);
}
this.startTimeout = setTimeout(() => {this.initialize();}, 30000);
if (typeof BDFDB === "object" && typeof BDFDB.isLibraryOutdated === "function") this.initialize();
else libraryScript.addEventListener("load", () => {this.initialize();});
return true;
}
initialize () {
if (typeof BDFDB === "object") {
BDFDB.loadMessage(this);
var observer = null;
observer = new MutationObserver((changes, _) => {
changes.forEach(
(change, i) => {
var serverObj = this.getParentObject(change.target, "guild");
var folderDiv = this.getFolderOfServer(serverObj);
if (folderDiv) {
this.updateCopyInFolderContent(serverObj, folderDiv);
this.updateFolderNotifications(folderDiv);
}
}
);
});
BDFDB.addObserver(this, null, {name:"badgeObserver",instance:observer,multi:true}, {characterData:true,subtree:true});
observer = new MutationObserver((changes, _) => {
changes.forEach(
(change, i) => {
if (change.addedNodes) {
change.addedNodes.forEach((node) => {
if (node && node.nodeType == 1 && node.className.includes(BDFDB.disCN.contextmenu)) {
this.onContextMenu(node);
}
});
}
}
);
});
BDFDB.addObserver(this, BDFDB.dotCN.appmount, {name:"serverContextObserver",instance:observer}, {childList: true});
observer = new MutationObserver((changes, _) => {
changes.forEach(
(change, i) => {
if (change.type == "attributes" && change.attributeName == "class") {
var serverObj = this.getParentObject(change.target, "guild");
var folderDiv = this.getFolderOfServer(serverObj);
if (folderDiv) {
this.updateCopyInFolderContent(serverObj, folderDiv);
this.updateFolderNotifications(folderDiv);
}
}
if (change.addedNodes) {
change.addedNodes.forEach((node) => {
var serverObj = this.getParentObject(node, "guild");
var folderDiv = this.getFolderOfServer(serverObj);
if (folderDiv) {
this.updateCopyInFolderContent(serverObj, folderDiv);
this.updateFolderNotifications(folderDiv);
if (node.tagName && node.classList.contains(BDFDB.disCN.badge)) {
BDFDB.addObserver(this, node, {name:"badgeObserver",multi:true}, {characterData:true,subtree:true});
}
$(serverObj.div).attr("folder",folderDiv.id).hide();
}
});
}
if (change.removedNodes) {
change.removedNodes.forEach((node) => {
var isBadge = $(node).hasClass(BDFDB.disCN.badge);
var serverObj = this.getParentObject(isBadge ? change.target : node, "guild");
var folderDiv = this.getFolderOfServer(serverObj);
if (folderDiv) {
if (isBadge) this.updateCopyInFolderContent(serverObj, folderDiv);
else $("#copy_of_" + serverObj.id).remove();
this.updateFolderNotifications(folderDiv);
}
});
}
}
);
});
BDFDB.addObserver(this, BDFDB.dotCN.guilds, {name:"serverListObserver",instance:observer}, {childList: true, attributes: true, subtree: true});
document.querySelectorAll(BDFDB.dotCN.badge + ":not(.folder):not(.copy)").forEach((badge) => {
BDFDB.addObserver(this, badge, {name:"badgeObserver",multi:true}, {characterData:true,subtree:true});
});
$(BDFDB.dotCN.guilds).on("click." + this.name, BDFDB.dotCN.guildseparator + " ~ div" + BDFDB.dotCN.guild + ":not(.folder)", () => {
if (BDFDB.getData("closeAllFolders", this, "settings")) {
document.querySelectorAll(".folder.open").forEach(openFolder => {this.openCloseFolder(openFolder);});
}
});
// PATCH OLD DATA REMOVE AFTER SOME TIME
var customIcons = BDFDB.loadData("customicons", this, "customicons") || [];
if (customIcons.length > 0) {
BDFDB.showToast("Patching old ServerFolders data. This may take a minute. Do not close Discord.", {type:"warn"});
let folders = BDFDB.loadAllData(this, "folders");
this.folderIcons.forEach(pair => {
pair.custom = false;
});
customIcons.forEach(pair => {
pair.custom = true;
pair.customID = this.generateID("customicon", "customicons");
BDFDB.saveData(pair.customID, {"openicon":pair.openicon,"closedicon":pair.closedicon,"customID":pair.customID}, this, "customicons");
});
var icons = this.folderIcons.concat(customIcons);
for (var id in folders) {
var folder = folders[id];
if (icons[folder.iconID].custom) {
folder.iconID = icons[folder.iconID].customID;
BDFDB.saveData(id, folder, this, "folders");
}
}
BDFDB.removeData("customicons", this, "customicons");
}
setTimeout(() => {
this.addDragListener();
this.loadAllFolders();
},5000);
return true;
}
else {
2019-01-24 13:37:08 +01:00
console.error(`%c[${this.name}]%c`, 'color: #3a71c1; font-weight: 700;', '', 'Fatal Error: Could not load BD functions!');
2018-10-11 10:21:26 +02:00
return false;
}
}
onStop () {
if (typeof BDFDB === "object") {
this.resetAllElements();
BDFDB.unloadMessage(this);
return true;
}
else {
return false;
}
}
onSwitch() {
if (typeof BDFDB === "object") {
if (BDFDB.getData("forceOpenFolder", this, "settings")) {
var serverObj = BDFDB.getSelectedServer();
if (!serverObj) return;
var folderDiv = this.getFolderOfServer(serverObj);
if (!folderDiv || folderDiv.classList.contains("open")) return;
this.openCloseFolder(folderDiv);
}
}
}
// begin of own functions
updateSettings (settingspanel) {
var settings = {};
for (var input of settingspanel.querySelectorAll(BDFDB.dotCN.switchinner)) {
settings[input.value] = input.checked;
}
BDFDB.saveAllData(settings, this, "settings");
this.updateFolders = true;
}
resetAll () {
if (confirm("Are you sure you want to delete all folders?")) {
BDFDB.removeAllData(this, "folders");
this.resetAllElements();
}
}
removeAllIcons () {
if (confirm("Are you sure you want to remove all custom icons?")) {
BDFDB.removeAllData(this, "customicons");
}
}
resetAllElements () {
$(".foldercontainer").remove();
$(BDFDB.dotCN.guild + ".folder").remove();
$(".serverFoldersPreview").remove();
BDFDB.readServerList().forEach(serverObj => $(serverObj.div).removeAttr("folder").show());
$(".folderopen").removeClass("folderopen");
BDFDB.removeLocalStyle("ChannelSizeCorrection");
}
changeLanguageStrings () {
this.serverContextEntryMarkup = this.serverContextEntryMarkup.replace("REPLACE_servercontext_serverfolders_text", this.labels.servercontext_serverfolders_text);
this.serverContextSubMenuMarkup = this.serverContextSubMenuMarkup.replace("REPLACE_serversubmenu_createfolder_text", this.labels.serversubmenu_createfolder_text);
this.serverContextSubMenuMarkup = this.serverContextSubMenuMarkup.replace("REPLACE_serversubmenu_removefromfolder_text", this.labels.serversubmenu_removefromfolder_text);
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);
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);
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);
this.folderSettingsModalMarkup = this.folderSettingsModalMarkup.replace("REPLACE_btn_save_text", this.labels.btn_save_text);
}
onContextMenu (context) {
if (!context || !context.tagName || !context.parentElement || context.querySelector(".serverfolders-item")) return;
var info = BDFDB.getKeyInformation({"node":context, "key":"guild"});
if (info && BDFDB.getKeyInformation({"node":context, "key":"displayName", "value":"GuildLeaveGroup"})) {
$(context).append(this.serverContextEntryMarkup)
.on("mouseenter." + this.name, ".serverfolders-item", (e) => {
this.createContextSubMenu(info, e, context);
});
BDFDB.updateContextPosition(context);
}
}
createContextSubMenu (info, e, context) {
var serverObj = BDFDB.getDivOfServer(info.id);
var serverContextSubMenu = $(this.serverContextSubMenuMarkup);
serverContextSubMenu
.on("click." + this.name, ".createfolder-item", () => {
$(context).hide();
this.createNewFolder(serverObj.div);
});
var folderDiv = this.getFolderOfServer(serverObj);
if (folderDiv) {
serverContextSubMenu
.find(".removefromfolder-item")
.removeClass(BDFDB.disCN.contextmenuitemdisabled)
.on("click." + this.name, () => {
$(context).hide();
this.removeServerFromFolder(serverObj, folderDiv);
});
}
BDFDB.appendSubMenu(e.currentTarget, serverContextSubMenu);
}
addDragListener () {
$(BDFDB.dotCN.guilds)
.off("mousedown." + this.name)
.on("mousedown." + this.name, "div" + BDFDB.dotCN.guild + ":not(.folder):not(.copy)", (e) => {
if (BDFDB.pressedKeys.includes(17)) {
e.stopPropagation();
e.preventDefault();
var serverObj = this.getParentObject(e.target, "guild");
if (serverObj) {
var serverPreview = serverObj.div.cloneNode(true);
$(serverPreview)
.appendTo(BDFDB.dotCN.appmount)
.addClass("serverFoldersPreview")
.offset({"left":e.clientX + 5,"top":e.clientY + 5});
$(document)
.off("mouseup." + this.name).off("mousemove." + this.name)
.on("mouseup." + this.name, (e2) => {
var folderDiv = this.getParentObject(e2.target, "folder").div;
if (folderDiv) this.addServerToFolder(serverObj, folderDiv);
$(document).off("mouseup." + this.name).off("mousemove." + this.name);
serverPreview.remove();
})
.on("mousemove." + this.name, (e2) => {
$(serverPreview).offset({"left":e2.clientX + 5,"top":e2.clientY + 5});
});
}
}
});
}
addServerToFolder (serverObj, folderDiv) {
var data = BDFDB.loadData(folderDiv.id, this, "folders");
if (serverObj && data && !data.servers.includes(serverObj.id)) {
data.servers.push(serverObj.id);
BDFDB.saveData(folderDiv.id, data, this, "folders");
$(serverObj.div).attr("folder",folderDiv.id).hide();
var message = this.labels.toast_addserver_text ?
this.labels.toast_addserver_text.replace("${servername}", serverObj.name).replace("${foldername}", data.folderName ? " " + data.folderName : "") : "";
BDFDB.showToast(message, {type:"success"});
this.updateCopyInFolderContent(serverObj, folderDiv);
this.updateFolderNotifications(folderDiv);
}
}
removeServerFromFolder (serverObj, folderDiv) {
var data = BDFDB.loadData(folderDiv.id, this, "folders");
if (serverObj && data) {
BDFDB.removeFromArray(data.servers, serverObj.id);
BDFDB.saveData(folderDiv.id, data, this, "folders");
$(serverObj.div).removeAttr("folder").show();
var message = this.labels.toast_removeserver_text ?
this.labels.toast_removeserver_text.replace("${servername}", serverObj.name).replace("${foldername}", data.folderName ? " " + data.folderName : "") : "";
BDFDB.showToast(message, {type:"danger"});
$("#copy_of_" + serverObj.id).remove();
this.updateFolderNotifications(folderDiv);
}
}
createNewFolder (ankerDiv) {
if (!ankerDiv) return;
var folderID = this.generateID("folder", "folders");
var folderName = "";
var position = Array.from(document.querySelectorAll("div" + BDFDB.dotCN.guildseparator + " ~ div" + BDFDB.dotCN.guild)).indexOf(ankerDiv);
var iconID = 0;
var icons = this.folderIcons[0];
var autounread = false;
var color1 = ["0","0","0"];
var color2 = ["255","255","255"];
var color3 = null;
var color4 = null;
var servers = [];
var folderDiv = this.createFolderDiv({folderID,folderName,position,iconID,icons,autounread,color1,color2,color3,color4,servers});
this.showFolderSettings(folderDiv);
this.updateFolderPositions();
}
loadAllFolders () {
var folders = BDFDB.loadAllData(this, "folders");
var sortedFolders = [];
for (var id in folders) {
sortedFolders[folders[id].position] = folders[id];
}
for (var i = 0; i < sortedFolders.length; i++) {
var data = sortedFolders[i];
if (data) {
var folderDiv = this.createFolderDiv(data);
this.readIncludedServerList(folderDiv).forEach((serverObj) => {$(serverObj.div).attr("folder",folderDiv.id).hide();});
}
}
}
createFolderDiv (data) {
var folderDiv = $(this.folderIconMarkup)[0];
$(folderDiv).insertBefore(document.querySelectorAll("div" + BDFDB.dotCN.guildseparator + " ~ div" + BDFDB.dotCN.guild)[data.position]);
var avatar = folderDiv.querySelector(BDFDB.dotCN.avataricon);
$(folderDiv)
.addClass("closed")
.attr("id", data.folderID)
.on("mouseenter", () => {this.createFolderToolTip(folderDiv);})
.on("click", () => {
if (BDFDB.getData("closeOtherFolders", this, "settings")) {
document.querySelectorAll(".folder.open").forEach(openFolder => {
if (openFolder != folderDiv) this.openCloseFolder(openFolder);
});
}
this.openCloseFolder(folderDiv);
})
.on("contextmenu", (e) => {
this.createFolderContextMenu(folderDiv, e);
})
.on("mousedown." + this.name, (e) => {
var mouseTimeout = null;
var folderPreview = folderDiv.cloneNode(true);
var hoveredElement = null;
var placeholder = $(`<div class="${BDFDB.disCNS.guild + BDFDB.disCN.guildplaceholder} folder folder-placeholder"></div>`)[0];
var guildswrap = document.querySelector(BDFDB.dotCN.guilds);
$(folderPreview)
.hide()
.appendTo(BDFDB.dotCN.appmount)
.addClass("serverFoldersPreview")
.offset({"left":e.clientX + 5,"top":e.clientY + 5});
$(document)
.off("mouseup." + this.name)
.on("mouseup." + this.name, (e2) => {
clearTimeout(mouseTimeout);
placeholder.remove();
folderPreview.remove();
$(folderDiv).css("display","");
$(document).off("mouseup." + this.name).off("mousemove." + this.name);
if (hoveredElement) {
guildswrap.insertBefore(folderDiv, hoveredElement.nextSibling);
this.updateFolderPositions(folderDiv);
}
});
mouseTimeout = setTimeout(() => {
$(document)
.off("mousemove." + this.name)
.on("mousemove." + this.name, (e2) => {
placeholder.remove();
$(folderDiv).hide();
$(folderPreview)
.show()
.offset({"left":e2.clientX + 5,"top":e2.clientY + 5});
hoveredElement = this.getParentObject(e2.target, "folder").div;
if (hoveredElement) guildswrap.insertBefore(placeholder, hoveredElement.nextSibling);
else {
hoveredElement = this.getParentObject(e2.target, "guild").div;
if (hoveredElement) guildswrap.insertBefore(placeholder, hoveredElement.nextSibling);
}
});
},100);
});
$(avatar)
.css("background-image", "url(\"" + data.icons.closedicon + "\")");
BDFDB.saveData(data.folderID, data, this, "folders");
this.updateFolderNotifications(folderDiv);
return folderDiv;
}
generateID (prefix, dataname) {
var data = BDFDB.loadAllData(this, dataname);
var id = prefix + "_" + Math.round(Math.random()*10000000000000000);
return data[id] ? this.generateID(prefix, dataname) : id;
}
createFolderContextMenu (folderDiv, e) {
var folderID = folderDiv.id;
var data = BDFDB.loadData(folderID, this, "folders");
if (data) {
var folderContext = $(this.folderContextMarkup);
folderContext
.on("click." + this.name, ".autounreadfolder-item", (e2) => {
var checkbox = $(e2.currentTarget).find("input");
var isChecked = checkbox.prop("checked");
checkbox.prop("checked", !isChecked)
data.autounread = !isChecked;
BDFDB.saveData(folderID, data, this, "folders");
})
.on("click." + this.name, ".foldersettings-item", () => {
folderContext.remove();
this.showFolderSettings(folderDiv);
})
.on("click." + this.name, ".createfolder-item", () => {
folderContext.remove();
this.createNewFolder(folderDiv);
})
.on("click." + this.name, ".removefolder-item", () => {
folderContext.remove();
this.removeFolder(folderDiv);
})
.find(".autounreadfolder-item input").prop("checked", data.autounread);
var unreadServers = BDFDB.readUnreadServerList(this.readIncludedServerList(folderDiv));
if (unreadServers.length > 0) {
folderContext
.find(".unreadfolder-item")
.removeClass(BDFDB.disCN.contextmenuitemdisabled)
.on("click." + this.name, () => {
folderContext.remove();
BDFDB.clearReadNotifications(unreadServers);
});
}
BDFDB.appendContextMenu(folderContext[0], e);
}
}
createFolderToolTip (folderDiv) {
var data = BDFDB.loadData(folderDiv.id, this, "folders");
if (data) {
if (data.folderName) {
var bgColor = data.color3 ? BDFDB.color2RGB(data.color3) : "";
var fontColor = data.color4 ? BDFDB.color2RGB(data.color4) : "";
var customTooltipCSS = `
body .tooltip.guild-folder-tooltip {
color: ${fontColor} !important;
background-color: ${bgColor} !important;
}
body .guild-folder-tooltip:after {
border-right-color: ${bgColor} !important;
}`;
BDFDB.createTooltip(data.folderName, folderDiv, {type:"right",selector:"guild-folder-tooltip",css:customTooltipCSS});
}
}
}
createServerToolTip (serverObj, target, e) {
var data = BDFDB.loadData(serverObj.id, "EditServers", "servers");
var text = data ? (data.name ? data.name : serverObj.name) : serverObj.name;
var bgColor = data ? (data.color3 ? BDFDB.color2RGB(data.color3) : "") : "";
var fontColor = data ? (data.color4 ? BDFDB.color2RGB(data.color4) : "") : "";
var customTooltipCSS = `
body .tooltip.guild-custom-tooltip {
color: ${fontColor} !important;
background-color: ${bgColor} !important;
}
body .tooltip.guild-custom-tooltip:after {
border-right-color: ${bgColor} !important;
}`;
BDFDB.createTooltip(text, target, {type:"right",selector:"guild-custom-tooltip",css:customTooltipCSS});
}
showFolderSettings (folderDiv) {
var folderID = folderDiv.id;
var data = BDFDB.loadData(folderID, this, "folders");
if (data) {
var folderName = data.folderName;
var position = data.position;
var iconID = data.iconID;
var icons = data.icons;
var color1 = data.color1;
var color2 = data.color2;
var color3 = data.color3;
var color4 = data.color4;
var servers = data.servers;
var folderSettingsModal = $(this.folderSettingsModalMarkup);
folderSettingsModal.find(BDFDB.dotCN.modalguildname).text(folderName ? folderName : "");
folderSettingsModal.find("#input-foldername").val(folderName);
folderSettingsModal.find("#input-foldername").attr("placeholder", folderName);
this.setIcons(iconID, folderSettingsModal.find(".icons"));
BDFDB.setColorSwatches(color1, folderSettingsModal.find(".swatches1"), "swatch1");
BDFDB.setColorSwatches(color2, folderSettingsModal.find(".swatches2"), "swatch2");
BDFDB.setColorSwatches(color3, folderSettingsModal.find(".swatches3"), "swatch3");
BDFDB.setColorSwatches(color4, folderSettingsModal.find(".swatches4"), "swatch4");
BDFDB.appendModal(folderSettingsModal);
folderSettingsModal
.on("change", "input[type='file'][option]", (e) => {
var file = e.currentTarget.files[0];
if (file) this.fetchCustomIcon(folderSettingsModal[0], e.currentTarget.getAttribute("option"));
})
.on("keyup", "input[type='text'][option]", (e) => {
if (e.which == 13) this.fetchCustomIcon(folderSettingsModal[0], e.currentTarget.getAttribute("option"));
})
.on("click", ".btn-addcustom", (e) => {
this.saveCustomIcon(folderSettingsModal[0]);
})
.on("click", ".btn-save", (e) => {
folderName = null;
if (folderSettingsModal.find("#input-foldername").val()) {
if (folderSettingsModal.find("#input-foldername").val().trim().length > 0) {
folderName = folderSettingsModal.find("#input-foldername").val().trim();
}
}
iconID = folderSettingsModal.find(".ui-icon-picker-icon.selected").attr("value");
color1 = BDFDB.getSwatchColor("swatch1");
color2 = BDFDB.getSwatchColor("swatch2");
color3 = BDFDB.getSwatchColor("swatch3");
color4 = BDFDB.getSwatchColor("swatch4");
if (iconID != data.iconID || !BDFDB.equals(color1, data.color1) || !BDFDB.equals(color2, data.color2)) {
var folderIcons = this.loadAllIcons();
var isOpen = folderDiv.classList.contains("open");
if (!folderSettingsModal.find(".ui-icon-picker-icon.selected").hasClass("custom")) {
this.changeImgColor(color1, color2, folderIcons[iconID].openicon, (openicon) => {
icons.openicon = openicon;
this.changeImgColor(color1, color2, folderIcons[iconID].closedicon, (closedicon) => {
icons.closedicon = closedicon;
$(folderDiv).find(BDFDB.dotCN.avataricon).css("background-image", isOpen ? "url(\"" + icons.openicon + "\")" : "url(\"" + icons.closedicon + "\")");
BDFDB.saveData(folderID, {folderID,folderName,position,iconID,icons,color1,color2,color3,color4,servers}, this, "folders");
});
});
}
else {
icons.openicon = folderIcons[iconID].openicon;
icons.closedicon = folderIcons[iconID].closedicon;
$(folderDiv).find(BDFDB.dotCN.avataricon).css("background-image", isOpen ? "url(\"" + icons.openicon + "\")" : "url(\"" + icons.closedicon + "\")");
BDFDB.saveData(folderID, {folderID,folderName,position,iconID,icons,color1,color2,color3,color4,servers}, this, "folders");
}
}
else {
BDFDB.saveData(folderID, {folderID,folderName,position,iconID,icons,color1,color2,color3,color4,servers}, this, "folders");
}
});
folderSettingsModal.find("#input-foldername").focus();
}
}
setIcons (selection, wrapper) {
wrapper.find(".ui-icon-picker-icon").remove();
var folderIcons = this.loadAllIcons();
var icons =
`<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.nowrap}" style="flex: 1 1 auto; margin-top: 5px;">
<div class="flex-lFgbSz flex-3B1Tl4 horizontal-2BEEBe horizontal-2VE-Fw directionRow-yNbSvJ justifyStart-2yIZo0 alignStretch-1hwxMa wrap-1da0e3 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>`;
$(icons).appendTo(wrapper);
if (!folderIcons[selection]) {
selection = 0;
}
wrapper.find(`.ui-icon-picker-icon[value="${selection}"]`)
.addClass("selected")
.css("background-color", "grey");
wrapper
.off("click").off("mouseenter").off("mouseleave")
.on("click", ".ui-icon-picker-icon", (e) => {
if (e.target.classList.contains(BDFDB.disCN.hovercardbutton)) return
wrapper.find(".ui-icon-picker-icon.selected")
.removeClass("selected")
.css("background-color", "transparent");
$(e.currentTarget)
.addClass("selected")
.css("background-color", "grey");
})
.on("click", BDFDB.dotCN.hovercardbutton, (e) => {
BDFDB.removeData(e.currentTarget.getAttribute("value"), this, "customicons");
e.currentTarget.parentElement.remove();
BDFDB.showToast(`Custom Icon was deleted.`, {type:"success"});
})
.on("mouseenter", ".ui-icon-picker-icon", (e) => {
$(e.currentTarget).find(".ui-picker-inner").css("background-image", "url(" + folderIcons[e.currentTarget.getAttribute("value")].openicon + ")");
})
.on("mouseleave", ".ui-icon-picker-icon", (e) => {
$(e.currentTarget).find(".ui-picker-inner").css("background-image", "url(" + folderIcons[e.currentTarget.getAttribute("value")].closedicon + ")");
});
}
loadAllIcons () {
var icons = {};
this.folderIcons.forEach((array,i) => {
icons[i] = {"openicon":array.openicon,"closedicon":array.closedicon,"customID":null};
});
Object.assign(icons, BDFDB.loadAllData(this, "customicons"));
return icons;
}
fetchCustomIcon (modal, type) {
var successFetchIcon;
var url = modal.querySelector("input[type='text'][option='" + type + "']").value;
if (url.indexOf("http") == 0) {
let request = require("request");
request(url, (error, response, result) => {
if (response) {
var type = response.headers["content-type"];
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"});
}
}
successFetchIcon = () => {
var iconpreview = modal.querySelector(".ui-icon-picker-icon.preview." + type);
var iconpreviewinner = iconpreview.querySelector(".ui-picker-inner");
iconpreview.classList.remove("nopic");
iconpreview.url = url;
iconpreviewinner.style.backgroundImage = "url(" + url + ")";
var iconpreviewopen = modal.querySelector(".ui-icon-picker-icon.preview.open");
var iconpreviewclosed = modal.querySelector(".ui-icon-picker-icon.preview.closed");
if (!iconpreviewopen.classList.contains("nopic") && !iconpreviewclosed.classList.contains("nopic")) {
var iconpreviewswitching = modal.querySelector(".ui-icon-picker-icon.preview.switching");
var iconpreviewopeninner = iconpreviewopen.querySelector(".ui-picker-inner");
var iconpreviewclosedinner = iconpreviewclosed.querySelector(".ui-picker-inner");
var iconpreviewswitchinginner = iconpreviewswitching.querySelector(".ui-picker-inner");
iconpreviewswitching.classList.remove("nopic");
iconpreviewswitchinginner.style.backgroundImage = iconpreviewopeninner.style.backgroundImage;
var switching = true;
iconpreviewswitching.switchInterval = setInterval(() => {
switching = !switching;
iconpreviewswitchinginner.style.backgroundImage = switching ? iconpreviewopeninner.style.backgroundImage : iconpreviewclosedinner.style.backgroundImage;
},1000);
}
};
}
saveCustomIcon (modal) {
var iconpreviewopen = modal.querySelector(".ui-icon-picker-icon.preview.open");
var iconpreviewclosed = modal.querySelector(".ui-icon-picker-icon.preview.closed");
var iconpreviewswitching = modal.querySelector(".ui-icon-picker-icon.preview.switching");
if (!iconpreviewopen.classList.contains("nopic") && !iconpreviewclosed.classList.contains("nopic") && !iconpreviewswitching.classList.contains("nopic")) {
var customID = this.generateID("customicon", "customicons");
BDFDB.saveData(customID, {"openicon":iconpreviewopen.url,"closedicon":iconpreviewclosed.url,customID}, this, "customicons");
modal.querySelectorAll("input[type='text'][option]").forEach((input) => {
input.value = "";
});
var iconpreviewopeninner = iconpreviewopen.querySelector(".ui-picker-inner");
var iconpreviewclosedinner = iconpreviewclosed.querySelector(".ui-picker-inner");
var iconpreviewswitchinginner = iconpreviewswitching.querySelector(".ui-picker-inner");
iconpreviewopen.classList.add("nopic");
iconpreviewopeninner.style.backgroundImage = "";
iconpreviewclosed.classList.add("nopic");
iconpreviewclosedinner.style.backgroundImage = "";
iconpreviewswitching.classList.add("nopic");
iconpreviewswitchinginner.style.backgroundImage = "";
clearInterval(iconpreviewswitching.switchInterval);
BDFDB.showToast(`Custom Icon was added to selection.`, {type:"success"});
this.setIcons(modal.querySelector(".ui-icon-picker-icon.selected").getAttribute("value"), $(modal).find(".icons"));
}
else {
BDFDB.showToast(`Add an image for the open and the closed icon.`, {type:"danger"});
}
};
removeFolder (folderDiv) {
this.readIncludedServerList(folderDiv).forEach((serverObj) => {$(serverObj.div).removeAttr("folder").show();});
BDFDB.removeData(folderDiv.id, this, "folders");
this.closeFolderContent(folderDiv);
folderDiv.remove();
this.updateFolderPositions();
}
openCloseFolder (folderDiv) {
var data = BDFDB.loadData(folderDiv.id, this, "folders");
if (data) {
var isOpen = folderDiv.classList.contains("open");
if (!isOpen) {
var includedServers = this.readIncludedServerList(folderDiv);
if (includedServers.length > 0) {
$(folderDiv)
.addClass("open")
.removeClass("closed");
var alreadyOpen = document.querySelector(".foldercontainer");
if (!alreadyOpen) {
document.body.classList.add("folderopen");
$(BDFDB.dotCN.guildswrapper).addClass("folderopen");
$(`<div class="foldercontainer"></div>`).insertBefore(BDFDB.dotCN.guild + ":first");
}
for (var i = 0; i < includedServers.length; i++) {
this.updateCopyInFolderContent(includedServers[i], folderDiv);
}
if (!alreadyOpen) {
var guildswrapper = $(BDFDB.dotCN.guildswrapper);
var guildsscroller = guildswrapper.find(BDFDB.dotCN.guilds);
var ChannelSizeCorrectionCSS = `
.foldercontainer {
padding: ${guildsscroller.css("padding")};
margin: ${guildsscroller.css("margin")};
}`;
if (guildswrapper.outerHeight() > guildswrapper.outerWidth()) {
var columnamount = Math.floor(guildswrapper.outerWidth() / $(BDFDB.dotCN.guild).outerWidth());
ChannelSizeCorrectionCSS += `
.foldercontainer {
width: ${guildswrapper.outerWidth() / columnamount}px;
left: ${guildswrapper.outerWidth()}px;
overflow-x: hidden !important;
overflow-y: scroll !important;
}
body.folderopen .bd-settings-button {
width: ${guildswrapper.outerWidth() + (guildswrapper.outerWidth() / columnamount)}px !important;
}
${BDFDB.dotCN.guildswrapper}.folderopen {
overflow: visible !important;
width: ${guildswrapper.outerWidth() + (guildswrapper.outerWidth() / columnamount)}px !important;
}
${BDFDB.dotCN.guildswrapper}.folderopen ${BDFDB.dotCN.scrollerwrapold},
${BDFDB.dotCN.guildswrapper}.folderopen ${BDFDB.dotCN.guilds} {
width: ${guildswrapper.outerWidth() + (guildswrapper.outerWidth() / columnamount)}px !important;
}`;
}
else {
var rowamount = Math.floor(guildswrapper.outerHeight() / $(BDFDB.dotCN.guild).outerHeight());
ChannelSizeCorrectionCSS += `
.foldercontainer ${BDFDB.dotCN.guild} {
display: inline-block !important;
}
.foldercontainer {
height: ${guildswrapper.outerHeight() / rowamount}px;
bottom: ${guildswrapper.outerHeight()}px;
overflow-x: scroll !important;
overflow-y: hidden !important;
}
${BDFDB.dotCN.guildswrapper}.folderopen {
overflow: visible !important;
height: ${guildswrapper.outerouterHeightWidth() + (guildswrapper.outerHeight() / rowamount)}px !important;
}
${BDFDB.dotCN.guildswrapper}.folderopen ${BDFDB.dotCN.scrollerwrapold},
${BDFDB.dotCN.guildswrapper}.folderopen ${BDFDB.dotCN.guilds} {
height: ${guildswrapper.outerouterHeightWidth() + (guildswrapper.outerHeight() / rowamount)}px !important;
}`;
}
BDFDB.appendLocalStyle("ChannelSizeCorrection", ChannelSizeCorrectionCSS);
}
}
else return; // nothing to do when closed and empty
}
else {
this.closeFolderContent(folderDiv);
}
$(folderDiv).find(BDFDB.dotCN.avataricon).css("background-image", !isOpen ? "url(\"" + data.icons.openicon + "\")" : "url(\"" + data.icons.closedicon + "\")");
}
}
updateCopyInFolderContent (serverObj, folderDiv) {
if (!serverObj) return;
var foldercontainer = document.querySelector(".foldercontainer");
if (foldercontainer && folderDiv.classList.contains("open")) {
var oldCopy = foldercontainer.querySelector("#copy_of_" + serverObj.id);
if (oldCopy) {
foldercontainer.insertBefore(this.createCopyOfServer(serverObj, folderDiv), oldCopy);
oldCopy.remove();
}
else {
var sameFolderCopies = foldercontainer.querySelectorAll(".content_of_" + folderDiv.id);
var insertNode = sameFolderCopies.length > 0 ? sameFolderCopies[sameFolderCopies.length-1].nextSibling : null;
foldercontainer.insertBefore(this.createCopyOfServer(serverObj, folderDiv), insertNode);
}
}
}
createCopyOfServer (serverObj, folderDiv) {
var serverDiv = serverObj.div;
var foldercontainer = document.querySelector(".foldercontainer");
var serverCopy = serverDiv.cloneNode(true);
$(serverCopy)
.attr("id", "copy_of_" + serverObj.id)
.addClass("copy")
.addClass("content_of_" + folderDiv.id)
.css("display", "")
.on("mouseenter." + this.name, (e) => {this.createServerToolTip(serverObj, serverCopy, e);})
.on("click." + this.name, (e) => {
e.preventDefault();
if (BDFDB.pressedKeys.includes(46)) {
this.removeServerFromFolder(serverObj, folderDiv);
}
else {
var settings = BDFDB.getAllData(this, "settings");
if (settings.closeAllFolders) {
document.querySelectorAll(".folder.open").forEach(openFolder => {
this.openCloseFolder(openFolder);
});
}
else if (settings.closeTheFolder) {
this.openCloseFolder(folderDiv);
}
serverDiv.querySelector("a").click();
}
})
.on("contextmenu." + this.name, (e) => {
var handleContextMenu = BDFDB.getKeyInformation({"node":serverDiv.firstElementChild, "key":"handleContextMenu"});
if (handleContextMenu) {
var data = {
preventDefault: a=>a,
stopPropagation: a=>a,
pageX: e.pageX,
pageY: e.pageY,
};
handleContextMenu(data);
}
})
.on("mousedown." + this.name, (e) => {
var mouseTimeout = null;
var serverPreview = serverDiv.cloneNode(true);
var hoveredCopy = null;
var placeholder = $(`<div class="${BDFDB.disCNS.guild + BDFDB.disCN.guildplaceholder} copy copy-placeholder"></div>`)[0];
$(serverPreview)
.appendTo(BDFDB.dotCN.appmount)
.addClass("serverFoldersPreview")
.offset({"left":e.clientX + 5,"top":e.clientY + 5});
$(document)
.off("mouseup." + this.name)
.on("mouseup." + this.name, (e2) => {
clearTimeout(mouseTimeout);
placeholder.remove();
serverPreview.remove();
$(serverCopy).css("display","");
var newFolderDiv = this.getParentObject(e2.target, "folder").div;
if (newFolderDiv && newFolderDiv != folderDiv) {
this.removeServerFromFolder(serverObj, folderDiv);
this.addServerToFolder(serverObj, newFolderDiv);
}
else {
if (hoveredCopy) {
foldercontainer.insertBefore(serverCopy, hoveredCopy.nextSibling);
this.updateServerPositions(folderDiv);
}
}
$(document).off("mouseup." + this.name).off("mousemove." + this.name);
});
mouseTimeout = setTimeout(() => {
$(document)
.off("mousemove." + this.name)
.on("mousemove." + this.name, (e2) => {
placeholder.remove();
$(serverCopy).hide();
$(serverPreview)
.show()
.offset({"left":e2.clientX + 5,"top":e2.clientY + 5});
if (foldercontainer.contains(e2.target)) {
hoveredCopy = this.getParentObject(e2.target, "copy").div;
if (hoveredCopy && hoveredCopy.classList.contains("content_of_" + folderDiv.id)) {
foldercontainer.insertBefore(placeholder, hoveredCopy.nextSibling);
}
else hoveredCopy = null;
}
});
},100);
})
.find("a").attr("draggable","false");
return serverCopy;
}
closeFolderContent (folderDiv) {
$(folderDiv)
.removeClass("open")
.addClass("closed");
$(".content_of_" + folderDiv.id).remove();
var foldercontainer = document.querySelector(".foldercontainer");
if (foldercontainer && !foldercontainer.firstChild) {
foldercontainer.remove();
$(".folderopen").removeClass("folderopen");
BDFDB.removeLocalStyle("ChannelSizeCorrection");
}
}
updateFolderPositions () {
var serverAndFolders = document.querySelectorAll("div" + BDFDB.dotCN.guildseparator + " ~ div" + BDFDB.dotCN.guild);
for (let i = 0; i < serverAndFolders.length; i++) {
var folderDiv = this.getParentObject(serverAndFolders[i], "folder").div;
if (folderDiv) {
var folderID = folderDiv.id;
var data = BDFDB.loadData(folderID, this, "folders");
if (data) {
data.position = i;
BDFDB.saveData(folderID, data, this, "folders");
}
}
}
}
updateServerPositions (folderDiv) {
var data = BDFDB.loadData(folderDiv.id, this, "folders");
if (data) {
var serversInData = data.servers;
var serversInFolder = Array.from(document.querySelectorAll(".content_of_" + folderDiv.id)).map(server => {return server.id.replace("copy_of_", "");});
for (var i = 0; i < serversInFolder.length; i++) {
BDFDB.removeFromArray(serversInData, serversInFolder[i]);
}
data.servers = serversInFolder.concat(serversInData);
BDFDB.saveData(folderDiv.id, data, this, "folders");
}
}
updateFolderNotifications (folderDiv) {
var data = BDFDB.loadData(folderDiv.id, this, "folders");
if (data) {
var includedServers = this.readIncludedServerList(folderDiv);
var unreadServers = BDFDB.readUnreadServerList(includedServers);
if (unreadServers.length > 0 && data.autounread) {
BDFDB.clearReadNotifications(unreadServers);
}
else {
var badgeAmount = 0;
var audioEnabled = false;
var videoEnabled = false;
includedServers.forEach((serverObj) => {
let serverDiv = serverObj.div;
let badge = serverDiv.querySelector(BDFDB.dotCN.badge);
if (badge) badgeAmount += parseInt(badge.innerText);
if (serverDiv.classList.contains(BDFDB.disCN.guildaudio)) audioEnabled = true;
if (serverDiv.classList.contains(BDFDB.disCN.guildvideo)) videoEnabled = true;
});
$(folderDiv)
.toggleClass(BDFDB.disCN.guildunread, unreadServers.length > 0)
.toggleClass(BDFDB.disCN.guildaudio, audioEnabled)
.toggleClass(BDFDB.disCN.guildvideo, videoEnabled);
$(folderDiv)
.find(".folder" + BDFDB.dotCN.badge + ".notifications")
.toggle(badgeAmount > 0)
.text(badgeAmount);
$(folderDiv)
.find(".folder" + BDFDB.dotCN.badge + ".count")
.toggle(includedServers.length > 0 && BDFDB.getData("showCountBadge", this, "settings"))
.text(includedServers.length);
if (folderDiv.classList.contains("open") && !document.querySelector(".content_of_" + folderDiv.id)) this.openCloseFolder(folderDiv);
}
}
}
getParentObject (div, type) {
if (!div) return {div:null};
if (document.querySelector(BDFDB.dotCN.dms) && document.querySelector(BDFDB.dotCN.dms).contains(div)) return {div:null};
if (div.tagName && div.querySelector(BDFDB.dotCN.guildserror)) return {div:null};
if (div.classList && div.classList.length > 0 && (div.classList.contains(BDFDB.disCN.guilds) || div.classList.contains("serverFoldersPreview"))) return {div:null};
if (div.classList && div.classList.length > 0 && div.classList.contains(BDFDB.disCN.guild) && div.classList.contains(type) && div.querySelector(BDFDB.dotCN.avataricon)) {
if (type == "guild") {
var info = BDFDB.getKeyInformation({"node":div, "key":"guild"});
if (info) return Object.assign({},info,{div:div,data:info});
}
else {
return {div};
}
}
return this.getParentObject(div.parentElement, type);
}
getFolderOfServer (serverObj) {
if (!serverObj) return;
var folders = BDFDB.loadAllData(this, "folders");
for (var id in folders) {
var serverIDs = folders[id].servers;
for (var i = 0; serverIDs.length > i; i++) {
if (serverIDs[i] == serverObj.id) return document.querySelector("#" + folders[id].folderID);
}
}
return null;
}
readIncludedServerList (folderDiv) {
var data = BDFDB.loadData(folderDiv.id, this, "folders");
var includedServers = [];
if (data) {
var serverIDs = data.servers;
for (var i = 0; serverIDs.length > i; i++) {
var serverObj = BDFDB.getDivOfServer(serverIDs[i]);
if (serverObj) includedServers.push(serverObj);
}
}
return includedServers;
}
changeImgColor (color1, color2, icon, callback) {
color1 = BDFDB.color2COMP(color1);
color2 = BDFDB.color2COMP(color2);
if (!color1 || !color2 || !icon) return;
var img = new Image();
img.src = icon;
img.onload = () => {
if (icon.indexOf("data:image") == 0 && img.width < 200 && img.height < 200) {
var can = document.createElement("canvas");
can.width = img.width;
can.height = img.height;
var ctx = can.getContext("2d");
ctx.drawImage(img, 0, 0);
var imageData = ctx.getImageData(0, 0, img.width, img.height);
var data = imageData.data;
for (var i = 0; i < data.length; i += 4) {
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);
}
};
}
getSettingsPanel () {
var settings = BDFDB.getAllData(this, "settings");
var settingshtml = `<div class="DevilBro-settings ${this.name}-settings">`;
for (let key in settings) {
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="${key}" class="${BDFDB.disCNS.switchinnerenabled + BDFDB.disCN.switchinner}"${settings[key] ? " checked" : ""}></div></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;">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>`;
var settingspanel = $(settingshtml)[0];
$(settingspanel)
.on("click", BDFDB.dotCN.switchinner, () => {this.updateSettings(settingspanel);})
.on("click", ".reset-button", () => {this.resetAll();})
.on("click", ".removecustom-button", () => {this.removeAllIcons()});
return settingspanel;
}
onSettingsClosed () {
if (this.updateFolders) {
document.querySelectorAll(".folder").forEach(folderDiv => {this.updateFolderNotifications(folderDiv);});
this.updateFolders = false;
}
}
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",
serversubmenu_removefromfolder_text: "Ukloni poslužitelj iz mape",
foldercontext_unreadfolder_text: "Označi sve kao pročitano",
foldercontext_autounreadfolder_text: "Auto: Označite kao pročitano",
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",
modal_tabheader4_text: "Prilagođeni ikona",
modal_iconpicker_text: "Odabir mape",
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",
modal_custompreview_text: "Pregled ikona",
btn_cancel_text: "Prekid",
btn_save_text: "Uštedjeti"
};
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",
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",
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",
modal_custompreview_text: "Ikon forhåndsvisning",
btn_cancel_text: "Afbryde",
btn_save_text: "Spare"
};
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",
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",
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",
modal_custompreview_text: "Iconvorschau",
btn_cancel_text: "Abbrechen",
btn_save_text: "Speichern"
};
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",
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",
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",
modal_custompreview_text: "Vista previa del icono",
btn_cancel_text: "Cancelar",
btn_save_text: "Guardar"
};
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",
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",
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",
modal_custompreview_text: "Aperçu de l'icône",
btn_cancel_text: "Abandonner",
btn_save_text: "Enregistrer"
};
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",
serversubmenu_removefromfolder_text: "Rimuovere il server dalla cartella",
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",
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",
modal_custompreview_text: "Icona anteprima",
btn_cancel_text: "Cancellare",
btn_save_text: "Salvare"
};
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",
serversubmenu_removefromfolder_text: "Server uit map verwijderen",
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",
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",
modal_custompreview_text: "Voorbeeld van keuze",
btn_cancel_text: "Afbreken",
btn_save_text: "Opslaan"
};
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",
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",
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",
modal_custompreview_text: "Ikon forhåndsvisning",
btn_cancel_text: "Avbryte",
btn_save_text: "Lagre"
};
case "pl": //polish
return {
toast_addserver_text: "${servername} został dodany do folderu${foldername}.",
toast_removeserver_text: "${servername} został usunięty z folderu${foldername}.",
servercontext_serverfolders_text: "Foldery serwera",
serversubmenu_createfolder_text: "Utwórz folder",
serversubmenu_removefromfolder_text: "Usuń serwer z folderu",
foldercontext_unreadfolder_text: "Oznacz wszystkie jako przeczytane",
foldercontext_autounreadfolder_text: "Auto: Oznacz jako przeczytane",
foldercontext_foldersettings_text: "Ustawienia folderu",
foldercontext_removefolder_text: "Usuń folder",
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",
modal_colorpicker1_text: "Podstawowy kolor folderu",
modal_colorpicker2_text: "Drugorzędny kolor folderu",
modal_colorpicker3_text: "Kolor podpowiedzi",
modal_colorpicker4_text: "Kolor czcionki",
modal_customopen_text: "Otwarta ikona",
modal_customclosed_text: "Zamknięta ikona",
modal_custompreview_text: "Podgląd ikony",
btn_cancel_text: "Anuluj",
btn_save_text: "Zapisz"
};
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",
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",
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",
modal_custompreview_text: "Pré-visualização de ícones",
btn_cancel_text: "Cancelar",
btn_save_text: "Salvar"
};
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",
serversubmenu_removefromfolder_text: "Poista palvelin kansioista",
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",
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",
modal_custompreview_text: "Kuvakkeen esikatselu",
btn_cancel_text: "Peruuttaa",
btn_save_text: "Tallentaa"
};
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",
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",
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",
modal_custompreview_text: "Ikon förhandsvisning",
btn_cancel_text: "Avbryta",
btn_save_text: "Spara"
};
case "tr": //turkish
return {
toast_addserver_text: "${servername} klasörü${foldername} eklendi.",
toast_removeserver_text: "${servername} klasörü${foldername} kaldırıldı",
servercontext_serverfolders_text: "Sunucu klasörleri",
serversubmenu_createfolder_text: "Klasör oluşturun",
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ı",
foldercontext_removefolder_text: "Klasörü sil",
modal_header_text: "Klasör Ayarları",
modal_foldername_text: "Klasör adı",
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",
modal_colorpicker1_text: "Birincil klasör rengi",
modal_colorpicker2_text: "İkincil klasör rengi",
modal_colorpicker3_text: "Tooltip rengi",
modal_colorpicker4_text: "Yazı rengi",
modal_customopen_text: "Açılmış simge",
modal_customclosed_text: "Kapalı simge",
modal_custompreview_text: "Simge önizleme",
btn_cancel_text: "Iptal",
btn_save_text: "Kayıt"
};
case "cs": //czech
return {
toast_addserver_text: "${servername} byl přidán do složky${foldername}.",
toast_removeserver_text: "${servername} byl odstraněn ze složky${foldername}.",
servercontext_serverfolders_text: "Složky serveru",
serversubmenu_createfolder_text: "Vytvořit složky",
serversubmenu_removefromfolder_text: "Odstranit server ze složky",
foldercontext_unreadfolder_text: "Označit vše jako přečtené",
foldercontext_autounreadfolder_text: "Auto: Označit jako přečtené",
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",
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",
modal_customopen_text: "Otevřená ikona",
modal_customclosed_text: "Uzavřená ikona",
modal_custompreview_text: "Náhled ikony",
btn_cancel_text: "Zrušení",
btn_save_text: "Uložit"
};
case "bg": //bulgarian
return {
toast_addserver_text: "${servername} е добавен към папката${foldername}.",
toast_removeserver_text: "${servername} е премахнат от папката${foldername}.",
servercontext_serverfolders_text: "Сървърни папки",
serversubmenu_createfolder_text: "Създай папка",
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: "Избор на папки",
modal_colorpicker1_text: "Цвят основнен на папка",
modal_colorpicker2_text: "цвят вторичен на папка",
modal_colorpicker3_text: "Цвят на подсказка",
modal_colorpicker4_text: "Цвят на шрифта",
modal_customopen_text: "Отворена икона",
modal_customclosed_text: "Затворена икона",
modal_custompreview_text: "Икона Преглед",
btn_cancel_text: "Зъбести",
btn_save_text: "Cпасяване"
};
case "ru": //russian
return {
toast_addserver_text: "${servername} добавлен в папку${foldername}.",
toast_removeserver_text: "${servername} был удален из папки${foldername}.",
servercontext_serverfolders_text: "Папки сервера",
serversubmenu_createfolder_text: "Создать папки",
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: "Выбор папки",
modal_colorpicker1_text: "Цвет основной папки",
modal_colorpicker2_text: "Цвет вторичной папки",
modal_colorpicker3_text: "Цвет подсказка",
modal_colorpicker4_text: "Цвет шрифта",
modal_customopen_text: "Открытая иконка",
modal_customclosed_text: "Закрытая иконка",
modal_custompreview_text: "Иконка Просмотр",
btn_cancel_text: "Отмена",
btn_save_text: "Cпасти"
};
case "uk": //ukrainian
return {
toast_addserver_text: "${servername} було додано до папки${foldername}.",
toast_removeserver_text: "${servername} був вилучений з папки${foldername}.",
servercontext_serverfolders_text: "Папки сервера",
serversubmenu_createfolder_text: "Створити папки",
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: "Вибір папки",
modal_colorpicker1_text: "Колір основної папки",
modal_colorpicker2_text: "Колір вторинного папки",
modal_colorpicker3_text: "Колір підказка",
modal_colorpicker4_text: "Колір шрифту",
modal_customopen_text: "Відкрита ікона",
modal_customclosed_text: "Закрита ікона",
modal_custompreview_text: "Піктограма попереднього перегляду",
btn_cancel_text: "Скасувати",
btn_save_text: "Зберегти"
};
case "ja": //japanese
return {
toast_addserver_text: "${servername} がフォルダ${foldername} に追加されました。",
toast_removeserver_text: "${servername} がフォルダ${foldername} から削除されました。",
servercontext_serverfolders_text: "サーバーフォルダ",
serversubmenu_createfolder_text: "フォルダーを作る",
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: "フォルダの選択",
modal_colorpicker1_text: "プライマリフォルダの色",
modal_colorpicker2_text: "セカンダリフォルダの色",
modal_colorpicker3_text: "ツールチップの色",
modal_colorpicker4_text: "フォントの色",
modal_customopen_text: "開いたアイコン",
modal_customclosed_text: "クローズドアイコン",
modal_custompreview_text: "アイコンのプレビュー",
btn_cancel_text: "キャンセル",
btn_save_text: "セーブ"
};
case "zh-TW": //chinese (traditional)
return {
toast_addserver_text: "${servername} 已被添加到文件夾${foldername}.",
toast_removeserver_text: "${servername} 已從文件夾${foldername} 中刪除.",
servercontext_serverfolders_text: "服務器文件夾",
serversubmenu_createfolder_text: "創建文件夾",
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: "文件夾選擇",
modal_colorpicker1_text: "主文件夾顏色",
modal_colorpicker2_text: "輔助文件夾顏色",
modal_colorpicker3_text: "工具提示顏色",
modal_colorpicker4_text: "字體顏色",
modal_customopen_text: "打開的圖標",
modal_customclosed_text: "封閉的圖標",
modal_custompreview_text: "圖標預覽",
btn_cancel_text: "取消",
btn_save_text: "保存"
};
case "ko": //korean
return {
toast_addserver_text: "${servername} 가 폴더${foldername} 에 추가되었습니다.",
toast_removeserver_text: "${servername} 가 폴더${foldername} 에서 제거되었습니다.",
servercontext_serverfolders_text: "서버 폴더",
serversubmenu_createfolder_text: "폴더 만들기",
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: "폴더 선택",
modal_colorpicker1_text: "기본 폴더 색",
modal_colorpicker2_text: "보조 폴더 색",
modal_colorpicker3_text: "툴팁 색깔",
modal_colorpicker4_text: "글꼴 색깔",
modal_customopen_text: "열린 아이콘",
modal_customclosed_text: "닫힌 아이콘",
modal_custompreview_text: "아이콘 미리보기",
btn_cancel_text: "취소",
btn_save_text: "저장"
};
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",
serversubmenu_removefromfolder_text: "Remove Server From Folder",
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",
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",
modal_custompreview_text: "Iconpreview",
btn_cancel_text: "Cancel",
btn_save_text: "Save"
};
}
}
}
};