|
|
@ -720,14 +720,18 @@ function rcube_webmail()
|
|
|
|
|
|
|
|
|
|
|
|
// check input before leaving compose step
|
|
|
|
// check input before leaving compose step
|
|
|
|
if (this.task == 'mail' && this.env.action == 'compose' && !this.env.server_error && command != 'save-pref'
|
|
|
|
if (this.task == 'mail' && this.env.action == 'compose' && !this.env.server_error && command != 'save-pref'
|
|
|
|
&& $.inArray(command, this.env.compose_commands) < 0
|
|
|
|
&& $.inArray(command, this.env.compose_commands) < 0 && !this.compose_skip_unsavedcheck
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
if (!this.env.is_sent && this.cmp_hash != this.compose_field_hash() && !confirm(this.get_label('notsentwarning')))
|
|
|
|
if (!this.env.is_sent && this.cmp_hash != this.compose_field_hash()) {
|
|
|
|
return false;
|
|
|
|
this.show_confirm(this.get_label('notsentwarning'), 'discard', function() {
|
|
|
|
|
|
|
|
|
|
|
|
// remove copy from local storage if compose screen is left intentionally
|
|
|
|
// remove copy from local storage if compose screen is left intentionally
|
|
|
|
this.remove_compose_data(this.env.compose_id);
|
|
|
|
ref.remove_compose_data(ref.env.compose_id);
|
|
|
|
this.compose_skip_unsavedcheck = true;
|
|
|
|
ref.compose_skip_unsavedcheck = true;
|
|
|
|
|
|
|
|
ref.command(command, props, obj, event);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.last_command = command;
|
|
|
|
this.last_command = command;
|
|
|
@ -3155,8 +3159,10 @@ function rcube_webmail()
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// if shift was pressed delete it immediately
|
|
|
|
// if shift was pressed delete it immediately
|
|
|
|
if ((list && list.modkey == SHIFT_KEY) || (event && rcube_event.get_modifier(event) == SHIFT_KEY)) {
|
|
|
|
if ((list && list.modkey == SHIFT_KEY) || (event && rcube_event.get_modifier(event) == SHIFT_KEY)) {
|
|
|
|
if (confirm(this.get_label('deletemessagesconfirm')))
|
|
|
|
this.show_confirm(this.get_label('deletemessagesconfirm'), 'delete', function() {
|
|
|
|
this.permanently_remove_messages();
|
|
|
|
ref.permanently_remove_messages();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
this.move_messages(trash);
|
|
|
|
this.move_messages(trash);
|
|
|
@ -4036,17 +4042,19 @@ function rcube_webmail()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var lock, post_data = {_mbox: mbox};
|
|
|
|
var lock, post_data = {_mbox: mbox};
|
|
|
|
|
|
|
|
|
|
|
|
if (!confirm(this.get_label('purgefolderconfirm')))
|
|
|
|
this.show_confirm(this.get_label('purgefolderconfirm'), 'delete', function() {
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// lock interface if it's the active mailbox
|
|
|
|
// lock interface if it's the active mailbox
|
|
|
|
if (mbox == this.env.mailbox) {
|
|
|
|
if (mbox == ref.env.mailbox) {
|
|
|
|
lock = this.set_busy(true, 'loading');
|
|
|
|
lock = ref.set_busy(true, 'loading');
|
|
|
|
post_data._reload = 1;
|
|
|
|
post_data._reload = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// send request to server
|
|
|
|
// send request to server
|
|
|
|
this.http_post('purge', post_data, lock);
|
|
|
|
ref.http_post('purge', post_data, lock);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// test if purge command is allowed
|
|
|
|
// test if purge command is allowed
|
|
|
@ -4762,8 +4770,11 @@ function rcube_webmail()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// submit delete request
|
|
|
|
// submit delete request
|
|
|
|
if (key && confirm(this.get_label('deleteresponseconfirm'))) {
|
|
|
|
if (key) {
|
|
|
|
this.http_post('settings/delete-response', { _key: key }, false);
|
|
|
|
this.show_confirm(this.get_label('deleteresponseconfirm'), 'delete', function() {
|
|
|
|
|
|
|
|
ref.http_post('settings/delete-response', { _key: key }, false);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -6204,10 +6215,12 @@ function rcube_webmail()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var undelete = this.env.source && this.env.address_sources[this.env.source].undelete;
|
|
|
|
var undelete = this.env.source && this.env.address_sources[this.env.source].undelete;
|
|
|
|
|
|
|
|
|
|
|
|
if (!undelete && !confirm(this.get_label('deletecontactconfirm')))
|
|
|
|
if (!undelete) {
|
|
|
|
return;
|
|
|
|
this.show_confirm(this.get_label('deletecontactconfirm'), 'delete', function() {
|
|
|
|
|
|
|
|
ref._with_selected_contacts('delete');
|
|
|
|
return this._with_selected_contacts('delete');
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
this._with_selected_contacts = function(action, post_data)
|
|
|
|
this._with_selected_contacts = function(action, post_data)
|
|
|
@ -6389,9 +6402,12 @@ function rcube_webmail()
|
|
|
|
|
|
|
|
|
|
|
|
this.group_delete = function()
|
|
|
|
this.group_delete = function()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (this.env.group && confirm(this.get_label('deletegroupconfirm'))) {
|
|
|
|
if (this.env.group) {
|
|
|
|
var lock = this.set_busy(true, 'groupdeleting');
|
|
|
|
this.show_confirm(this.get_label('deletegroupconfirm'), 'delete', function() {
|
|
|
|
this.http_post('group-delete', {_source: this.env.source, _gid: this.env.group}, lock);
|
|
|
|
var lock = ref.set_busy(true, 'groupdeleting');
|
|
|
|
|
|
|
|
ref.http_post('group-delete', {_source: ref.env.source, _gid: ref.env.group}, lock);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -6924,8 +6940,12 @@ function rcube_webmail()
|
|
|
|
id = this.env.iid ? this.env.iid : selection[0];
|
|
|
|
id = this.env.iid ? this.env.iid : selection[0];
|
|
|
|
|
|
|
|
|
|
|
|
// submit request with appended token
|
|
|
|
// submit request with appended token
|
|
|
|
if (id && confirm(this.get_label('deleteidentityconfirm')))
|
|
|
|
if (id) {
|
|
|
|
this.http_post('settings/delete-identity', { _iid: id }, true);
|
|
|
|
this.show_confirm(this.get_label('deleteidentityconfirm'), 'delete', function() {
|
|
|
|
|
|
|
|
ref.http_post('settings/delete-identity', { _iid: id }, true);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
this.update_identity_row = function(id, name, add)
|
|
|
|
this.update_identity_row = function(id, name, add)
|
|
|
@ -7088,8 +7108,11 @@ function rcube_webmail()
|
|
|
|
if (!name)
|
|
|
|
if (!name)
|
|
|
|
name = this.env.mailbox;
|
|
|
|
name = this.env.mailbox;
|
|
|
|
|
|
|
|
|
|
|
|
if (name && confirm(this.get_label('deletefolderconfirm'))) {
|
|
|
|
if (name) {
|
|
|
|
this.http_post('delete-folder', {_mbox: name}, this.set_busy(true, 'folderdeleting'));
|
|
|
|
this.show_confirm(this.get_label('deletefolderconfirm'), 'delete', function() {
|
|
|
|
|
|
|
|
ref.http_post('delete-folder', {_mbox: name}, ref.set_busy(true, 'folderdeleting'));
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -7878,12 +7901,19 @@ function rcube_webmail()
|
|
|
|
buttons.unshift({
|
|
|
|
buttons.unshift({
|
|
|
|
text: this.get_label(save_label),
|
|
|
|
text: this.get_label(save_label),
|
|
|
|
'class': 'mainaction ' + save_label.replace(/^[^\.]+\./i, ''),
|
|
|
|
'class': 'mainaction ' + save_label.replace(/^[^\.]+\./i, ''),
|
|
|
|
click: function(e, ui) { if (action_func(e)) close_func(e, ui, this); }
|
|
|
|
click: function(e, ui) { if (action_func(e, ref)) close_func(e, ui, this); }
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return this.show_popup_dialog(content, title, buttons, options);
|
|
|
|
return this.show_popup_dialog(content, title, buttons, options);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// simple_dialog() wrapper for confirm() type dialogs
|
|
|
|
|
|
|
|
this.show_confirm = function(content, button_label, action_func)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var options = { button: button_label || 'continue' };
|
|
|
|
|
|
|
|
return this.simple_dialog(content, this.get_label('confirmationtitle'), action_func, options);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// enable/disable buttons for page shifting
|
|
|
|
// enable/disable buttons for page shifting
|
|
|
|
this.set_page_buttons = function()
|
|
|
|
this.set_page_buttons = function()
|
|
|
|
{
|
|
|
|
{
|
|
|
|