Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions TinyMCE5/languagetool/include/languagetool.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
var LanguageTool = function LanguageTool(lt_set,$) {

// Declare Variables
var lt_localstorage = lt_set['lt_localstorage'];
var ignore = lt_localstorage && localStorage[lt_localstorage] ? JSON.parse(localStorage[lt_localstorage]) : { once:{}, all:{}, rule:{}, categories:{} };

var sgevent = {}; // Events that can be called
var sgfunc = {}; // Store functions
var sgcheck = {}; // Active storage of changes
var sgdocevents = {}; // Events called on document
var sgewinevents={}; // Events caleld on editor window
var sgstore = { html:{}, text:{}, obj:{}, lt:{}, lock:{}, run:[], contextmenu:{}, ignore:{ once:{}, all:{}, rule:{}, categories:{}}, queue:[[],[],[]], dqueue:{}, iaqueue:{}, progress:[0,0,0,0], issues:{}, viewport_process:'disabled', enabled: true }; // Universal Storage
var sgstore = { html:{}, text:{}, obj:{}, lt:{}, lock:{}, run:[], contextmenu:{}, ignore:ignore, queue:[[],[],[]], dqueue:{}, iaqueue:{}, progress:[0,0,0,0], issues:{}, viewport_process:'disabled', enabled: true }; // Universal Storage
var timerRunner = 0; // Timer coundown for remote url (counts upwards though)
var lastActive=0; // Last activity for hibernation
var lastRun=0; // Keep track of when time last ran in epoch
Expand Down Expand Up @@ -55,8 +58,8 @@ var LanguageTool = function LanguageTool(lt_set,$) {

sgstore.viewport_process = lt_set['lt_viewport_process'] || 'disabled';

sgstore['ignore']['all']=lt_set['lt_ignore_words'] || {};
sgstore['ignore']['rule']=lt_set['lt_ignore_rules'] || {};
Object.assign(sgstore['ignore']['all'], lt_set['lt_ignore_words'] || {});
Object.assign(sgstore['ignore']['rule'], lt_set['lt_ignore_rules'] || {});


lt_setHighlight['misspelling'] = lt_setHighlight['misspelling'] || "hlr1";
Expand Down Expand Up @@ -1641,7 +1644,10 @@ sgfunc['confirm'].call(this,'Are you sure you wish to ignore this rule going for
});

}


if (lt_localstorage) {
localStorage[lt_localstorage] = JSON.stringify(sgstore.ignore);
}

}

Expand Down