| | |
| | | this.init_address_input_events($("[name='_cc']")); |
| | | this.init_address_input_events($("[name='_bcc']")); |
| | | |
| | | if (!html_mode) |
| | | this.set_caret_pos(input_message, this.env.top_posting ? 0 : $(input_message).val().length); |
| | | |
| | | if (!html_mode) { |
| | | // add signature according to selected identity |
| | | if (input_from.attr('type') == 'select-one' && $("input[name='_draft_saveid']").val() == '' |
| | | && !html_mode) { // if we have HTML editor, signature is added in callback |
| | | // if we have HTML editor, signature is added in callback |
| | | if (input_from.attr('type') == 'select-one' && $("input[name='_draft_saveid']").val() == '') { |
| | | this.change_identity(input_from[0]); |
| | | } |
| | | else if (!html_mode) |
| | | this.set_caret_pos(input_message, this.env.top_posting ? 0 : $(input_message).val().length); |
| | | } |
| | | |
| | | if (input_to.val() == '') |
| | | input_to.focus(); |
| | |
| | | var input_message = $("[name='_message']"); |
| | | |
| | | // check sender (if have no identities) |
| | | if (input_from.attr('type') == 'text' && !rcube_check_email(input_from.val(), true)) |
| | | { |
| | | if (input_from.attr('type') == 'text' && !rcube_check_email(input_from.val(), true)) { |
| | | alert(this.get_label('nosenderwarning')); |
| | | input_from.focus(); |
| | | return false; |
| | |
| | | |
| | | // check for empty recipient |
| | | var recipients = input_to.val() ? input_to.val() : (input_cc.val() ? input_cc.val() : input_bcc.val()); |
| | | if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true)) |
| | | { |
| | | if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true)) { |
| | | alert(this.get_label('norecipientwarning')); |
| | | input_to.focus(); |
| | | return false; |
| | |
| | | return false; |
| | | |
| | | var elm, list; |
| | | if (elm = this.gui_objects.uploadbox) |
| | | { |
| | | if (a && (list = this.gui_objects.attachmentlist)) |
| | | { |
| | | if (elm = this.gui_objects.uploadbox) { |
| | | if (a && (list = this.gui_objects.attachmentlist)) { |
| | | var pos = $(list).offset(); |
| | | elm.style.top = (pos.top + list.offsetHeight + 10) + 'px'; |
| | | elm.style.left = pos.left + 'px'; |
| | |
| | | // get file input fields |
| | | var send = false; |
| | | for (var n=0; n<form.elements.length; n++) |
| | | if (form.elements[n].type=='file' && form.elements[n].value) |
| | | { |
| | | if (form.elements[n].type=='file' && form.elements[n].value) { |
| | | send = true; |
| | | break; |
| | | } |
| | | |
| | | // create hidden iframe and post upload form |
| | | if (send) |
| | | { |
| | | if (send) { |
| | | var ts = new Date().getTime(); |
| | | var frame_name = 'rcmupload'+ts; |
| | | |
| | | // have to do it this way for IE |
| | | // otherwise the form will be posted to a new window |
| | | if(document.all) |
| | | { |
| | | if (document.all) { |
| | | var html = '<iframe name="'+frame_name+'" src="program/blank.gif" style="width:0;height:0;visibility:hidden;"></iframe>'; |
| | | document.body.insertAdjacentHTML('BeforeEnd',html); |
| | | } |
| | | else // for standards-compilant browsers |
| | | { |
| | | else { // for standards-compilant browsers |
| | | var frame = document.createElement('iframe'); |
| | | frame.name = frame_name; |
| | | frame.style.border = 'none'; |
| | |
| | | // send remote request to search mail or contacts |
| | | this.qsearch = function(value) |
| | | { |
| | | if (value != '') |
| | | { |
| | | if (value != '') { |
| | | var addurl = ''; |
| | | if (this.message_list) { |
| | | this.message_list.clear(); |
| | |
| | | { |
| | | this.list_mailbox(); |
| | | this.display_message(msg, type, true); |
| | | } |
| | | }; |
| | | |
| | | |
| | | /*********************************************************/ |