reordered code

This commit is contained in:
Matteo Manzinello 2019-06-03 15:01:13 +02:00
parent c90a602cf5
commit d3be2896e4
4 changed files with 50 additions and 50 deletions

48
dist/mailgo.js vendored
View File

@ -352,30 +352,6 @@ document.addEventListener("click", mailgoCheckRender); // validate a single emai
var validateEmail = function validateEmail(email) { var validateEmail = function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email); return re.test(email);
}; // validate an array of emails
var validateEmails = function validateEmails(arr) {
return arr.every(validateEmail);
}; // copy of a string
var copyToClipboard = function copyToClipboard(str) {
var el = document.createElement("textarea");
el.value = str;
el.setAttribute("readonly", "");
el.style.position = "absolute";
el.style.left = "-9999px";
document.body.appendChild(el);
var selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
el.select();
document.execCommand("copy");
document.body.removeChild(el);
if (selected) {
document.getSelection().removeAllRanges();
document.getSelection().addRange(selected);
}
}; // show the modal }; // show the modal
@ -423,4 +399,28 @@ var composedPath = function composedPath(el) {
el = el.parentElement; el = el.parentElement;
} }
}; // validate an array of emails
var validateEmails = function validateEmails(arr) {
return arr.every(validateEmail);
}; // copy of a string
var copyToClipboard = function copyToClipboard(str) {
var el = document.createElement("textarea");
el.value = str;
el.setAttribute("readonly", "");
el.style.position = "absolute";
el.style.left = "-9999px";
document.body.appendChild(el);
var selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false;
el.select();
document.execCommand("copy");
document.body.removeChild(el);
if (selected) {
document.getSelection().removeAllRanges();
document.getSelection().addRange(selected);
}
}; };

2
dist/mailgo.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -434,30 +434,6 @@ const validateEmail = email => {
return re.test(email); return re.test(email);
}; };
// validate an array of emails
const validateEmails = arr => arr.every(validateEmail);
// copy of a string
const copyToClipboard = str => {
let el = document.createElement("textarea");
el.value = str;
el.setAttribute("readonly", "");
el.style.position = "absolute";
el.style.left = "-9999px";
document.body.appendChild(el);
let selected =
document.getSelection().rangeCount > 0
? document.getSelection().getRangeAt(0)
: false;
el.select();
document.execCommand("copy");
document.body.removeChild(el);
if (selected) {
document.getSelection().removeAllRanges();
document.getSelection().addRange(selected);
}
};
// show the modal // show the modal
const showMailgo = () => (getE("mailgo").style.display = "flex"); const showMailgo = () => (getE("mailgo").style.display = "flex");
@ -493,3 +469,27 @@ const composedPath = el => {
el = el.parentElement; el = el.parentElement;
} }
}; };
// validate an array of emails
const validateEmails = arr => arr.every(validateEmail);
// copy of a string
const copyToClipboard = str => {
let el = document.createElement("textarea");
el.value = str;
el.setAttribute("readonly", "");
el.style.position = "absolute";
el.style.left = "-9999px";
document.body.appendChild(el);
let selected =
document.getSelection().rangeCount > 0
? document.getSelection().getRangeAt(0)
: false;
el.select();
document.execCommand("copy");
document.body.removeChild(el);
if (selected) {
document.getSelection().removeAllRanges();
document.getSelection().addRange(selected);
}
};