| | |
| | | { |
| | | this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'viewsource', 'print', 'load-attachment', true); |
| | | if (this.env.next_uid) |
| | | { |
| | | this.enable_command('nextmessage', true); |
| | | this.enable_command('lastmessage', true); |
| | | } |
| | | if (this.env.prev_uid) |
| | | { |
| | | this.enable_command('previousmessage', true); |
| | | this.enable_command('firstmessage', true); |
| | | } |
| | | } |
| | | |
| | | if (this.env.action=='show' && this.env.blockedobjects) |
| | |
| | | this.list_page('next'); |
| | | break; |
| | | |
| | | case 'lastpage': |
| | | this.list_page('last'); |
| | | break; |
| | | |
| | | case 'previouspage': |
| | | this.list_page('prev'); |
| | | break; |
| | | |
| | | case 'firstpage': |
| | | this.list_page('first'); |
| | | break; |
| | | |
| | | case 'expunge': |
| | |
| | | this.show_message(this.env.next_uid); |
| | | break; |
| | | |
| | | case 'lastmessage': |
| | | if (this.env.last_uid) |
| | | this.show_message(this.env.last_uid); |
| | | break; |
| | | |
| | | case 'previousmessage': |
| | | if (this.env.prev_uid) |
| | | this.show_message(this.env.prev_uid); |
| | | break; |
| | | |
| | | case 'firstmessage': |
| | | if (this.env.first_uid) |
| | | this.show_message(this.env.first_uid); |
| | | break; |
| | | |
| | | case 'checkmail': |
| | |
| | | { |
| | | if (page=='next') |
| | | page = this.env.current_page+1; |
| | | if (page=='last') |
| | | page = this.env.pagecount; |
| | | if (page=='prev' && this.env.current_page>1) |
| | | page = this.env.current_page-1; |
| | | if (page=='first' && this.env.current_page>1) |
| | | page = 1; |
| | | |
| | | if (page > 0 && page <= this.env.pagecount) |
| | | { |
| | |
| | | a_uids[a_uids.length] = this.env.uid; |
| | | else |
| | | { |
| | | var selection = this.message_list.get_selection(); |
| | | var id; |
| | | for (var n=0; n<selection.length; n++) |
| | | { |
| | |
| | | this.permanently_remove_messages = function() |
| | | { |
| | | // exit if no mailbox specified or if selection is empty |
| | | var selection = this.message_list.get_selection(); |
| | | if (!(selection.length || this.env.uid)) |
| | | return; |
| | | |
| | | if (!this.env.uid) |
| | | { |
| | | if (!this.message_list || !this.message_list.get_selection().length) |
| | | return; |
| | | } |
| | | |
| | | var a_uids = new Array(); |
| | | |
| | | if (this.env.uid) |
| | | a_uids[a_uids.length] = this.env.uid; |
| | | else |
| | | { |
| | | var selection = this.message_list.get_selection(); |
| | | var id; |
| | | for (var n=0; n<selection.length; n++) |
| | | { |
| | |
| | | |
| | | // if there is a trash mailbox defined and we're not currently in it: |
| | | if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase()!=String(this.env.trash_mailbox).toLowerCase()) |
| | | this.move_messages(this.env.trash_mailbox); |
| | | // if shift was pressed delete it immediately |
| | | if (this.message_list.shiftkey) |
| | | { |
| | | if (confirm(this.get_label('deletemessagesconfirm'))) |
| | | this.permanently_remove_messages(); |
| | | } |
| | | else |
| | | this.move_messages(this.env.trash_mailbox); |
| | | // if there is a trash mailbox defined but we *are* in it: |
| | | else if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() == String(this.env.trash_mailbox).toLowerCase()) |
| | | this.permanently_remove_messages(); |
| | |
| | | this.set_page_buttons = function() |
| | | { |
| | | this.enable_command('nextpage', (this.env.pagecount > this.env.current_page)); |
| | | this.enable_command('lastpage', (this.env.pagecount > this.env.current_page)); |
| | | this.enable_command('previouspage', (this.env.current_page > 1)); |
| | | this.enable_command('firstpage', (this.env.current_page > 1)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | case 'list': |
| | | if (this.env.messagecount) |
| | | this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox)); |
| | | this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox)); |
| | | |
| | | case 'expunge': |
| | | this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false); |