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