Elastic: Support space-separated email addresses in recipient input (#6529)

pull/5786/merge
Aleksander Machniak 4 years ago
parent 4e00237cc4
commit 218cd2ab4a

@ -3,7 +3,6 @@ CHANGELOG Roundcube Webmail
- Allow array in smtp_host config (#7296)
- Remove use of ext-iconv
- Elastic: Moving single recipients between recipient inputs with drag-n-drop (#5069)
- Support RFC8438: IMAP STATUS=SIZE - for faster folder size calculation (#7269)
- MySQL: Use utf8mb4 charset and utf8mb4_unicode_ci collation (#6535, #7113)
- Support for language codes up to 16 chars long (e.g. es-419) in database schema (#6851)
@ -18,7 +17,9 @@ CHANGELOG Roundcube Webmail
- Managesieve: Fix bug where forward/vacation rule could end up being duplicated (#7349)
- Password: Added 'pwned' password strength driver (#7274)
- Add support for SameSite cookie attribute via session_samesite option (req PHP >= 7.3.0) (#6772)
- Elastic: Moving single recipients between recipient inputs with drag-n-drop (#5069)
- Elastic: Display a special icon for other users and shared namespace roots (#5012)
- Elastic: Support space-separated email addresses in recipient input (#6529)
- Change folders sorting so shared/other users namespaces are listed last (#5012)
- Display a warning and do not try to open empty attachments (#7332)
- Templates: Add support for expressions in object attributes (#7237)

@ -3228,8 +3228,8 @@ function rcube_elastic_ui()
apply_func();
return false;
}
// Here we add a recipient box when the separator (,;) or Enter was pressed
else if (e.key == ',' || e.key == ';' || (e.key == 'Enter' && !rcmail.ksearch_visible())) {
// Here we add a recipient box when the separator (,;\s) or Enter was pressed,
else if (e.key == ' ' || e.key == ',' || e.key == ';' || (e.key == 'Enter' && !rcmail.ksearch_visible())) {
if (update_func()) {
return false;
}
@ -3304,16 +3304,31 @@ function rcube_elastic_ui()
$.each(matches || [], function() {
if (this.length && (recipient_rx1.test(this) || recipient_rx2.test(this))) {
var email = RegExp.$1,
name = this.replace(email, '').trim();
var email, str = this;
recipients.push({
name: name,
email: email.replace(/(^<|>$)/g, ''),
text: this
});
text = text.replace(str, '');
// Support space-separated email addresses
while (str.length && str.indexOf(RegExp.$1) === 0) {
email = RegExp.$1;
recipients.push({
name: '',
email: email.replace(/(^<|>$)/g, '')
});
text = text.replace(this, '');
str = str.replace(email, '').trim();
if (!recipient_rx1.test(str) && !recipient_rx2.test(str)) {
break;
}
}
if (email != RegExp.$1) {
email = RegExp.$1;
recipients.push({
name: str.replace(email, '').trim(),
email: email.replace(/(^<|>$)/g, '')
});
}
}
});

Loading…
Cancel
Save