Changeset 25c35c8 in github
- Timestamp:
- Sep 19, 2008 12:14:10 PM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 20a2519
- Parents:
- 50b59a1
- Location:
- program
- Files:
-
- 3 edited
-
js/app.js (modified) (16 diffs)
-
js/list.js (modified) (1 diff)
-
steps/mail/show.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
program/js/app.js
rcc0d55c r25c35c8 759 759 { 760 760 uid = props._row.uid; 761 this.message_list.dont_select = true;762 761 // toggle flagged/unflagged 763 762 if (this.message_list.rows[uid].flagged) … … 1346 1345 /*********************************************************/ 1347 1346 1348 1349 1347 // when user doble-clicks on a row 1350 1348 this.show_message = function(id, safe, preview) … … 1541 1539 }; 1542 1540 1541 // set message icon 1542 this.set_message_icon = function(uid) 1543 { 1544 var icn_src; 1545 var rows = this.message_list.rows; 1546 1547 if (!rows[uid]) 1548 return false; 1549 1550 if (rows[uid].deleted && this.env.deletedicon) 1551 icn_src = this.env.deletedicon; 1552 else if (rows[uid].replied && this.env.repliedicon) 1553 { 1554 if (rows[uid].forwarded && this.env.forwardedrepliedicon) 1555 icn_src = this.env.forwardedrepliedicon; 1556 else 1557 icn_src = this.env.repliedicon; 1558 } 1559 else if (rows[uid].forwarded && this.env.forwardedicon) 1560 icn_src = this.env.forwardedicon; 1561 else if (rows[uid].unread && this.env.unreadicon) 1562 icn_src = this.env.unreadicon; 1563 else if (this.env.messageicon) 1564 icn_src = this.env.messageicon; 1565 1566 if (icn_src && rows[uid].icon) 1567 rows[uid].icon.src = icn_src; 1568 1569 icn_src = ''; 1570 1571 if (rows[uid].flagged && this.env.flaggedicon) 1572 icn_src = this.env.flaggedicon; 1573 else if (this.env.unflaggedicon) 1574 icn_src = this.env.unflaggedicon; 1575 1576 if (rows[uid].flagged_icon && icn_src) 1577 rows[uid].flagged_icon.src = icn_src; 1578 } 1579 1580 // set message status 1581 this.set_message_status = function(uid, flag, status) 1582 { 1583 var rows = this.message_list.rows; 1584 1585 if (!rows[uid]) return false; 1586 1587 if (flag == 'unread') 1588 rows[uid].unread = status; 1589 else if(flag == 'deleted') 1590 rows[uid].deleted = status; 1591 else if (flag == 'replied') 1592 rows[uid].replied = status; 1593 else if (flag == 'forwarded') 1594 rows[uid].forwarded = status; 1595 else if (flag == 'flagged') 1596 rows[uid].flagged = status; 1597 } 1598 1599 // set message row status, class and icon 1600 this.set_message = function(uid, flag, status) 1601 { 1602 var rows = this.message_list.rows; 1603 1604 if (!rows[uid]) return false; 1605 1606 if (flag) 1607 this.set_message_status(uid, flag, status); 1608 1609 if (rows[uid].unread && rows[uid].classname.indexOf('unread')<0) 1610 { 1611 rows[uid].classname += ' unread'; 1612 this.set_classname(rows[uid].obj, 'unread', true); 1613 } 1614 else if (!rows[uid].unread && rows[uid].classname.indexOf('unread')>=0) 1615 { 1616 rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 1617 this.set_classname(rows[uid].obj, 'unread', false); 1618 } 1619 1620 if (rows[uid].deleted && rows[uid].classname.indexOf('deleted')<0) 1621 { 1622 rows[uid].classname += ' deleted'; 1623 this.set_classname(rows[uid].obj, 'deleted', true); 1624 } 1625 else if (!rows[uid].deleted && rows[uid].classname.indexOf('deleted')>=0) 1626 { 1627 rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, ''); 1628 this.set_classname(rows[uid].obj, 'deleted', false); 1629 } 1630 1631 this.set_message_icon(uid); 1632 } 1543 1633 1544 1634 // move selected messages to the specified mailbox … … 1640 1730 { 1641 1731 rows[id].deleted = true; 1642 1643 if (rows[id].classname.indexOf('deleted')<0)1644 {1645 rows[id].classname += ' deleted';1646 this.set_classname(rows[id].obj, 'deleted', true);1647 }1648 1732 if (this.env.read_when_deleted) 1649 { 1650 rows[id].classname = rows[id].classname.replace(/\s*unread/, ''); 1651 this.set_classname(rows[id].obj, 'unread', false); 1652 } 1653 1654 if (rows[id].icon && this.env.deletedicon) 1655 rows[id].icon.src = this.env.deletedicon; 1733 rows[id].unread = false; 1734 this.set_message(id); 1656 1735 } 1657 1736 } … … 1728 1807 { 1729 1808 // mark all message rows as read/unread 1730 var icn_src;1731 var rows = this.message_list.rows;1732 1809 for (var i=0; i<a_uids.length; i++) 1733 { 1734 uid = a_uids[i]; 1735 if (rows[uid]) 1736 { 1737 rows[uid].unread = (flag=='unread' ? true : false); 1738 1739 if (rows[uid].classname.indexOf('unread')<0 && rows[uid].unread) 1740 { 1741 rows[uid].classname += ' unread'; 1742 this.set_classname(rows[uid].obj, 'unread', true); 1743 1744 if (this.env.unreadicon) 1745 icn_src = this.env.unreadicon; 1746 } 1747 else if (!rows[uid].unread) 1748 { 1749 rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 1750 this.set_classname(rows[uid].obj, 'unread', false); 1751 1752 if (this.env.messageicon) 1753 icn_src = this.env.messageicon; 1754 } 1755 1756 if (rows[uid].icon && icn_src 1757 && !(rows[uid].replied && this.env.repliedicon) 1758 && !(rows[uid].forwarded && this.env.forwardedicon) 1759 && !(rows[uid].deleted && this.env.deletedicon)) 1760 rows[uid].icon.src = icn_src; 1761 } 1762 } 1810 this.set_message(a_uids[i], 'unread', (flag=='unread' ? true : false)); 1763 1811 1764 1812 this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag); 1765 1813 }; 1766 1814 1767 // set class to read/unread1768 this.mark_as_read_from_preview = function(uid)1769 {1770 var icn_src;1771 var rows = parent.rcmail.message_list.rows;1772 if(rows[uid].unread)1773 {1774 rows[uid].unread = false;1775 rows[uid].classname = rows[uid].classname.replace(/\s*unread/, '');1776 parent.rcmail.set_classname(rows[uid].obj, 'unread', false);1777 1778 if (rows[uid].deleted && parent.rcmail.env.deletedicon)1779 icn_src = parent.rcmail.env.deletedicon;1780 else if (rows[uid].replied && parent.rcmail.env.repliedicon)1781 {1782 if (rows[uid].forwarded && parent.rcmail.env.forwardedrepliedicon)1783 icn_src = parent.rcmail.env.forwardedrepliedicon;1784 else1785 icn_src = parent.rcmail.env.repliedicon;1786 }1787 else if (rows[uid].forwarded && parent.rcmail.env.forwardedicon)1788 icn_src = parent.rcmail.env.forwardedicon;1789 else if (parent.rcmail.env.messageicon)1790 icn_src = parent.rcmail.env.messageicon;1791 1792 if (rows[uid].icon && icn_src)1793 rows[uid].icon.src = icn_src;1794 }1795 }1796 1797 1798 1815 // set image to flagged or unflagged 1799 1816 this.toggle_flagged_status = function(flag, a_uids) 1800 1817 { 1801 1818 // mark all message rows as flagged/unflagged 1802 var icn_src;1803 var rows = this.message_list.rows;1804 1819 for (var i=0; i<a_uids.length; i++) 1805 { 1806 uid = a_uids[i]; 1807 if (rows[uid]) 1808 { 1809 rows[uid].flagged = (flag=='flagged' ? true : false); 1810 1811 if (rows[uid].flagged && this.env.flaggedicon) 1812 icn_src = this.env.flaggedicon; 1813 else if (this.env.unflaggedicon) 1814 icn_src = this.env.unflaggedicon; 1815 1816 if (rows[uid].flagged_icon && icn_src) 1817 rows[uid].flagged_icon.src = icn_src; 1818 } 1819 } 1820 this.set_message(a_uids[i], 'flagged', (flag=='flagged' ? true : false)); 1820 1821 1821 1822 this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag); … … 1829 1830 if (a_uids.length==1) 1830 1831 { 1831 if (!rows.length || (rows[a_uids[0]] && rows[a_uids[0]].classname.indexOf('deleted') < 0))1832 if (!rows.length || (rows[a_uids[0]] && !rows[a_uids[0]].deleted)) 1832 1833 this.flag_as_deleted(a_uids); 1833 1834 else … … 1842 1843 uid = a_uids[i]; 1843 1844 if (rows[uid]) { 1844 if ( rows[uid].classname.indexOf('deleted')<0)1845 if (!rows[uid].deleted) 1845 1846 { 1846 1847 all_deleted = false; … … 1861 1862 this.flag_as_undeleted = function(a_uids) 1862 1863 { 1863 var icn_src;1864 var rows = this.message_list ? this.message_list.rows : new Array();1865 1866 1864 for (var i=0; i<a_uids.length; i++) 1867 { 1868 uid = a_uids[i]; 1869 if (rows[uid]) { 1870 rows[uid].deleted = false; 1871 1872 if (rows[uid].classname.indexOf('deleted') > 0) 1873 { 1874 rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, ''); 1875 this.set_classname(rows[uid].obj, 'deleted', false); 1876 } 1877 1878 if (rows[uid].unread && this.env.unreadicon) 1879 icn_src = this.env.unreadicon; 1880 else if (rows[uid].replied && this.env.repliedicon) 1881 { 1882 if (rows[uid].forwarded && this.env.forwardedrepliedicon) 1883 icn_src = this.env.forwardedrepliedicon; 1884 else 1885 icn_src = this.env.repliedicon; 1886 } 1887 else if (rows[uid].forwarded && this.env.forwardedicon) 1888 icn_src = this.env.forwardedicon; 1889 else if (this.env.messageicon) 1890 icn_src = this.env.messageicon; 1891 1892 if (rows[uid].icon && icn_src) 1893 rows[uid].icon.src = icn_src; 1894 } 1895 } 1865 this.set_message(a_uids[i], 'deleted', false); 1896 1866 1897 1867 this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag=undelete'); … … 1911 1881 if (rows[uid]) 1912 1882 { 1913 rows[uid].deleted = true; 1914 1915 if (rows[uid].classname.indexOf('deleted')<0) 1916 { 1917 rows[uid].classname += ' deleted'; 1918 this.set_classname(rows[uid].obj, 'deleted', true); 1919 } 1920 if (this.env.read_when_deleted) 1921 { 1922 rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 1923 this.set_classname(rows[uid].obj, 'unread', false); 1924 } 1925 1926 if (rows[uid].icon && this.env.deletedicon) 1927 rows[uid].icon.src = this.env.deletedicon; 1928 1883 this.set_message(uid, 'deleted', true); 1929 1884 if (rows[uid].unread) 1930 1885 r_uids[r_uids.length] = uid; … … 1958 1913 rows[uid].unread = false; 1959 1914 rows[uid].read = true; 1960 1961 rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 1962 this.set_classname(rows[uid].obj, 'unread', false); 1963 1964 if (rows[uid].icon) 1965 rows[uid].icon.src = this.env.deletedicon; 1915 this.set_message(uid); 1966 1916 } 1967 1917 } … … 2360 2310 /********* keyboard live-search methods *********/ 2361 2311 /*********************************************************/ 2362 2363 2312 2364 2313 // handler for keyboard events on address-fields … … 2582 2531 /*********************************************************/ 2583 2532 2584 2585 2533 this.contactlist_keypress = function(list) 2586 2534 { … … 3511 3459 if (flags.deleted && this.env.deletedicon) 3512 3460 icon = this.env.deletedicon; 3513 else if(flags.unread && this.env.unreadicon)3514 icon = this.env.unreadicon;3515 3461 else if (flags.replied && this.env.repliedicon) 3516 3462 { … … 3522 3468 else if (flags.forwarded && this.env.forwardedicon) 3523 3469 icon = this.env.forwardedicon; 3470 else if(flags.unread && this.env.unreadicon) 3471 icon = this.env.unreadicon; 3524 3472 3525 3473 var col = document.createElement('TD'); … … 3657 3605 }; 3658 3606 3659 // update parent's mailboxlist (from preview)3660 this.set_unread_count_from_preview = function(mbox, count, set_title)3661 {3662 parent.rcmail.set_unread_count(mbox, count, set_title);3663 }3664 3665 3607 // add row to contacts list 3666 3608 this.add_contact_row = function(cid, cols, select) … … 4234 4176 bw.win ? 500 : 200); 4235 4177 } 4236 -
program/js/list.js
r633142f r25c35c8 174 174 175 175 /** 176 * Set focu rto the list176 * Set focus to the list 177 177 */ 178 178 focus: function(e) -
program/steps/mail/show.inc
r203ee44 r25c35c8 72 72 if($RCMAIL->action == 'preview' && $marked != -1) 73 73 { 74 $OUTPUT->command(' set_unread_count_from_preview', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX'));75 $OUTPUT->command(' mark_as_read_from_preview', $MESSAGE->uid);74 $OUTPUT->command('parent.set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX')); 75 $OUTPUT->command('parent.set_message', $MESSAGE->uid, 'unread', false); 76 76 } 77 77 }
Note: See TracChangeset
for help on using the changeset viewer.
