summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-05-31 07:38:56 +0000
committeralecpl <alec@alec.pl>2011-05-31 07:38:56 +0000
commit340546c975bca94526a3e16039895a6d0600828b (patch)
tree06d6256f1f444557068e107128575d775e447924 /program/js/app.js
parent644e3ad91250c0cb7b291b48e3b5cef401bffd90 (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.js18
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);