[Svn] r4101 - in trunk/roundcubemail: . config program/js program/localization/en_US program/localization/pl_PL program/steps/mail skins/default skins/default/templates

trac at roundcube.net trac at roundcube.net
Sun Oct 17 19:43:05 CEST 2010


Author: alec
Date: 2010-10-17 12:43:05 -0500 (Sun, 17 Oct 2010)
New Revision: 4101

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/config/main.inc.php.dist
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/localization/en_US/labels.inc
   trunk/roundcubemail/program/localization/pl_PL/labels.inc
   trunk/roundcubemail/program/steps/mail/func.inc
   trunk/roundcubemail/skins/default/ie6hacks.css
   trunk/roundcubemail/skins/default/mail.css
   trunk/roundcubemail/skins/default/templates/mail.html
Log:
- Add separate column for message status icon (#1486665)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/CHANGELOG	2010-10-17 17:43:05 UTC (rev 4101)
@@ -31,6 +31,7 @@
 - Fix double e-mail filed in identity form (#1487054)
 - Display IMAP errors for LIST/THREAD/SEARCH commands (#1486905)
 - Add LITERAL+ (IMAP4 non-synchronizing literals) support (RFC2088)
+- Add separate column for message status icon (#1486665)
 
 RELEASE 0.4.2
 -------------

Modified: trunk/roundcubemail/config/main.inc.php.dist
===================================================================
--- trunk/roundcubemail/config/main.inc.php.dist	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/config/main.inc.php.dist	2010-10-17 17:43:05 UTC (rev 4101)
@@ -293,8 +293,8 @@
 $rcmail_config['message_sort_order'] = 'DESC';
 
 // These cols are shown in the message list. Available cols are:
-// subject, from, to, cc, replyto, date, size, flag, attachment
-$rcmail_config['list_cols'] = array('subject', 'from', 'date', 'size', 'flag', 'attachment');
+// subject, from, to, cc, replyto, date, size, status, flag, attachment
+$rcmail_config['list_cols'] = array('subject', 'status', 'from', 'date', 'size', 'flag', 'attachment');
 
 // the default locale setting (leave empty for auto-detection)
 // RFC1766 formatted language name like en_US, de_DE, de_CH, fr_FR, pt_BR

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/program/js/app.js	2010-10-17 17:43:05 UTC (rev 4101)
@@ -1550,8 +1550,10 @@
     if (uid && this.env.messages[uid])
       $.extend(row, this.env.messages[uid]);
 
-    // set eventhandler to message icon
-    if (this.env.subject_col != null && (row.icon = document.getElementById('msgicn'+row.uid))) {
+    row.msgicon = document.getElementById('msgicn'+row.uid);
+
+    // set eventhandler to message status icon
+    if (row.icon = document.getElementById('statusicn'+row.uid)) {
       row.icon._row = row.obj;
       row.icon.onmousedown = function(e) { self.command('toggle_status', this); rcube_event.cancel(e); };
     }
@@ -1618,20 +1620,14 @@
     row.id = 'rcmrow'+uid;
     row.className = css_class;
 
-    // message status icon
+    // message status icons
     css_class = 'msgicon';
     if (!flags.unread && flags.unread_children > 0)
       css_class += ' unreadchildren';
-    if (flags.deleted)
-      css_class += ' deleted';
-    else if (flags.replied || flags.forwarded) {
-      if (flags.replied)
-        css_class += ' replied';
-      if (flags.forwarded)
-        css_class += ' forwarded';
-    }
-    else if (flags.unread)
-      css_class += ' unread';
+    if (flags.replied)
+      css_class += ' replied';
+    if (flags.forwarded)
+      css_class += ' forwarded';
 
     // update selection
     if (message.selected && !list.in_selection(uid))
@@ -1693,6 +1689,15 @@
         else
           html = ' ';
       }
+      else if (c == 'status') {
+        if (flags.deleted)
+          css_class = 'deleted';
+        else if (flags.unread)
+          css_class = 'unread';
+        else
+          css_class = 'msgicon';
+        html = '<span id="statusicn'+uid+'" class="'+css_class+'"> </span>';
+      }
       else if (c == 'threads')
         html = expando;
       else if (c == 'subject')
@@ -2221,23 +2226,28 @@
       return false;
 
     if (rows[uid].icon) {
-      css_class = 'msgicon';
-      if (!rows[uid].unread && rows[uid].unread_children)
-        css_class += ' unreadchildren';
       if (rows[uid].deleted)
-        css_class += ' deleted';
-      else if (rows[uid].replied || rows[uid].forwarded) {
-        if (rows[uid].replied)
-          css_class += ' replied';
-        if (rows[uid].forwarded)
-          css_class += ' forwarded';
-      }
+        css_class = 'deleted';
       else if (rows[uid].unread)
-        css_class += ' unread';
+        css_class = 'unread';
+      else
+        css_class = 'msgicon';
 
       rows[uid].icon.className = css_class;
     }
 
+    if (rows[uid].msgicon) {
+      css_class = 'msgicon';
+      if (!rows[uid].unread && rows[uid].unread_children)
+        css_class += ' unreadchildren';
+      if (rows[uid].replied)
+        css_class += ' replied';
+      if (rows[uid].forwarded)
+        css_class += ' forwarded';
+
+      rows[uid].msgicon.className = css_class;
+    }
+
     if (rows[uid].flagged_icon) {
       css_class = (rows[uid].flagged ? 'flagged' : 'unflagged');
       rows[uid].flagged_icon.className = css_class;

Modified: trunk/roundcubemail/program/localization/en_US/labels.inc
===================================================================
--- trunk/roundcubemail/program/localization/en_US/labels.inc	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/program/localization/en_US/labels.inc	2010-10-17 17:43:05 UTC (rev 4101)
@@ -52,6 +52,7 @@
 $labels['size']    = 'Size';
 $labels['priority'] = 'Priority';
 $labels['organization'] = 'Organization';
+$labels['readstatus'] = 'Read status';
 
 // aliases
 $labels['reply-to'] = $labels['replyto'];

Modified: trunk/roundcubemail/program/localization/pl_PL/labels.inc
===================================================================
--- trunk/roundcubemail/program/localization/pl_PL/labels.inc	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/program/localization/pl_PL/labels.inc	2010-10-17 17:43:05 UTC (rev 4101)
@@ -45,6 +45,7 @@
 $labels['replyto'] = 'Odp. do';
 $labels['date'] = 'Data';
 $labels['size'] = 'Rozmiar';
+$labels['readstatus'] = 'Przeczytano';
 $labels['priority'] = 'Priorytet';
 $labels['organization'] = 'Organizacja';
 $labels['reply-to'] = 'Odpowiedz do';

Modified: trunk/roundcubemail/program/steps/mail/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/func.inc	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/program/steps/mail/func.inc	2010-10-17 17:43:05 UTC (rev 4101)
@@ -255,17 +255,14 @@
   if (empty($a_headers))
     return;
 
-  // remove 'threads', 'attachment', 'flag' columns, we don't need them here
-  if (($key = array_search('attachment', $a_show_cols)) !== FALSE)
-    unset($a_show_cols[$key]);
-  if (($key = array_search('flag', $a_show_cols)) !== FALSE)
-    unset($a_show_cols[$key]);
-  if (($key = array_search('threads', $a_show_cols)) !== FALSE)
-    unset($a_show_cols[$key]);
-  // loop through message headers
+  // remove 'threads', 'attachment', 'flag', 'status' columns, we don't need them here
+  foreach (array('threads', 'attachment', 'flag', 'status') as $col) {
+    if (($key = array_search($col, $a_show_cols)) !== FALSE)
+      unset($a_show_cols[$key]);
+  }
 
-  foreach ($a_headers as $n => $header)
-    {
+  // loop through message headers
+  foreach ($a_headers as $n => $header) {
     if (empty($header))
       continue;
 
@@ -275,16 +272,14 @@
     $IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']);
 
     // format each col; similar as in rcmail_message_list()
-    foreach ($a_show_cols as $col)
-      {
+    foreach ($a_show_cols as $col) {
       if (in_array($col, array('from', 'to', 'cc', 'replyto')))
         $cont = Q(rcmail_address_string($header->$col, 3), 'show');
-      else if ($col=='subject')
-        {
+      else if ($col=='subject') {
         $cont = abbreviate_string(trim($IMAP->decode_header($header->$col)), 160);
         if (!$cont) $cont = rcube_label('nosubject');
         $cont = Q($cont);
-        }
+      }
       else if ($col=='size')
         $cont = show_bytes($header->$col);
       else if ($col=='date')
@@ -293,7 +288,7 @@
         $cont = Q($header->$col);
 
       $a_msg_cols[$col] = $cont;
-      }
+    }
 
     if ($header->depth)
       $a_msg_flags['depth'] = $header->depth;
@@ -332,11 +327,11 @@
       $a_msg_cols,
       $a_msg_flags,
       $insert_top);
-    }
+  }
 
-    if ($IMAP->threading) {
-      $OUTPUT->command('init_threads', (array) $roots);
-    }
+  if ($IMAP->threading) {
+    $OUTPUT->command('init_threads', (array) $roots);
+  }
 }
 
 
@@ -380,7 +375,8 @@
         $col_name = '<span class="flagged"> </span>';
         break;
       case 'attachment':
-        $col_name = '<span class="attachment"> </span>';
+      case 'status':
+        $col_name = '<span class="' . $col .'"> </span>';
         break;
       case 'threads':
         $col_name = $list_menu;

Modified: trunk/roundcubemail/skins/default/ie6hacks.css
===================================================================
--- trunk/roundcubemail/skins/default/ie6hacks.css	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/skins/default/ie6hacks.css	2010-10-17 17:43:05 UTC (rev 4101)
@@ -128,11 +128,13 @@
 #messagelist tr td.attachment span.report,
 #messagelist tr td.flag span.flagged,
 #messagelist tr td.flag span.unflagged:hover,
+#messagelist tr td.status span.status,
+#messagelist tr td.status span.msgicon,
+#messagelist tr td.status span.unread,
+#messagelist tr td.status span.deleted,
 #messagelist tr td.subject span.msgicon,
 #messagelist tr td.subject span.msgicon.replied,
 #messagelist tr td.subject span.msgicon.forwarded,
-#messagelist tr td.subject span.msgicon.deleted,
-#messagelist tr td.subject span.msgicon.unread,
 #messagelist tr td.subject span.msgicon.unreadchildren
 {
   background-image: url(images/messageicons.gif);

Modified: trunk/roundcubemail/skins/default/mail.css
===================================================================
--- trunk/roundcubemail/skins/default/mail.css	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/skins/default/mail.css	2010-10-17 17:43:05 UTC (rev 4101)
@@ -701,12 +701,14 @@
   display: inline-block;
 }
 
-#messagelist tbody tr td.flag
+#messagelist tbody tr td.flag,
+#messagelist tbody tr td.status
 {
   cursor: pointer;
 }
 
 #messagelist tr td.flag span,
+#messagelist tr td.status span,
 #messagelist tr td.attachment span
 {
   width: 15px;
@@ -719,11 +721,13 @@
 #messagelist tr td.attachment span.report,
 #messagelist tr td.flag span.flagged,
 #messagelist tr td.flag span.unflagged:hover,
+#messagelist tr td.status span.status,
+#messagelist tr td.status span.msgicon,
+#messagelist tr td.status span.deleted,
+#messagelist tr td.status span.unread,
 #messagelist tr td.subject span.msgicon,
 #messagelist tr td.subject span.msgicon.replied,
 #messagelist tr td.subject span.msgicon.forwarded,
-#messagelist tr td.subject span.msgicon.deleted,
-#messagelist tr td.subject span.msgicon.unread,
 #messagelist tr td.subject span.msgicon.unreadchildren
 {
   vertical-align: middle;
@@ -757,7 +761,6 @@
 {
   background-position: 0 -51px;
   margin: 0 2px;
-  cursor: pointer;
 }
 
 #messagelist tr td.subject span.msgicon.replied
@@ -775,12 +778,18 @@
   background-position: 0 -102px;
 }
 
-#messagelist tr td.subject span.msgicon.deleted
+#messagelist tr td.status span.msgicon
 {
+  background-position: 0 -51px;
+}
+
+#messagelist tr td.status span.deleted
+{
   background-position: 0 -187px;
 }
 
-#messagelist tr td.subject span.msgicon.unread
+#messagelist tr td.status span.status,
+#messagelist tr td.status span.unread
 {
   background-position: 0 -119px;
 }
@@ -821,10 +830,11 @@
 
 #messagelist tr td.attachment,
 #messagelist tr td.threads,
+#messagelist tr td.status,
 #messagelist tr td.flag
 {
-  width: 19px;
-  padding: 0 2px;
+  width: 17px;
+  padding: 0 0 0 2px;
 }
 
 #messagelist tr td.size

Modified: trunk/roundcubemail/skins/default/templates/mail.html
===================================================================
--- trunk/roundcubemail/skins/default/templates/mail.html	2010-10-17 17:09:09 UTC (rev 4100)
+++ trunk/roundcubemail/skins/default/templates/mail.html	2010-10-17 17:43:05 UTC (rev 4101)
@@ -189,6 +189,7 @@
     <li><input type="checkbox" name="list_col[]" value="cc" id="cols_cc" /><label for="cols_cc"><roundcube:label name="cc" /></label></li>
     <li><input type="checkbox" name="list_col[]" value="date" id="cols_date" /><label for="cols_date"><roundcube:label name="date" /></label></li>
     <li><input type="checkbox" name="list_col[]" value="size" id="cols_size" /><label for="cols_size"><roundcube:label name="size" /></label></li>
+    <li><input type="checkbox" name="list_col[]" value="status" id="cols_status" /><label for="cols_status"><roundcube:label name="readstatus" /></label></li>
     <li><input type="checkbox" name="list_col[]" value="attachment" id="cols_attachment" /><label for="cols_attachment"><roundcube:label name="attachment" /></label></li>
     <li><input type="checkbox" name="list_col[]" value="flag" id="cols_flag" /><label for="cols_flag"><roundcube:label name="flag" /></label></li>
   </ul>

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn