From d6f707a5eb5e191f20cb8242a9037334b7e1cd8b Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 17 Feb 2009 00:19:01 -0700 Subject: [PATCH] Move attachment icon display to status column. --- imp/js/src/DimpBase.js | 40 +++++++++++++++----------- imp/js/src/ViewPort.js | 10 ++++--- imp/lib/DIMP.php | 2 ++ imp/lib/UI/Mailbox.php | 2 +- imp/templates/index/index-dimp.inc | 10 ------- imp/templates/javascript/mailbox-dimp.js | 4 +-- imp/themes/screen-dimp.css | 48 ++++++++++++++++---------------- imp/themes/silver/screen-dimp.css | 15 ++++++++-- 8 files changed, 70 insertions(+), 61 deletions(-) diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index d692a0e90..cb4b19351 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -32,14 +32,14 @@ var DimpBase = { }), flags: $H({ - unseen: 'statusUnseen', - flagged: 'statusFlagged', - deletedmsg: 'statusDeleted', - unimportant: 'lowPriority', - important: 'highPriority', - answered: 'statusAnswered', - forwarded: 'statusForwarded', - draft: 'statusDraft' + unseen: 'Unseen', + flagged: 'Flagged', + deletedmsg: 'Deleted', + unimportant: 'LowPriority', + important: 'HighPriority', + answered: 'Answered', + forwarded: 'Forwarded', + draft: 'Draft' }), // Message selection functions @@ -432,11 +432,6 @@ var DimpBase = { elt.replace(tmp.insert(elt.getText().escapeHTML())); } - // Add attachment graphics - if (row.atc) { - r.down('.msgSize').insert({ top: $($('atc_img_' + row.atc).cloneNode(false)).writeAttribute('id', '') }); - } - // Add context menu this._addMouseEvents({ id: row.domid, type: row.menutype }); new Drag(r, this._msgDragConfig); @@ -2179,13 +2174,24 @@ var DimpBase = { updateStatusFlags: function(row) { var elt = new Element('DIV'), - s = row.down('.msgStatus'); + r = $(row.domid), + s = r.down('.msgStatus'), + tmp; + + // Add attachment graphic + if (row.atc) { + tmp = 'status' + row.atc.capitalize(); + if (!s.down('.' + tmp)) { + s.insert($(elt.cloneNode(false)).writeAttribute({ className: tmp, title: DIMP.conf.atc_list[row.atc] || null })); + } + } this.flags.each(function(c) { - var d = s.down('.' + c.value); - if (row.hasClassName(c.key)) { + tmp = 'status' + c.value; + var d = s.down('.' + tmp); + if (r.hasClassName(c.key)) { if (!d) { - s.insert($(elt.cloneNode(false)).addClassName(c.value)); + s.insert($(elt.cloneNode(false)).addClassName(tmp)); } } else if (d) { d.remove(); diff --git a/imp/js/src/ViewPort.js b/imp/js/src/ViewPort.js index 0bfe7cb38..ec4f6ccbb 100644 --- a/imp/js/src/ViewPort.js +++ b/imp/js/src/ViewPort.js @@ -705,7 +705,7 @@ var ViewPort = Class.create({ c.update(c_nodes.join('')); if (this.opts.onUpdateClass) { - rows.get('div').each(function(d) { + rows.get('dataob').each(function(d) { this.opts.onUpdateClass(d); }, this); } @@ -826,11 +826,13 @@ var ViewPort = Class.create({ } else { d.removeClassName(flag); } + }, this); - if (this.opts.onUpdateClass) { + if (this.opts.onUpdateClass) { + vs.get('dataob').each(function(d) { this.opts.onUpdateClass(d); - } - }, this); + }, this); + } }, _getLineHeight: function() diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index 0229412d8..54a4d87e2 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -182,6 +182,8 @@ class DIMP 'login_view' => $prefs->getValue('dimp_login_view'), 'background_inbox' => !empty($conf['dimp']['viewport']['background_inbox']), + 'atc_list' => IMP_UI_Mailbox::getAttachmentAltList(), + // Turn debugging on? 'debug' => !empty($conf['dimp']['js']['debug']), ); diff --git a/imp/lib/UI/Mailbox.php b/imp/lib/UI/Mailbox.php index a4e9a21ad..4a5c36728 100644 --- a/imp/lib/UI/Mailbox.php +++ b/imp/lib/UI/Mailbox.php @@ -163,7 +163,7 @@ class IMP_UI_Mailbox * * @return array Type -> ALT text mappings. */ - public function getAttachmentAltList() + static public function getAttachmentAltList() { return array( 'signed' => _("Message is signed"), diff --git a/imp/templates/index/index-dimp.inc b/imp/templates/index/index-dimp.inc index fb157e2bb..7c46ae74d 100644 --- a/imp/templates/index/index-dimp.inc +++ b/imp/templates/index/index-dimp.inc @@ -5,13 +5,6 @@ $hordeimg = $registry->getImageDir('horde'); // Thread images $thread_imgs = IMP_IMAP_Thread::getImageUrls(true, true); -// Attachment images -$imp_ui = new IMP_UI_Mailbox('INBOX'); -$atc_imgs = array(); -foreach ($imp_ui->getAttachmentAltList() as $k => $v) { - $atc_imgs[] = IMP::img($k . '.png', $v, array('id' => 'atc_img_' . $k)); -} - $usetrash = $prefs->getValue('use_trash'); $menu_view = $prefs->getValue('menu_view'); $show_text = ($menu_view == 'text' || $menu_view == 'both'); @@ -444,10 +437,7 @@ function _simpleButton($id, $text, $image, $imagedir = null)
- "> - "> - [] diff --git a/imp/templates/javascript/mailbox-dimp.js b/imp/templates/javascript/mailbox-dimp.js index 35e31174e..2ecd666d0 100644 --- a/imp/templates/javascript/mailbox-dimp.js +++ b/imp/templates/javascript/mailbox-dimp.js @@ -12,12 +12,12 @@ */ DimpBase.message_list_template = -'
' + +'
' + '
' + '
' + '
' + '
#{from}
' + - '
#{subject}
' + + '
#{subject}
' + '
#{date}
' + '
#{size}
' + '
 
' + diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 3a2970726..b4e430055 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -108,7 +108,7 @@ div.msgStatus, div.msgFrom, div.msgSubject, div.msgDate, div.msgSize { overflow: hidden; } div.msgStatus { - width: 7%; + width: 8%; } div.msgStatus div { display: inline-block; @@ -120,13 +120,13 @@ div.msgFrom { width: 20%; } div.msgSubject { - width: 51%; + width: 52%; } div.msgDate { width: 14%; } div.msgSize { - width: 8%; + width: 6%; } /* Message List Header and Column Header */ @@ -217,45 +217,50 @@ div.msgSize { } /* Checkbox images */ -.msglist .msCheck { +.msglist div.msCheck { background-image: url("graphics/checkbox_off.png"); } -.msglist .msCheck:hover { +.msglist div.msCheck:hover { background-image: url("graphics/checkbox_over.png"); } -.msglist div.selectedRow .msCheck { +.msglist div.selectedRow div.msCheck { background-image: url("graphics/checkbox_on.png"); } -/* Status images and flags selectors: status column */ -.msglist .statusUnseen { +/* Status images and flags selectors */ +.msglist div.statusUnseen { background-image: url("graphics/mail_unseen.png"); } -.msglist .statusFlagged { +.msglist div.statusFlagged { background-image: url("graphics/mail_flagged.png"); } -.msglist .statusDeleted { +.msglist div.statusDeleted { background-image: url("graphics/mail_deleted.png"); } - -/* Status images and flags selectors: priority column */ -.msglist .lowPriority, span.lowpriorityImg { +.msglist div.statusLowPriority { background-image: url("graphics/mail_priority_low.png"); } -.msglist .highPriority, span.highpriorityImg { +.msglist div.statusHighPriority { background-image: url("graphics/mail_priority_high.png"); } - -/* Status images and flags selectors: compose status column */ -.msglist .statusAnswered { +.msglist div.statusAnswered { background-image: url("graphics/mail_answered.png"); } -.msglist .statusForwarded { +.msglist div.statusForwarded { background-image: url("graphics/mail_forwarded.png"); } -.msglist .statusDraft { +.msglist div.statusDraft { background-image: url("graphics/mail_draft.png"); } +.msglist div.statusAttachment { + background-image: url("graphics/attachment.png"); +} +.msglist div.statusEncrypted { + background-image: url("graphics/encrypted.png"); +} +.msglist div.statusSigned { + background-image: url("graphics/signed.png"); +} /* Thread images. */ div.msgSubject img { @@ -264,11 +269,6 @@ div.msgSubject img { padding-right: 1px; } -/* Size images. */ -div.msgSize img { - margin-right: 2px; -} - /* Scroller */ .sbdiv { position: relative; diff --git a/imp/themes/silver/screen-dimp.css b/imp/themes/silver/screen-dimp.css index a5a07b379..bea60c0e6 100644 --- a/imp/themes/silver/screen-dimp.css +++ b/imp/themes/silver/screen-dimp.css @@ -1,16 +1,25 @@ -/* Background images. */ .msglist div.statusDeleted { background-image: url("graphics/mail_deleted.png"); } .msglist div.statusForwarded, #hordeAlerts div.imp-forward, #hordeAlerts div.imp-redirect { background-image: url("graphics/mail_forwarded.png"); } -.msglist div.lowPriority { +.msglist div.statusLowPriority { background-image: url("graphics/mail_priority_low.png"); } -.msglist div.highPriority { +.msglist div.statusHighPriority { background-image: url("graphics/mail_priority_high.png"); } +.msglist div.statusAttachment { + background-image: url("graphics/attachment.png"); +} +.msglist div.statusEncrypted { + background-image: url("graphics/encrypted.png"); +} +.msglist div.statusSigned { + background-image: url("graphics/signed.png"); +} + #sidebarPanel .base { background-image: url("graphics/folder.png"); -- 2.11.0