| | |
| | | this.selectedIndex = 0; |
| | | }); |
| | | |
| | | $("input[type='text']").first().focus(); |
| | | $("input[type='text']:visible").first().focus(); |
| | | } |
| | | else if (this.gui_objects.qsearchbox) { |
| | | this.enable_command('search', 'reset-search', 'moveto', true); |
| | |
| | | input_name.focus(); |
| | | break; |
| | | } |
| | | else if (input_email.length && !rcube_check_email(input_email.val())) { |
| | | else if (this.task == 'settings' && input_email.length && !rcube_check_email(input_email.val())) { |
| | | alert(this.get_label('noemailwarning')); |
| | | input_email.focus(); |
| | | break; |
| | |
| | | |
| | | // create hidden iframe and post upload form |
| | | if (send) { |
| | | this.async_upload_form(form, 'upload', function(e) { |
| | | var frame_name = this.async_upload_form(form, 'upload', function(e) { |
| | | var d, content = ''; |
| | | try { |
| | | if (this.contentDocument) { |
| | |
| | | d = this.contentWindow.document; |
| | | } |
| | | content = d.childNodes[0].innerHTML; |
| | | } catch (e) {} |
| | | } catch (err) {} |
| | | |
| | | if (!content.match(/add2attachment/) && (!bw.opera || (rcmail.env.uploadframe && rcmail.env.uploadframe == e.data.ts))) { |
| | | if (!content.match(/display_message/)) |
| | |
| | | }); |
| | | |
| | | // display upload indicator and cancel button |
| | | var content = this.get_label('uploading'); |
| | | var content = this.get_label('uploading'), |
| | | ts = frame_name.replace(/^rcmupload/, ''); |
| | | |
| | | if (this.env.loadingicon) |
| | | content = '<img src="'+this.env.loadingicon+'" alt="" />'+content; |
| | | if (this.env.cancelicon) |
| | |
| | | if (q == this.ksearch_value) |
| | | return; |
| | | |
| | | if (q.length < min) { |
| | | if (q.length && q.length < min) { |
| | | if (!this.env.acinfo) { |
| | | var label = this.get_label('autocompletechars'); |
| | | label = label.replace('$min', min); |
| | | this.env.acinfo = this.display_message(label); |
| | | this.env.acinfo = this.display_message( |
| | | this.get_label('autocompletechars').replace('$min', min)); |
| | | } |
| | | return; |
| | | } |
| | | else if (this.env.acinfo && q.length == min) { |
| | | else if (this.env.acinfo) { |
| | | this.hide_message(this.env.acinfo); |
| | | } |
| | | |
| | |
| | | // update a contact record in the list |
| | | this.update_contact_row = function(cid, cols_arr, newcid) |
| | | { |
| | | cid = String(cid).replace(this.identifier_expr, '_'); |
| | | newcid = String(newcid).replace(this.identifier_expr, '_'); |
| | | |
| | | var row; |
| | | if (this.contact_list.rows[cid] && (row = this.contact_list.rows[cid].obj)) { |
| | | for (var c=0; c<cols_arr.length; c++) |
| | |
| | | even = rowcount%2, |
| | | row = document.createElement('tr'); |
| | | |
| | | row.id = 'rcmrow'+cid; |
| | | row.id = 'rcmrow'+String(cid).replace(this.identifier_expr, '_'); |
| | | row.className = 'contact '+(even ? 'even' : 'odd'); |
| | | |
| | | if (this.contact_list.in_selection(cid)) |
| | |
| | | this.env.contactfolders[key] = this.env.contactgroups[key] = prop; |
| | | |
| | | var link = $('<a>').attr('href', '#') |
| | | .attr('rel', prop.source+':'+prop.id) |
| | | .bind('click', function() { return rcmail.command('listgroup', prop, this);}) |
| | | .html(prop.name); |
| | | var li = $('<li>').attr('id', 'rcmli'+key.replace(this.identifier_expr, '_')) |
| | |
| | | { |
| | | this.reset_add_input(); |
| | | |
| | | var key = 'G'+prop.source+prop.id, link, li = this.get_folder_li(key); |
| | | var key = 'G'+prop.source+prop.id, |
| | | li = this.get_folder_li(key), |
| | | link; |
| | | |
| | | if (li && (link = li.firstChild) && link.tagName.toLowerCase() == 'a') |
| | | // group ID has changed, replace link node and identifiers |
| | | if (li && prop.newid) { |
| | | var newkey = 'G'+prop.source+prop.newid; |
| | | li.id = String('rcmli'+newkey).replace(this.identifier_expr, '_'); |
| | | this.env.contactfolders[newkey] = this.env.contactfolders[key]; |
| | | this.env.group = prop.newid; |
| | | |
| | | var newprop = $.extend({}, prop); |
| | | newprop.id = prop.newid; |
| | | newprop.type = 'group'; |
| | | |
| | | link = $('<a>').attr('href', '#') |
| | | .attr('rel', prop.source+':'+prop.newid) |
| | | .bind('click', function() { return rcmail.command('listgroup', newprop, this);}) |
| | | .html(prop.name); |
| | | $(li).children().replaceWith(link); |
| | | } |
| | | // update displayed group name |
| | | else if (li && (link = li.firstChild) && link.tagName.toLowerCase() == 'a') |
| | | link.innerHTML = prop.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] }); |
| | | this.triggerEvent('group_update', { id:prop.id, source:prop.source, name:prop.name, li:li[0], newid:prop.newid }); |
| | | }; |
| | | |
| | | |
| | |
| | | |
| | | elem.focus(function(){ ref.focus_textfield(this); }) |
| | | .blur(function(){ ref.blur_textfield(this); }) |
| | | .each(function(){ this._placeholder = ref.env.coltypes[col].label; ref.blur_textfield(this); }); |
| | | .each(function(){ this._placeholder = this.title = ref.env.coltypes[col].label; ref.blur_textfield(this); }); |
| | | }; |
| | | |
| | | this.insert_edit_field = function(col, section, menu) |
| | |
| | | // post the given form to a hidden iframe |
| | | this.async_upload_form = function(form, action, onload) |
| | | { |
| | | var ts = new Date().getTime(); |
| | | var frame_name = 'rcmupload'+ts; |
| | | var ts = new Date().getTime(), |
| | | frame_name = 'rcmupload'+ts; |
| | | |
| | | // have to do it this way for IE |
| | | // otherwise the form will be posted to a new window |
| | |
| | | form.action = this.url(action, { _uploadid:ts }); |
| | | form.setAttribute('enctype', 'multipart/form-data'); |
| | | form.submit(); |
| | | |
| | | return frame_name; |
| | | }; |
| | | |
| | | // starts interval for keep-alive/check-recent signal |