| | |
| | | .addEventListener('initrow', function(o) { ref.triggerEvent('insertrow', { cid:o.uid, row:o }); }) |
| | | .addEventListener('select', function(o) { ref.compose_recipient_select(o); }) |
| | | .addEventListener('dblclick', function(o) { ref.compose_add_recipient('to'); }) |
| | | .addEventListener('keypress', function(o) { if (o.key_pressed == o.ENTER_KEY) ref.compose_add_recipient('to'); }) |
| | | .addEventListener('keypress', function(o) { |
| | | if (o.key_pressed == o.ENTER_KEY) { |
| | | if (!ref.compose_add_recipient('to')) { |
| | | // execute link action on <enter> if not a recipient entry |
| | | if (o.last_selected && String(o.last_selected).charAt(0) == 'G') { |
| | | $(o.rows[o.last_selected].obj).find('a').first().click(); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | .init(); |
| | | } |
| | | |
| | |
| | | |
| | | if (this.gui_objects.identitieslist) { |
| | | this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist, |
| | | {multiselect:false, draggable:false, keyboard:false}); |
| | | {multiselect:false, draggable:false, keyboard:true}); |
| | | this.identity_list |
| | | .addEventListener('select', function(o) { ref.identity_select(o); }) |
| | | .addEventListener('keypress', function(o) { |
| | | if (o.key_pressed == o.ENTER_KEY) { |
| | | ref.identity_select(o); |
| | | } |
| | | }) |
| | | .init() |
| | | .focus(); |
| | | |
| | |
| | | this.identity_list.highlight_row(this.env.iid); |
| | | } |
| | | else if (this.gui_objects.sectionslist) { |
| | | this.sections_list = new rcube_list_widget(this.gui_objects.sectionslist, {multiselect:false, draggable:false, keyboard:false}); |
| | | this.sections_list = new rcube_list_widget(this.gui_objects.sectionslist, {multiselect:false, draggable:false, keyboard:true}); |
| | | this.sections_list |
| | | .addEventListener('select', function(o) { ref.section_select(o); }) |
| | | .addEventListener('keypress', function(o) { if (o.key_pressed == o.ENTER_KEY) ref.section_select(o); }) |
| | | .init() |
| | | .focus(); |
| | | } |
| | |
| | | this.init_subscription_list(); |
| | | } |
| | | else if (this.gui_objects.responseslist) { |
| | | this.responses_list = new rcube_list_widget(this.gui_objects.responseslist, {multiselect:false, draggable:false, keyboard:false}); |
| | | this.responses_list = new rcube_list_widget(this.gui_objects.responseslist, {multiselect:false, draggable:false, keyboard:true}); |
| | | this.responses_list |
| | | .addEventListener('select', function(list) { |
| | | var win, id = list.get_single_selection(); |
| | |
| | | { |
| | | var ret, uid, cid, url, flag, aborted = false; |
| | | |
| | | if (obj && obj.blur) |
| | | if (obj && obj.blur && !(event || rcube_event.is_keyboard(event))) |
| | | obj.blur(); |
| | | |
| | | // do nothing if interface is locked by other command (with exception for searching reset) |
| | |
| | | if ($(target).closest('.ui-dialog, .ui-widget-overlay').length) |
| | | return; |
| | | |
| | | list = this.message_list || this.contact_list; |
| | | if (list && !rcube_mouse_is_over(e, list.list.parentNode)) |
| | | list.blur(); |
| | | // remove focus from list widgets |
| | | if (window.rcube_list_widget && rcube_list_widget._instances.length) { |
| | | $.each(rcube_list_widget._instances, function(i,list){ |
| | | if (list && !rcube_mouse_is_over(e, list.list.parentNode)) |
| | | list.blur(); |
| | | }); |
| | | } |
| | | |
| | | // reset 'pressed' buttons |
| | | if (this.buttons_sel) { |
| | |
| | | |
| | | // reset popup menus; delayed to have updated menu_stack data |
| | | window.setTimeout(function(e){ |
| | | var obj, skip, config, id, i; |
| | | var obj, skip, config, id, i, parents = $(target).parents(); |
| | | for (i = ref.menu_stack.length - 1; i >= 0; i--) { |
| | | id = ref.menu_stack[i]; |
| | | obj = $('#' + id); |
| | |
| | | if (obj.is(':visible') |
| | | && target != obj.data('opener') |
| | | && target != obj.get(0) // check if scroll bar was clicked (#1489832) |
| | | && !parents.is(obj.data('opener')) |
| | | && id != skip |
| | | && (obj.attr('data-editable') != 'true' || !$(target).parents('#' + id).length) |
| | | && (obj.attr('data-sticky') != 'true' || !rcube_mouse_is_over(e, obj.get(0))) |
| | |
| | | { |
| | | // Helper method to move focus to the next/prev active menu item |
| | | var focus_menu_item = function(dir) { |
| | | var obj, mod = dir < 0 ? 'prevAll' : 'nextAll', limit = dir < 0 ? 'last' : 'first'; |
| | | var obj, item, mod = dir < 0 ? 'prevAll' : 'nextAll', limit = dir < 0 ? 'last' : 'first'; |
| | | if (ref.focused_menu && (obj = $('#'+ref.focused_menu))) { |
| | | return obj.find(':focus').closest('li')[mod](':has(:not([aria-disabled=true]))').find('a,input')[limit]().focus().length; |
| | | item = obj.find(':focus').closest('li')[mod](':has(:not([aria-disabled=true]))').find('a,input')[limit](); |
| | | if (!item.length) |
| | | item = obj.find(':focus').closest('ul')[mod](':has(:not([aria-disabled=true]))').find('a,input')[limit](); |
| | | return item.focus().length; |
| | | } |
| | | |
| | | return 0; |
| | |
| | | flags: flags.extra_flags |
| | | }); |
| | | |
| | | var c, n, col, html, css_class, |
| | | var c, n, col, html, css_class, label, status_class = '', status_label = '', |
| | | tree = '', expando = '', |
| | | list = this.message_list, |
| | | rows = list.rows, |
| | |
| | | css_class = 'msgicon'; |
| | | if (this.env.status_col === null) { |
| | | css_class += ' status'; |
| | | if (flags.deleted) |
| | | css_class += ' deleted'; |
| | | else if (!flags.seen) |
| | | css_class += ' unread'; |
| | | else if (flags.unread_children > 0) |
| | | css_class += ' unreadchildren'; |
| | | if (flags.deleted) { |
| | | status_class += ' deleted'; |
| | | status_label += this.get_label('deleted') + ' '; |
| | | } |
| | | else if (!flags.seen) { |
| | | status_class += ' unread'; |
| | | status_label += this.get_label('unread') + ' '; |
| | | } |
| | | else if (flags.unread_children > 0) { |
| | | status_class += ' unreadchildren'; |
| | | } |
| | | } |
| | | if (flags.answered) |
| | | css_class += ' replied'; |
| | | if (flags.forwarded) |
| | | css_class += ' forwarded'; |
| | | if (flags.answered) { |
| | | status_class += ' replied'; |
| | | status_label += this.get_label('replied') + ' '; |
| | | } |
| | | if (flags.forwarded) { |
| | | status_class += ' forwarded'; |
| | | status_label += this.get_label('replied') + ' '; |
| | | } |
| | | |
| | | // update selection |
| | | if (message.selected && !list.in_selection(uid)) |
| | |
| | | row_class += ' unroot'; |
| | | } |
| | | |
| | | tree += '<span id="msgicn'+row.id+'" class="'+css_class+'"> </span>'; |
| | | tree += '<span id="msgicn'+row.id+'" class="'+css_class+status_class+'" title="'+status_label+'"></span>'; |
| | | row.className = row_class; |
| | | |
| | | // build subject link |
| | |
| | | |
| | | if (c == 'flag') { |
| | | css_class = (flags.flagged ? 'flagged' : 'unflagged'); |
| | | html = '<span id="flagicn'+row.id+'" class="'+css_class+'"> </span>'; |
| | | label = this.get_label(css_class); |
| | | html = '<span id="flagicn'+row.id+'" class="'+css_class+'" title="'+label+'"></span>'; |
| | | } |
| | | else if (c == 'attachment') { |
| | | label = this.get_label('withattachment'); |
| | | if (flags.attachmentClass) |
| | | html = '<span class="'+flags.attachmentClass+'"> </span>'; |
| | | html = '<span class="'+flags.attachmentClass+'" title="'+label+'"></span>'; |
| | | else if (/application\/|multipart\/(m|signed)/.test(flags.ctype)) |
| | | html = '<span class="attachment"> </span>'; |
| | | html = '<span class="attachment" title="'+label+'"></span>'; |
| | | else if (/multipart\/report/.test(flags.ctype)) |
| | | html = '<span class="report"> </span>'; |
| | | else |
| | | html = '<span class="report"></span>'; |
| | | else |
| | | html = ' '; |
| | | } |
| | | else if (c == 'status') { |
| | | if (flags.deleted) |
| | | label = ''; |
| | | if (flags.deleted) { |
| | | css_class = 'deleted'; |
| | | else if (!flags.seen) |
| | | label = this.get_label('deleted'); |
| | | } |
| | | else if (!flags.seen) { |
| | | css_class = 'unread'; |
| | | else if (flags.unread_children > 0) |
| | | label = this.get_label('unread'); |
| | | } |
| | | else if (flags.unread_children > 0) { |
| | | css_class = 'unreadchildren'; |
| | | } |
| | | else |
| | | css_class = 'msgicon'; |
| | | html = '<span id="statusicn'+row.id+'" class="'+css_class+'"> </span>'; |
| | | html = '<span id="statusicn'+row.id+'" class="'+css_class+status_class+'" title="'+label+'"></span>'; |
| | | } |
| | | else if (c == 'threads') |
| | | html = expando; |
| | |
| | | html = tree + cols[c]; |
| | | } |
| | | else if (c == 'priority') { |
| | | if (flags.prio > 0 && flags.prio < 6) |
| | | html = '<span class="prio'+flags.prio+'"> </span>'; |
| | | if (flags.prio > 0 && flags.prio < 6) { |
| | | label = this.get_label('priority') + ' ' + flags.prio; |
| | | html = '<span class="prio'+flags.prio+'" title="'+label+'"></span>'; |
| | | } |
| | | else |
| | | html = ' '; |
| | | } |
| | |
| | | this.clear_message_list = function() |
| | | { |
| | | this.env.messages = {}; |
| | | this.last_selected = 0; |
| | | |
| | | this.show_contentframe(false); |
| | | if (this.message_list) |
| | |
| | | // set message icon |
| | | this.set_message_icon = function(uid) |
| | | { |
| | | var css_class, |
| | | var css_class, label = '', |
| | | row = this.message_list.rows[uid]; |
| | | |
| | | if (!row) |
| | |
| | | |
| | | if (row.icon) { |
| | | css_class = 'msgicon'; |
| | | if (row.deleted) |
| | | if (row.deleted) { |
| | | css_class += ' deleted'; |
| | | else if (row.unread) |
| | | label += this.get_label('deleted') + ' '; |
| | | } |
| | | else if (row.unread) { |
| | | css_class += ' unread'; |
| | | label += this.get_label('unread') + ' '; |
| | | } |
| | | else if (row.unread_children) |
| | | css_class += ' unreadchildren'; |
| | | if (row.msgicon == row.icon) { |
| | | if (row.replied) |
| | | if (row.replied) { |
| | | css_class += ' replied'; |
| | | if (row.forwarded) |
| | | label += this.get_label('replied') + ' '; |
| | | } |
| | | if (row.forwarded) { |
| | | css_class += ' forwarded'; |
| | | label += this.get_label('forwarded') + ' '; |
| | | } |
| | | css_class += ' status'; |
| | | } |
| | | |
| | | row.icon.className = css_class; |
| | | $(row.icon).attr('class', css_class).attr('title', label); |
| | | } |
| | | |
| | | if (row.msgicon && row.msgicon != row.icon) { |
| | | label = ''; |
| | | css_class = 'msgicon'; |
| | | if (!row.unread && row.unread_children) |
| | | if (!row.unread && row.unread_children) { |
| | | css_class += ' unreadchildren'; |
| | | if (row.replied) |
| | | } |
| | | if (row.replied) { |
| | | css_class += ' replied'; |
| | | if (row.forwarded) |
| | | label += this.get_label('replied') + ' '; |
| | | } |
| | | if (row.forwarded) { |
| | | css_class += ' forwarded'; |
| | | label += this.get_label('forwarded') + ' '; |
| | | } |
| | | |
| | | row.msgicon.className = css_class; |
| | | $(row.msgicon).attr('class', css_class).attr('title', label); |
| | | } |
| | | |
| | | if (row.flagicon) { |
| | | css_class = (row.flagged ? 'flagged' : 'unflagged'); |
| | | row.flagicon.className = css_class; |
| | | label = this.get_label(css_class); |
| | | $(row.flagicon).attr('class', css_class) |
| | | .attr('aria-label', label) |
| | | .attr('title', label); |
| | | } |
| | | }; |
| | | |
| | |
| | | input.val(oldval + recipients.join(delim + ' ') + delim + ' '); |
| | | this.triggerEvent('add-recipient', { field:field, recipients:recipients }); |
| | | } |
| | | |
| | | return recipients.length; |
| | | }; |
| | | |
| | | // checks the input fields before sending a message |
| | |
| | | // add link to pop back to parent group |
| | | if (this.env.address_group_stack.length > 1) { |
| | | $('<a href="#list">...</a>') |
| | | .attr('title', this.gettext('uponelevel')) |
| | | .addClass('poplink') |
| | | .appendTo(boxtitle) |
| | | .click(function(e){ return ref.command('popgroup','',this); }); |
| | |
| | | this.last_sub_rx = RegExp('['+delim+']?[^'+delim+']+$'); |
| | | |
| | | this.subscription_list = new rcube_list_widget(this.gui_objects.subscriptionlist, |
| | | {multiselect:false, draggable:true, keyboard:false, toggleselect:true}); |
| | | {multiselect:false, draggable:true, keyboard:true, toggleselect:true}); |
| | | this.subscription_list |
| | | .addEventListener('select', function(o){ ref.subscription_select(o); }) |
| | | .addEventListener('dragstart', function(o){ ref.drag_active = true; }) |
| | |
| | | row.obj.onmouseover = function() { ref.focus_subscription(row.id); }; |
| | | row.obj.onmouseout = function() { ref.unfocus_subscription(row.id); }; |
| | | }) |
| | | .init(); |
| | | .init() |
| | | .focus(); |
| | | |
| | | $('#mailboxroot') |
| | | .mouseover(function(){ ref.focus_subscription(this.id); }) |
| | |
| | | align = obj.attr('data-align') || '', |
| | | stack = false; |
| | | |
| | | // find "real" button element |
| | | if (ref.get(0).tagName != 'A' && ref.closest('a').length) |
| | | ref = ref.closest('a'); |
| | | |
| | | if (typeof prop == 'string') |
| | | prop = { menu:name }; |
| | | |
| | |
| | | this.enable_command('set-listmode', this.env.threads && !is_multifolder); |
| | | |
| | | if ((response.action == 'list' || response.action == 'search') && this.message_list) { |
| | | this.message_list.focus(); |
| | | if (this.message_list.rowcount > 0) |
| | | this.message_list.focus(); |
| | | this.msglist_select(this.message_list); |
| | | this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:this.message_list.rowcount }); |
| | | } |
| | |
| | | this.enable_command('search-create', this.env.source == ''); |
| | | this.enable_command('search-delete', this.env.search_id); |
| | | this.update_group_commands(); |
| | | this.contact_list.focus(); |
| | | if (this.contact_list.rowcount > 0) |
| | | this.contact_list.focus(); |
| | | this.triggerEvent('listupdate', { folder:this.env.source, rowcount:this.contact_list.rowcount }); |
| | | } |
| | | } |
| | | break; |
| | | |
| | | case 'list-contacts': |
| | | case 'search-contacts': |
| | | if (this.contact_list && this.contact_list.rowcount > 0) |
| | | this.contact_list.focus(); |
| | | break; |
| | | } |
| | | |
| | | if (response.unlock) |