diff options
author | alecpl <alec@alec.pl> | 2010-10-18 17:32:34 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-10-18 17:32:34 +0000 |
commit | 98f2c93209dfb6277502ec0f29d5128e139cf0ff (patch) | |
tree | 3774f3ffce67a1d3272b15eb1090bea4ef21f946 | |
parent | 8b6eff6e69c2842cefbfe5ca384732c3ccd1305e (diff) |
- When read-status column is disabled create status icon in subject column
- Change read-status column icons so they are working like in flag column
- Some js code cleanup
-rw-r--r-- | program/js/app.js | 115 | ||||
-rw-r--r-- | skins/default/ie6hacks.css | 12 | ||||
-rw-r--r-- | skins/default/images/messageicons.gif | bin | 1647 -> 1687 bytes | |||
-rw-r--r-- | skins/default/images/messageicons.png | bin | 2891 -> 3011 bytes | |||
-rw-r--r-- | skins/default/mail.css | 36 |
5 files changed, 103 insertions, 60 deletions
diff --git a/program/js/app.js b/program/js/app.js index 558a8b8a7..45569ea95 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1545,23 +1545,28 @@ function rcube_webmail() this.init_message_row = function(row) { - var expando, self = this, uid = row.uid; + var expando, self = this, uid = row.uid, + status_icon = (this.env.status_col != null ? 'status' : 'msg') + 'icn' + row.uid; if (uid && this.env.messages[uid]) $.extend(row, this.env.messages[uid]); - row.msgicon = document.getElementById('msgicn'+row.uid); - - // set eventhandler to message status icon - if (row.icon = document.getElementById('statusicn'+row.uid)) { + // set eventhandler to status icon + if (row.icon = document.getElementById(status_icon)) { row.icon._row = row.obj; row.icon.onmousedown = function(e) { self.command('toggle_status', this); rcube_event.cancel(e); }; } + // save message icon position too + if (this.env.status_col != null) + row.msgicon = document.getElementById('msgicn'+row.uid); + else + row.msgicon = row.icon; + // set eventhandler to flag icon, if icon found - if (this.env.flagged_col != null && (row.flagged_icon = document.getElementById('flagicn'+row.uid))) { - row.flagged_icon._row = row.obj; - row.flagged_icon.onmousedown = function(e) { self.command('toggle_flag', this); rcube_event.cancel(e); }; + if (this.env.flagged_col != null && (row.flagicon = document.getElementById('flagicn'+row.uid))) { + row.flagicon._row = row.obj; + row.flagicon.onmousedown = function(e) { self.command('toggle_flag', this); rcube_event.cancel(e); }; } if (!row.depth && row.has_children && (expando = document.getElementById('rcmexpando'+row.uid))) { @@ -1622,8 +1627,15 @@ function rcube_webmail() // message status icons css_class = 'msgicon'; - if (!flags.unread && flags.unread_children > 0) - css_class += ' unreadchildren'; + if (this.env.status_col === null) { + css_class += ' status'; + if (flags.deleted) + css_class += ' deleted'; + else if (flags.unread) + css_class += ' unread'; + else if (flags.unread_children > 0) + css_class += ' unreadchildren'; + } if (flags.replied) css_class += ' replied'; if (flags.forwarded) @@ -1694,6 +1706,8 @@ function rcube_webmail() css_class = 'deleted'; else if (flags.unread) css_class = 'unread'; + else if (flags.unread_children > 0) + css_class = 'unreadchildren'; else css_class = 'msgicon'; html = '<span id="statusicn'+uid+'" class="'+css_class+'"> </span>'; @@ -2220,84 +2234,94 @@ function rcube_webmail() this.set_message_icon = function(uid) { var css_class, - rows = this.message_list.rows; + row = this.message_list.rows[uid]; - if (!rows[uid]) + if (!row) return false; - if (rows[uid].icon) { - if (rows[uid].deleted) - css_class = 'deleted'; - else if (rows[uid].unread) - css_class = 'unread'; - else - css_class = 'msgicon'; + if (row.icon) { + css_class = 'msgicon'; + if (row.deleted) + css_class += ' deleted'; + else if (row.unread) + css_class += ' unread'; + else if (row.unread_children) + css_class += ' unreadchildren'; + if (row.msgicon == row.icon) { + if (row.replied) + css_class += ' replied'; + if (row.forwarded) + css_class += ' forwarded'; + css_class += ' status'; + } - rows[uid].icon.className = css_class; + row.icon.className = css_class; } - if (rows[uid].msgicon) { + if (row.msgicon && row.msgicon != row.icon) { css_class = 'msgicon'; - if (!rows[uid].unread && rows[uid].unread_children) + if (!row.unread && row.unread_children) css_class += ' unreadchildren'; - if (rows[uid].replied) + if (row.replied) css_class += ' replied'; - if (rows[uid].forwarded) + if (row.forwarded) css_class += ' forwarded'; - rows[uid].msgicon.className = css_class; + row.msgicon.className = css_class; } - if (rows[uid].flagged_icon) { - css_class = (rows[uid].flagged ? 'flagged' : 'unflagged'); - rows[uid].flagged_icon.className = css_class; + if (row.flagicon) { + css_class = (row.flagged ? 'flagged' : 'unflagged'); + row.flagicon.className = css_class; } }; // set message status this.set_message_status = function(uid, flag, status) { - var rows = this.message_list.rows; + var row = this.message_list.rows[uid]; - if (!rows[uid]) return false; + if (!row) + return false; if (flag == 'unread') - rows[uid].unread = status; + row.unread = status; else if(flag == 'deleted') - rows[uid].deleted = status; + row.deleted = status; else if (flag == 'replied') - rows[uid].replied = status; + row.replied = status; else if (flag == 'forwarded') - rows[uid].forwarded = status; + row.forwarded = status; else if (flag == 'flagged') - rows[uid].flagged = status; + row.flagged = status; }; // set message row status, class and icon this.set_message = function(uid, flag, status) { - var rows = this.message_list.rows; + var row = this.message_list.rows[uid]; - if (!rows[uid]) return false; + if (!row) + return false; if (flag) this.set_message_status(uid, flag, status); - var rowobj = $(rows[uid].obj); + var rowobj = $(row.obj); - if (rows[uid].unread && !rowobj.hasClass('unread')) + if (row.unread && !rowobj.hasClass('unread')) rowobj.addClass('unread'); - else if (!rows[uid].unread && rowobj.hasClass('unread')) + else if (!row.unread && rowobj.hasClass('unread')) rowobj.removeClass('unread'); - if (rows[uid].deleted && !rowobj.hasClass('deleted')) + if (row.deleted && !rowobj.hasClass('deleted')) rowobj.addClass('deleted'); - else if (!rows[uid].deleted && rowobj.hasClass('deleted')) + else if (!row.deleted && rowobj.hasClass('deleted')) rowobj.removeClass('deleted'); - if (rows[uid].flagged && !rowobj.hasClass('flagged')) + if (row.flagged && !rowobj.hasClass('flagged')) rowobj.addClass('flagged'); - else if (!rows[uid].flagged && rowobj.hasClass('flagged')) + else if (!row.flagged && rowobj.hasClass('flagged')) rowobj.removeClass('flagged'); this.set_unread_children(uid); @@ -4681,6 +4705,7 @@ function rcube_webmail() this.env.subject_col = null; this.env.flagged_col = null; + this.env.status_col = null; if ((n = $.inArray('subject', this.env.coltypes)) >= 0) { this.set_env('subject_col', n); @@ -4689,6 +4714,8 @@ function rcube_webmail() } if ((n = $.inArray('flag', this.env.coltypes)) >= 0) this.set_env('flagged_col', n); + if ((n = $.inArray('status', this.env.coltypes)) >= 0) + this.set_env('status_col', n); this.message_list.init_header(); }; diff --git a/skins/default/ie6hacks.css b/skins/default/ie6hacks.css index d5cdf4537..1b8135dfe 100644 --- a/skins/default/ie6hacks.css +++ b/skins/default/ie6hacks.css @@ -130,12 +130,16 @@ ul.toolbarmenu li.separator_below #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.status span.unread, +#messagelist tr td.status span.unreadchildren, #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.unreadchildren +#messagelist tr td.subject span.deleted, +#messagelist tr td.subject span.unread, +#messagelist tr td.subject span.replied, +#messagelist tr td.subject span.forwarded, +#messagelist tr td.subject span.unreadchildren { background-image: url(images/messageicons.gif); } + diff --git a/skins/default/images/messageicons.gif b/skins/default/images/messageicons.gif Binary files differindex e4c3fdcb3..60526f1f3 100644 --- a/skins/default/images/messageicons.gif +++ b/skins/default/images/messageicons.gif diff --git a/skins/default/images/messageicons.png b/skins/default/images/messageicons.png Binary files differindex e5dd6a285..5afb4cbf8 100644 --- a/skins/default/images/messageicons.png +++ b/skins/default/images/messageicons.png diff --git a/skins/default/mail.css b/skins/default/mail.css index 5e7ddf26d..fd094202f 100644 --- a/skins/default/mail.css +++ b/skins/default/mail.css @@ -702,7 +702,8 @@ body.messagelist } #messagelist tbody tr td.flag, -#messagelist tbody tr td.status +#messagelist tbody tr td.status, +#messagelist tbody tr td.subject span.status { cursor: pointer; } @@ -725,10 +726,13 @@ body.messagelist #messagelist tr td.status span.msgicon, #messagelist tr td.status span.deleted, #messagelist tr td.status span.unread, +#messagelist tr td.status span.unreadchildren, #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.unreadchildren +#messagelist tr td.subject span.deleted, +#messagelist tr td.subject span.unread, +#messagelist tr td.subject span.replied, +#messagelist tr td.subject span.forwarded, +#messagelist tr td.subject span.unreadchildren { vertical-align: middle; height: 17px; @@ -757,39 +761,47 @@ body.messagelist } #messagelist tr td.subject span.msgicon, -#messagelist tr td.subject span.msgicon.unreadchildren +#messagelist tr td.subject span.unreadchildren { background-position: 0 -51px; margin: 0 2px; } -#messagelist tr td.subject span.msgicon.replied +#messagelist tr td.subject span.replied { background-position: 0 -85px; } -#messagelist tr td.subject span.msgicon.forwarded +#messagelist tr td.subject span.forwarded { background-position: 0 -68px; } -#messagelist tr td.subject span.msgicon.replied.forwarded +#messagelist tr td.subject span.replied.forwarded { background-position: 0 -102px; } -#messagelist tr td.status span.msgicon +#messagelist tr td.status span.msgicon, +#messagelist tr td.status span.unreadchildren { - background-position: 0 -51px; + background-position: 0 17px; /* no icon */ } -#messagelist tr td.status span.deleted +#messagelist tr td.status span.msgicon:hover +{ + background-position: 0 -272px; +} + +#messagelist tr td.status span.deleted, +#messagelist tr td.subject span.deleted { background-position: 0 -187px; } #messagelist tr td.status span.status, -#messagelist tr td.status span.unread +#messagelist tr td.status span.unread, +#messagelist tr td.subject span.unread { background-position: 0 -119px; } |