mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-28 18:41:34 +08: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/LICENCE
Normal file
20
plugins/contact-group-excel-paste/LICENCE
Normal file
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 https://github.com/korukugashi/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
4
plugins/contact-group-excel-paste/README
Normal file
4
plugins/contact-group-excel-paste/README
Normal file
|
@ -0,0 +1,4 @@
|
|||
Add ability to paste multi row email addresses (from Excel for instance) to a contact in a single row, in order to create a contact group.
|
||||
|
||||
Usage : open address book, paste your emails separated by line breaks in an email field. Emails will be collapsed with "," separator.
|
||||
Then, when you write an email, select the email group and all addresses will be added.
|
1
plugins/contact-group-excel-paste/VERSION
Normal file
1
plugins/contact-group-excel-paste/VERSION
Normal file
|
@ -0,0 +1 @@
|
|||
0.1
|
9
plugins/contact-group-excel-paste/index.php
Normal file
9
plugins/contact-group-excel-paste/index.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
class ContactGroupExcelPastePlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||
{
|
||||
public function Init()
|
||||
{
|
||||
$this->addJs('js/excel_contact_group.js');
|
||||
}
|
||||
}
|
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…
Reference in a new issue