Improvements to dimp remove attachment behavior/display
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Apr 2009 19:19:11 +0000 (13:19 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Apr 2009 19:29:37 +0000 (13:29 -0600)
imp/ajax.php
imp/js/src/compose-dimp.js
imp/lib/DIMP.php
imp/themes/screen-dimp.css

index 6d6dce6..0e3146b 100644 (file)
@@ -544,7 +544,9 @@ case 'DeleteAttach':
     $atc = Util::getPost('atc_indices');
     if (!is_null($atc)) {
         $imp_compose = IMP_Compose::singleton(Util::getPost('imp_compose'));
-        $imp_compose->deleteAttachment($atc);
+        foreach ($imp_compose->deleteAttachment($atc) as $val) {
+            $notification->push(sprintf(_("Deleted the attachment \"%s\"."), Horde_Mime::decode($val)), 'horde.success');
+        }
     }
     break;
 
index 1d0ac49..f1d0288 100644 (file)
@@ -507,7 +507,7 @@ var DimpCompose = {
     {
         var span = new Element('SPAN').insert(name),
             div = new Element('DIV').insert(span).insert(' [' + type + '] (' + size + ' KB) '),
-            input = new Element('INPUT', { type: 'button', atc_id: atc_num, value: DIMP.text_compose.remove });
+            input = new Element('SPAN', { atc_id: atc_num, className: 'remove' }).insert(DIMP.text_compose.remove);
         div.insert(input);
         $('attach_list').insert(div);
 
@@ -523,7 +523,7 @@ var DimpCompose = {
         var ids = [];
         e.each(function(n) {
             n = $(n);
-            ids.push(n.down('INPUT').readAttribute('atc_id'));
+            ids.push(n.down('SPAN.remove').readAttribute('atc_id'));
             n.remove();
         });
         DimpCore.doAction('DeleteAttach', { atc_indices: ids, imp_compose: $F('composeCache') });
@@ -682,7 +682,7 @@ var DimpCompose = {
                 break;
 
             case 'attach_list':
-                if (orig.match('INPUT')) {
+                if (orig.match('SPAN.remove')) {
                     this.removeAttach([ orig.up() ]);
                 } else if (orig.match('SPAN.attachName')) {
                     atc_num = orig.next().readAttribute('atc_id');
index e22f378..29874f5 100644 (file)
@@ -290,7 +290,7 @@ class DIMP
                 'cancel' => _("Cancelling this message will permanently discard its contents and will delete auto-saved drafts.\nAre you sure you want to do this?"),
                  'nosubject' => _("The message does not have a Subject entered.") . "\n" . _("Send message without a Subject?"),
                 'fillform' => _("You have already changed the message body, are you sure you want to drop the changes?"),
-                'remove' => _("remove"),
+                'remove' => _("Remove"),
                 'uploading' => _("Uploading..."),
                 'attachment_limit' => _("The attachment limit has been reached."),
                 'sending' => _("Sending..."),
index bc99126..e03cce3 100644 (file)
@@ -702,10 +702,13 @@ div.dimpActionsCompose, div.dimpActionsMsg {
 #attach_list {
     padding-top: 5px;
 }
-#attach_list input {
-    background: none;
+#attach_list span.remove {
     border: 1px solid #ccc;
     font-weight: bold;
+    padding: 1px 2px;
+}
+#attach_list span.remove:hover {
+    text-decoration: underline;
 }
 #attach_list div, span.attachmentImg {
     background-image: url("graphics/attachment.png");