Skip to content

Commit

Permalink
Merge branch 'master' of ssh://dev.horde.org/horde/git/horde
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jan 8, 2015
2 parents a7da30e + 5505612 commit cc773aa
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 38 deletions.
12 changes: 1 addition & 11 deletions imp/config/prefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
);

Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions imp/docs/UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
54 changes: 35 additions & 19 deletions imp/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<a>' + r.from + '</a>';
}
var links = [],
title = [];

r.from.each(function(f) {
links.push(
'<a class="msgFromLink" x-email="' + escapeAttr(Object.toJSON(f)) + '">' + (f.p || f.b).escapeHTML() + '</a>'
);
title.push(escapeAttr(f.b));
});

r.from = links.join(', ');
r.fromtitle = title.join(', ');

switch (ImpCore.getPref('qsearch_field')) {
case 'all':
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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() });
}
}
Expand Down
7 changes: 6 additions & 1 deletion imp/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

Expand Down
6 changes: 2 additions & 4 deletions imp/lib/Ajax/Application/ListMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion imp/lib/Dynamic/Mailbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 3 additions & 2 deletions imp/themes/default/dynamic/message_view.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
font-weight: bold;
padding-right: 4px;
text-align: right;
vertical-align: middle;
white-space: nowrap;
}
.msgHeaders .subject {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cc773aa

Please sign in to comment.