From: Michael M Slusarz Date: Fri, 26 Jun 2009 16:59:52 +0000 (-0600) Subject: Give notification feedback on auto-draft save X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=51710600c944a3f6b89bc50bfe56ffdd79f148d6;p=horde.git Give notification feedback on auto-draft save --- diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index d779c68ce..9d4f258a7 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -105,7 +105,9 @@ if (count($_POST)) { /* 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) { diff --git a/imp/js/src/compose-dimp.js b/imp/js/src/compose-dimp.js index 497f1c442..0cc3a2e55 100644 --- a/imp/js/src/compose-dimp.js +++ b/imp/js/src/compose-dimp.js @@ -437,14 +437,12 @@ var DimpCompose = { } // 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'); diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index a029c862e..51b680095 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -80,7 +80,6 @@ class IMP_Views_Compose } $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) ); diff --git a/imp/templates/javascript_defs_dimp.php b/imp/templates/javascript_defs_dimp.php index 77ab16bd6..721ea051a 100644 --- a/imp/templates/javascript_defs_dimp.php +++ b/imp/templates/javascript_defs_dimp.php @@ -129,6 +129,7 @@ if ($compose_mode) { /* 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')),