diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-31 07:38:56 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-31 07:38:56 +0000 |
| commit | 638b7c6222892fb62291448a14f0421d026b08a3 (patch) | |
| tree | 17830fe8995bbb092d6d7765b074e7cf9b644436 /roundcubemail/program/js/app.js | |
| parent | b99d09dd1b1b7d964b9726104cd6bdd82de9cef1 (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
git-svn-id: https://svn.roundcube.net/trunk@4818 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/app.js')
| -rw-r--r-- | roundcubemail/program/js/app.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index 5f5473a1b..32d7a6332 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/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); |
