'),
myprompt_content = $('
')
.appendTo(myprompt),
myprompt_input = $('').attr({type: 'password', size: 30, 'data-submit': 'true'})
.appendTo(myprompt);
data.key = data.keyid;
if (data.keyid.length > 8)
data.keyid = data.keyid.substr(data.keyid.length - 8);
$.each(['keyid', 'user'], function() {
msg = msg.replace('$' + this, data[this]);
});
myprompt_content.text(msg);
this.show_popup_dialog(myprompt, this.get_label('enigma.enterkeypasstitle'),
[{
text: this.get_label('ok'),
'class': 'mainaction save unlock',
click: function(e) {
e.stopPropagation();
var jq = ref.is_framed() ? window.parent.$ : $;
data.password = myprompt_input.val();
if (!data.password) {
myprompt_input.focus();
return;
}
ref.enigma_password_submit(data);
jq(this).remove();
}
},
{
text: this.get_label('cancel'),
'class': 'cancel',
click: function(e) {
var jq = ref.is_framed() ? window.parent.$ : $;
e.stopPropagation();
jq(this).remove();
}
}], {width: 400});
if (this.is_framed() && parent.rcmail.message_list) {
// this fixes bug when pressing Enter on "Save" button in the dialog
parent.rcmail.message_list.blur();
}
};
// submit entered password
rcube_webmail.prototype.enigma_password_submit = function(data)
{
var lock, form;
if (this.env.action == 'compose' && !data['compose-init']) {
return this.enigma_password_compose_submit(data);
}
else if (this.env.action == 'plugin.enigmakeys' && (form = this.gui_objects.importform)) {
if (!$('input[name="_keyid"]', form).length) {
$(form).append($('').attr({type: 'hidden', name: '_keyid', value: data.key}))
.append($('').attr({type: 'hidden', name: '_passwd', value: data.password}))
}
return this.enigma_import();
}
lock = data.nolock ? null : this.set_busy(true, 'loading');
form = $('