Skip to content

Commit

Permalink
ENgrid Update
Browse files Browse the repository at this point in the history
  • Loading branch information
fernanDOTdo committed Nov 6, 2024
1 parent d0a51b3 commit 6764b85
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 37 deletions.
56 changes: 42 additions & 14 deletions dist/engrid.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
*
* ENGRID PAGE TEMPLATE ASSETS
*
* Date: Monday, October 28, 2024 @ 12:28:46 ET
* By: bryancasler
* ENGrid styles: v0.19.9
* ENGrid scripts: v0.19.13
* Date: Tuesday, November 5, 2024 @ 21:19:26 ET
* By: fernando
* ENGrid styles: v0.19.15
* ENGrid scripts: v0.19.14
*
* Created by 4Site Studios
* Come work with us or join our team, we would love to hear from you
Expand Down Expand Up @@ -1748,21 +1748,25 @@ template{
--h2_line-height:initial;
--h2_text-transform:initial;
--h3_font-family:var(--h1_font-family);
--h3_color:initial;
--h3_font-size:calc(var(--default_font-size)*var(--scale-up_40pct));
--h3_font-weight:initial;
--h3_line-height:initial;
--h3_text-transform:initial;
--h4_font-family:var(--h1_font-family);
--h4_color:initial;
--h4_font-size:calc(var(--default_font-size)*var(--scale-up_40pct));
--h4_font-weight:initial;
--h4_line-height:initial;
--h4_text-transform:initial;
--h5_font-family:var(--h1_font-family);
--h5_color:initial;
--h5_font-size:calc(var(--default_font-size)*var(--scale-up_40pct));
--h5_font-weight:initial;
--h5_line-height:initial;
--h5_text-transform:initial;
--h6_font-family:var(--h1_font-family);
--h6_color:initial;
--h6_font-size:calc(var(--default_font-size)*var(--scale-up_40pct));
--h6_font-weight:initial;
--h6_line-height:initial;
Expand Down Expand Up @@ -1807,24 +1811,48 @@ h2{
}

h3{
color:var(--h3_color);
font-family:var(--h3_font-family);
font-size:var(--h3_font-size);
font-weight:var(--h3_font-weight);
line-height:var(--h3_line-height);
margin-bottom:calc(1rem*var(--scale-down_40pct));
margin-top:calc(2rem*var(--scale-down_40pct));
text-transform:var(--h3_text-transform);
}

h3,h4,h5,h6{
color:var(--h3_color);
font-family:var(--h3_font-family);
font-weight:var(--h3_font-weight);
line-height:var(--h3_line-height);
h4{
color:var(--h4_color);
font-family:var(--h4_font-family);
font-size:var(--h4_font-size);
font-weight:var(--h4_font-weight);
line-height:var(--h4_line-height);
text-transform:var(--h4_text-transform);
}

h4,h5,h6{
font-size:calc(var(--h3_font-size)*var(--scale-down_20pct));
margin-bottom:calc(1rem*var(--scale-down_80pct));
margin-top:calc(2rem*var(--scale-down_80pct));
text-transform:var(--h4_text-transform);
h4,h5{
margin-bottom:calc(1rem*var(--scale-down_60pct));
margin-top:calc(2rem*var(--scale-down_60pct));
}

h5{
color:var(--h5_color);
font-family:var(--h5_font-family);
font-size:var(--h5_font-size);
font-weight:var(--h5_font-weight);
line-height:var(--h5_line-height);
text-transform:var(--h5_text-transform);
}

h6{
color:var(--h6_color);
font-family:var(--h6_font-family);
font-size:var(--h6_font-size);
font-weight:var(--h6_font-weight);
line-height:var(--h6_line-height);
margin-bottom:calc(1rem*var(--scale-down_60pct));
margin-top:calc(2rem*var(--scale-down_60pct));
text-transform:var(--h6_text-transform);
}

p{
Expand Down
51 changes: 44 additions & 7 deletions dist/engrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
*
* ENGRID PAGE TEMPLATE ASSETS
*
* Date: Monday, October 28, 2024 @ 12:28:46 ET
* By: bryancasler
* ENGrid styles: v0.19.9
* ENGrid scripts: v0.19.13
* Date: Tuesday, November 5, 2024 @ 21:19:26 ET
* By: fernando
* ENGrid styles: v0.19.15
* ENGrid scripts: v0.19.14
*
* Created by 4Site Studios
* Come work with us or join our team, we would love to hear from you
Expand Down Expand Up @@ -11200,6 +11200,12 @@ class DonationAmount {
if (found.length) {
const amountField = found[0];
amountField.checked = true;
// Change Event
const event = new Event("change", {
bubbles: true,
cancelable: true,
});
amountField.dispatchEvent(event);
// Clear OTHER text field
this.clearOther();
}
Expand All @@ -11211,6 +11217,12 @@ class DonationAmount {
enFieldOtherAmountRadio.checked = true;
}
otherField.value = parseFloat(amount.toString()).toFixed(2);
// Change Event
const event = new Event("change", {
bubbles: true,
cancelable: true,
});
otherField.dispatchEvent(event);
const otherWrapper = otherField.parentNode;
otherWrapper.classList.remove("en__field__item--hidden");
}
Expand Down Expand Up @@ -14059,15 +14071,16 @@ class UpsellCheckbox {
this.checkboxContainer = null;
this.oldAmount = 0;
this.oldFrequency = "one-time";
this.resetCheckbox = false;
this.logger = new EngridLogger("UpsellCheckbox", "black", "LemonChiffon", "✅");
let options = "EngridUpsell" in window ? window.EngridUpsell : {};
this.options = Object.assign(Object.assign({}, UpsellOptionsDefaults), options);
if (this.options.upsellCheckbox === false) {
this.logger.log("Skipped");
return;
}
// If window.EngridUpsell has only the upsellCheckbox property, set window.EngridUpsell.skipUpsell to true
if (Object.keys(options).length === 1 && "upsellCheckbox" in options) {
// To avoid using both UpsellLightbox and UpsellCheckbox at the same time, set window.EngridUpsell.skipUpsell to true if there's an upsellCheckbox
if ("upsellCheckbox" in options && options.upsellCheckbox !== false) {
window.EngridUpsell.skipUpsell = true; // Skip the upsell lightbox
}
this.checkboxOptions = Object.assign(Object.assign({}, this.checkboxOptionsDefaults), this.options.upsellCheckbox);
Expand All @@ -14079,13 +14092,32 @@ class UpsellCheckbox {
this.renderCheckbox();
this.updateLiveData();
this._frequency.onFrequencyChange.subscribe(() => this.updateLiveData());
this._frequency.onFrequencyChange.subscribe(() => this.resetUpsellCheckbox());
this._amount.onAmountChange.subscribe(() => this.updateLiveData());
this._amount.onAmountChange.subscribe(() => this.resetUpsellCheckbox());
this._fees.onFeeChange.subscribe(() => this.updateLiveData());
}
updateLiveData() {
this.liveAmounts();
this.liveFrequency();
}
resetUpsellCheckbox() {
var _a, _b;
// Only reset the upsell checkbox if it has been checked
if (!this.resetCheckbox)
return;
this.logger.log("Reset");
// Uncheck the upsell checkbox
const checkbox = (_a = this.checkboxContainer) === null || _a === void 0 ? void 0 : _a.querySelector("#upsellCheckbox");
if (checkbox) {
checkbox.checked = false;
}
// Hide the upsell checkbox
(_b = this.checkboxContainer) === null || _b === void 0 ? void 0 : _b.classList.add("recurring-frequency-y-hide");
this.oldAmount = 0;
this.oldFrequency = "one-time";
this.resetCheckbox = false;
}
renderCheckbox() {
if (this.checkboxOptions === false)
return;
Expand Down Expand Up @@ -14211,8 +14243,13 @@ class UpsellCheckbox {
this._dataLayer.addEndOfGiftProcessVariable("ENGRID_UPSELL_ORIGINAL_AMOUNT", originalAmount);
this._dataLayer.addEndOfGiftProcessVariable("ENGRID_UPSELL_DONATION_FREQUENCY", "MONTHLY");
this.renderConversionField("upsellSuccess", "onetime", originalAmount, "monthly", upsoldAmount, "monthly", upsoldAmount);
// Set the resetCheckbox flag to true so it will reset if the user changes the amount or frequency
window.setTimeout(() => {
this.resetCheckbox = true;
}, 500);
}
else {
this.resetCheckbox = false;
this.logger.success("Not Upsold");
this._amount.setAmount(this.oldAmount);
this._frequency.setFrequency(this.oldFrequency);
Expand Down Expand Up @@ -21757,7 +21794,7 @@ class CheckboxLabel {
}

;// CONCATENATED MODULE: ./node_modules/@4site/engrid-scripts/dist/version.js
const AppVersion = "0.19.13";
const AppVersion = "0.19.14";

;// CONCATENATED MODULE: ./node_modules/@4site/engrid-scripts/dist/index.js
// Runs first so it can change the DOM markup before any markup dependent code fires
Expand Down
10 changes: 5 additions & 5 deletions dist/engrid.min.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/engrid.min.js

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6764b85

Please sign in to comment.