From f56e70bd049bde916c368f3f79df702a73ad63db Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 28 May 2014 15:19:49 +0200 Subject: TinyMCE4: Fix spellchecker resume --- program/js/app.js | 8 +++----- program/steps/mail/sendmail.inc | 8 +++++++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'program') diff --git a/program/js/app.js b/program/js/app.js index b0b2cb15c..b88ed28c3 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3592,11 +3592,9 @@ function rcube_webmail() { if (ishtml) { var ed = tinymce.get(this.env.composebody); - sp = ed.plugins.spellchecker; - - sp.active = 1; - sp._markWords(data); - ed.nodeChanged(); + ed.settings.spellchecker_callback = function(name, text, done, error) { done(data); }; + ed.execCommand('mceSpellCheck'); + ed.settings.spellchecker_callback = null; } else { var sp = this.env.spellcheck; diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 5bddc249a..2255acc13 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -301,7 +301,13 @@ if (!$savedraft) { $COMPOSE['spell_checked'] = true; if (!$spell_result) { - $result = $isHtml ? $spellchecker->get_words() : $spellchecker->get_xml(); + if ($isHtml) { + $result['words'] = $spellchecker->get(); + $result['dictionary'] = (bool) $RCMAIL->config->get('spellcheck_dictionary'); + } + else { + $result = $spellchecker->get_xml(); + } $OUTPUT->show_message('mispellingsfound', 'error'); $OUTPUT->command('spellcheck_resume', $isHtml, $result); -- cgit v1.2.3