From 340546c975bca94526a3e16039895a6d0600828b Mon Sep 17 00:00:00 2001 From: alecpl Date: Tue, 31 May 2011 07:38:56 +0000 Subject: - 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 --- program/js/app.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'program/js/app.js') 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); -- cgit v1.2.3