From c6be45646b1dd4de54dd9397b921ebf1e3fcd88f Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 26 Jan 2011 06:25:58 -0500
Subject: [PATCH] Separate full message headers UI element from headers table (#1487715) + Remove double borders in folder listing (#1487713)

---
 CHANGELOG                                   |    2 +
 skins/default/mail.css                      |   77 ++++++++++++++++++++------------------
 program/steps/mail/func.inc                 |   24 ++++++++---
 skins/default/templates/message.html        |    1 
 skins/default/templates/messagepreview.html |    1 
 5 files changed, 62 insertions(+), 43 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index da22cdd..4d13f32 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Remove double borders in folder listing (#1487713)
+- Separate full message headers UI element from headers table (#1487715)
 - Add part MIME ID to message_part_* hooks (#1487718) 
 - Improve parsing of MS Outlook vCards (#1487716)
 - Updated PEAR::Net_Socket to 1.0.10
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index d56f0f3..99f792f 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -942,16 +942,25 @@
     $table->add(array('class' => 'header '.$hkey), Q($row['value'], ($hkey == 'subject' ? 'strict' : 'show')));
   }
 
-  // all headers division
-  $table->add(array('colspan' => 2, 'class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('load-headers','',this)"), '');
-  $table->add_row(array('id' => "all-headers"));
-  $table->add(array('colspan' => 2, 'class' => "all"), html::div(array('id' => 'headers-source'), ''));
+  return $table->show($attrib);
+}
+
+
+/**
+ * return block to show full message headers
+ */
+function rcmail_message_full_headers($attrib, $headers=NULL)
+{
+  global $OUTPUT;
+  
+  $html = html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('load-headers','',this)"), '');
+  $html .= html::div(array('id' => "all-headers", 'class' => "all", 'style' => 'display:none'), html::div(array('id' => 'headers-source'), ''));
   
   $OUTPUT->add_gui_object('all_headers_row', 'all-headers');
   $OUTPUT->add_gui_object('all_headers_box', 'headers-source');
-
-  return $table->show($attrib);
-  }
+  
+  return html::div($attrib, $html);
+}
 
 
 /**
@@ -1751,6 +1760,7 @@
   'quotadisplay' => 'rcmail_quota_display',
   'mailboxname' => 'rcmail_mailbox_name_display',
   'messageheaders' => 'rcmail_message_headers',
+  'messagefullheaders' => 'rcmail_message_full_headers',
   'messagebody' => 'rcmail_message_body',
   'messagecontentframe' => 'rcmail_messagecontent_frame',
   'messagepartframe' => 'rcmail_message_part_frame',
diff --git a/skins/default/mail.css b/skins/default/mail.css
index 3057229..129ed44 100644
--- a/skins/default/mail.css
+++ b/skins/default/mail.css
@@ -383,6 +383,11 @@
   border-bottom: 1px solid #EBEBEB;
 }
 
+#mailboxlist li ul li:last-child
+{
+  border-bottom: none;
+}
+
 #mailboxlist li div
 {
   position: absolute;
@@ -1007,17 +1012,12 @@
   background-color: #EBEBEB;
 }
 
+#messagebody #full-headers,
 #messagebody table.headers-table
 {
   width: auto;
   margin: 6px 8px;
   background-color: #F4F4F4;
-  border: 1px solid #ccc;
-}
-
-#messageframe table.headers-table
-{
-  border-bottom: 1px solid #ccc;
 }
 
 table.headers-table tr td
@@ -1033,7 +1033,7 @@
   font-weight: bold;
   text-align: right;
   white-space: nowrap;
-  padding: 0 4px;
+  padding: 0 4px 0 8px;
 }
 
 table.headers-table tr td.header
@@ -1046,25 +1046,6 @@
   font-weight: bold;
 }
 
-table.headers-table tr td.all
-{
-  width: 100%;
-  color: #666666;
-  text-align: left;
-  padding-right: 10px;
-  text-align: center;
-  padding: 2px 6px 4px 6px;
-  border-bottom: 0;
-}
-
-table.headers-table tr td.more-headers
-{
-  cursor: pointer;
-  width: 100%;
-  height: 8px;
-  border-bottom: 0;
-}
-
 #attachment-list
 {
   margin: 0;
@@ -1073,6 +1054,16 @@
   list-style-image: none;
   list-style-type: none;
   background: url(images/icons/attachment.png) 4px 2px no-repeat #DFDFDF;
+}
+
+#messageframe #attachment-list
+{
+  border-bottom: 1px solid #ccc;
+}
+
+.messageheaderbox #attachment-list
+{
+  border-top: 1px solid #ccc;
 }
 
 #attachment-list:after
@@ -1210,31 +1201,45 @@
   border: 0;
 }
 
-td.show-headers
+#full-headers
+{
+  color: #666666;
+  text-align: center;
+  padding: 2px 6px;
+  border-bottom: 1px solid #ccc;
+  background-color: #EBEBEB;
+}
+
+.messageheaderbox #full-headers
+{
+  border-bottom: 0;
+}
+
+div.more-headers
+{
+  cursor: pointer;
+  height: 8px;
+  border-bottom: 0;
+}
+
+div.show-headers
 {
   background: url(images/icons/down_small.gif) no-repeat center;
 }
 
-td.hide-headers
+div.hide-headers
 {
   background: url(images/icons/up_small.gif) no-repeat center;
 }
 
-#all-headers
-{
-  height: 150px;
-  display: none;
-}
-
 #headers-source
 {
-  margin: 0 5px;
+  margin: 0 0 2px 0;
   padding: 0.5em;
   height: 145px;
   background: white;
   overflow: auto;
   font-size: 11px;
-  white-space: nowrap;
   border: 1px solid #999999;
   display: none;
   text-align: left;
diff --git a/skins/default/templates/message.html b/skins/default/templates/message.html
index 8e8af93..d59210c 100644
--- a/skins/default/templates/message.html
+++ b/skins/default/templates/message.html
@@ -50,6 +50,7 @@
 <div id="messageframe">
 <div class="boxlistcontent" style="top:0; overflow-x:auto">
 <roundcube:object name="messageHeaders" class="headers-table" cellspacing="0" cellpadding="2" addicon="/images/icons/silhouette.png" summary="Message headers" />
+<roundcube:object name="messageFullHeaders" id="full-headers" />
 <roundcube:object name="messageAttachments" id="attachment-list" />
 
 <roundcube:object name="blockedObjects" id="remote-objects-message" />
diff --git a/skins/default/templates/messagepreview.html b/skins/default/templates/messagepreview.html
index fbece6b..bfd7d7d 100644
--- a/skins/default/templates/messagepreview.html
+++ b/skins/default/templates/messagepreview.html
@@ -9,6 +9,7 @@
 <div class="messageheaderbox">
 <roundcube:button command="permaurl" image="/images/icons/extwin.png" width="15" height="15" title="openinextwin" id="messageviewlink" target="_blank" />
 <roundcube:object name="messageHeaders" class="headers-table" cellspacing="0" cellpadding="2" addicon="/images/icons/silhouette.png" summary="Message headers" />
+<roundcube:object name="messageFullHeaders" id="full-headers" />
 <roundcube:object name="messageAttachments" id="attachment-list" />
 </div>
 

--
Gitblit v1.9.1