From 0403415efb00c61c3a8f9b1f95b05813023c7d58 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 7 Apr 2009 13:19:11 -0600 Subject: [PATCH] Improvements to dimp remove attachment behavior/display --- imp/ajax.php | 4 +++- imp/js/src/compose-dimp.js | 6 +++--- imp/lib/DIMP.php | 2 +- imp/themes/screen-dimp.css | 7 +++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/imp/ajax.php b/imp/ajax.php index 6d6dce6d7..0e3146b58 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -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; diff --git a/imp/js/src/compose-dimp.js b/imp/js/src/compose-dimp.js index 1d0ac4913..f1d028886 100644 --- a/imp/js/src/compose-dimp.js +++ b/imp/js/src/compose-dimp.js @@ -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'); diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index e22f37851..29874f5c0 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -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..."), diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index bc991261c..e03cce30e 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -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"); -- 2.11.0