Alter buttons when in Drafts mailbox
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 30 Sep 2010 21:54:30 +0000 (15:54 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 30 Sep 2010 22:28:03 +0000 (16:28 -0600)
imp/js/dimpbase.js
imp/templates/dimp/index.inc
imp/themes/dimp/screen.css

index 4e3185a..c3085fc 100644 (file)
@@ -609,23 +609,31 @@ var DimpBase = {
                     }
                 }
 
-                if (this.viewport.getMetaData('spam')) {
-                    if (!DIMP.conf.spam_spammbox) {
-                        spam = 'hide';
+                if (this.viewport.getMetaData('drafts')) {
+                    $('button_resume').show();
+                    $('button_reply', 'button_forward', 'button_spam', 'button_ham').compact().invoke('up').invoke('hide');
+                } else {
+                    $('button_resume').hide();
+                    $('button_reply', 'button_forward').compact().invoke('up').invoke('show');
+
+                    if (this.viewport.getMetaData('spam')) {
+                        if (!DIMP.conf.spam_spammbox) {
+                            spam = 'hide';
+                        }
+                    } else if (DIMP.conf.ham_spammbox) {
+                        ham = 'hide';
                     }
-                } else if (DIMP.conf.ham_spammbox) {
-                    ham = 'hide';
-                }
 
-                if ($('button_ham')) {
-                    [ $('button_ham').up(), $('ctx_message_ham') ].invoke(ham);
-                }
-                if ($('button_spam')) {
-                    [ $('button_spam').up(), $('ctx_message_spam') ].invoke(spam);
+                    if ($('button_ham')) {
+                        [ $('button_ham').up(), $('ctx_message_ham') ].invoke(ham);
+                    }
+                    if ($('button_spam')) {
+                        [ $('button_spam').up(), $('ctx_message_spam') ].invoke(spam);
+                    }
                 }
 
                 /* Read-only changes. 'oa_setflag' is handled elsewhere. */
-                tmp = [ $('button_deleted') ].compact().invoke('up', 'SPAN').concat($('ctx_message_deleted', 'ctx_message_setflag', 'ctx_message_undeleted'));
+                tmp = [ $('button_deleted') ].compact().invoke('up').concat($('ctx_message_deleted', 'ctx_message_setflag', 'ctx_message_undeleted'));
 
                 if (this.viewport.getMetaData('readonly')) {
                     tmp.compact().invoke('hide');
@@ -2070,6 +2078,11 @@ var DimpBase = {
                 this.composeMailbox(id == 'button_reply' ? 'reply_auto' : 'forward_auto');
                 break;
 
+            case 'button_resume':
+                this.composeMailbox('resume');
+                e.stop();
+                return;
+
             case 'button_ham':
             case 'button_spam':
                 this.reportSpam(id == 'button_spam');
index 945169d..70fa52f 100644 (file)
@@ -185,6 +185,7 @@ function _simpleButton($id, $text, $image, $nodisplay = false)
 <?php if (!empty($conf['notspam']['reporting'])): ?>
       <div><?php echo IMP_Dimp::actionButton(array('class' => 'noselectDisable', 'icon' => 'Ham', 'id' => 'button_ham', 'title' => _("Innocent"))) ?></div>
 <?php endif; ?>
+      <div><?php echo IMP_Dimp::actionButton(array('class' => 'noselectDisable', 'icon' => 'Resume', 'id' => 'button_resume', 'title' => _("Resume"))) ?></div>
       <div><?php echo IMP_Dimp::actionButton(array('class' => 'noselectDisable', 'icon' => 'Delete', 'id' => 'button_deleted', 'title' => _("Delete"))) ?></div>
       <div id="button_compose"><?php echo IMP_Dimp::actionButton(array('icon' => 'Compose', 'title' => _("Compose"))) ?></div>
       <div id="button_checkmail"><?php echo IMP_Dimp::actionButton(array('icon' => 'Checkmail', 'title' => _("Get Mail"))) ?></div>
index 15010d2..2cd7f8a 100644 (file)
@@ -928,6 +928,9 @@ span.dimpactionDrafts {
 span.dimpactionEditsearch {
     background-image: url("../graphics/edit.png");
 }
+span.dimpactionResume {
+    background-image: url("../graphics/mail_draft.png");
+}
 
 /* Context menu images */
 #ctx_message_reply span.contextImg {