diff --git a/imp/config/prefs.php b/imp/config/prefs.php index 15fe96e8f6b..b7a15d850e7 100644 --- a/imp/config/prefs.php +++ b/imp/config/prefs.php @@ -1395,7 +1395,7 @@ 'desc' => _("Change display preferences for viewing the listing of messages in a mailbox."), 'members' => array( 'initialpageselect', 'mailbox_start', 'sortby', 'sortdir', 'sortdate', - 'from_link', 'atc_flag' + 'atc_flag' ) ); @@ -1476,16 +1476,6 @@ 'desc' => _("Criteria to use when sorting by date:") ); -$_prefs['from_link'] = array( - 'value' => 1, - 'type' => 'enum', - 'enum' => array( - 0 => _("Clicking on the address will compose a new message to the sender"), - 1 => _("Clicking on the address will open the message to be read") - ), - 'desc' => _("The From: column of the message should be linked:") -); - $_prefs['atc_flag'] = array( // Disabled by default since display requires a bit of extra overhead to // obtain the MIME Content-Type of the base portion of the message. diff --git a/imp/docs/UPGRADING b/imp/docs/UPGRADING index e5873ef923a..b9dca8f39d8 100644 --- a/imp/docs/UPGRADING +++ b/imp/docs/UPGRADING @@ -90,6 +90,7 @@ The following preferences have been removed:: empty_spam_menu empty_trash_menu filter_menuitem + from_link max_msgs preview_enabled preview_maxlen diff --git a/imp/js/base.js b/imp/js/base.js index 0be48f3a048..612d91ca740 100644 --- a/imp/js/base.js +++ b/imp/js/base.js @@ -511,11 +511,18 @@ var ImpBase = { switch (h) { case 'from': - r.fromtitle = escapeAttr(r.fromaddr || r.from); - r.from = r.from.escapeHTML(); - if (ImpCore.conf.from_link) { - r.from = '' + r.from + ''; - } + var links = [], + title = []; + + r.from.each(function(f) { + links.push( + '' + (f.p || f.b).escapeHTML() + '' + ); + title.push(escapeAttr(f.b)); + }); + + r.from = links.join(', '); + r.fromtitle = title.join(', '); switch (ImpCore.getPref('qsearch_field')) { case 'all': @@ -641,15 +648,33 @@ var ImpBase = { /* Custom ViewPort events. */ container.observe('ViewPort:add', function(e) { + var a = e.memo.down('.msgFromLink'); + ImpCore.addContextMenu({ elt: e.memo, type: 'message' }); + + if (a) { + a.store('email', a.readAttribute('x-email').evalJSON()); + a.removeAttribute('x-email'); + ImpCore.addContextMenu({ + elt: a, + left: true, + offset: a, + type: 'contacts' + }); + } + new Drag(e.memo, this.msgDragConfig); }.bindAsEventListener(this)); container.observe('ViewPort:clear', function(e) { - $(e.memo).fire('ImpBase:removeElt'); + var a = e.memo.down('.msgFromLink'); + if (a) { + a.fire('ImpBase:removeElt'); + } + e.memo.fire('ImpBase:removeElt'); }.bindAsEventListener(this)); container.observe('ViewPort:contentComplete', function() { @@ -2443,12 +2468,7 @@ var ImpBase = { if (elt.hasClassName('vpRow')) { args = { right: e.memo.isRightClick() }; - d.fromClick = d.selectIfNoDrag = false; - - if (ImpCore.conf.from_link && e.memo.findElement('.msgFrom a')) { - d.fromClick = !args.right; - return; - } + d.selectIfNoDrag = false; // Handle selection first. if (ImpCore.DMenu.operaCheck(e)) { @@ -2507,17 +2527,13 @@ var ImpBase = { onDragMouseUp: function(e) { - var elt = e.element(), + var d, + elt = e.element(), id = elt.identify(); if (elt.hasClassName('vpRow')) { d = DragDrop.Drags.getDrag(id); - if (d.fromClick) { - ImpCore.compose('new_to', { - buid: this.viewport.createSelection('div', elt).get('uid').toViewportUidString(), - mailbox: this.view - }); - } else if (d.selectIfNoDrag) { + if (d.selectIfNoDrag) { this.msgSelect(id, { right: e.memo.isRightClick() }); } } diff --git a/imp/js/core.js b/imp/js/core.js index 7213fdcf52a..d0ee7c0c5e7 100644 --- a/imp/js/core.js +++ b/imp/js/core.js @@ -182,7 +182,12 @@ var ImpCore = { df.appendChild(a); } - this.DMenu.addElement(a.identify(), 'ctx_contacts', { offset: a, left: true }); + this.addContextMenu({ + elt: a, + left: true, + offset: a, + type: 'contacts' + }); }, this); }, diff --git a/imp/lib/Ajax/Application/ListMessages.php b/imp/lib/Ajax/Application/ListMessages.php index 6f57ffd27f2..6013b8483a8 100644 --- a/imp/lib/Ajax/Application/ListMessages.php +++ b/imp/lib/Ajax/Application/ListMessages.php @@ -454,10 +454,8 @@ private function _getOverviewData($mbox, $msglist) /* Format the From: Header. */ $getfrom = $imp_ui->getFrom($ob['envelope']); - $msg['from'] = $getfrom['from']; - if ($getfrom['from'] !== $getfrom['from_addr']) { - $msg['fromaddr'] = $getfrom['from_addr']; - } + $from_ob = new IMP_Ajax_Addresses($getfrom['from_list']); + $msg['from'] = $from_ob->toArray()->addr; /* Format the Subject: Header. */ $msg['subject'] = $imp_ui->getSubject($ob['envelope']->subject); diff --git a/imp/lib/Dynamic/Mailbox.php b/imp/lib/Dynamic/Mailbox.php index 9a91b59ffb7..e7bc969dbb2 100644 --- a/imp/lib/Dynamic/Mailbox.php +++ b/imp/lib/Dynamic/Mailbox.php @@ -165,7 +165,6 @@ protected function _addMailboxVars() // Other variables 'acl' => $acl, 'filter_any' => intval($prefs->getValue('filter_any_mailbox')), - 'from_link' => intval($prefs->getValue('from_link') == 0), 'fsearchid' => IMP_Mailbox::formTo(IMP_Search::MBOX_PREFIX . IMP_Search::FILTERSEARCH), 'initial_page' => is_null($initial_page = IMP::getInitialPage()->mbox) ? null : $initial_page->form_to, 'mbox_expand' => intval($prefs->getValue('nav_expanded') == 2), diff --git a/imp/themes/default/dynamic/message_view.css b/imp/themes/default/dynamic/message_view.css index c73152c11fd..4107e11739e 100644 --- a/imp/themes/default/dynamic/message_view.css +++ b/imp/themes/default/dynamic/message_view.css @@ -20,6 +20,7 @@ font-weight: bold; padding-right: 4px; text-align: right; + vertical-align: middle; white-space: nowrap; } .msgHeaders .subject { @@ -111,8 +112,8 @@ /* Email Addresses. */ .msgHeaders .horde-button { - padding: 1px 3px; - margin: -1px 1px 2px 0; + margin: 1px; + padding: 2px 3px; } .msgHeaders a.addrgroup-name { font-weight: bold;