diff --git a/dist/engrid.css b/dist/engrid.css index dd20225..8641033 100644 --- a/dist/engrid.css +++ b/dist/engrid.css @@ -19,7 +19,7 @@ * * ENGRID PAGE TEMPLATE ASSETS * - * Date: Tuesday, April 2, 2024 @ 11:21:26 ET + * Date: Tuesday, April 2, 2024 @ 13:14:06 ET * By: michael * ENGrid styles: v0.17.19 * ENGrid scripts: v0.17.20 @@ -8863,7 +8863,7 @@ body[data-engrid-debug]:before{ color:#000; } -iframe[src*=fluidads]{ +body[data-engrid-page-type=donation][data-engrid-payment-type=paypal]:not([data-engrid-currency-code=USD]) .en__submit,body[data-engrid-page-type=donation][data-engrid-payment-type=paypaltouch]:not([data-engrid-currency-code=USD]) .en__submit,body[data-engrid-page-type=premiumgift][data-engrid-payment-type=paypal]:not([data-engrid-currency-code=USD]) .en__submit,body[data-engrid-page-type=premiumgift][data-engrid-payment-type=paypaltouch]:not([data-engrid-currency-code=USD]) .en__submit,iframe[src*=fluidads]{ display:none; } body{ diff --git a/dist/engrid.js b/dist/engrid.js index 08381d7..3aa112d 100644 --- a/dist/engrid.js +++ b/dist/engrid.js @@ -17,7 +17,7 @@ * * ENGRID PAGE TEMPLATE ASSETS * - * Date: Tuesday, April 2, 2024 @ 11:21:26 ET + * Date: Tuesday, April 2, 2024 @ 13:14:06 ET * By: michael * ENGrid styles: v0.17.19 * ENGrid scripts: v0.17.20 @@ -23146,6 +23146,17 @@ const customScript = function (App, EnForm) { if (addRecipientButton) { addRecipientButton.innerHTML = "Add Recipient"; } + + const formInstance = EnForm.getInstance(); + formInstance.onValidate.subscribe(() => { + if (!formInstance.validate) return; + + if (App.getPageType() === "DONATION" && ["paypaltouch", "paypal"].includes(App.getPaymentType()) && App.getCurrencyCode() !== "USD") { + App.addHtml('
\n Giving as ${p.getFieldValue("supporter.firstName")} ${p.getFieldValue("supporter.lastName")} \n with ${p.getFieldValue("transaction.paymenttype").toUpperCase()}\n (change)
\n ${this.options.otherLabel}\n
\n\n ${t}\n
\n \x3c!-- YES BUTTON --\x3e\n