| | |
| | | |
| | | 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(); |
| | |
| | | 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))) |
| | |
| | | this.env.recipients_delimiter = this.env.recipients_separator + ' '; |
| | | |
| | | obj.keydown(function(e) { return ref.ksearch_keydown(e, this, props); }) |
| | | .attr('autocomplete', 'off') |
| | | .attr('aria-autocomplete', 'list') |
| | | .attr('aria-expanded', 'false'); |
| | | .attr({ 'autocomplete': 'off', 'aria-autocomplete': 'list', 'aria-expanded': 'false', 'role': 'combobox' }); |
| | | }; |
| | | |
| | | this.submit_messageform = function(draft) |
| | |
| | | } |
| | | |
| | | if (node) { |
| | | $(node).addClass('selected').removeAttr('aria-selected', 'true'); |
| | | $(node).addClass('selected').attr('aria-selected', 'true'); |
| | | this.ksearch_selected = node._rcm_id; |
| | | $(this.ksearch_input).attr('aria-activedecendant', 'rcmkSearchItem' + this.ksearch_selected); |
| | | $(this.ksearch_input).attr('aria-activedescendant', 'rcmkSearchItem' + this.ksearch_selected); |
| | | } |
| | | }; |
| | | |
| | |
| | | } |
| | | |
| | | if (ul.childNodes.length) { |
| | | this.ksearch_pane.show(); |
| | | // select the first |
| | | if (!this.env.contacts.length) { |
| | | this.ksearch_select($('li:first', ul).get(0)); |
| | | } |
| | | |
| | | // set the right aria-* attributes to the input field |
| | | $(this.ksearch_input) |
| | | .attr('aria-haspopup', 'true') |
| | | .attr('aria-expanded', 'true') |
| | | .attr('aria-owns', 'rcmKSearchpane') |
| | | .attr('aria-owns', 'rcmKSearchpane'); |
| | | |
| | | this.ksearch_pane.show(); |
| | | |
| | | // select the first |
| | | if (!this.env.contacts.length) { |
| | | this.ksearch_select($('li:first', ul).get(0)); |
| | | } |
| | | } |
| | | |
| | | if (len) |
| | |
| | | $(this.ksearch_input) |
| | | .attr('aria-haspopup', 'false') |
| | | .attr('aria-expanded', 'false') |
| | | .removeAttr('aria-activedecendant') |
| | | .removeAttr('aria-activedescendant') |
| | | .removeAttr('aria-owns'); |
| | | |
| | | this.ksearch_destroy(); |
| | |
| | | // 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); }); |
| | |
| | | |
| | | if (appendcontainer.length && appendcontainer.get(0).nodeName == 'FIELDSET') { |
| | | var input, colprop = this.env.coltypes[col], |
| | | input_id = 'ff_' + col + (colprop.count || 0), |
| | | row = $('<div>').addClass('row'), |
| | | cell = $('<div>').addClass('contactfieldcontent data'), |
| | | label = $('<div>').addClass('contactfieldlabel label'); |
| | |
| | | if (colprop.subtypes_select) |
| | | label.html(colprop.subtypes_select); |
| | | else |
| | | label.html(colprop.label); |
| | | label.html('<label for="' + input_id + '">' + colprop.label + '</label>'); |
| | | |
| | | var name_suffix = colprop.limit != 1 ? '[]' : ''; |
| | | if (colprop.type == 'text' || colprop.type == 'date') { |
| | | input = $('<input>') |
| | | .addClass('ff_'+col) |
| | | .attr({type: 'text', name: '_'+col+name_suffix, size: colprop.size}) |
| | | .attr({type: 'text', name: '_'+col+name_suffix, size: colprop.size, id: input_id}) |
| | | .appendTo(cell); |
| | | |
| | | this.init_edit_field(col, input); |
| | |
| | | else if (colprop.type == 'textarea') { |
| | | input = $('<textarea>') |
| | | .addClass('ff_'+col) |
| | | .attr({ name: '_'+col+name_suffix, cols:colprop.size, rows:colprop.rows }) |
| | | .attr({ name: '_'+col+name_suffix, cols:colprop.size, rows:colprop.rows, id: input_id }) |
| | | .appendTo(cell); |
| | | |
| | | this.init_edit_field(col, input); |
| | |
| | | else if (colprop.type == 'select') { |
| | | input = $('<select>') |
| | | .addClass('ff_'+col) |
| | | .attr('name', '_'+col+name_suffix) |
| | | .attr({ 'name': '_'+col+name_suffix, id: input_id }) |
| | | .appendTo(cell); |
| | | |
| | | var options = input.attr('options'); |
| | |
| | | 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); }) |
| | |
| | | tr = document.createElement('tr'); |
| | | |
| | | for (c=0, len=repl.length; c < len; c++) { |
| | | cell = document.createElement('td'); |
| | | cell = document.createElement('th'); |
| | | cell.innerHTML = repl[c].html || ''; |
| | | if (repl[c].id) cell.id = repl[c].id; |
| | | if (repl[c].className) cell.className = repl[c].className; |
| | |
| | | container.data('callback')($(this).data('id')); |
| | | return false; |
| | | }); |
| | | /* |
| | | // hide selector on click out of selector element |
| | | var fn = function(e) { if (e.target != container.get(0)) container.hide(); }; |
| | | $(document.body).on('mouseup', fn); |
| | | $('iframe').contents().on('mouseup', fn) |
| | | .load(function(e) { try { $(this).contents().on('mouseup', fn); } catch(e) {}; }); |
| | | */ |
| | | |
| | | this.folder_selector_element = container; |
| | | } |
| | | |
| | |
| | | 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 }; |
| | | |