stuff
This commit is contained in:
parent
69a64b3063
commit
58bedcf7e2
|
@ -543,13 +543,15 @@ module.exports = (_ => {
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
BDFDB.DOMUtils.removeLocalStyle(plugin.name);
|
if (BDFDB.DOMUtils) BDFDB.DOMUtils.removeLocalStyle(plugin.name);
|
||||||
BDFDB.ListenerUtils.remove(plugin);
|
if (BDFDB.ListenerUtils) BDFDB.ListenerUtils.remove(plugin);
|
||||||
BDFDB.StoreChangeUtils.remove(plugin);
|
if (BDFDB.StoreChangeUtils) BDFDB.StoreChangeUtils.remove(plugin);
|
||||||
BDFDB.ObserverUtils.disconnect(plugin);
|
if (BDFDB.ObserverUtils) BDFDB.ObserverUtils.disconnect(plugin);
|
||||||
BDFDB.PatchUtils.unpatch(plugin);
|
if (BDFDB.PatchUtils) BDFDB.PatchUtils.unpatch(plugin);
|
||||||
|
if (BDFDB.WindowUtils) {
|
||||||
BDFDB.WindowUtils.closeAll(plugin);
|
BDFDB.WindowUtils.closeAll(plugin);
|
||||||
BDFDB.WindowUtils.removeListener(plugin);
|
BDFDB.WindowUtils.removeListener(plugin);
|
||||||
|
}
|
||||||
}, "Failed to clean up plugin!", plugin.name)();
|
}, "Failed to clean up plugin!", plugin.name)();
|
||||||
};
|
};
|
||||||
BDFDB.PluginUtils.checkUpdate = function (pluginName, url) {
|
BDFDB.PluginUtils.checkUpdate = function (pluginName, url) {
|
||||||
|
@ -3098,14 +3100,13 @@ module.exports = (_ => {
|
||||||
function isRGB(comp) {return comp.slice(0, 3).every(rgb => rgb.toString().indexOf("%") == -1 && parseFloat(rgb) == parseInt(rgb));};
|
function isRGB(comp) {return comp.slice(0, 3).every(rgb => rgb.toString().indexOf("%") == -1 && parseFloat(rgb) == parseInt(rgb));};
|
||||||
function isHSL(comp) {return comp.slice(1, 3).every(hsl => hsl.toString().indexOf("%") == hsl.length - 1);};
|
function isHSL(comp) {return comp.slice(1, 3).every(hsl => hsl.toString().indexOf("%") == hsl.length - 1);};
|
||||||
};
|
};
|
||||||
BDFDB.ColorUtils.createGradient = function (colorobj, direction = "to right") {
|
BDFDB.ColorUtils.createGradient = function (colorObj, direction = "to right") {
|
||||||
var sortedgradient = {};
|
let gradientString = "linear-gradient(" + direction;
|
||||||
var gradientstring = "linear-gradient(" + direction;
|
for (let pos of Object.keys(colorObj).sort()) {
|
||||||
for (let pos of Object.keys(colorobj).sort()) {
|
let color = BDFDB.ColorUtils.convert(colorObj[pos], "RGBA");
|
||||||
let color = BDFDB.ColorUtils.convert(colorobj[pos], "RGBA");
|
gradientString += color ? `, ${color} ${pos*100}%` : ''
|
||||||
gradientstring += color ? `, ${color} ${pos*100}%` : ''
|
|
||||||
}
|
}
|
||||||
return gradientstring += ")";
|
return gradientString += ")";
|
||||||
};
|
};
|
||||||
BDFDB.ColorUtils.getSwatchColor = function (container, number) {
|
BDFDB.ColorUtils.getSwatchColor = function (container, number) {
|
||||||
if (!Node.prototype.isPrototypeOf(container)) return;
|
if (!Node.prototype.isPrototypeOf(container)) return;
|
||||||
|
|
|
@ -155,7 +155,7 @@ module.exports = (_ => {
|
||||||
for (let input of settingsPanel.querySelectorAll(".input-newquote " + BDFDB.dotCN.input)) if (!input.value || input.value.length == 0 || input.value.trim().length == 0) return BDFDB.NotificationUtils.toast("Fill out all fields to add a new quote.", {type:"danger"});
|
for (let input of settingsPanel.querySelectorAll(".input-newquote " + BDFDB.dotCN.input)) if (!input.value || input.value.length == 0 || input.value.trim().length == 0) return BDFDB.NotificationUtils.toast("Fill out all fields to add a new quote.", {type:"danger"});
|
||||||
let key = settingsPanel.querySelector(".input-name " + BDFDB.dotCN.input).value.trim();
|
let key = settingsPanel.querySelector(".input-name " + BDFDB.dotCN.input).value.trim();
|
||||||
let quote = settingsPanel.querySelector(".input-quote " + BDFDB.dotCN.input).value.trim();
|
let quote = settingsPanel.querySelector(".input-quote " + BDFDB.dotCN.input).value.trim();
|
||||||
if (formats[key]) return BDFDB.NotificationUtils.toast("A quote with the choosen name already exists. Please choose another name.", {type:"danger"});
|
if (formats[key]) return BDFDB.NotificationUtils.toast("A quote with the choosen name already exists, please choose another name", {type:"danger"});
|
||||||
else {
|
else {
|
||||||
formats[key] = quote;
|
formats[key] = quote;
|
||||||
BDFDB.DataUtils.save(formats, this, "formats");
|
BDFDB.DataUtils.save(formats, this, "formats");
|
||||||
|
@ -256,7 +256,7 @@ module.exports = (_ => {
|
||||||
format = choice;
|
format = choice;
|
||||||
if (copy || !BDFDB.LibraryModules.QuoteUtils.canQuote(e.instance.props.message, e.instance.props.channel)) {
|
if (copy || !BDFDB.LibraryModules.QuoteUtils.canQuote(e.instance.props.message, e.instance.props.channel)) {
|
||||||
BDFDB.LibraryRequires.electron.clipboard.write({text:this.parseQuote(e.instance.props.message, e.instance.props.channel)});
|
BDFDB.LibraryRequires.electron.clipboard.write({text:this.parseQuote(e.instance.props.message, e.instance.props.channel)});
|
||||||
BDFDB.NotificationUtils.toast("Quote has been copied to clipboard.", {type:"success"});
|
BDFDB.NotificationUtils.toast("Quote has been copied to clipboard", {type:"success"});
|
||||||
}
|
}
|
||||||
else BDFDB.LibraryModules.MessageManageUtils.quoteMessage(e.instance.props.channel, e.instance.props.message);
|
else BDFDB.LibraryModules.MessageManageUtils.quoteMessage(e.instance.props.channel, e.instance.props.message);
|
||||||
format = null;
|
format = null;
|
||||||
|
@ -270,7 +270,7 @@ module.exports = (_ => {
|
||||||
item = BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
item = BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
|
||||||
label: BDFDB.LanguageUtils.LanguageStrings.QUOTE,
|
label: BDFDB.LanguageUtils.LanguageStrings.QUOTE,
|
||||||
id: "quote",
|
id: "quote",
|
||||||
action: _ => {action(null, event.shiftKey);}
|
action: event => {action(null, event.shiftKey);}
|
||||||
});
|
});
|
||||||
let [unreadChildren, unreadIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "mark-unread"});
|
let [unreadChildren, unreadIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "mark-unread"});
|
||||||
unreadChildren.splice(unreadIndex > -1 ? unreadIndex - 1 : unreadChildren.length, 0, item);
|
unreadChildren.splice(unreadIndex > -1 ? unreadIndex - 1 : unreadChildren.length, 0, item);
|
||||||
|
|
Loading…
Reference in New Issue