reordered code
This commit is contained in:
		
							
								
								
									
										48
									
								
								dist/mailgo.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								dist/mailgo.js
									
									
									
									
										vendored
									
									
								
							@@ -352,30 +352,6 @@ document.addEventListener("click", mailgoCheckRender); // validate a single emai
 | 
			
		||||
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,}))$/;
 | 
			
		||||
  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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -423,4 +399,28 @@ var composedPath = function composedPath(el) {
 | 
			
		||||
 | 
			
		||||
    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
									
									
								
							
							
						
						
									
										2
									
								
								dist/mailgo.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -434,30 +434,6 @@ const validateEmail = 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
 | 
			
		||||
const showMailgo = () => (getE("mailgo").style.display = "flex");
 | 
			
		||||
 | 
			
		||||
@@ -493,3 +469,27 @@ const composedPath = el => {
 | 
			
		||||
    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);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user