| | |
| | | if (this.env.trash_mailbox && this.env.mailbox != this.env.trash_mailbox) |
| | | this.set_alttext('delete', 'movemessagetotrash'); |
| | | |
| | | this.env.message_commands = ['show', 'reply', 'reply-all', 'forward', 'moveto', 'copy', 'delete', |
| | | 'open', 'mark', 'edit', 'viewsource', 'download', 'print', 'load-attachment', 'load-headers']; |
| | | this.env.message_commands = ['show', 'reply', 'reply-all', 'reply-list', 'forward', |
| | | 'moveto', 'copy', 'delete', 'open', 'mark', 'edit', 'viewsource', 'download', |
| | | 'print', 'load-attachment', 'load-headers']; |
| | | |
| | | if (this.env.action=='show' || this.env.action=='preview') { |
| | | this.enable_command(this.env.message_commands, this.env.uid); |
| | | this.enable_command('reply-list', this.env.list_post); |
| | | |
| | | if (this.env.next_uid) { |
| | | this.enable_command('nextmessage', 'lastmessage', true); |
| | |
| | | break; |
| | | |
| | | case 'reply-all': |
| | | case 'reply-list': |
| | | case 'reply': |
| | | var uid; |
| | | if (uid = this.get_single_uid()) |
| | | this.goto_url('compose', '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(command=='reply-all' ? '&_all=1' : ''), true); |
| | | if (uid = this.get_single_uid()) { |
| | | var url = '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox); |
| | | if (command == 'reply-all') |
| | | // do reply-list, when list is detected and popup menu wasn't used |
| | | url += '&_all=' + (!props && this.commands['reply-list'] ? 'list' : 'all'); |
| | | else if (command == 'reply-list') |
| | | url += '&_all=list'; |
| | | |
| | | this.goto_url('compose', url, true); |
| | | } |
| | | break; |
| | | |
| | | case 'forward': |
| | |
| | | } |
| | | } |
| | | |
| | | this.http_post('utils/save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); |
| | | this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); |
| | | this.set_unread_count_display(id, false); |
| | | }; |
| | | |
| | |
| | | var selected = list.get_single_selection() != null; |
| | | |
| | | this.enable_command(this.env.message_commands, selected); |
| | | // Hide certain command buttons when Drafts folder is selected |
| | | if (selected && this.env.mailbox == this.env.drafts_mailbox) { |
| | | this.enable_command('reply', 'reply-all', 'forward', false); |
| | | if (selected) { |
| | | // Hide certain command buttons when Drafts folder is selected |
| | | if (this.env.mailbox == this.env.drafts_mailbox) |
| | | this.enable_command('reply', 'reply-all', 'reply-list', 'forward', false); |
| | | // Disable reply-list when List-Post header is not set |
| | | else { |
| | | var msg = this.env.messages[list.get_single_selection()]; |
| | | if (!msg.ml) |
| | | this.enable_command('reply-list', false); |
| | | } |
| | | } |
| | | // Multi-message commands |
| | | this.enable_command('delete', 'moveto', 'copy', 'mark', (list.selection.length > 0 ? true : false)); |
| | |
| | | if ((found = $.inArray('subject', this.env.coltypes)) >= 0) |
| | | this.set_env('subject_col', found); |
| | | |
| | | this.http_post('utils/save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' }); |
| | | this.http_post('save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' }); |
| | | }; |
| | | |
| | | this.check_droptarget = function(id) |
| | |
| | | unread_children: flags.unread_children?flags.unread_children:0, |
| | | parent_uid: flags.parent_uid?flags.parent_uid:0, |
| | | selected: this.select_all_mode || this.message_list.in_selection(uid), |
| | | ml: flags.ml?1:0, |
| | | // flags from plugins |
| | | flags: flags.extra_flags |
| | | }); |
| | |
| | | |
| | | this.init_address_input_events = function(obj) |
| | | { |
| | | var handler = function(e){ return ref.ksearch_keypress(e,this); }; |
| | | obj.bind((bw.safari || bw.ie ? 'keydown' : 'keypress'), handler); |
| | | obj.attr('autocomplete', 'off'); |
| | | obj[bw.ie || bw.safari || bw.chrome ? 'keydown' : 'keypress'](function(e){ return ref.ksearch_keydown(e, this); }) |
| | | .attr('autocomplete', 'off'); |
| | | }; |
| | | |
| | | // checks the input fields before sending a message |
| | |
| | | |
| | | this.sent_successfully = function(type, msg) |
| | | { |
| | | this.list_mailbox(); |
| | | this.display_message(msg, type, true); |
| | | // before redirect we need to wait some time for Chrome (#1486177) |
| | | window.setTimeout(function(){ ref.list_mailbox(); }, 500); |
| | | }; |
| | | |
| | | |
| | |
| | | /*********************************************************/ |
| | | |
| | | // handler for keyboard events on address-fields |
| | | this.ksearch_keypress = function(e, obj) |
| | | this.ksearch_keydown = function(e, obj) |
| | | { |
| | | if (this.ksearch_timer) |
| | | clearTimeout(this.ksearch_timer); |
| | |
| | | } |
| | | }; |
| | | |
| | | |
| | | this.delete_contacts = function() |
| | | { |
| | | // exit if no mailbox specified or if selection is empty |
| | |
| | | |
| | | this.enable_command('export', (this.contact_list.rowcount > 0)); |
| | | }; |
| | | |
| | | |
| | | this.group_create = function() |
| | | { |
| | |
| | | if (li && (link = li.firstChild) && link.tagName.toLowerCase() == 'a') |
| | | link.innerHTML = prop.name; |
| | | |
| | | this.env.contactfolders[key].name = this.env.contactgroups[key].name = name; |
| | | this.env.contactfolders[key].name = this.env.contactgroups[key].name = prop.name; |
| | | this.triggerEvent('group_update', { id:prop.id, source:prop.source, name:prop.name, li:li[0] }); |
| | | }; |
| | | |
| | |
| | | if (this.env.action == 'show') { |
| | | // re-enable commands on move/delete error |
| | | this.enable_command(this.env.message_commands, true); |
| | | if (!this.env.list_post) |
| | | this.enable_command('reply-list', false); |
| | | } |
| | | else if (this.task == 'addressbook') { |
| | | this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount }); |