From be61601950236dc6dee40054945f6e58c17104f8 Mon Sep 17 00:00:00 2001 From: Adrian Amaglio Date: Sat, 26 Dec 2020 14:03:13 +0100 Subject: [PATCH] Refactoring. Client has no global names anymore, and no inline scripts --- client/index.js | 15 +++++++++++++-- client/package.json | 2 +- test.html | 9 ++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/client/index.js b/client/index.js index 27137da..f4a2ca9 100644 --- a/client/index.js +++ b/client/index.js @@ -1,3 +1,6 @@ +/* Executed after page loading */ +(function () { + class JeanCloudContactFormNotifier { constructor (theme, messageContainer) { /* Choose the theme */ @@ -112,7 +115,6 @@ function jeanCloudContactFormIntercept (formId, notifier) { } } -(function () { /* Get the current js file location */ const path = (document.currentScript.src[-1] == '/' ? document.currentScript.src : document.currentScript.src.replace(/\/[^\/]*$/, '')) @@ -125,6 +127,15 @@ function jeanCloudContactFormIntercept (formId, notifier) { link.integrity = 'sha384-D12RSMaIURTgZZljhdQqYlQzgEfXvOFwtiqzkWnNcDbKFwMWXcmsCRFO5BNii0MB' // cat style.css | openssl dgst -sha384 -binary | openssl base64 -A document.head.appendChild(link); + + /* Load the targeted forms */ + var configs = document.getElementsByClassName('contact-form-config') + for (var i=0; i
-
+ - +
@@ -27,11 +27,10 @@
- +
- - +