Skip to content

Commit

Permalink
Merge pull request #12 from 4site-interactive-studios/remove-ran2
Browse files Browse the repository at this point in the history
remove ran2 and fix tippy once and for all
  • Loading branch information
fernanDOTdo authored Nov 2, 2023
2 parents 127d60a + 0755609 commit ff8e91a
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 3,070 deletions.
1,090 changes: 2 additions & 1,088 deletions dist/engrid.css

Large diffs are not rendered by default.

77 changes: 22 additions & 55 deletions dist/engrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*
* ENGRID PAGE TEMPLATE ASSETS
*
* Date: Thursday, October 5, 2023 @ 17:46:00 ET
* By: fernando
* Date: Wednesday, October 25, 2023 @ 05:46:50 ET
* By: michael
* ENGrid styles: v0.15.3
* ENGrid scripts: v0.15.8
*
Expand Down Expand Up @@ -20595,8 +20595,7 @@ class DonationLightboxForm {
;// CONCATENATED MODULE: ./src/scripts/main.js
const customScript = function (App) {
App.log("ENGrid client scripts are executing"); // Add your client scripts here

const themeVersion = Number(document.body.dataset.engridTheme.slice(-1)); // If we're on the last page OR we're redirected from another EN Page
// If we're on the last page OR we're redirected from another EN Page

if (App.getPageNumber() === App.getPageCount() || document.referrer.includes("act.ran.org")) {
// Load the Cohort iFrame to the end of the #endgrid element
Expand All @@ -20618,42 +20617,14 @@ const customScript = function (App) {
let enFieldOtherAmt = document.querySelectorAll(".radio-to-buttons_donationAmt .en__field--radio.en__field--donationAmt .en__field__input--other")[0];

if (enFieldOtherAmt) {
enFieldOtherAmt.placeholder = themeVersion === 2 ? "Other" : "Custom Amount";
enFieldOtherAmt.placeholder = "Custom Amount";
} // Add placeholder to the Mobile Phone Field


let enFieldMobilePhone = document.querySelectorAll("input#en__field_supporter_phoneNumber")[0];

if (enFieldMobilePhone) {
enFieldMobilePhone.placeholder = "000-000-0000 (optional)";
}

if (themeVersion === 2) {
// Digital Wallets Moving Parts
const digitalWalletWrapper = document.querySelector(".merge-with-give-by-select #en__digitalWallet");
const digitalWalletFirstChild = document.querySelector("#en__digitalWallet");
const giveBySelect = document.querySelector(".give-by-select");

if (digitalWalletWrapper && giveBySelect) {
giveBySelect.appendChild(digitalWalletWrapper);
digitalWalletFirstChild.insertAdjacentHTML("beforeend", "<div class='digital-divider'><span class='divider-left'></span><p class='divider-center'>or enter manually</p><span class='divider-right'></span></div>");
}

let digitalWalletsExist;
setTimeout(function () {
digitalWalletsExist = document.querySelectorAll(".en__digitalWallet__container > *");

if (digitalWalletsExist.length > 0) {
giveBySelect.setAttribute("show-wallets", "");
}
}, 500);
setTimeout(function () {
digitalWalletsExist = document.querySelectorAll(".en__digitalWallet__container > *");

if (digitalWalletsExist.length > 0) {
giveBySelect.setAttribute("show-wallets", "");
}
}, 2500);
} // Make Sure we don't have selected hidden payment method when changing frequency or currency


Expand Down Expand Up @@ -20690,8 +20661,10 @@ const customScript = function (App) {
});
}

if (themeVersion === 3) {
const tippyInstance = document.querySelector(".media-with-attribution figattribution")._tippy;
const attriubtion = document.querySelector(".media-with-attribution figattribution");

if (attriubtion) {
const tippyInstance = attriubtion._tippy;

if (tippyInstance) {
tippyInstance.setProps({
Expand All @@ -20700,13 +20673,13 @@ const customScript = function (App) {
placement: "right-end"
});
}
}

document.body.removeAttribute("data-engrid-errors");
const ACHOption = document.querySelector('[name="transaction.paymenttype"] [value="ACH"]');
document.body.removeAttribute("data-engrid-errors");
const ACHOption = document.querySelector('[name="transaction.paymenttype"] [value="ACH"]');

if (ACHOption) {
ACHOption.value = "ach";
}
if (ACHOption) {
ACHOption.value = "ach";
} // Add these classes to the submit div to hide it when the digital wallet is selected


Expand All @@ -20728,15 +20701,6 @@ const customScript = function (App) {



const rememberMeOptions = {
checked: true,
remoteUrl: "https://www.ran.org/wp-content/themes/ran-2020/data-remember.html",
fieldOptInSelectorTarget: "div.en__field--telephone, div.en__field--email, div.en__field--lastName",
fieldOptInSelectorTargetLocation: "after",
fieldClearSelectorTarget: "div.en__field--firstName div, div.en__field--email div",
fieldClearSelectorTargetLocation: "after",
fieldNames: ["supporter.firstName", "supporter.lastName", "supporter.address1", "supporter.address2", "supporter.city", "supporter.country", "supporter.region", "supporter.postcode", "supporter.emailAddress"]
};
const options = {
applePay: false,
CapitalizeFields: true,
Expand Down Expand Up @@ -20770,7 +20734,15 @@ const options = {
phone_date_field: "supporter.NOT_TAGGED_44",
phone_status_field: "supporter.NOT_TAGGED_43"
},
RememberMe: rememberMeOptions,
RememberMe: {
checked: true,
remoteUrl: "https://www.ran.org/wp-content/themes/ran-2020/data-remember.html",
fieldOptInSelectorTarget: "div.en__field--postcode, div.en__field--telephone, div.en__field--email, div.en__field--lastName",
fieldOptInSelectorTargetLocation: "after",
fieldClearSelectorTarget: "div.en__field--firstName div, div.en__field--email div",
fieldClearSelectorTargetLocation: "after",
fieldNames: ["supporter.firstName", "supporter.lastName", "supporter.address1", "supporter.address2", "supporter.city", "supporter.country", "supporter.region", "supporter.postcode", "supporter.emailAddress"]
},
Plaid: true,
Debug: App.getUrlParameter("debug") == "true" ? true : false,
onLoad: () => {
Expand All @@ -20788,11 +20760,6 @@ const options = {
}
}
};

if (document.body.dataset.engridTheme === "engrid-ran3") {
rememberMeOptions.fieldOptInSelectorTarget = "div.en__field--postcode, div.en__field--telephone, div.en__field--email, div.en__field--lastName";
}

new App(options);
})();

Expand Down
8 changes: 3 additions & 5 deletions dist/engrid.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit ff8e91a

Please sign in to comment.