mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
creation of plugin that handle paste multi row mail addresses into a single email field
This commit is contained in:
parent
263d97ee31
commit
bc6a0be048
5 changed files with 54 additions and 0 deletions
20
plugins/contact-group-excel-paste/js/excel_contact_group.js
Normal file
20
plugins/contact-group-excel-paste/js/excel_contact_group.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(function(window, $) {
|
||||
$(function() {
|
||||
$(window.document).on('paste', '.RL-PopupsContacts .contactValueInput', function() {
|
||||
// trigger the process on click and paste
|
||||
var $this = $(this);
|
||||
|
||||
setTimeout(function () {
|
||||
$this.trigger('keyup');
|
||||
});
|
||||
}).on('keyup', '.RL-PopupsContacts .contactValueInput', function() {
|
||||
var $this = $(this),
|
||||
value = $this.val(),
|
||||
match = value && value.match(/@/ig);
|
||||
|
||||
if (match && match.length > 1) {
|
||||
$this.val($this.val().replace(/\n| /ig, ','));
|
||||
}
|
||||
});
|
||||
});
|
||||
}(window, $));
|
||||
Loading…
Add table
Add a link
Reference in a new issue