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/steps | |
| 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/steps')
| -rw-r--r-- | roundcubemail/program/steps/mail/sendmail.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc index 80543041a..91d71a74f 100644 --- a/roundcubemail/program/steps/mail/sendmail.inc +++ b/roundcubemail/program/steps/mail/sendmail.inc @@ -411,7 +411,7 @@ if (!$savedraft) { // Check spelling before send if ($CONFIG['spellcheck_before_send'] && $CONFIG['enable_spellcheck'] - && empty($_SESSION['compose']['spell_checked']) + && empty($_SESSION['compose']['spell_checked']) && !empty($message_body) ) { $spellchecker = new rcube_spellchecker(get_input_value('_lang', RCUBE_INPUT_GPC)); $spell_result = $spellchecker->check($message_body, $isHtml); @@ -419,8 +419,9 @@ if (!$savedraft) { $_SESSION['compose']['spell_checked'] = true; if (!$spell_result) { + $result = $isHtml ? $spellchecker->get_words() : $spellchecker->get_xml(); $OUTPUT->show_message('mispellingsfound', 'error'); - $OUTPUT->command('command', 'spellcheck'); + $OUTPUT->command('spellcheck_resume', $isHtml, $result); $OUTPUT->send('iframe'); } } |
