|
17 | 17 | * |
18 | 18 | * ENGRID PAGE TEMPLATE ASSETS |
19 | 19 | * |
20 | | - * Date: Tuesday, November 4, 2025 @ 17:29:41 ET |
| 20 | + * Date: Thursday, November 6, 2025 @ 10:44:05 ET |
21 | 21 | * By: fernando |
22 | 22 | * ENGrid styles: v0.23.0 |
23 | | - * ENGrid scripts: v0.23.0 |
| 23 | + * ENGrid scripts: v0.23.2 |
24 | 24 | * |
25 | 25 | * Created by 4Site Studios |
26 | 26 | * Come work with us or join our team, we would love to hear from you |
@@ -13478,6 +13478,13 @@ class DataAttributes { |
13478 | 13478 | this.setDataAttributes(); |
13479 | 13479 | } |
13480 | 13480 | setDataAttributes() { |
| 13481 | + // Apple Pay Availability |
| 13482 | + if (window.hasOwnProperty("ApplePaySession")) { |
| 13483 | + engrid_ENGrid.setBodyData("apple-pay-available", "true"); |
| 13484 | + } |
| 13485 | + else { |
| 13486 | + engrid_ENGrid.setBodyData("apple-pay-available", "false"); |
| 13487 | + } |
13481 | 13488 | // Add the Page Type as a Data Attribute on the Body Tag |
13482 | 13489 | if (engrid_ENGrid.checkNested(window, "pageJson", "pageType")) { |
13483 | 13490 | engrid_ENGrid.setBodyData("page-type", window.pageJson.pageType); |
@@ -20985,8 +20992,17 @@ class DigitalWallets { |
20985 | 20992 | } |
20986 | 20993 | addStripeDigitalWallets() { |
20987 | 20994 | this.addOptionToPaymentTypeField("stripedigitalwallet", "GooglePay / ApplePay"); |
20988 | | - engrid_ENGrid.setBodyData("payment-type-option-apple-pay", DigitalWallets.isApplePayAvailable.toString()); |
20989 | | - engrid_ENGrid.setBodyData("payment-type-option-google-pay", !DigitalWallets.isApplePayAvailable.toString()); |
| 20995 | + // ENGrid.setBodyData( |
| 20996 | + // "payment-type-option-apple-pay", |
| 20997 | + // DigitalWallets.isApplePayAvailable.toString() |
| 20998 | + // ); |
| 20999 | + // ENGrid.setBodyData( |
| 21000 | + // "payment-type-option-google-pay", |
| 21001 | + // !DigitalWallets.isApplePayAvailable.toString() |
| 21002 | + // ); |
| 21003 | + // TODO: Change to trustworthy detection of Google Pay & Apple Pay availability |
| 21004 | + engrid_ENGrid.setBodyData("payment-type-option-apple-pay", "true"); |
| 21005 | + engrid_ENGrid.setBodyData("payment-type-option-google-pay", "true"); |
20990 | 21006 | engrid_ENGrid.setBodyData("payment-type-option-stripedigitalwallet", "true"); |
20991 | 21007 | } |
20992 | 21008 | addPaypalTouchDigitalWallets() { |
@@ -21042,7 +21058,6 @@ class DigitalWallets { |
21042 | 21058 | observer.observe(node, { childList: true, subtree: true }); |
21043 | 21059 | } |
21044 | 21060 | } |
21045 | | -DigitalWallets.isApplePayAvailable = !!window.hasOwnProperty("ApplePaySession"); |
21046 | 21061 |
|
21047 | 21062 | ;// CONCATENATED MODULE: ./node_modules/@4site/engrid-scripts/dist/mobile-cta.js |
21048 | 21063 | // This component adds a floating CTA button to the page, which can be used to scroll to the top of the form |
@@ -23880,19 +23895,23 @@ class PreferredPaymentMethod { |
23880 | 23895 | this.logger.log("Not a donation page. Skipping preferred payment selection."); |
23881 | 23896 | return false; |
23882 | 23897 | } |
| 23898 | + // If there's a "payment" URL parameter, we can proceed |
| 23899 | + if (engrid_ENGrid.getUrlParameter("payment")) { |
| 23900 | + return true; |
| 23901 | + } |
23883 | 23902 | if (!this.getGiveBySelectInputs().length) { |
23884 | 23903 | this.logger.log("No give-by-select inputs found. Skipping."); |
23885 | 23904 | return false; |
23886 | 23905 | } |
23887 | | - const config = engrid_ENGrid.getOption("PreferredPaymentMethod"); |
| 23906 | + const config = engrid_ENGrid.getOption("PreferredPaymentMethod") || false; |
23888 | 23907 | if (config === false) { |
23889 | 23908 | this.logger.log("PreferredPaymentMethod option disabled."); |
23890 | 23909 | return false; |
23891 | 23910 | } |
23892 | 23911 | return true; |
23893 | 23912 | } |
23894 | 23913 | resolveConfig() { |
23895 | | - const option = engrid_ENGrid.getOption("PreferredPaymentMethod"); |
| 23914 | + const option = engrid_ENGrid.getOption("PreferredPaymentMethod") || false; |
23896 | 23915 | if (option && typeof option === "object") { |
23897 | 23916 | const preferredPaymentMethodField = option.preferredPaymentMethodField || ""; |
23898 | 23917 | const defaultPaymentMethod = Array.isArray(option.defaultPaymentMethod) |
@@ -24066,14 +24085,8 @@ class PreferredPaymentMethod { |
24066 | 24085 | this.logger.log(`Payment method "${method}" is not available to select.`); |
24067 | 24086 | return; |
24068 | 24087 | } |
24069 | | - const label = this.findLabelForInput(input); |
24070 | | - if (label) { |
24071 | | - label.click(); |
24072 | | - } |
24073 | | - else { |
24074 | | - input.checked = true; |
24075 | | - input.dispatchEvent(new Event("change", { bubbles: true, cancelable: true })); |
24076 | | - } |
| 24088 | + input.checked = true; |
| 24089 | + input.dispatchEvent(new Event("change", { bubbles: true, cancelable: true })); |
24077 | 24090 | engrid_ENGrid.setPaymentType(method); |
24078 | 24091 | this.syncPreferredField(input.value); |
24079 | 24092 | this.selectionFinalized = true; |
@@ -24142,7 +24155,7 @@ class PreferredPaymentMethod { |
24142 | 24155 | } |
24143 | 24156 |
|
24144 | 24157 | ;// CONCATENATED MODULE: ./node_modules/@4site/engrid-scripts/dist/version.js |
24145 | | -const AppVersion = "0.23.0"; |
| 24158 | +const AppVersion = "0.23.2"; |
24146 | 24159 |
|
24147 | 24160 | ;// CONCATENATED MODULE: ./node_modules/@4site/engrid-scripts/dist/index.js |
24148 | 24161 | // Runs first so it can change the DOM markup before any markup dependent code fires |
|
0 commit comments