From 570f943bd17e46d432b2ca857496256737927c37 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Thu, 27 Jun 2024 16:00:54 +0200 Subject: [PATCH] Custom Embed script (#469) * Custom Embed script * Fix redirecting whene embedded --------- Co-authored-by: Chirag Chhatrala --- .../open/forms/OpenCompleteForm.vue | 3 +- .../components/pages/forms/show/EmbedCode.vue | 7 +- client/public/widgets/iframe.js | 495 ++++++++++++++++++ client/public/widgets/iframe.min.js | 1 + 4 files changed, 500 insertions(+), 6 deletions(-) create mode 100644 client/public/widgets/iframe.js create mode 100644 client/public/widgets/iframe.min.js diff --git a/client/components/open/forms/OpenCompleteForm.vue b/client/components/open/forms/OpenCompleteForm.vue index dd5c3890..6930ebd0 100644 --- a/client/components/open/forms/OpenCompleteForm.vue +++ b/client/components/open/forms/OpenCompleteForm.vue @@ -272,7 +272,8 @@ export default { type: 'form-submitted', form: { slug: this.form.slug, - id: this.form.id + id: this.form.id, + redirect_target_url: (this.form.is_pro && data.redirect && data.redirect_url) ? data.redirect_url : null }, submission_data: form.data() }) diff --git a/client/components/pages/forms/show/EmbedCode.vue b/client/components/pages/forms/show/EmbedCode.vue index 8500a9af..f512ed48 100644 --- a/client/components/pages/forms/show/EmbedCode.vue +++ b/client/components/pages/forms/show/EmbedCode.vue @@ -49,11 +49,8 @@ export default { computed: { embedCode() { // eslint-disable no-useless-escape - return ` -