stuff
This commit is contained in:
parent
99ad6e2aab
commit
e269756d69
|
@ -1222,7 +1222,7 @@ module.exports = (_ => {
|
||||||
}, timeout);
|
}, timeout);
|
||||||
BDFDB.TimeUtils.timeout(_ => {BDFDB.DOMUtils.removeClass(data.toast, BDFDB.disCN.toastopening);});
|
BDFDB.TimeUtils.timeout(_ => {BDFDB.DOMUtils.removeClass(data.toast, BDFDB.disCN.toastopening);});
|
||||||
data.toast.close = _ => {
|
data.toast.close = _ => {
|
||||||
clearTimeout(closeTimeout);
|
BDFDB.TimeUtils.clear(closeTimeout);
|
||||||
if (document.contains(data.toast)) {
|
if (document.contains(data.toast)) {
|
||||||
BDFDB.DOMUtils.addClass(data.toast, BDFDB.disCN.toastclosing);
|
BDFDB.DOMUtils.addClass(data.toast, BDFDB.disCN.toastclosing);
|
||||||
data.toast.style.setProperty("pointer-events", "none", "important");
|
data.toast.style.setProperty("pointer-events", "none", "important");
|
||||||
|
|
|
@ -14,13 +14,8 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "SpellCheck",
|
"name": "SpellCheck",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "1.5.4",
|
"version": "1.5.5",
|
||||||
"description": "Add a Spellcheck to all Textareas. Select a Word and Right Click it to add it to your Dictionary"
|
"description": "Add a Spellcheck to all Textareas. Select a Word and Right Click it to add it to your Dictionary"
|
||||||
},
|
|
||||||
"changeLog": {
|
|
||||||
"improved": {
|
|
||||||
"New Toast API": ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -201,8 +196,8 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSlateContextMenu (e) {
|
onSlateContextMenu (e) {
|
||||||
let [SCparent, SCindex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "spellcheck", group: true});
|
let [removeParent, removeIndex] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "spellcheck", group: true});
|
||||||
if (SCindex > -1) SCparent.splice(SCindex, 1);
|
if (removeIndex > -1) removeParent.splice(removeIndex, 1);
|
||||||
let textarea = BDFDB.DOMUtils.getParent(BDFDB.dotCN.textarea, e.instance.props.target), word = null;
|
let textarea = BDFDB.DOMUtils.getParent(BDFDB.dotCN.textarea, e.instance.props.target), word = null;
|
||||||
if (textarea) for (let error of textarea.parentElement.querySelectorAll(BDFDB.dotCN._spellcheckerror)) {
|
if (textarea) for (let error of textarea.parentElement.querySelectorAll(BDFDB.dotCN._spellcheckerror)) {
|
||||||
let rects = BDFDB.DOMUtils.getRects(error);
|
let rects = BDFDB.DOMUtils.getRects(error);
|
||||||
|
@ -347,10 +342,10 @@ module.exports = (_ => {
|
||||||
}, 500);
|
}, 500);
|
||||||
languageToasts[key].lang = lang
|
languageToasts[key].lang = lang
|
||||||
|
|
||||||
let folder = BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), "dictionaries");
|
const folder = BDFDB.LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), "dictionaries");
|
||||||
let filePath = BDFDB.LibraryRequires.path.join(folder, lang + ".dic");
|
const filePath = BDFDB.LibraryRequires.path.join(folder, lang + ".dic");
|
||||||
|
|
||||||
let parse = (error, response, body, download) => {
|
const parse = (error, response, body, download) => {
|
||||||
this.killLanguageToast(key);
|
this.killLanguageToast(key);
|
||||||
if (error || (response && body.toLowerCase().indexOf("<!doctype html>") > -1)) {
|
if (error || (response && body.toLowerCase().indexOf("<!doctype html>") > -1)) {
|
||||||
BDFDB.NotificationUtils.toast(this.labels.toast_dictionary_fail.replace("{{var0}}", this.getLanguageName(languages[lang])), {
|
BDFDB.NotificationUtils.toast(this.labels.toast_dictionary_fail.replace("{{var0}}", this.getLanguageName(languages[lang])), {
|
||||||
|
@ -399,7 +394,7 @@ module.exports = (_ => {
|
||||||
killLanguageToast (key) {
|
killLanguageToast (key) {
|
||||||
if (languageToasts[key]) {
|
if (languageToasts[key]) {
|
||||||
BDFDB.TimeUtils.clear(languageToasts[key].interval);
|
BDFDB.TimeUtils.clear(languageToasts[key].interval);
|
||||||
languageToasts[key].close == "function" && languageToasts[key].close();
|
languageToasts[key].close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue