mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-06 17:44:27 -06:00
Update CodeMirror Spell Checker to v1.0.5
This commit is contained in:
parent
8754f008fd
commit
438b3ef531
@ -1,12 +1,16 @@
|
|||||||
CodeMirror.defineMode("spell-checker", function(config, parserConfig) {
|
// Initialize data globally to reduce memory consumption
|
||||||
// Initialize data
|
|
||||||
var num_loaded = 0;
|
var num_loaded = 0;
|
||||||
|
var aff_loading = false;
|
||||||
|
var dic_loading = false;
|
||||||
var aff_data = "";
|
var aff_data = "";
|
||||||
var dic_data = "";
|
var dic_data = "";
|
||||||
var typo;
|
var typo;
|
||||||
|
|
||||||
|
|
||||||
|
CodeMirror.defineMode("spell-checker", function(config, parserConfig) {
|
||||||
// Load AFF/DIC data
|
// Load AFF/DIC data
|
||||||
|
if(!aff_loading){
|
||||||
|
aff_loading = true;
|
||||||
var xhr_aff = new XMLHttpRequest();
|
var xhr_aff = new XMLHttpRequest();
|
||||||
xhr_aff.open("GET", "https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff", true);
|
xhr_aff.open("GET", "https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff", true);
|
||||||
xhr_aff.onload = function (e) {
|
xhr_aff.onload = function (e) {
|
||||||
@ -22,7 +26,10 @@ CodeMirror.defineMode("spell-checker", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr_aff.send(null);
|
xhr_aff.send(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!dic_loading){
|
||||||
|
dic_loading = true;
|
||||||
var xhr_dic = new XMLHttpRequest();
|
var xhr_dic = new XMLHttpRequest();
|
||||||
xhr_dic.open("GET", "https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic", true);
|
xhr_dic.open("GET", "https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic", true);
|
||||||
xhr_dic.onload = function (e) {
|
xhr_dic.onload = function (e) {
|
||||||
@ -38,6 +45,8 @@ CodeMirror.defineMode("spell-checker", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr_dic.send(null);
|
xhr_dic.send(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Define what separates a word
|
// Define what separates a word
|
||||||
|
Loading…
x
Reference in New Issue
Block a user