/* Delete existing draft. */
_removeAutoSaveDraft($old_index);
- if ($action != 'auto_save_draft') {
+ if ($action == 'auto_save_draft') {
+ $notification->push(_("Draft automatically saved."), 'horde.message');
+ } else {
$notification->push($res);
}
} catch (IMP_Compose_Exception $e) {
}
// Set auto-save-drafts now if not already active.
- if (DIMP.conf_compose.auto_save_interval_val && !this.auto_save_interval) {
+ if (DIMP.conf_compose.auto_save_interval_val &&
+ !this.auto_save_interval) {
this.auto_save_interval = new PeriodicalExecuter(function() {
- var cur_msg;
- if (this.editor_on) {
- cur_msg = FCKeditorAPI.GetInstance('message').GetHTML();
- } else {
- cur_msg = $F(msgval);
- }
+ var cur_msg = this.editor_on
+ ? FCKeditorAPI.GetInstance('message').GetHTML()
+ : $F(msgval);
cur_msg = cur_msg.replace(/\r/g, '');
if (!cur_msg.empty() && this.last_msg != cur_msg) {
this.uniqueSubmit('auto_save_draft');
}
$result['js'] = array(
- 'DIMP.conf_compose.auto_save_interval_val = ' . intval($GLOBALS['prefs']->getValue('auto_save_drafts')),
'DIMP.conf_compose.identities = ' . Horde_Serialize::serialize($identities, Horde_Serialize::JSON)
);
/* Variables used in compose page. */
$code['conf_compose'] = array_filter(array(
'attach_limit' => ($GLOBALS['conf']['compose']['attach_count_limit'] ? intval($GLOBALS['conf']['compose']['attach_count_limit']) : -1),
+ 'auto_save_interval_val' => intval($GLOBALS['prefs']->getValue('auto_save_drafts')),
'bcc' => intval($GLOBALS['prefs']->getValue('compose_bcc')),
'cc' => intval($GLOBALS['prefs']->getValue('compose_cc')),
'close_draft' => intval($GLOBALS['prefs']->getValue('close_draft')),