From 0bcfbb2079388663de95f8dd6305539b328e779d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 13 Apr 2010 00:00:02 -0600 Subject: [PATCH] Better place for 'Clear Sort' in IMP --- imp/js/mailbox.js | 15 +++++++++++---- imp/mailbox.php | 25 +++++++++++++++++++------ imp/templates/imp/mailbox/actions.html | 13 +++++++------ imp/templates/imp/mailbox/message_headers.html | 3 --- imp/themes/screen.css | 5 ----- 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/imp/js/mailbox.js b/imp/js/mailbox.js index ca1e169bb..67e11b99b 100644 --- a/imp/js/mailbox.js +++ b/imp/js/mailbox.js @@ -202,33 +202,40 @@ var ImpMailbox = { if (elt.match('.msgactions A.widget')) { if (elt.hasClassName('moveAction')) { this._transfer('move_messages'); + e.stop(); } else if (elt.hasClassName('copyAction')) { this._transfer('copy_messages'); + e.stop(); } else if (elt.hasClassName('permdeleteAction')) { if (confirm(IMP.text.mailbox_delete)) { this.submit('delete_messages'); } + e.stop(); } else if (elt.hasClassName('deleteAction')) { this.submit('delete_messages'); + e.stop(); } else if (elt.hasClassName('undeleteAction')) { this.submit('undelete_messages'); + e.stop(); } else if (elt.hasClassName('blacklistAction')) { this.submit('blacklist'); + e.stop(); } else if (elt.hasClassName('whitelistAction')) { this.submit('whitelist'); + e.stop(); } else if (elt.hasClassName('forwardAction')) { this.submit('fwd_digest'); + e.stop(); } else if (elt.hasClassName('spamAction')) { this.submit('spam_report'); + e.stop(); } else if (elt.hasClassName('notspamAction')) { this.submit('notspam_report'); + e.stop(); } else if (elt.hasClassName('viewAction')) { this.submit('view_messages'); - } else if (elt.hasClassName('hideAction') || elt.hasClassName('purgeAction')) { - return; + e.stop(); } - - e.stop(); return; } else if (elt.hasClassName('checkbox')) { this.selectRange(e); diff --git a/imp/mailbox.php b/imp/mailbox.php index 2bf761bd4..2d9967d1f 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -513,14 +513,31 @@ if ($pageOb['msgcount']) { $a_template->set('undelete', Horde::widget('#', _("Undelete"), 'widget undeleteAction', '', '', _("_Undelete"))); } + $mboxactions = array(); if ($showdelete['purge']) { $mailbox_link = $mailbox_imp_url->copy()->add('page', $pageOb['page']); if (isset($deleted_prompt)) { - $a_template->set('hide_deleted', Horde::widget($mailbox_link->copy()->add(array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt)); + $mboxactions[] = array( + 'v' => Horde::widget($mailbox_link->copy()->add(array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt) + ); } - $a_template->set('purge_deleted', Horde::widget($mailbox_link->copy()->add(array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted"))); + $mboxacrtions[] = array( + 'v' => Horde::widget($mailbox_link->copy()->add(array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")) + ); } + if ($sortpref['by'] != Horde_Imap_Client::SORT_SEQUENCE) { + $mboxactions[] = array( + 'v' => Horde::widget($sort_url->copy()->remove('sortdir')->add(array('sortby' => Horde_Imap_Client::SORT_SEQUENCE, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), _("Clear Sort"), 'widget', '', '', _("Clear Sort")) + ); + } + + /* Hack since IE doesn't support :last-child CSS selector. */ + if (!empty($mboxactions)) { + $mboxactions[count($mboxactions) - 1]['last'] = true; + } + $a_template->set('mboxactions', $mboxactions); + if ($registry->hasMethod('mail/blacklistFrom')) { $a_template->set('blacklist', Horde::widget('#', _("Blacklist"), 'widget blacklistAction', '', '', _("_Blacklist"))); } @@ -651,10 +668,6 @@ if ($pageOb['msgcount']) { $mh_template->set('sessiontag', Horde_Util::formInput()); $mh_template->set('headers', $headers); - if ($sortpref['by'] != Horde_Imap_Client::SORT_SEQUENCE) { - $mh_template->set('no_sort', Horde::widget($sort_url->copy()->remove('sortdir')->add(array('sortby' => Horde_Imap_Client::SORT_SEQUENCE, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), _("Clear Sort"), 'widget', '', '', _("Clear Sort"))); - } - if (!$search_mbox) { $mh_template->set('mh_count', $mh_count++); echo $mh_template->fetch(IMP_TEMPLATES . '/imp/mailbox/message_headers.html'); diff --git a/imp/templates/imp/mailbox/actions.html b/imp/templates/imp/mailbox/actions.html index 5f411e636..bc4b9a806 100644 --- a/imp/templates/imp/mailbox/actions.html +++ b/imp/templates/imp/mailbox/actions.html @@ -1,13 +1,14 @@
-
+
    - class="lastnavbar"> -
  • + + class="lastnavbar"> +
-
-
+ +
  • @@ -22,7 +23,7 @@
-
+
diff --git a/imp/templates/imp/mailbox/message_headers.html b/imp/templates/imp/mailbox/message_headers.html index fd4bf460b..cd5c70b28 100644 --- a/imp/templates/imp/mailbox/message_headers.html +++ b/imp/templates/imp/mailbox/message_headers.html @@ -12,9 +12,6 @@ /> - - [] - diff --git a/imp/themes/screen.css b/imp/themes/screen.css index 8b69c6420..4095fe42c 100644 --- a/imp/themes/screen.css +++ b/imp/themes/screen.css @@ -62,11 +62,6 @@ #checkheader input { float: left; } -#checkheader span.nosort { - font-weight: normal; - font-size: 90%; - padding-left: 3px; -} /* Newmail alerts. */ #newmail { -- 2.11.0