added comments, better management of types
This commit is contained in:
parent
776c4627d7
commit
3df5d53a8e
2
dist/mailgo.min.js
vendored
2
dist/mailgo.min.js
vendored
File diff suppressed because one or more lines are too long
@ -448,8 +448,11 @@ const mailgoRender = (type = MAIL_TYPE, mailgo) => {
|
|||||||
|
|
||||||
// add the actions to buttons
|
// add the actions to buttons
|
||||||
waButton.addEventListener("click", () => actions.openWhatsApp());
|
waButton.addEventListener("click", () => actions.openWhatsApp());
|
||||||
|
|
||||||
telegramButton.addEventListener("click", () => actions.openTelegram());
|
telegramButton.addEventListener("click", () => actions.openTelegram());
|
||||||
|
|
||||||
callButton.addEventListener("click", () => actions.callDefault());
|
callButton.addEventListener("click", () => actions.callDefault());
|
||||||
|
|
||||||
copyButton.addEventListener("click", () => actions.copy(tel));
|
copyButton.addEventListener("click", () => actions.copy(tel));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,13 +585,19 @@ const isMailgo = (element, type = MAIL_TYPE) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* mailgoCheckRender
|
* mailgoCheckRender
|
||||||
* function to check if an element is mailgo-enabled or not referencing to the old
|
* function to check if an element is mailgo-enabled or not referencing to
|
||||||
|
* mail:
|
||||||
* document.querySelectorAll(
|
* document.querySelectorAll(
|
||||||
* 'a[href^="mailto:" i]:not(.no-mailgo), a[href="#mailgo"], a.mailgo'
|
* 'a[href^="mailto:" i]:not(.no-mailgo), a[href="#mailgo"], a.mailgo'
|
||||||
* );
|
* );
|
||||||
|
* tel:
|
||||||
* document.querySelectorAll(
|
* document.querySelectorAll(
|
||||||
* 'a[href^="tel:" i]:not(.no-mailgo), a[href="#mailgo"], a.mailgo'
|
* 'a[href^="tel:" i]:not(.no-mailgo), a[href="#mailgo"], a.mailgo'
|
||||||
* );
|
* );
|
||||||
|
* or
|
||||||
|
* document.querySelectorAll(
|
||||||
|
* 'a[href^="callto:" i]:not(.no-mailgo), a[href="#mailgo"], a.mailgo'
|
||||||
|
* );
|
||||||
*/
|
*/
|
||||||
const mailgoCheckRender = event => {
|
const mailgoCheckRender = event => {
|
||||||
// check if the id=mailgo exists in the body
|
// check if the id=mailgo exists in the body
|
||||||
@ -706,9 +715,16 @@ document.addEventListener("click", mailgoCheckRender);
|
|||||||
|
|
||||||
// show the modal
|
// show the modal
|
||||||
const showMailgo = (type = MAIL_TYPE) => {
|
const showMailgo = (type = MAIL_TYPE) => {
|
||||||
type === TEL_TYPE
|
// show mailgo type mail
|
||||||
? setDisplay("mailgo-tel", "flex")
|
if (type === MAIL_TYPE) {
|
||||||
: setDisplay("mailgo", "flex");
|
setDisplay("mailgo", "flex");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// show mailgo type tel
|
||||||
|
if (type === TEL_TYPE) {
|
||||||
|
setDisplay("mailgo-tel", "flex");
|
||||||
|
return;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// hide the modal
|
// hide the modal
|
||||||
@ -773,7 +789,7 @@ const validateEmail = email => {
|
|||||||
const validateEmails = arr => arr.every(validateEmail);
|
const validateEmails = arr => arr.every(validateEmail);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// clean a telephone number (removes +, - ...)
|
// clean a telephone number (removes - ...)
|
||||||
const cleanTel = tel => tel;
|
const cleanTel = tel => tel;
|
||||||
|
|
||||||
// copy of a string
|
// copy of a string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user