This commit is contained in:
Elisa 2020-08-27 16:30:04 +02:00
commit 92d75ca8d0
2 changed files with 7 additions and 3 deletions

View File

@ -58,10 +58,13 @@ function jeanCloudContactFormIntercept (formId, notifier) {
*/
const formElem = document.getElementById(formId)
if (!formElem) {
console.error('You tried to intercept form id:"' + formId + '" but it was not found.')
console.error('You tried to intercept form with id:"' + formId + '" but it was not found.')
return
}
if (!notifier)
console.log('No notifier given, no message can be displayed')
/* Intercept the submit event */
formElem.onsubmit = async (e) => {
e.preventDefault()
@ -91,6 +94,7 @@ function jeanCloudContactFormIntercept (formId, notifier) {
})
.catch((error) => {
console.error(error)
loadingText.parentNode.removeChild(loadingText)
notifier.error('Impossible denvoyer le formulaire. Vérifiez votre connexion internet ou réessayez plus tard.')
})
@ -107,7 +111,7 @@ function jeanCloudContactFormIntercept (formId, notifier) {
link.rel = "stylesheet";
link.crossOrigin = 'anonymous';
link.href = path + "/style.css";
link.integrity = 'sha384-8PWvFCRowSxssUyiGirvpq/Nh6TTzYrsbAmpC0cw/OUKkZibNdI5L1gFiHxfrTZT'
link.integrity = 'sha384-WJutysMMrOQpV0KGvocEEo29oFWTmU2iw0ZSgPqi53R8YElWq3qnSLd2vRCXAhjz'
// cat style.css | openssl dgst -sha384 -binary | openssl base64 -A
document.head.appendChild(link);
})()

View File

@ -1,6 +1,6 @@
{
"name": "jean-cloud-contact-mailer-client",
"version": "1.0.16",
"version": "1.1.2",
"description": "",
"main": "index.js",
"scripts": {