mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 00:13:47 +03:00
Split paste into addr field by commas
This commit is contained in:
parent
32d4e9a14c
commit
501f594a0a
2 changed files with 35 additions and 0 deletions
|
@ -2862,6 +2862,23 @@ const compose = (opts, listMailboxes) => {
|
||||||
}, function change() {
|
}, function change() {
|
||||||
autosizeElem.dataset.value = inputElem.value;
|
autosizeElem.dataset.value = inputElem.value;
|
||||||
fetchRecipientSecurity();
|
fetchRecipientSecurity();
|
||||||
|
}, function paste(e) {
|
||||||
|
const data = e.clipboardData?.getData('text/plain');
|
||||||
|
if (typeof data !== 'string' || data === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const split = data.split(',');
|
||||||
|
if (split.length <= 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
autosizeElem.dataset.value = inputElem.value = split[0];
|
||||||
|
let last;
|
||||||
|
for (const rest of split.splice(1)) {
|
||||||
|
last = newAddrView(rest.trim(), isRecipient, views, btn, cell, row, single);
|
||||||
|
}
|
||||||
|
last.input.focus();
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
}), securityBar = dom.span(css('securitybar', {
|
}), securityBar = dom.span(css('securitybar', {
|
||||||
margin: '0 1px',
|
margin: '0 1px',
|
||||||
borderBottom: '1.5px solid',
|
borderBottom: '1.5px solid',
|
||||||
|
|
|
@ -1785,6 +1785,24 @@ const compose = (opts: ComposeOptions, listMailboxes: listMailboxes) => {
|
||||||
autosizeElem.dataset.value = inputElem.value
|
autosizeElem.dataset.value = inputElem.value
|
||||||
fetchRecipientSecurity()
|
fetchRecipientSecurity()
|
||||||
},
|
},
|
||||||
|
function paste(e: ClipboardEvent) {
|
||||||
|
const data = e.clipboardData?.getData('text/plain')
|
||||||
|
if (typeof data !== 'string' || data === '') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const split = data.split(',')
|
||||||
|
if (split.length <= 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
autosizeElem.dataset.value = inputElem.value = split[0]
|
||||||
|
let last
|
||||||
|
for (const rest of split.splice(1)) {
|
||||||
|
last = newAddrView(rest.trim(), isRecipient, views, btn, cell, row, single)
|
||||||
|
}
|
||||||
|
last!!.input.focus()
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
},
|
||||||
),
|
),
|
||||||
securityBar=dom.span(
|
securityBar=dom.span(
|
||||||
css('securitybar', {
|
css('securitybar', {
|
||||||
|
|
Loading…
Reference in a new issue