Define more classes for dialog buttons

pull/5838/head
Aleksander Machniak 8 years ago
parent 51fb3bfa58
commit 542a817214

@ -350,7 +350,7 @@ rcube_webmail.prototype.acl_init_form = function(id)
id ? this.get_label('acl.editperms') : this.get_label('acl.newuser'), id ? this.get_label('acl.editperms') : this.get_label('acl.newuser'),
buttons, buttons,
{ {
button_classes: ['mainaction'], button_classes: ['mainaction submit'],
modal: true, modal: true,
closeOnEscape: true, closeOnEscape: true,
close: function(e, ui) { close: function(e, ui) {

@ -64,7 +64,12 @@ function rcmail_attachment_reminder_dialog()
}; };
rcmail.env.attachment_reminder = false; rcmail.env.attachment_reminder = false;
rcmail.show_popup_dialog(rcmail.get_label('attachment_reminder.forgotattachment'), '', buttons); rcmail.show_popup_dialog(
rcmail.get_label('attachment_reminder.forgotattachment'),
rcmail.get_label('attachment_reminder.missingattachment'),
buttons,
{button_classes: ['mainaction attach', 'send']}
);
}; };

@ -37,7 +37,7 @@ class attachment_reminder extends rcube_plugin
if ($rcmail->task == 'mail' && $rcmail->action == 'compose') { if ($rcmail->task == 'mail' && $rcmail->action == 'compose') {
if ($rcmail->config->get('attachment_reminder')) { if ($rcmail->config->get('attachment_reminder')) {
$this->include_script('attachment_reminder.js'); $this->include_script('attachment_reminder.js');
$this->add_texts('localization/', array('keywords', 'forgotattachment')); $this->add_texts('localization/', array('keywords', 'forgotattachment', 'missingattachment'));
$rcmail->output->add_label('addattachment', 'send'); $rcmail->output->add_label('addattachment', 'send');
} }
} }

@ -17,6 +17,7 @@
*/ */
$messages = array(); $messages = array();
$messages['missingattachment'] = "Missing attachment?";
$messages['forgotattachment'] = "Did you forget to attach a file?"; $messages['forgotattachment'] = "Did you forget to attach a file?";
$messages['reminderoption'] = "Remind about forgotten attachments"; $messages['reminderoption'] = "Remind about forgotten attachments";
$messages['keywords'] = "attachment,file,attach,attached,attaching,enclosed,CV,cover letter"; $messages['keywords'] = "attachment,file,attach,attached,attaching,enclosed,CV,cover letter";

@ -500,7 +500,7 @@ rcube_webmail.prototype.enigma_password_request = function(data)
this.show_popup_dialog(myprompt, this.get_label('enigma.enterkeypasstitle'), this.show_popup_dialog(myprompt, this.get_label('enigma.enterkeypasstitle'),
[{ [{
text: this.get_label('save'), text: this.get_label('save'),
'class': 'mainaction', 'class': 'mainaction save',
click: function(e) { click: function(e) {
e.stopPropagation(); e.stopPropagation();
@ -519,6 +519,7 @@ rcube_webmail.prototype.enigma_password_request = function(data)
}, },
{ {
text: this.get_label('cancel'), text: this.get_label('cancel'),
'class': 'cancel',
click: function(e) { click: function(e) {
var jq = ref.is_framed() ? window.parent.$ : $; var jq = ref.is_framed() ? window.parent.$ : $;
e.stopPropagation(); e.stopPropagation();

@ -3919,17 +3919,13 @@ function rcube_webmail()
}); });
// display dialog with missing keys // display dialog with missing keys
ref.show_popup_dialog( ref.simple_dialog(
$('<div>') $('<div>')
.append($('<p>').html(ref.get_label('encryptpubkeysfound'))) .append($('<p>').html(ref.get_label('encryptpubkeysfound')))
.append(ul), .append(ul),
ref.get_label('importpubkeys'), ref.get_label('importpubkeys'),
[{ null,
text: ref.get_label('close'), {cancel_label: 'close', cancel_button: 'close'}
click: function() {
(ref.is_framed() ? parent.$ : $)(this).dialog('close');
}
}]
); );
// delegate handler for import button clicks // delegate handler for import button clicks
@ -4054,21 +4050,12 @@ function rcube_webmail()
content = $('<div>').append(nodes); content = $('<div>').append(nodes);
$('input:not([disabled]):first', content).attr('checked', true); $('input:not([disabled]):first', content).attr('checked', true);
this.show_popup_dialog(content, this.get_label('markallread'), this.simple_dialog(content, this.get_label('markallread'),
[{ function() {
'class': 'mainaction', ref.mark_all_read(folder, $('input:checked', this).val());
text: this.get_label('mark'), return true;
click: function() {
ref.mark_all_read(folder, $('input:checked', this).val());
$(this).dialog('close');
}
}, },
{ {button: 'mark'}
text: this.get_label('cancel'),
click: function() {
$(this).dialog('close');
}
}]
); );
return; return;
@ -4323,7 +4310,7 @@ function rcube_webmail()
// the message has been sent but not saved, ask the user what to do // the message has been sent but not saved, ask the user what to do
if (!saveonly && this.env.is_sent) { if (!saveonly && this.env.is_sent) {
return this.simple_dialog(this.get_label('messageissent'), '', return this.simple_dialog(this.get_label('messageissent'), '', // TODO: dialog title
function() { function() {
ref.submit_messageform(false, true); ref.submit_messageform(false, true);
return true; return true;
@ -4482,7 +4469,8 @@ function rcube_webmail()
click: function() { save_func(true); } click: function() { save_func(true); }
}, { }, {
text: this.get_label('cancel'), text: this.get_label('cancel'),
click: function() { dialog.dialog('close'); } click: function() { dialog.dialog('close'); },
'class': 'cancel'
}], }],
{dialogClass: 'warning'} {dialogClass: 'warning'}
); );
@ -4508,10 +4496,11 @@ function rcube_webmail()
this.get_label('nosubjecttitle'), this.get_label('nosubjecttitle'),
[{ [{
text: this.get_label('sendmessage'), text: this.get_label('sendmessage'),
click: function() { save_func(); }, 'class': 'mainaction send',
'class': 'mainaction' click: function() { save_func(); }
}, { }, {
text: this.get_label('cancel'), text: this.get_label('cancel'),
'class': 'cancel',
click: function() { click: function() {
input_subject.focus(); input_subject.focus();
dialog.dialog('close'); dialog.dialog('close');
@ -4602,7 +4591,7 @@ function rcube_webmail()
$(this).dialog('close'); $(this).dialog('close');
}; };
this.show_popup_dialog(html, this.get_label('newresponse'), buttons, {button_classes: ['mainaction']}); this.show_popup_dialog(html, this.get_label('newresponse'), buttons, {button_classes: ['mainaction save', 'cancel']});
$('#ffresponsetext').val(text); $('#ffresponsetext').val(text);
$('#ffresponsename').select(); $('#ffresponsename').select();
@ -7693,7 +7682,7 @@ function rcube_webmail()
// assign special classes to dialog buttons // assign special classes to dialog buttons
$.each(options.button_classes || [], function(i, v) { $.each(options.button_classes || [], function(i, v) {
if (v) $($('.ui-dialog-buttonpane button.ui-button', popup.parent()).get(i)).addClass(v); if (v) $($('.ui-dialog-buttonpane button', popup.parent()).get(i)).addClass(v);
}); });
return popup; return popup;

Loading…
Cancel
Save