Changeset 3118 in subversion


Ignore:
Timestamp:
Nov 19, 2009 1:08:37 PM (4 years ago)
Author:
alec
Message:
  • use underlined subject for parent with unread children + some fixes
Location:
branches/devel-threads
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-threads/THREADS

    r3111 r3118  
    99    - removed imap_thread_algorithm option, we're using the best algorithm 
    1010      supported by server and implement REFS sorting in Roundcube 
     11    - use underlined subject for root with unread children (icon is also supported) 
    1112 
    1213CHANGES IN RELATION TO TRUNK (for pasting into CHANGELOG after merge) 
     
    2223      if "expand all" is disabled we should fetch only root messages and fetch 
    2324      children on-demand (on expand button click), 
     25      Notice: this is not so simple, because we need to fetch children 
     26              to set "unread_children", but we can fetch only flags instead of 
     27              all headers for each child 
    2428    - after message delete we shouldn't reload the whole list, only the thread 
    2529      in which the message was 
     
    3135    - replace expand_unread() (list.js) with something universal, 
    3236      e.g. expand_all('unread'), because list widget could be used not for messages only 
    33     - mark root message with unread children as underlined subject instead 
    34       of unread_children icon 
    3537    - reset autoexpand feature if collapse-all/expand-all was used. Save state for next page 
    3638      in the same folder. E.g. autoexpand is on, list is displayed with expanded 
     
    4143      listing the folders) 
    4244    - thread css: message row height, thread/status icon alignment 
     45    - use underlined subject only if thread is collapsed 
    4346 
    4447KNOWN ISSUES: 
    4548    - after message(s) deletion the whole list is reloaded (see TODO), 
    46     - unread_children icon is not shown after changing message status to 
    47       Seen, when root is e.g. "replied", also when thread contains many unread 
    48       children. For me, we should use underlined subject instead of unread_children  
    49       icon 
  • branches/devel-threads/program/include/rcube_imap.php

    r3106 r3118  
    859859        $headers[$idx]->parent_uid = end($parents); 
    860860        if (!$header->seen) 
    861           $headers[$parents[0]]->unread_children = true; 
     861          $headers[$parents[0]]->unread_children++; 
    862862        } 
    863863      array_push($parents, $header->uid); 
  • branches/devel-threads/program/js/app.js

    r3109 r3118  
    441441      } 
    442442 
     443    // global variable 'subject_col' may be not defined yet 
     444    if (this.env.subject_col == null && this.env.coltypes) 
     445      { 
     446      var found; 
     447      if((found = find_in_array('subject', this.env.coltypes)) >= 0) 
     448        this.set_env('subject_col', found); 
     449      } 
     450 
    443451    // set eventhandler to message icon 
    444     if (row.icon = row.obj.getElementsByTagName('td')[0].getElementsByTagName('img')[0]) 
     452    if (this.env.subject_col != null 
     453        && (row.icon = row.obj.getElementsByTagName('td')[this.env.subject_col].getElementsByTagName('img')[0])) 
    445454      { 
    446455      var p = this; 
     
    451460 
    452461    // global variable 'flagged_col' may be not defined yet 
    453     if (!this.env.flagged_col && this.env.coltypes) 
     462    if (this.env.flagged_col == null && this.env.coltypes) 
    454463      { 
    455464      var found; 
     
    459468 
    460469    // set eventhandler to flag icon, if icon found 
    461     if (this.env.flagged_col && (row.flagged_icon = row.obj.getElementsByTagName('td')[this.env.flagged_col].getElementsByTagName('img')[0])) 
     470    if (this.env.flagged_col != null 
     471         && (row.flagged_icon = row.obj.getElementsByTagName('td')[this.env.flagged_col].getElementsByTagName('img')[0])) 
    462472      { 
    463473      var p = this; 
     
    16261636        { 
    16271637        this.set_message(id, 'unread', false); 
    1628         this.update_parents(id, 'read'); 
     1638        this.update_thread_root(id, 'read'); 
    16291639        if (this.env.unread_counts[this.env.mailbox]) 
    16301640          { 
     
    18151825  }; 
    18161826 
    1817   // update parents in a thread 
    1818   this.update_parents = function(uid, flag) 
     1827  // update parent in a thread 
     1828  this.update_thread_root = function(uid, flag) 
     1829  { 
     1830    if (!this.env.threading) 
     1831      return; 
     1832 
     1833    var root = this.find_thread_root(uid); 
     1834     
     1835    if (uid == root) 
     1836      return; 
     1837 
     1838    var p = this.message_list.rows[root]; 
     1839 
     1840    if (flag == 'read' && p.unread_children) { 
     1841      p.unread_children--; 
     1842    } else if (flag == 'unread' && p.has_children) { 
     1843      // unread_children may be undefined 
     1844      p.unread_children = p.unread_children ? p.unread_children + 1 : 1; 
     1845    } else { 
     1846      return; 
     1847    } 
     1848 
     1849    this.set_message_icon(root); 
     1850  }; 
     1851 
     1852  // finds root message for specified thread 
     1853  this.find_thread_root = function(uid) 
    18191854  { 
    18201855    var r = this.message_list.rows[uid]; 
    1821     if (r.parent_uid) { 
    1822       var p = this.message_list.rows[r.parent_uid]; 
    1823       if (flag == 'read' && p.unread_children > 0) { 
    1824         p.unread_children--; 
    1825       } else if (flag == 'unread') { 
    1826         p.unread_children++; 
    1827       } else { 
    1828         return; 
    1829       } 
    1830       this.set_message_icon(r.parent_uid); 
    1831       this.update_parents(r.parent_uid, flag); 
    1832     } 
    1833   }; 
     1856   
     1857    if (r.parent_uid) 
     1858      return this.find_thread_root(r.parent_uid); 
     1859    else 
     1860      return uid; 
     1861  } 
    18341862 
    18351863  // set message icon 
     
    18411869    if (!rows[uid]) 
    18421870      return false; 
    1843     if (!rows[uid].unread && rows[uid].unread_children > 0 && this.env.unreadchildrenicon) { 
     1871    if (!rows[uid].unread && rows[uid].unread_children && this.env.unreadchildrenicon) { 
    18441872      icn_src = this.env.unreadchildrenicon; 
    18451873    } 
     
    18691897    else if (!rows[uid].flagged && this.env.unflaggedicon) 
    18701898      icn_src = this.env.unflaggedicon; 
     1899 
     1900    if (rows[uid].has_children) { 
     1901      if (!rows[uid].unread && rows[uid].unread_children) 
     1902        $(rows[uid].obj).addClass('unroot'); 
     1903      else 
     1904        $(rows[uid].obj).removeClass('unroot'); 
     1905    } 
    18711906 
    18721907    if (rows[uid].flagged_icon && icn_src) 
     
    19041939    if (flag) 
    19051940      this.set_message_status(uid, flag, status); 
    1906      
     1941 
    19071942    var rowobj = $(rows[uid].obj); 
    19081943    if (rows[uid].unread && rows[uid].classname.indexOf('unread')<0) 
     
    20492084    var a_uids = new Array(); 
    20502085    var r_uids = new Array(); 
    2051     var selection = this.message_list ? this.message_list.get_selection('mark') : new Array(); 
     2086    var selection = this.message_list ? this.message_list.get_selection() : new Array(); 
    20522087 
    20532088    if (uid) 
     
    21112146 
    21122147    for (var i=0; i<a_uids.length; i++) 
    2113       this.update_parents(a_uids[i], flag); 
     2148      this.update_thread_root(a_uids[i], flag); 
    21142149  }; 
    21152150 
     
    39583993        + (flags.deleted ? ' deleted' : '') 
    39593994        + (flags.flagged ? ' flagged' : '') 
     3995        + (flags.unread_children && !flags.unread ? ' unroot' : '') 
    39603996        + (this.message_list.in_selection(uid) ? ' selected' : ''); 
    39613997 
  • branches/devel-threads/program/steps/mail/func.inc

    r3111 r3118  
    328328      $attach_icon = $attrib['attachmenticon']; 
    329329         
    330     $out .= sprintf('<tr id="rcmrow%d" class="message%s%s%s%s"%s>'."\n", 
     330    $out .= sprintf('<tr id="rcmrow%d" class="message%s%s%s%s%s"%s>'."\n", 
    331331                    $header->uid, 
    332332                    $header->seen ? '' : ' unread', 
    333333                    $header->deleted ? ' deleted' : '', 
    334334                    $header->flagged ? ' flagged' : '', 
     335                    $header->unread_children && $header->seen ? ' unroot' : '', 
    335336                    $zebra_class, 
    336337                    ($header->depth) ? ' style="display: none"' : ''); 
  • branches/devel-threads/skins/default/mail.css

    r3106 r3118  
    797797} 
    798798 
     799 
    799800#messagelist tbody tr td.flag img:hover, 
    800801#messagelist thead tr td.flag img 
     
    808809  vertical-align: middle; 
    809810  width: 99%; 
     811} 
     812 
     813/* thread parent message with unread children */ 
     814#messagelist tbody tr.unroot td.subject a 
     815{ 
     816  text-decoration: underline; 
    810817} 
    811818 
  • branches/devel-threads/skins/default/templates/mail.html

    r3109 r3118  
    6161  flaggedIcon="/images/icons/flagged.png" 
    6262  unflaggedIcon="/images/icons/blank.gif" 
    63   unreadchildrenIcon="/images/icons/unread_children.png" 
    6463  optionsmenuIcon="/images/icons/columnpicker.gif" /> 
    6564</div> 
Note: See TracChangeset for help on using the changeset viewer.