diff options
author | alecpl <alec@alec.pl> | 2011-05-31 07:38:56 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-05-31 07:38:56 +0000 |
commit | 340546c975bca94526a3e16039895a6d0600828b (patch) | |
tree | 06d6256f1f444557068e107128575d775e447924 /program/js/app.js | |
parent | 644e3ad91250c0cb7b291b48e3b5cef401bffd90 (diff) |
- Optimization for spellcheck_before_send: don't invoke new ajax request. While we already have mispellings, we can return them and enable spellchecker directly without querying the server again
Diffstat (limited to 'program/js/app.js')
-rw-r--r-- | program/js/app.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js index 5f5473a1b..32d7a6332 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3018,6 +3018,24 @@ function rcube_webmail() } }; + // resume spellchecking, highlight provided mispellings without new ajax request + this.spellcheck_resume = function(ishtml, data) + { + if (ishtml) { + var ed = tinyMCE.get(this.env.composebody); + sp = ed.plugins.spellchecker; + + sp.active = 1; + sp._markWords(data); + ed.nodeChanged(); + } + else { + var sp = this.env.spellcheck; + sp.prepare(false, true); + sp.processData(data); + } + } + this.set_draft_id = function(id) { $("input[name='_draft_saveid']").val(id); |