Changeset 3118 in subversion
- Timestamp:
- Nov 19, 2009 1:08:37 PM (4 years ago)
- Location:
- branches/devel-threads
- Files:
-
- 6 edited
-
THREADS (modified) (4 diffs)
-
program/include/rcube_imap.php (modified) (1 diff)
-
program/js/app.js (modified) (11 diffs)
-
program/steps/mail/func.inc (modified) (1 diff)
-
skins/default/mail.css (modified) (2 diffs)
-
skins/default/templates/mail.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-threads/THREADS
r3111 r3118 9 9 - removed imap_thread_algorithm option, we're using the best algorithm 10 10 supported by server and implement REFS sorting in Roundcube 11 - use underlined subject for root with unread children (icon is also supported) 11 12 12 13 CHANGES IN RELATION TO TRUNK (for pasting into CHANGELOG after merge) … … 22 23 if "expand all" is disabled we should fetch only root messages and fetch 23 24 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 24 28 - after message delete we shouldn't reload the whole list, only the thread 25 29 in which the message was … … 31 35 - replace expand_unread() (list.js) with something universal, 32 36 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 instead34 of unread_children icon35 37 - reset autoexpand feature if collapse-all/expand-all was used. Save state for next page 36 38 in the same folder. E.g. autoexpand is on, list is displayed with expanded … … 41 43 listing the folders) 42 44 - thread css: message row height, thread/status icon alignment 45 - use underlined subject only if thread is collapsed 43 46 44 47 KNOWN ISSUES: 45 48 - after message(s) deletion the whole list is reloaded (see TODO), 46 - unread_children icon is not shown after changing message status to47 Seen, when root is e.g. "replied", also when thread contains many unread48 children. For me, we should use underlined subject instead of unread_children49 icon -
branches/devel-threads/program/include/rcube_imap.php
r3106 r3118 859 859 $headers[$idx]->parent_uid = end($parents); 860 860 if (!$header->seen) 861 $headers[$parents[0]]->unread_children = true;861 $headers[$parents[0]]->unread_children++; 862 862 } 863 863 array_push($parents, $header->uid); -
branches/devel-threads/program/js/app.js
r3109 r3118 441 441 } 442 442 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 443 451 // 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])) 445 454 { 446 455 var p = this; … … 451 460 452 461 // 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) 454 463 { 455 464 var found; … … 459 468 460 469 // 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])) 462 472 { 463 473 var p = this; … … 1626 1636 { 1627 1637 this.set_message(id, 'unread', false); 1628 this.update_ parents(id, 'read');1638 this.update_thread_root(id, 'read'); 1629 1639 if (this.env.unread_counts[this.env.mailbox]) 1630 1640 { … … 1815 1825 }; 1816 1826 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) 1819 1854 { 1820 1855 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 } 1834 1862 1835 1863 // set message icon … … 1841 1869 if (!rows[uid]) 1842 1870 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) { 1844 1872 icn_src = this.env.unreadchildrenicon; 1845 1873 } … … 1869 1897 else if (!rows[uid].flagged && this.env.unflaggedicon) 1870 1898 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 } 1871 1906 1872 1907 if (rows[uid].flagged_icon && icn_src) … … 1904 1939 if (flag) 1905 1940 this.set_message_status(uid, flag, status); 1906 1941 1907 1942 var rowobj = $(rows[uid].obj); 1908 1943 if (rows[uid].unread && rows[uid].classname.indexOf('unread')<0) … … 2049 2084 var a_uids = new Array(); 2050 2085 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(); 2052 2087 2053 2088 if (uid) … … 2111 2146 2112 2147 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); 2114 2149 }; 2115 2150 … … 3958 3993 + (flags.deleted ? ' deleted' : '') 3959 3994 + (flags.flagged ? ' flagged' : '') 3995 + (flags.unread_children && !flags.unread ? ' unroot' : '') 3960 3996 + (this.message_list.in_selection(uid) ? ' selected' : ''); 3961 3997 -
branches/devel-threads/program/steps/mail/func.inc
r3111 r3118 328 328 $attach_icon = $attrib['attachmenticon']; 329 329 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", 331 331 $header->uid, 332 332 $header->seen ? '' : ' unread', 333 333 $header->deleted ? ' deleted' : '', 334 334 $header->flagged ? ' flagged' : '', 335 $header->unread_children && $header->seen ? ' unroot' : '', 335 336 $zebra_class, 336 337 ($header->depth) ? ' style="display: none"' : ''); -
branches/devel-threads/skins/default/mail.css
r3106 r3118 797 797 } 798 798 799 799 800 #messagelist tbody tr td.flag img:hover, 800 801 #messagelist thead tr td.flag img … … 808 809 vertical-align: middle; 809 810 width: 99%; 811 } 812 813 /* thread parent message with unread children */ 814 #messagelist tbody tr.unroot td.subject a 815 { 816 text-decoration: underline; 810 817 } 811 818 -
branches/devel-threads/skins/default/templates/mail.html
r3109 r3118 61 61 flaggedIcon="/images/icons/flagged.png" 62 62 unflaggedIcon="/images/icons/blank.gif" 63 unreadchildrenIcon="/images/icons/unread_children.png"64 63 optionsmenuIcon="/images/icons/columnpicker.gif" /> 65 64 </div>
Note: See TracChangeset
for help on using the changeset viewer.
