// Variables defaulting to empty/false:
// auto_save_interval, button_pressed, compose_cursor, dbtext,
// editor_on, mp_padding, resizebcc, resizecc, resizeto, row_height,
- // sbtext, uploading
+ // sbtext, skip_spellcheck, spellcheck, uploading
last_msg: '',
textarea_ready: true,
var db, params, sb,
c = $('compose');
- if (DIMP.SpellCheckerObject) {
+ if (DIMP.SpellCheckerObject &&
+ DIMP.SpellCheckerObject.isActive()) {
DIMP.SpellCheckerObject.resume();
+ this.skip_spellcheck = true;
if (!this.textarea_ready) {
this.uniqueSubmit.bind(this, action).defer();
return;
}
}
- c.setStyle({ cursor: 'wait' });
-
if (action == 'send_message' || action == 'save_draft') {
this.button_pressed = true;
return;
}
+ if (!this.skip_spellcheck &&
+ DIMP.conf_compose.spellcheck &&
+ DIMP.SpellCheckerObject &&
+ !DIMP.SpellCheckerObject.isActive()) {
+ DIMP.SpellCheckerObject.spellCheck(this.onNoSpellError.bind(this, action));
+ return;
+ }
+
if (!this.sbtext) {
sb = $('send_button');
this.sbtext = sb.getText();
return;
}
}
+
+ c.setStyle({ cursor: 'wait' });
+ this.skip_spellcheck = false;
$('action').setValue(action);
if (action == 'add_attachment') {
DimpCore.showNotifications(r.msgs);
},
+ onNoSpellError: function(action)
+ {
+ this.skip_spellcheck = true;
+ this.uniqueSubmit(action);
+ },
+
toggleHtmlEditor: function(noupdate)
{
if (!DIMP.conf_compose.rte_avail) {
'attach_limit' => ($conf['compose']['attach_count_limit'] ? intval($conf['compose']['attach_count_limit']) : -1),
'close_draft' => $prefs->getValue('close_draft'),
'compose_cursor' => ($compose_cursor ? $compose_cursor : 'top'),
-
+ 'spellcheck' => intval($prefs->getValue('compose_spellcheck')),
);
if ($registry->hasMethod('contacts/search')) {