`;
for (let config in this.defaults.configs) {
@@ -161,8 +168,6 @@ class ChatAliases {
BDFDB.loadMessage(this);
this.UploadModule = BDFDB.WebModules.findByProperties("instantBatchUpload");
- this.CurrentUserPerms = BDFDB.WebModules.findByProperties("getChannelPermissions", "can");
- this.Permissions = BDFDB.WebModules.findByProperties("Permissions", "ActivityTypes").Permissions;
this.aliases = BDFDB.loadAllData(this, "words");
@@ -188,7 +193,9 @@ class ChatAliases {
// begin of own functions
updateContainer (settingspanel, ele) {
- var action = ele.getAttribute("action"), update = () => {
+ var wordvalue = null, replacevalue = null, action = ele.getAttribute("action");
+
+ var update = () => {
BDFDB.saveAllData(this.aliases, this, "words");
var containerhtml = ``;
@@ -214,7 +221,7 @@ class ChatAliases {
}
}
else if (action == "remove") {
- var wordvalue = ele.getAttribute("word");
+ wordvalue = ele.getAttribute("word");
if (wordvalue) {
delete this.aliases[wordvalue];
update();
@@ -327,11 +334,9 @@ class ChatAliases {
}
processChannelTextArea (instance, wrapper) {
- if (instance.props && instance.props.type) {
+ if (instance.props && instance.props.channel && instance.props.type) {
var textarea = wrapper.querySelector("textarea");
if (!textarea) return;
- var channel = BDFDB.getSelectedChannel();
- if (!channel) return;
var settings = BDFDB.getAllData(this, "settings");
BDFDB.addEventListener(this, textarea, "input", () => {
if (this.format) {
@@ -344,8 +349,8 @@ class ChatAliases {
if (messageInput && messageInput.text != null) {
document.execCommand("insertText", false, messageInput.text ? messageInput.text + " " : "");
}
- if (messageInput && messageInput.files.length > 0 && (channel.type == 1 || this.CurrentUserPerms.can(this.Permissions.ATTACH_FILES, channel))) {
- this.UploadModule.instantBatchUpload(channel.id, messageInput.files);
+ if (messageInput && messageInput.files.length > 0 && (instance.props.channel.type == 1 || BDFDB.isUserAllowedTo("ATTACH_FILES"))) {
+ this.UploadModule.instantBatchUpload(instance.props.channel.id, messageInput.files);
}
}
}
@@ -387,7 +392,7 @@ class ChatAliases {
}
addAutoCompleteMenu (textarea) {
- if (textarea.parentElement.querySelector(".autocompleteAliasesRow")) return;
+ if (!textarea.value || textarea.parentElement.querySelector(".autocompleteAliasesRow") || BDFDB.getData("minAliasLength", this, "amounts") > textarea.value.length) return;
let words = textarea.value.split(/\s/);
let lastword = words[words.length-1].trim();
if (words.length == 1 && BDFDB.isPluginEnabled("WriteUpperCase")) {
diff --git a/Plugins/EmojiStatistics/EmojiStatistics.plugin.js b/Plugins/EmojiStatistics/EmojiStatistics.plugin.js
index f50f13bf7e..1635dc7f4e 100644
--- a/Plugins/EmojiStatistics/EmojiStatistics.plugin.js
+++ b/Plugins/EmojiStatistics/EmojiStatistics.plugin.js
@@ -158,7 +158,7 @@ class EmojiStatistics {
enableEmojiStatisticsButton: {value:true, description:"Add a Button in the Emojipicker to open the Statistics Overview."}
},
amounts: {
- hoverDelay: {value:1000, description:"Tooltip delay in millisec:"}
+ hoverDelay: {value:1000, min:0, description:"Tooltip delay in millisec:"}
}
};
}
@@ -172,7 +172,7 @@ class EmojiStatistics {
settingshtml += `
`;
}
for (let key in amounts) {
- settingshtml += `
`;
+ settingshtml += `
`;
}
settingshtml += `