Changed colorpicker
This commit is contained in:
parent
eb4dedb566
commit
2f044b06f9
File diff suppressed because one or more lines are too long
|
@ -473,11 +473,4 @@ class ChatAliases {
|
|||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
replaceWord (string, regex) {
|
||||
let result = regex.exec(string), rest = "";
|
||||
if (result) {
|
||||
rest = string.slice(a.indexOf(b)+b.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,9 +59,7 @@ class EditChannels {
|
|||
<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.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -86,7 +84,7 @@ class EditChannels {
|
|||
|
||||
getDescription () {return "Allows you to rename and recolor channelnames.";}
|
||||
|
||||
getVersion () {return "3.7.6";}
|
||||
getVersion () {return "3.7.7";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -283,7 +281,7 @@ class EditChannels {
|
|||
channelSettingsModal.find(BDFDB.dotCN.modalguildname).text(info.name);
|
||||
channelSettingsModal.find("#input-channelname").val(name);
|
||||
channelSettingsModal.find("#input-channelname").attr("placeholder", info.name);
|
||||
BDFDB.setColorSwatches(color, channelSettingsModal.find(".swatches1"), "swatch1");
|
||||
BDFDB.setColorSwatches(channelSettingsModal, color);
|
||||
BDFDB.appendModal(channelSettingsModal);
|
||||
channelSettingsModal
|
||||
.on("click", ".btn-save", (event) => {
|
||||
|
@ -296,14 +294,14 @@ class EditChannels {
|
|||
}
|
||||
}
|
||||
|
||||
color = BDFDB.getSwatchColor("swatch1");
|
||||
color = BDFDB.getSwatchColor(channelSettingsModal, 1);
|
||||
if (color) {
|
||||
if (color[0] < 30 && color[1] < 30 && color[2] < 30) BDFDB.colorCHANGE(color, 30);
|
||||
else if (color[0] > 225 && color[1] > 225 && color[2] > 225) BDFDB.colorCHANGE(color, -30);
|
||||
}
|
||||
|
||||
if (name == null && color == null) {
|
||||
this.removeChannelData(info.id);
|
||||
this.removeChannelData(info);
|
||||
}
|
||||
else {
|
||||
BDFDB.saveData(info.id, {name,color}, this, "channels");
|
||||
|
|
|
@ -83,29 +83,21 @@ class EditServers {
|
|||
<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.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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 class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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 class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -124,7 +116,7 @@ class EditServers {
|
|||
|
||||
getDescription () {return "Allows you to change the icon, name and color of servers.";}
|
||||
|
||||
getVersion () {return "1.8.6";}
|
||||
getVersion () {return "1.8.7";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -310,10 +302,10 @@ class EditServers {
|
|||
serverSettingsModal.find("#input-serverurl").addClass(url ? "valid" : "");
|
||||
serverSettingsModal.find("#input-serverurl").prop("disabled", removeIcon);
|
||||
serverSettingsModal.find("#input-removeicon").prop("checked", removeIcon);
|
||||
BDFDB.setColorSwatches(color1, serverSettingsModal.find(".swatches1"), "swatch1");
|
||||
BDFDB.setColorSwatches(color2, serverSettingsModal.find(".swatches2"), "swatch2");
|
||||
BDFDB.setColorSwatches(color3, serverSettingsModal.find(".swatches3"), "swatch3");
|
||||
BDFDB.setColorSwatches(color4, serverSettingsModal.find(".swatches4"), "swatch4");
|
||||
BDFDB.setColorSwatches(serverSettingsModal, color1);
|
||||
BDFDB.setColorSwatches(serverSettingsModal, color2);
|
||||
BDFDB.setColorSwatches(serverSettingsModal, color3);
|
||||
BDFDB.setColorSwatches(serverSettingsModal, color4);
|
||||
BDFDB.appendModal(serverSettingsModal);
|
||||
serverSettingsModal
|
||||
.on("click", "#input-removeicon", (event) => {
|
||||
|
@ -358,10 +350,10 @@ class EditServers {
|
|||
}
|
||||
}
|
||||
|
||||
color1 = BDFDB.getSwatchColor("swatch1");
|
||||
color2 = BDFDB.getSwatchColor("swatch2");
|
||||
color3 = BDFDB.getSwatchColor("swatch3");
|
||||
color4 = BDFDB.getSwatchColor("swatch4");
|
||||
color1 = BDFDB.getSwatchColor(serverSettingsModal, 1);
|
||||
color2 = BDFDB.getSwatchColor(serverSettingsModal, 2);
|
||||
color3 = BDFDB.getSwatchColor(serverSettingsModal, 3);
|
||||
color4 = BDFDB.getSwatchColor(serverSettingsModal, 4);
|
||||
|
||||
if (name == null && shortName == null && url == null && !removeIcon && color1 == null && color2 == null && color3 == null && color4 == null) {
|
||||
this.removeServerData(info.id);
|
||||
|
@ -402,10 +394,10 @@ class EditServers {
|
|||
createNoticeTooltip (e) {
|
||||
$(BDFDB.dotCN.tooltips).find(".notice-tooltip").remove();
|
||||
|
||||
var input = e.target;
|
||||
var disabled = $(input).prop("disabled");
|
||||
var valid = $(input).hasClass("valid");
|
||||
var invalid = $(input).hasClass("invalid");
|
||||
var input = e.currentTarget;
|
||||
var disabled = input.disabled;
|
||||
var valid = input.classList.contains("valid");
|
||||
var invalid = input.classList.contains("invalid");
|
||||
if (disabled || valid || invalid) {
|
||||
var text = disabled ? this.labels.modal_ignoreurl_text : valid ? this.labels.modal_validurl_text : this.labels.modal_invalidurl_text;
|
||||
var bgColor = disabled ? "#282524" : valid ? "#297828" : "#8C2528";
|
||||
|
|
|
@ -112,29 +112,21 @@ class EditUsers {
|
|||
<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.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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 class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></div>
|
||||
</div>
|
||||
<div tab="tag" 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.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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 class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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: 1 1 auto;">REPLACE_modal_ignoretagcolor_text</h3>
|
||||
<div class="${BDFDB.disCNS.flexchild + BDFDB.disCNS.switchenabled + BDFDB.disCNS.switch + BDFDB.disCNS.switchvalue + BDFDB.disCNS.switchsizedefault + BDFDB.disCNS.switchsize + BDFDB.disCN.switchthemedefault}" style="flex: 0 0 auto;">
|
||||
|
@ -177,7 +169,7 @@ class EditUsers {
|
|||
|
||||
getDescription () {return "Allows you to change the icon, name, tag and color of users. Does not work in compact mode.";}
|
||||
|
||||
getVersion () {return "2.4.6";}
|
||||
getVersion () {return "2.4.7";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -553,7 +545,7 @@ class EditUsers {
|
|||
var tag = data ? data.tag : null;
|
||||
var url = data ? data.url : null;
|
||||
var removeIcon = data ? data.removeIcon : false;
|
||||
var ignoreTagColor = data && data.ignoreTagColor ? data.ignoreTagColor : false;
|
||||
var ignoreTagColor = data ? data.ignoreTagColor : false;
|
||||
var color1 = data ? data.color1 : null;
|
||||
var color2 = data ? data.color2 : null;
|
||||
var color3 = data ? data.color3 : null;
|
||||
|
@ -571,19 +563,19 @@ class EditUsers {
|
|||
userSettingsModal.find("#input-userurl").addClass(url ? "valid" : "");
|
||||
userSettingsModal.find("#input-userurl").prop("disabled", removeIcon);
|
||||
userSettingsModal.find("#input-removeicon").prop("checked", removeIcon);
|
||||
userSettingsModal.find(".swatches3, .swatches4").toggleClass("disabled", ignoreTagColor);
|
||||
userSettingsModal.find(".swatches[swatchnr='3'], .swatches[swatchnr='4']").toggleClass("disabled", ignoreTagColor);
|
||||
userSettingsModal.find("#input-ignoretagcolor").prop("checked", ignoreTagColor);
|
||||
BDFDB.setColorSwatches(color1, userSettingsModal.find(".swatches1"), "swatch1");
|
||||
BDFDB.setColorSwatches(color2, userSettingsModal.find(".swatches2"), "swatch2");
|
||||
BDFDB.setColorSwatches(color3, userSettingsModal.find(".swatches3"), "swatch3");
|
||||
BDFDB.setColorSwatches(color4, userSettingsModal.find(".swatches4"), "swatch4");
|
||||
BDFDB.setColorSwatches(userSettingsModal, color1);
|
||||
BDFDB.setColorSwatches(userSettingsModal, color2);
|
||||
BDFDB.setColorSwatches(userSettingsModal, color3);
|
||||
BDFDB.setColorSwatches(userSettingsModal, color4);
|
||||
BDFDB.appendModal(userSettingsModal);
|
||||
userSettingsModal
|
||||
.on("click", "#input-removeicon", (event) => {
|
||||
userSettingsModal.find("#input-userurl").prop("disabled", event.target.checked);
|
||||
userSettingsModal.find("#input-userurl").prop("disabled", event.currentTarget.checked);
|
||||
})
|
||||
.on("click", "#input-ignoretagcolor", (event) => {
|
||||
userSettingsModal.find(".swatches3, .swatches4").toggleClass("disabled", event.target.checked);
|
||||
userSettingsModal.find(".swatches[swatchnr='3'], .swatches[swatchnr='4']").toggleClass("disabled", event.currentTarget.checked);
|
||||
})
|
||||
.on("change keyup paste", "#input-userurl", (event) => {
|
||||
this.checkUrl(userSettingsModal, event);
|
||||
|
@ -625,10 +617,10 @@ class EditUsers {
|
|||
}
|
||||
}
|
||||
|
||||
color1 = BDFDB.getSwatchColor("swatch1");
|
||||
color2 = BDFDB.getSwatchColor("swatch2");
|
||||
color3 = BDFDB.getSwatchColor("swatch3");
|
||||
color4 = BDFDB.getSwatchColor("swatch4");
|
||||
color1 = BDFDB.getSwatchColor(userSettingsModal, 1);
|
||||
color2 = BDFDB.getSwatchColor(userSettingsModal, 2);
|
||||
color3 = BDFDB.getSwatchColor(userSettingsModal, 3);
|
||||
color4 = BDFDB.getSwatchColor(userSettingsModal, 4);
|
||||
|
||||
if (name == null && tag == null && url == null && !removeIcon && !ignoreTagColor && color1 == null && color2 == null && color3 == null && color4 == null) {
|
||||
BDFDB.removeData(info.id, this, "users")
|
||||
|
@ -669,10 +661,10 @@ class EditUsers {
|
|||
createNoticeTooltip (e) {
|
||||
$(BDFDB.dotCN.tooltips).find(".notice-tooltip").remove();
|
||||
|
||||
var input = e.target;
|
||||
var disabled = $(input).prop("disabled");
|
||||
var valid = $(input).hasClass("valid");
|
||||
var invalid = $(input).hasClass("invalid");
|
||||
var input = e.currentTarget;
|
||||
var disabled = input.disabled;
|
||||
var valid = input.classList.contains("valid");
|
||||
var invalid = input.classList.contains("invalid");
|
||||
if (disabled || valid || invalid) {
|
||||
var text = disabled ? this.labels.modal_ignoreurl_text : valid ? this.labels.modal_validurl_text : this.labels.modal_invalidurl_text;
|
||||
var bgColor = disabled ? "#282524" : valid ? "#297828" : "#8C2528";
|
||||
|
|
|
@ -192,37 +192,27 @@ class ServerFolders {
|
|||
<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 class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} icons" style="flex: 1 1 auto;"></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.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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 class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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 class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.aligncenter + BDFDB.disCNS.nowrap + BDFDB.disCN.marginbottom8} swatches" style="flex: 1 1 auto;"></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;">
|
||||
|
@ -314,7 +304,7 @@ class ServerFolders {
|
|||
|
||||
getDescription () {return "Adds the feature to create folders to organize your servers. Right click a server > 'Serverfolders' > 'Create Server' to create a server. To add servers to a folder hold 'Ctrl' and drag the server onto the folder, this will add the server to the folderlist and hide it in the serverlist. To open a folder click the folder. A folder can only be opened when it has at least one server in it. To remove a server from a folder, open the folder and either right click the server > 'Serverfolders' > 'Remove Server from Folder' or hold 'Del' and click the server in the folderlist.";}
|
||||
|
||||
getVersion () {return "5.8.7";}
|
||||
getVersion () {return "5.8.8";}
|
||||
|
||||
getAuthor () {return "DevilBro";}
|
||||
|
||||
|
@ -851,11 +841,11 @@ class ServerFolders {
|
|||
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");
|
||||
this.setIcons(folderSettingsModal, iconID);
|
||||
BDFDB.setColorSwatches(folderSettingsModal, color1);
|
||||
BDFDB.setColorSwatches(folderSettingsModal, color2);
|
||||
BDFDB.setColorSwatches(folderSettingsModal, color3);
|
||||
BDFDB.setColorSwatches(folderSettingsModal, color4);
|
||||
BDFDB.appendModal(folderSettingsModal);
|
||||
folderSettingsModal
|
||||
.on("change", "input[type='file'][option]", (e) => {
|
||||
|
@ -878,10 +868,10 @@ class ServerFolders {
|
|||
|
||||
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");
|
||||
color1 = BDFDB.getSwatchColor(folderSettingsModal, 1);
|
||||
color2 = BDFDB.getSwatchColor(folderSettingsModal, 2);
|
||||
color3 = BDFDB.getSwatchColor(folderSettingsModal, 3);
|
||||
color4 = BDFDB.getSwatchColor(folderSettingsModal, 4);
|
||||
|
||||
if (iconID != data.iconID || !BDFDB.equals(color1, data.color1) || !BDFDB.equals(color2, data.color2)) {
|
||||
var folderIcons = this.loadAllIcons();
|
||||
|
@ -948,18 +938,20 @@ class ServerFolders {
|
|||
};
|
||||
}
|
||||
|
||||
setIcons (selection, wrapper) {
|
||||
wrapper.find(".ui-icon-picker-icon").remove();
|
||||
setIcons (container, selection) {
|
||||
let wrapper = BDFDB.$(container).find(".icons:not('[iconsnr]')").first();
|
||||
if (!wrapper.length) return;
|
||||
wrapper.attr("iconsnr", parseInt(BDFDB.$(container).find(".icons[iconsnr]").length + 1)).find(".ui-icon-picker-icon").remove();
|
||||
|
||||
var folderIcons = this.loadAllIcons();
|
||||
let 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;">
|
||||
let 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.disCNS.nowrap + BDFDB.disCN.margintop4}" style="flex: 1 1 auto;">
|
||||
<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.flex2 + BDFDB.disCNS.horizontal + BDFDB.disCNS.horizontal2 + BDFDB.disCNS.directionrow + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCN.wrap} ui-icon-picker-row" style="flex: 1 1 auto; display: flex; flex-wrap: wrap; overflow: visible !important;">
|
||||
${Object.getOwnPropertyNames(folderIcons).map(id => `<div class="ui-icon-picker-icon${folderIcons[id].customID ? ' custom' : ''}" value="${id}"><div class="ui-picker-inner" style="background-image: url(${folderIcons[id].closedicon});"></div>${folderIcons[id].customID ? '<div value="' + id + '" class="' + BDFDB.disCN.hovercardbutton + '"></div>' : ''}</div>`).join("")}
|
||||
</div>
|
||||
</div>`;
|
||||
$(icons).appendTo(wrapper);
|
||||
wrapper.append(icons);
|
||||
|
||||
if (!folderIcons[selection]) {
|
||||
selection = 0;
|
||||
|
@ -1083,7 +1075,7 @@ class ServerFolders {
|
|||
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"));
|
||||
this.setIcons(modal, modal.querySelector(".ui-icon-picker-icon.selected").getAttribute("value"));
|
||||
}
|
||||
else {
|
||||
BDFDB.showToast(`Add an image for the open and the closed icon.`, {type:"danger"});
|
||||
|
|
Loading…
Reference in New Issue