forked from Takika/rc_smime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc_smime.js
40 lines (37 loc) · 1.23 KB
/
rc_smime.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
if (window.rcmail) {
rcmail.addEventListener("init", function() {
this.password = "";
if (rcmail.env.action === "compose") {
// Clear password if identity changed
rcmail.addEventListener("change_identity", function() {
this.passphrase = "";
});
rcmail.addEventListener("beforesend", function(e) {
if(!beforeSend()) {
return false;
}
});
}
});
function beforeSend() {
if (!$("#smime_encrypt").is(":checked") && !$("#smime_sign").is(":checked")) {
if (confirm(rcmail.gettext("smime_continue_unencrypted", "rc_smime"))) {
// remove the public key attachment since we don't sign nor encrypt the message
// removePublicKeyAttachment();
return true;
} else {
return false;
}
}
// Sign only
if ($("#smime_sign").is(":checked") && !$("#smime_encrypt").is(":checked")) {
if (confirm(rcmail.gettext("smime_get_password", "rc_smime"))) {
return true;
} else {
return false;
}
}
}
}
*/