save-the-children-main-site

3.0.3

applePayDonationAnalytics

Sets up donation tracking on apple pay form

applePayDonationAnalytics(activeMinimum: any, $donationLevelContainer: [type]): [type]
Parameters
activeMinimum (any)
$donationLevelContainer ([type]) [ description ]
Returns
[type]: [ description ]

applePayFormAnalytics

Sets up form tracking of the apple pay form

applePayFormAnalytics(): [type]
Returns
[type]: [ description ]

handlePaymentEvent

Handles the securePaymentEvent

handlePaymentEvent(event: [type], subEvent: [type], info: [type])
Parameters
event ([type]) [ description ]
subEvent ([type]) subEvent is the event name (ie, 'landed', 'retry', etc.). info is the object holding the variables that are returned
info ([type]) [ description ]

hideRecurringLevels

Gets donation levels from the donation form and updates apple pay levels with the same classes

hideRecurringLevels()

updateDonationLevelLabels

Goes through the levels in the donation and apple pay forms. Assigns gift types classes to the apple pay levels, so they match the donation form

updateDonationLevelLabels($donationFormDonationLevels: any)
Parameters
$donationFormDonationLevels (any)

addCustomPaymentButtons

Adds Donate with ApplePay/Venmo submission buttons for those 2 external payment types. Adding them as separate buttons so it's easier to trigger the custom form submissions for those paymens.

addCustomPaymentButtons($donationForm: any)
Parameters
$donationForm (any)

addCustomPaymentTypes

Adds custom payment types to the .internal-payment container, if present, otherwise to the .external-payment container, if present

addCustomPaymentTypes($internalPaymentContainer: any, $externalPaymentContainer: any)
Parameters
$internalPaymentContainer (any)
$externalPaymentContainer (any)

addCustomPayments

Adds custom payment types into DOM of the donation forms. Initializes the Braintree scripts and attached handlers

addCustomPayments($customPaymentTypes: any, $customPaymentButtons: any, $internalPaymentContainer: any, $externalPaymentContainer: any)
Parameters
$customPaymentTypes (any)
$customPaymentButtons (any)
$internalPaymentContainer (any)
$externalPaymentContainer (any)

fixPaymentMethodToggle

Fixes the payment methods toggle, as higher versions of jQuery break luminate default functionality

fixPaymentMethodToggle()

handleRecurringClick

Handles the form changes when the recurring payment is selected

handleRecurringClick($donationForm: any, activeMinimum: Number)
Parameters
$donationForm (any)
activeMinimum (Number) Minimum donation amounts

handleServerErrors

If the server returns an error, scrolls user to an error and records error in analytics

handleServerErrors()

howDidYouHear

Creates the how did you hear drop down. $input is a hidden text input that will be submitted with the form.

howDidYouHear($select: [type]): [type]
Parameters
$select ([type]) [ description ]
Returns
[type]: [ description ]

ifCheckedThenShow

If a field is checked, then show its content & make sure that hte required fields are validated.

ifCheckedThenShow($content: any, $requiredFields: any)
Parameters
$content (any)
$requiredFields (any)

modifyCreditCardSection

Makes all the necessary modification to the credit card row

modifyCreditCardSection($ccExpCvvRow: any)
Parameters
$ccExpCvvRow (any)

modifyExpirationDateRow

Adds "Month" & "Year" to expiration date dropdowns. Updates HTML for ease of styling

modifyExpirationDateRow()

modifyHeadings

Adds a custom classes to headings based on it's content, for ease of toggling things with CSS

modifyHeadings()

modifyHonorFields

Modifies the structure of the honor fields, to look as expected. Attaches the handlers to the Dedicate my donation checkbox.

modifyHonorFields($repeatCheck: any)
Parameters
$repeatCheck (any)

modifyOtherInput

Updates the input to number if there is no premium area. Sets up validation on the other input

modifyOtherInput($premiumArea: [type]): [type]
Parameters
$premiumArea ([type]) [ description ]
Returns
[type]: [ description ]

modifyPaymentTypes

Modifies payment types section

modifyPaymentTypes(): [type]
Returns
[type]: [ description ]

populateDonationReceipt

Populates the receipt with the information from variables. This is used for 3rd party payment receipts.

populateDonationReceipt(customerInfo: any, address: any, donationAmount: String, confirmationCode: String): [type]
Parameters
customerInfo (any)
address (any)
donationAmount (String) [ description ]
confirmationCode (String) [ description ]
Returns
[type]: [ description ]

prependRequiredLabels

Prepend required field labels with an asterisk for each row, doing this to have an ability to do more complex logic as HTML is not uniform

prependRequiredLabels()

setActiveDonationLevel

Sets an active class on a donation level label when a donation amount is selected.

Must be called on container that contains both radios and labels, in Luminate Online it's .donation-level-input-container

setActiveDonationLevel()

modifyEcardForm

Reformats the eCard form to match the designs

modifyEcardForm(): [type]
Returns
[type]: [ description ]

modifyEcardForm

Reformats the eCommerce eCard form to match the designs

modifyEcardForm(formRequiredAsterisk: any)
Parameters
formRequiredAsterisk (any)

getEcommPageSettings

Creates a settings object with all the pertinent information for any one eCommerce page

getEcommPageSettings(): Object
Returns
Object: An object with all the necessary settings

Add links to mailed/printed cards to the cart summary

addCardLinks(index: Integer, basketItems: any, printCardDetailsSelector: String, printCardButtonHTML: any, mailingCardDetailsSelector: String, mailingCardButtonText: any, trackingCode: String, shippingAddress: Object)
Parameters
index (Integer) Product row index, for inserting unique ids to links
basketItems (any)
printCardDetailsSelector (String) A CSS selector for the printed card form
printCardButtonHTML (any)
mailingCardDetailsSelector (String) A CSS selector for the mailing card form
mailingCardButtonText (any)
trackingCode (String) Transaction id
shippingAddress (Object) (optional) JSON object representation of the shipping address, if null we are on multi-shipping or no shipping products

createButtonFromInput

Creates a <button> element from an <input> element. We use this to style submit buttons in a more elegant ways and to change the text of the buttons.

createButtonFromInput(newValue: string, newType: any)
Parameters
newValue (string) A new value for the button, if the old is not desired. Optional.
newType (any)

Creates a link for Mailing Card details

createMailingCardLink(index: Number, mailingCardDetailsSelector: String, mailingCardButtonText: String, trackingCode: String, shippingAddress: Object)
Parameters
index (Number) Index of item in a cart
mailingCardDetailsSelector (String) A CSS selector for the mailing card form container
mailingCardButtonText (String) A String that will be placed inside of the dynamically generated button
trackingCode (String) Transaction id
shippingAddress (Object) Shipping address details (optional)

modifyCartProductRow

Rewrites product row in eCommerce cart to allow for a more elegant formatting. With multiple shipping page will land us here as well

modifyCartProductRow(index: int, $updateCartButton: any, basketItems: any)
Parameters
index (int) Row index
$updateCartButton (any)
basketItems (any)

modifyCartReviewProductRow

rewrites each row of the cart on the ecommerce purchase page

modifyCartReviewProductRow(basketItems: any, basketClass: any)
Parameters
basketItems (any)
basketClass (any)

modifyCheckoutForm

Rearranges form fields on billing and shipping pages.

modifyCheckoutForm(settings: any)
Parameters
settings (any)

modifyMailingCardForm

reformats the Mailing Card Survey Form & prepopulates set fields, executes only once

modifyMailingCardForm(formRequiredAsterisk: any)
Parameters
formRequiredAsterisk (any)

modifyProductList

Rewrites a list of products in responsive eCommerce catalog pages up to designs

modifyProductList(imagePath: String)
Parameters
imagePath (String) A string representing the folder where the product images reside

modifyRelatedProducts

Wraps related products into an section, replaces images with the higher quality ones

modifyRelatedProducts(settings: any)
Parameters
settings (any)

parseMultipleShippingAddress

parses single shipping address form a Multiple Shipping pages

parseMultipleShippingAddress()

parseSingleShippingAddress

Parses single shipping address from a single shpping address page

parseSingleShippingAddress()

redirectOnChange

Operates on a dropdown select. Rewrites the current url with the value of selected option and then redirects users to it. This is a jQuery function so it has to be called on a <select> element. Ex: $select.redirectOnChange()

redirectOnChange(anchor: String)
Parameters
anchor (String) to be appended to the URL to ensure users sees the right section

removeTextNodes

Removes the non element nodes from the $elements

removeTextNodes()

selectCurrentOption

Sets a selected option as selected based on URL parameters Needs to be called on a <select> element

selectCurrentOption()

selectToList

Converts a select list to a <ul> list, class names will be set with prefix call on <select> jquery object title will set the list title

selectToList(prefix: String, title: String, emptyLinkParam: String, storeId: String, linkSuffix: String): String
Parameters
prefix (String) component prefix that will be added to classes
title (String) the title of the list
emptyLinkParam (String) name of the empty parameter to be appended to links.
storeId (String) Id of the store
linkSuffix (String) optional, a sting that can be added to the link
Returns
String: output - replacement HTML as a string

formHasResults

Checks if the form has search results. Used in Teamraiser

formHasResults()

updateInternationalState

Updates the parameters on the international state input & shows & hides it based on selected country. Handles the case of input alone, or input wrapped in a parent div.

updateInternationalState(stateContainerShow: Boolean, $countrySelect: any)
Parameters
stateContainerShow (Boolean) Should the regular state container be shown
$countrySelect (any)

isBirthdayValid

Handles the validation of the birthday when it's entered as 3 drop downs

isBirthdayValid($day: any, $month: any, $year: any): Boolean
Parameters
$day (any)
$month (any)
$year (any)
Returns
Boolean: Is the field is valid or not

setOtherMinimum

Sets the minimum validation on the other donation amount.

setOtherMinimum(minimum: Number)
Parameters
minimum (Number) The minimum amount that needs to be set on the input.

addStateName

[addStateName takes a state that is a dropdown containing all states on a survey/form ]

Returns
[type]: [ description ]

buttonProcessing

jQuery plugin that replaces target button/input with a 'processing state' mock.

Showing a mock and hiding the real button rather than dynamically switching the content of the target button avoides some issues related to persisting button data and dynamic redrawing of button when it's value changes.

buttonProcessing(options: any, obj: any): any
Parameters
options (any = {})
obj (any) |string Settings to apply or 'remove' to restore the button.
Returns
any: function Callback that can be executed to restore the button.

groupStatesByCountry

[groupStatesByCountry places

Returns
[type]: [ description ]

setDelayedInputAttribute

Sets the attribute on an input after some delay. Removes the attribute if the value is not defined. This is used to modify the values which Luminate sets with it's own scripts.

setDelayedInputAttribute(attr: String, value: String)
Parameters
attr (String) Name of the input attribute we want to set
value (String) Value of the input attribute we want to set, don't pass any values to remove the attribute.

submitFormOnEnter

When a user hits 'Enter' key the form is submitted using $mainSubmitButton. We use this one the forms in eCommerce with multiple submit buttons. Browsers automatically "click" the first submit button they see, which is not always the main action button.

submitFormOnEnter($mainSubmitButton: [type]): [type]
Parameters
$mainSubmitButton ([type]) [ description ]
Returns
[type]: [ description ]

textInputMaxLength

Sets a max length limit of 50 on text inputs

textInputMaxLength(The: input)
Parameters
The (input) text input that will have the max length set to it

textInputPattern

Injects pattern="^([a-z A-Z-']+)$" into the text input HTML.

textInputPattern(The: input)
Parameters
The (input) text input that will have the pattern applied to it

addIdsToYouTubeVideos

Adds in a unique id parameter to the YouTube iframes, so analytics can key off of that.

addIdsToYouTubeVideos()

alert

Shows/hides alert based on cookie, also handles the alert closing and cookie setting functions. Get's attached to the .section--alert class

alert()

detectLoginState

Detects if the user is logged in and adds the appropriate body class

detectLoginState(): [type]
Returns
[type]: [ description ]

detectRegistrationState

Detects if the user is registered and adds the appropriate body class

detectRegistrationState(): [type]
Returns
[type]: [ description ]

enableFancybox

Sets up custom fancybox settings and enables it on the appropriate elements. Exposes custom settings into a global scoe

enableFancybox()

enableMasonryBoard

Enables the dynamic stacking of rectangles.

enableMasonryBoard(): [type]
Returns
[type]: Container that includes all rectangles

fixBrowserQuirks

Fixes browser specific issues that deviate from the standard.

fixBrowserQuirks($main: any, $banner: any)
Parameters
$main (any)
$banner (any)

logOut

Deletes logged in and basket cookie on logout

logOut()

signUp

Handles Sign Up form submissions, gets called directly on a set of form objects

signUp(signUpFormsSelector: any)
Parameters
signUpFormsSelector (any)

tab

Sets up tab functionality. Needs to be called on the container.

tab()

teamraiserLoginAnalytics

Invokes the user analytics call on the appropriate Teamrasier pages.

teamraiserLoginAnalytics()

updateBasket

Updates the basket item count based on cookie, the inner html layout of the item is expected to be as follows: <span class="menu__basket-items" id="menu__basket-items">4</span><a class="menu__link--basket" href="#">My Basket</a></li>

updateBasket(basketContent: any, cookieValue: string)
Parameters
basketContent (any)
cookieValue (string) a string JSON object that stores basket count and total

addToggleLinkToParent

Adds a <span class="menu__toggle" /> to each list item, when it has children

addToggleLinkToParent($menuButton: any)
Parameters
$menuButton (any)

adjustToggleSpansHeight

Sets the height with JS on main menu toggles, to esure they looks elegant on screens where the text wraps

adjustToggleSpansHeight($menuButton: any)
Parameters
$menuButton (any)

closeOpenItems

Finds all items in a menus which are open and removes the class, closing them.

closeOpenItems()

disableButtonOnSubmit

Disables buttons or inputs on submit

disableButtonOnSubmit(hasBeenClicked: any)
Parameters
hasBeenClicked (any)

disableButton

disables a button after checking form's validity

disableButton()

getButtonTargetContainer

Get the mobile container element that lives withing the target from the data-target-container attribute. This is needed to create proper scrolling effect for multiple menus

getButtonTargetContainer($target: any)
Parameters
$target (any)

getButtonTarget

Get mobile outmost container from data-target attribute of the button

getButtonTarget()

inputToLowerCase

converts input to lower case on blur, when user leaves input box

inputToLowerCase()

Modifies links that point to YouTube, adds parameters that enable analytics to track video progress

modifyYoutubeLinks()

moveElement

Repositions element to the mobile or desktop container based on button visibility, which is set in CSS

moveElement($element: any, $mobileContainer: any, $desktopContainer: any)
Parameters
$element (any)
$mobileContainer (any)
$desktopContainer (any)

moveOneSource

Gets the mobile & deskop positions for each $source (in this case menu or search box) & attaches an on-resize hander

moveOneSource($source: any, $mobileContainer: any)
Parameters
$source (any)
$mobileContainer (any)

moveSources

Repositions each element in sources to $mobileContainer if $button is visibile; visibility is set set with CSS.

moveSources($mobileContainer: any, sources: Array)
Parameters
$mobileContainer (any)
sources (Array) Array of jQuery objects

replaceCheckRadio

Surrounds radio buttons and checkboxes with spans, hides inputs Must be envoked on a list of checkboxes & radio inputs

replaceCheckRadio()

setTabContainerHeight

Sets height of the container to the height of the tallest tab

setTabContainerHeight($tabs: any, $tabNav: any, $tabContents: any)
Parameters
$tabs (any)
$tabNav (any)
$tabContents (any)

signUpSurveySubmission

processed the Luminate API results, checks if the user is logged in

signUpSurveySubmission(data: any, firstName: any, email: any)
Parameters
data (any)
firstName (any)
email (any)

smartEvent

Throttles/debounces/delays an event to prevent excessive firing

smartEvent(event: Event, fn: Function)
Parameters
event (Event) Event to be delayed
fn (Function) Function that should be called in case of the event

smoothScroll

IE fix, shut down smooth scrolling, due to IE11 issues with fixed background rendering

smoothScroll(): [type]
Returns
[type]: [ description ]

component

Component that handles additional donation input in the cart

component

component

This component is meant to be included on thank-you pages for one-time additional gifts (spon & ecomm) to ensure that data is commited/cleared properly.

component

component

Component that displays on Cart page when basket is empty.

component

component

Component which displays a 'checkout' button in combo-cart-order-summary. We display only one button. The value of the button is set conditionally depending on the checkout type. We need only one button and route users based on it's value because the submission happens only ater the form validation, which accepts only one callback function. The one button approach is also needed to enable proper routing of users if they use keyboard and press "Enter" key to go to the next step. (TW#10434964)

component

component

Responible for finalizing receipt generation and clearing cart contents. Very hacky - but provides a clear way to implement this functionality with injections in LOM thank-you pages.

component

component

Combo cart ecard success message component. Displays above 'thank you' copy on success page after user is redirected there following a successful ecard submission carrying an ECARD_SUCCESS_URL param.

component

component

TW#9958154 - Module to output ids collected from various modules of combo cart. Will be used in testing only.

component

component

2017-10-30: EM, this component doesn't seem to be in use

component

component

Remove button that appears next to the sponsored child in cart

component

component

Component used to facilitate cart summary interactions between the app and the ecomm-cart.js lib. Allows data to be sent to vuex in addition to being stored in cookie.

component

component

Output a location name when given a location ID.

component

component

Output a location name when given a location ID.

component

component

Display the appropriate edit button/link for the various types of gift payment types.

component

component

Indicates the payment method (credit card, paypal, etc...) of a recurring gift from either LOM or BBCRM.

component

component

Supporter center debug bar.

component

component

Summary of giving component.

component

component

Outputs an array of sponsor children with quotes (if available) and includes a button for paginating through the available results 9 at a time (through only dipslays 6 on first page due to presence 3 'featured' children)

component

buttonValue

Sets the submit button value parameter, which will be used to determine where to route the user upon the form submission.

buttonValue(): String
Returns
String: The value of the submit button

isNative

Is this native checkout, there are no sponsorships & no gift sponsorships.

isNative(): Boolean
Returns
Boolean:

isSpon

Is this a sponsorship only checkout. There are sponsorships, but no gift sponsorships.

isSpon(): Boolean
Returns
Boolean:

isGiftSpon

Is this gift spon checkout. There is at least one gift sponsorships.

isGiftSpon(): [type]
Returns
[type]: [ description ]

giftSponDetailsNextStep

Handler for events when 'continue' button is clicked on a gift spon input form and of the if the child profile click. If we queued up a child to see, go to that profile. Else if multiple gift spons then proceed to next. Else, proceed to the billing step

giftSponDetailsNextStep()

setActiveChildId

Set the first gift sponsorship child as active

setActiveChildId(id: String)
Parameters
id (String = '') [ description ]

goToSponsorship

Trigger form submission, which will decide were to go next after the form is validated. We set the next child id as component data, as we can't pass that through to the parent's validation callback.

goToSponsorship(childID: String)
Parameters
childID (String = '') Child to whose profile we want to go.

ComboCartOrderSubmitSuccessComponent

This component processes the successful eCommerce (gift catalog only) transaction.

ComboCartOrderSubmitSuccessComponent

handleCartFormSubmission

Handles the form submission once the form validates

handleCartFormSubmission($form: any)
Parameters
$form (any)

submitForm

Handles the billing form submission. Is invoked as a callback to the enableValidation(), will be executed only when the form is valid.

submitForm(): Boolean
Returns
Boolean: Always returns false to prevent default form submission

nextStep

Handles from submission. The function is involed by enableFormValidation as a callback, only when the form is valid.

nextStep(): Boolean
Returns
Boolean: Must return false to prevent default form submission.

nextStep

Handles the shipping form submission. Is invoked as a callback to the enableValidation(), will be executed only when the form is valid.

nextStep(event: any): Boolean
Parameters
event (any)
Returns
Boolean: Always returns false to prevent default form submission

ComboCartSponsorshipRecipientRow

A single row representing a sponsorship in the ecomm cart.

ComboCartSponsorshipRecipientRow

ComboCartSponsorshipRowComponent

A single row representing a sponsorship in the ecomm cart.

ComboCartSponsorshipRowComponent

triggerAnalytics

Triggers an analytics call, based on the location Parameter ecommPage EcommPage object set in global scope. Assigning to a variable for ease of knowing where it came from.

triggerAnalytics()

filter

Format a numeric amount into currency.

filter

filter

Convert a sponsorship frequency string to its shorthand equivilant.

filter

cartAjaxSubmit

Facilitate fetching, embdding and submitting of user's ecomm cart. Primarily, this function is used when the user is on an interstitial step of the combo cart process (ex. Gift Spon input) and needs to work back into the Ecomm workflow.

cartAjaxSubmit(): any
Returns
any: jqXHR

childNameConcatenator

Function that accepts an array of Child records and returns a human-readable concatenation of child names, like so:

[Child] => Name [Child, Child] => Name and Name [Child, Child, Child] => Name, Name and Name

childNameConcatenator(children: any)
Parameters
children (any)

cloneProps

Simple function which clones the properties of the provided object. Returns default if param is not an object.

cloneProps(obj: any, def: any): any
Parameters
obj (any)
def (any = {})
Returns
any: mixed

ComponentMounter

Helper to dynamically mount Vue components to page. Ensures that component exists before mounting. Provides mounting instance methods per http://v1.vuejs.org/api/#Instance-Methods-DOM

Component arguments must be registered Vue compnents as returned by http://v1.vuejs.org/api/#Vue-component

new ComponentMounter()
Instance Members
appendTo(component, selector, function, string)
after(component, selector, function, string)
before(component, selector, function, string)
_mnt(component, function)
_exists(component, string)

STCCookie

A wrapper class for ease of setting cookies.

new STCCookie()
Instance Members
set(data, object)
get()
getJSON()
remove()
_set(data, object)

BasketCookie

Provides a common interface for working with the stc-basket cookie.

new BasketCookie()

Extends STCCookie

BuyerCookie

Provides a common interface for working with the stc-buyer cookie.

new BuyerCookie()

Extends STCCookie

STCLocalStorage

Class for implementing local storage.

new STCLocalStorage(key: any)
Parameters
key (any)
Instance Members
set(data, object)
get()

BasketItemsLocal

Class for storing basket items.

new BasketItemsLocal()

Extends STCLocalStorage

EcardRedirectData

Class for storing basket items.

new EcardRedirectData()

Extends STCLocalStorage

Instance Members
set(data, object)
get()

EcardRedirectData

Class for implementing local storage.

new EcardRedirectData(storageKey: any)
Parameters
storageKey (any = 'stc-ecard-redirect')
Instance Members
set(data, object)
get()

ProductCategoryMap

Creates an object map of product ids => categories

new ProductCategoryMap()

Extends STCLocalStorage

ReceiptLocal

Class for storing basket items.

new ReceiptLocal()

Extends STCLocalStorage

EcommCartItem

When passed a jquery object containing an ecomm product (as selected from an ecomm page) this class extracts pertinent details about the product and returns an object containing those details.

new EcommCartItem(jqEl: any, configs: any)
Parameters
jqEl (any)
configs (any)
Instance Members
_parseEl(row, jQuery)
isSponsorship()
isProduct()
getData()
_parseRowId(row, jQuery)
_parseRowName(row, jQuery)
_parseRowQuantity(row, jQuery)
_parseRowQuantityIndex(row, jQuery)
_parseRowCost(row, jQuery)
_type()
getCategory(id, string)

EcommCartSummarizer

Creates summary of ecomm cart passed on array of EcommCartItem items passed.

new EcommCartSummarizer(items: any)
Parameters
items (any)

EcommCart

Library used to facilitate communication with eComm shopping cart. Especially for purposes of manipulating cart contents via ajax and retrieving details about active cart contents.

Of particular interest is the updateBasket() method which retrieves cart contents from Ecomm, writes to cookie then updates My Basket in header. This method can be called to keep cart contnets in sync with ecomm rather than relying on parity between ecomm/cookie.

new EcommCart(opts: any)
Parameters
opts (any = {})
Instance Members
_init(opts)
addSponsorship()
registerProductId(id)
_addToCart(id, qty, userOpts, eventNames, int, int, object, array)
addProductForm($form, jQuery)
summaryPromise()
_productAddFailed()
_sponsorshipQtyUpdateFailed()
updateBasket()
setSponsorshipsQty(newSponQty, int)
getSponsorshipItem()
getCartItems()
numSponsorships()
_dataAddToCart(id, qty, int, int)
_raiseEvents(eventNames, array)
cartConfig()

EcommManipulator

Class used to manipulate ecomm pages.

new EcommManipulator()

EcommPage

Class which provides feedback about which page in the LOM Ecomm module the user is currently viewing. Requires current wrapper to be outfitted with EM's singularly awesome reus_body_class include as this library uses those classes to determine the page.

Requires jQuery.

new EcommPage()
Instance Members
is()
_classCheck(cls, string)
isHome()
isCategory()
isProduct()
isCart()
isShipping()
isBilling()
isConfirmation()
isECard()
isThankYou()

EcommTagMounter

Convenience class for mounting tags on ecomm pages.

new EcommTagMounter()
Instance Members
autoMount()
mountAll()
mountCartTags()
mountConfirmationPage()
mountThankYouPage()
mountBillingPage()
mountShippingPage()
moountBillingPage()

isTyped

Filtering predicates

isTyped(obj: any)
Parameters
obj (any)

getCartItems

Collections

getCartItems(cart: any)
Parameters
cart (any)

goToSponCheckout

Proceed to spon checkout page.

goToSponCheckout(): any
Returns
any: true

normalizeGiftSponsorship

Function to normalize the format of gift sponsorship object. Specifically, set the state property equal to the intl_state property then delete the latter.

normalizeGiftSponsorship(gs: any, obj: any): any
Parameters
gs (any)
obj (any)
Returns
any: obj

birthdayBetween

Does this child's birthday fall between two dates? Date check is fully inclusive of both dates.

Note that the child object contains separate birth month/day fields and no complete birthdate object so we have to perform some checks for date overlap in case start/end span across months.

WARNING: The span of time between start and end should not be more than a single month. The current logic is not setup to allow multi-month spanning ranges.

birthdayBetween(start: any, end: any, moment: any, moment: any): any
Parameters
start (any)
end (any)
moment (any) () Start date (today?)
moment (any) () End date
Returns
any: bool

TagMounter

Library for mounting custom tags to DOM. Requires jQuery.

new TagMounter()
Instance Members
mount(tag, selector, action, string, string, string, obj)

StcBasketMixin

Provides common access to cart basket.

StcBasketMixin

childIconActionsMixin

Deals with interactions for the icon that is displayed in search results

Note: For this mixin to work the child object must have been fetched from ODS with their countryOffice expanded. (ie. $expand=community($expand=impactArea($expand=countryOffice)))

childIconActionsMixin

childLivesInMixin

Calculates value for "i live in" attribute of a child's record. The child's home country should be returned for this attribute. Because the ODS data model is not strictly geographic and requires some aliasing it is necessary to apply some logic here rather than simply returning a string from the child's record.

Note: For this mixin to work the chid object must have been fetched from ODS with their countryOffice expanded. (ie. $expand=community($expand=impactArea($expand=countryOffice)))

childLivesInMixin

childLivesInMixin

Calculates value for "i live in" attribute of a child's record. The child's home country should be returned for this attribute. Because the ODS data model is not strictly geographic and requires some aliasing it is necessary to apply some logic here rather than simply returning a string from the child's record.

Note: For this mixin to work the chid object must have been fetched from ODS with their countryOffice expanded. (ie. $expand=community($expand=impactArea($expand=countryOffice)))

childLivesInMixin

countryIsDomestic

Is the provided country "domestic" (USA / Canada)

countryIsDomestic(country: any, string: any): any
Parameters
country (any)
string (any)
Returns
any: bool

isSearchMixin

Exposes isSearch(). Returns true if Vue router is available on we're on a search page.

isSearchMixin

StaticMixin

Expose isStatic prop. If set to true then after a VM has fully loaded we destroy the VM while leaving the DOM element in place. This effectively makes the content of that component static.

StaticMixin

transactionReceiptMixin

Provides convenient access to receipt store.

transactionReceiptMixin

getAdditionalDonationAnalytics

Retrieves the details about the additional donation information from cart. Returns an object that will go into digitalData.donation object only.

getAdditionalDonationAnalytics(store: [type])
Parameters
store ([type]) Vuex store

getAdditionalDonationFormAnalytics

Retrieves form details for the additional donation from the cart. Returns an object that will go into digitalData.form object only.

getAdditionalDonationFormAnalytics(store: [type])
Parameters
store ([type]) Vuex store

getDonorTypeAnalytics

Grabs user's type parameters from a variable embedded on the page or a logged in user's Cookie.

getDonorTypeAnalytics(store: Object, alreadySetDonorType: any): Object
Parameters
store (Object) Vuex store
alreadySetDonorType (any = false)
Returns
Object: JSON object with details about the donor type

getDonorTypeFromCookie

Cookie is always now set on all types of user logins, so we give this a priority over DTM & API call DMT also reads info from the cookie, so best to stick with a source of truth.

getDonorTypeFromCookie(store: any)
Parameters
store (any)

getDonationJourneyAnalytics

Returns an object with details of user journey, which is determined based on the location in the checkout flow.

getDonationJourneyAnalytics(store: [type], ecommPage: any)
Parameters
store ([type]) Vuex store
ecommPage (any)

getFormNameAndId

Sets default form properties, namely name & id, based on our location in the checkout flow. The default is the thank you page, as this function also gets called there.

getFormNameAndId(store: Object, ecommPage: any)
Parameters
store (Object) Vuex store
ecommPage (any)

getProductItemsForAnalytics

Takes all the products from the store and puts them into an array for analytics

getProductItemsForAnalytics(store: [type]): Array
Parameters
store ([type]) Vuex store
Returns
Array: An array of catalog items

getSponsorshipFormInfo

Creates an object that will passed along into Analytics for digitalData.form object

getSponsorshipFormInfo(store: [type]): [type]
Parameters
store ([type]) [ description ]
Returns
[type]: [ description ]

getSponsorshipsAsProducts

Gets all sponsorship items from the store, packages them as eCommerce items, includes additional child details. Original Analytics specs didn't define any of this, so this was added on 2017-06-06 in agreement with STC & Adobe to enable them to get all the necessary data points for reporting.

getSponsorshipsAsProducts(store: any)
Parameters
store (any)

resetAnalyticsData

Resets all the analytics data

resetAnalyticsData(store: [type]): [type]
Parameters
store ([type]) [ description ]
Returns
[type]: [ description ]

setChildAddedSponsorshipAnalytics

Sets information about the child that has been added to the cart, also include viewed children statistics. Gets called when the child is added to a cart.

setChildAddedSponsorshipAnalytics(store: [type], child: any)
Parameters
store ([type]) Vuex store
child (any)

setChildProfilesViewedAnalytics

Updates the number of children's individual profiles has been viewed.

setChildProfilesViewedAnalytics(store: [type])
Parameters
store ([type]) [ description ]

setChildrenViewedCountAnalytics

Updates the number of the children that has been viewed, in a list. Is called by a mixin in sponsorship.

setChildrenViewedCountAnalytics(store: Object, num: Number)
Parameters
store (Object) Vuex store
num (Number) Updated number

setChildSearchParametersAnalytics

Gets called each time we have a pageview in sponsorship, so the data is updated. As pageview clears the history. Grab child viewed stats & merges them with an child details object, so the data is complete.

setChildSearchParametersAnalytics(store: [type], object: [type])
Parameters
store ([type]) [ description ]
object ([type]) [ description ]

setChildNumberAndClickedAnalytics

Sets the statistics on how many children a user saw and how many profiles were clicked on. This is called in the checkout process, it enables to see how profiles viewed can relate to the success of the transaction.

setChildNumberAndClickedAnalytics(store: any)
Parameters
store (any)

setCombinedConfirmationCodesAnalytics

Writes confirmation codes from the store/local storage into the analytics object

setCombinedConfirmationCodesAnalytics(store: [type])
Parameters
store ([type]) [ description ]

setComboCartAnalytics

Sets combo cart analytics, gets called in the native cart on both gift catalog and combo transactions. Retrieves full transaction details for analytics, sets the data into Vuex store & into digitalData object.

setComboCartAnalytics(store: Object)
Parameters
store (Object) Vuex store

setConfirmationIdAnalytics

Sets the confirmation code into analytics store as purchaseId and transactionId. Value of the code is expected to be passed in.

setConfirmationIdAnalytics(store: Ojbect, confirmationCode: String, transactionType: String)
Parameters
store (Ojbect) Vuex store
confirmationCode (String) Confirmation code (read from the thank you page)
transactionType (String) The type of transaction that we are processing giftcat/spon/adrc

setConfirmationIdFromAPIAnalytics

Called when a sponsorship only billing form is submitted. Processes API response and sets confirmation ID based on the response.

setConfirmationIdFromAPIAnalytics(store: Object, data: any, transactionType: [type])
Parameters
store (Object) Vuex store
data (any)
transactionType ([type]) Transaction classification

setDonationAndFormAnalytics

Sets the details about the form and donation into digitalData. Called on donation amount update. We fake the thank you page on sponsorship checkout as we get the transaction details there. We need the thank you page information to be sent to analytics.

setDonationAndFormAnalytics(store: Object, fakeThankYouPage: Boolean)
Parameters
store (Object) Vuex store
fakeThankYouPage (Boolean) In sponsorships we call succcess on

setFormSubmissionErrorAnalytics

When the form submission fails, track the error in analytics

setFormSubmissionErrorAnalytics(store: Object, desc: String, type: String)
Parameters
store (Object) Vuex store
desc (String = 'Form submission error') Error description
type (String = '') Error type

setHowDidYouHearAnalytics

Updates the digitalData object with a value of How did you hear about us field.

setHowDidYouHearAnalytics(store: [type], val: [type])
Parameters
store ([type]) [ description ]
val ([type]) [ description ]

setSponsorshipProductId

Adds the product id to the sponsorship pages. This enables the more accurate analytics reporting in sponsorships, which follow the pattern of the gift catalog.

setSponsorshipProductId(store: Object)
Parameters
store (Object) Vuex store

setPaymentTypeAnalytics

Sets payment types based on form selection or sets it to the default value 'credit'.

setPaymentTypeAnalytics(store: Object)
Parameters
store (Object) Vues Store

setProductAnalytics

Gets all items in the cart (catalog & sponsorships) from the store and writes it into an analytics store, store.state.analytics object. Must grab from cart on each page, as it's often called to update the info. Ex: setting gift sponsorship flag Then writes the information into analytics object

setProductAnalytics(store: Object)
Parameters
store (Object) Vues Store

trackChildProfileClick

Triggers an analytics event when a user clicks on Learn more for a child from search results page

trackChildProfileClick(store: any)
Parameters
store (any)

trackInAnalytics

Trigger a custom call rule in analytics

trackInAnalytics(store: Object, callRule: String)
Parameters
store (Object) Vuex store
callRule (String) Name of the custom call rule

trackTransactionSuccessAnalytics

Triggers the custom call rule in analytics to record a successful transaction

trackTransactionSuccessAnalytics(store: any, $body: any)
Parameters
store (any)
$body (any = undefined)

trackUserAnalytics

Tracks user registration, but only the first time on the thank you page

trackUserAnalytics(store: any, formType: any): String
Parameters
store (any)
formType (any)
Returns
String: Form type, which will be passed into registration object

trackSponsorshipSearchAnalytics

Called when the child sponsorship search is executed

trackSponsorshipSearchAnalytics(store: any)
Parameters
store (any)

addSponsorChildToCart

Adds a child with computed properties to the cart

addSponsorChildToCart(store: any, child: any)
Parameters
store (any)
child (any)

updateSponsorChildBillingInCart

Updates billing address in the store

updateSponsorChildBillingInCart(store: [type], item: [type], val: [type]): [type]
Parameters
store ([type]) [ description ]
item ([type]) [ description ]
val ([type]) [ description ]
Returns
[type]: [ description ]

getAllFields

Get the fields for shipping and billing forms

getAllFields($0: Object): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
Returns
[type]: [ description ]

getUserData

Get the current user's information and store it in the form store. Used to pre-populate form data.

getUserData($0: Object): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
Returns
[type]: [ description ]

setCurrentPaymentType

Set the current payment type for the checkout billing form (cc or paypal)

setCurrentPaymentType(store: [type], type: [type])
Parameters
store ([type]) [ description ]
type ([type]) [ description ]

submitSponsorshipAdditionalBillingResponse

Processes the API response after the recurring payment submission has been made.

submitSponsorshipAdditionalBillingResponse($0: Object, data: any)
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
data (any)

submitSponsorshipOnlyBilling

Submits the sponsorship transactions. Get the current payment type for the checkout billing form (cc or paypal). Then calls the appropriate API method based on the payment type.

submitSponsorshipOnlyBilling($0: Object, alreadySetDonorType: Boolean): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
alreadySetDonorType (Boolean = false) [ description ]
Returns
[type]: [ description ]

submitSponsorshipOnlyBillingResponse

Executed when the sponsorship transaction is called, without any additional recurring donations. Processes the API response.

submitSponsorshipOnlyBillingResponse($0: Object, alreadySetDonorType: [type], data: [type]): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
alreadySetDonorType ([type]) [ description ]
data ([type]) [ description ]
Returns
[type]: [ description ]

submitNativeSponsorshipBilling

Submit sponsorship transaction in the native cart, if available. Otherwise submit additional donation billing.

submitNativeSponsorshipBilling($0: Object): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
Returns
[type]: [ description ]

submitNativeSponsorshipBillingResponse

Processes the API response of the sponsorship in the native gift catalog.

submitNativeSponsorshipBillingResponse($0: Object, data: [type]): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
data ([type]) [ description ]
Returns
[type]: [ description ]

submitNativeAdditionalBilling

Submits an additional recurring donation payment for processing. Gets called only in the gift catalog transactions.

submitNativeAdditionalBilling($0: Object, alreadySetDonorType: Boolean): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
alreadySetDonorType (Boolean = false) [ description ]
Returns
[type]: [ description ]

submitNativeAdditionalBillingResponse

Processes the API response after the additional recurring donation was processed in gift catalog.

submitNativeAdditionalBillingResponse($0: Object, alreadySetDonorType: [type], data: [type]): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
alreadySetDonorType ([type]) [ description ]
data ([type]) [ description ]
Returns
[type]: [ description ]

submitNativeCartBilling

Submits the native gift catalog order.

submitNativeCartBilling($0: Object): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
Returns
[type]: [ description ]

submitNativeBilling

Starts the execution of billing submission for the native gift catalog cart.

submitNativeBilling($0: Object): [type]
Parameters
$0 (Object)
Name Description
$0.dispatch any
$0.state any
Returns
[type]: [ description ]

vuexAnalyticsSponsorshipProducts

Returns list of sponsored children set in product format for analytics.

vuexAnalyticsSponsorshipProducts(state: [type]): [type]
Parameters
state ([type]) [ description ]
Returns
[type]: [ description ]

vuexAnalyticsSponsorshipInfo

Returns sponsorship form details in proper format for analytics.

vuexAnalyticsSponsorshipInfo(state: [type]): [type]
Parameters
state ([type]) [ description ]
Returns
[type]: [ description ]

vuexCartGiftSponsorships

Return sponsorships that are marked as Gift sponsorships.

vuexCartGiftSponsorships(state: any): any
Parameters
state (any)
Returns
any: array

vuexCartCurrentGiftSponsorship

Return the current sponsorship that are marked as Gift sponsorships.

vuexCartCurrentGiftSponsorship(state: any, id: any): any
Parameters
state (any)
id (any = false)
Returns
any: array

vuexCartCurrentGiftSponsorshipId

Return the current sponsorship that are marked as Gift sponsorships.

vuexCartCurrentGiftSponsorshipId(state: any): any
Parameters
state (any)
Returns
any: array

vuexAnalyticsDonationInfo

Return info about the donation donation from the analyics store.

vuexAnalyticsDonationInfo(state: Object): Object
Parameters
state (Object) Vuex state
Returns
Object: Object for analytics that describes the donation properties

vuexAnalyticsDonationFormInfo

Return info about the donation form from the analyics store.

vuexAnalyticsDonationFormInfo(state: Object): Object
Parameters
state (Object) Vuex state
Returns
Object: Object for analytics that describes the donation properties

vuexFormPaymentType

Return current billing type for the billing form (credit or paypal)

vuexFormPaymentType(state: [type]): [type]
Parameters
state ([type]) [ description ]
Returns
[type]: [ description ]

vuexHowDidYouHearAnalytics

Returns the how did you hear about us value

vuexHowDidYouHearAnalytics(state: [type]): [type]
Parameters
state ([type]) [ description ]
Returns
[type]: [ description ]

vuexPaymentTypeAnalytics

Returns the selected payment type from analytis store

vuexPaymentTypeAnalytics(state: [type]): String
Parameters
state ([type]) Vuex store
Returns
String:

vuexPurchaseId

Returns a set of combined purchase ids for analytics

vuexPurchaseId(state: Object): String
Parameters
state (Object) Vuex state
Returns
String: Purchase Ids

vuexTransactionId

Returns a set of combined transaction ids for analytics

vuexTransactionId(state: Object): String
Parameters
state (Object) Vuex state
Returns
String: Transaction Ids

vuexAnalyticsDefaults

Returns default settings for analytics module module. We set item that we need to store from page to page and cannot reliably rely on the combo cart store.

vuexAnalyticsDefaults()

state

Reset purchase id

state(state: any)
Parameters
state (any)

state

Reset transaction id

state(state: any)
Parameters
state (any)

state

Update the number of single child profiles that were viewed

state(state: any)
Parameters
state (any)

state

Update the number of children were viewed in a list mode.

state(state: any, number: any)
Parameters
state (any)
number (any)

state

Sets payment type into analytics

state(state: any, val: any)
Parameters
state (any)
val (any)

state

Set sponsorship info details for form object into analytics store so we can grab it on the review and thank you pages

state(state: any, info: any)
Parameters
state (any)
info (any)

state

Set sponsorship product for transaction object into analytics store so we can grab it on the review and thank you pages

state(state: any, items: any)
Parameters
state (any)
items (any)

state

Sets the gift sponsorship data for a given child.

state(state: any, childID: any, object: any, String: any, obj: any)
Parameters
state (any)
childID (any)
object (any)
String (any) childID of sponsorship child
obj (any) Gift sponsorship data

vuexSponParityPlugin

Plugin which attempts to ensure that the number of sponsorships present in the ecomm cart is the same as those stored in the local vuex store. This should help reduce situations whereby the user loses part of their cart contents (as when LOM cookie expires or is cleared) but user retains sponsorships in their data store.

vuexSponParityPlugin

vuexPersistStatePlugin

vuex-persistedstate v0.3.0

(c) 2016 Robin van der Vleuten robin@webstronauts.co

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

vuexPersistStatePlugin

vuexPersistStatePlugin

Hacked version of the vuex-persistedstate plugin compatible with our current build processes. Had to de-npm it and replace some dependency references. https://github.com/robinvdvleuten/vuex-persistedstate

vuexPersistStatePlugin

vuexSponRepeatTempLocks

Ensures that sponsor children remained locked in ODS while their corresponding sponsorship is in a user's cart. Locks are checked every checkEveryMillis millseconds to confirm that they are still locked. If not, then lock is reapplied.

vuexSponRepeatTempLocks(store: any)
Parameters
store (any)

setInterval

Starting core logic of the plugin. Here there be dragons!

setInterval

loginConfirmation

Applies to login confirmation screen that appears after logging in with social media for the first time

loginConfirmation()

passwordReset

Applies to the password reset page, sets up form instructions and validation

passwordReset(formSelector: String)
Parameters
formSelector (String) css form selector

rewriteInputIntoRow

Takes input, finds label and any other info, puts into a <div class="form__row"> Assumes that $formSection global vars exist

rewriteInputIntoRow(index: any, element: any, $registerForm: any)
Parameters
index (any)
element (any)
$registerForm (any)

$body

the scripts here apply to password-reset and social loging pages

$body

$body

stcBraintreePlugin is a third party Braintree payment plugig JS object. Setting it into global scope as we use it in a callback function, that's a callback to validation function, which is hard to pass by reference.

$body

$body

The scripts here apply to eCard campaign page

$body

donationForm

Set the structure for the donation form

donationForm($body: any): [type]
Parameters
$body (any)
Returns
[type]: [ description ]

donationThankYouPage

Donation thank you page set up. donationUrl & donationFormName are set in the wrapper, defined in _scripts.php

donationThankYouPage($body: any)
Parameters
$body (any)

resolveUrlConflicts

When a thank you page is reloaded it has duplicate parameters in the form ####.donation=xxxx. One parameter is for the doantion form and another one for the thank you page. This presents problems with display & analytics. This function strips out duplicates and redirects a user to the clean donation page.

resolveUrlConflicts(pageLocation: any): [type]
Parameters
pageLocation (any = window.location.href)
Returns
[type]: [ description ]

checkPremiumArea

Checks the premium area and decides if we need to do something about it.

checkPremiumArea(): [type]
Returns
[type]: [ description ]

handleCustomPaymentSubmission

Handles the callback of the successful, validated form submission. Stops the submission of 3rd party payments & calls custom functions from a plugin on those submissions. Allows the standard Luminate submissions to just go through.

handleCustomPaymentSubmission($form: any): Boolean
Parameters
$form (any)
Returns
Boolean: True if the form should proceed with a normal submission, false if the form should not submit normally.

modifyDonationRow

This function is executed on each row of the donaiton form. The necessary styling adjustments are made on each row as needed.

modifyDonationRow(index: [type], element: [type]): [type]
Parameters
index ([type]) [ description ]
element ([type]) [ description ]
Returns
[type]: [ description ]

modifyDonationRow

consHowDidYouHear is a global variable that is set in reus_how_did_you_hear pagebuilder reusable that's inserted in the wrapper

modifyDonationRow(index: any, element: any)
Parameters
index (any)
element (any)

modifyOneHeading

Adds a custom class to a heading based on it's content, for ease of toggling things with CSS

modifyOneHeading(index: Number, element: Object)
Parameters
index (Number) Order in which the element appears
element (Object) JavaScript Object representing the current DOM element

setFormValidation

Sets the form validation on the donation form inputs. Sets all the conditional dependencies, so we don't have to do it with JS on our end.

setFormValidation($donationForm: any, $billingIntState: any, $otherInput: any, $submitButton: any, activeMinimum: any)
Parameters
$donationForm (any)
$billingIntState (any)
$otherInput (any)
$submitButton (any)
activeMinimum (any)

setInputValidationAttributes

Sets validation attributes on all inputs of the donation form. This determines the validation logic dependencies for the form.

setInputValidationAttributes(index: Number, element: Element)
Parameters
index (Number) An index of a field in a collection
element (Element) A DOM element, representing a required input

showHideHonorFields

Handles the showing and hiding of the Honor/Tribute elements on page

showHideHonorFields(event: Event, $form: any, $repeatCheck: any, $toggleTargets: any, $tributeFields: any, $cardDisclaimer: any)
Parameters
event (Event) Event invoked on the show honor fields checkbox
$form (any)
$repeatCheck (any)
$toggleTargets (any)
$tributeFields (any)
$cardDisclaimer (any)

showHidePremiumArea

Shows or hides premium area based on the donation parameters that have been selected

showHidePremiumArea($repeatCheck: any, $repeatingLevels: any, $premiumArea: any)
Parameters
$repeatCheck (any)
$repeatingLevels (any)
$premiumArea (any)

updateDonationFormAnalytics

donationPrivateFormName is global JS variable, it is set on donation pages in the wrapper, the code for it defined in _scripts.php file memberStatus is global JS variable, it is set on donation, eccommerce and teamraiser pages in the wrapper, the code for it defined in _scripts.php file teamraiserEventName is global JS variable, it is set on teamraiser donation pages in the wrapper, the code for it defined in _scripts.php file

updateDonationFormAnalytics(event: any, donationAmount: any, paymentMethod: any, confirmationCode: any)
Parameters
event (any)
donationAmount (any)
paymentMethod (any)
confirmationCode (any)

updateDonationFormAnalytics

Sets the analytics on the donation form initially and updates it on form changes

updateDonationFormAnalytics(event: Event, donationAmount: String, paymentMethod: String, confirmationCode: any): Object
Parameters
event (Event) JavaScript event object set by the update or undefined on initial call
donationAmount (String) Amount that has been donated, used only by 3rd party integration as we don't have that info in DOM
paymentMethod (String) Payment method used for the donation, used only by 3rd party integration as we don't have that info in DOM
confirmationCode (any)
Returns
Object: An object with final properties, the value is only used for testing

setTransactionAnalytics

We are on donation page

setTransactionAnalytics

setTransactionAnalytics

Sets analytics info into 'transaction' trackingCode

setTransactionAnalytics(trackingCode: String, trackingCodePrefix: any, sourceCode: any, paymentType: any)
Parameters
trackingCode (String) An object containing one or more properties for the digitalData.transaction property
trackingCodePrefix (any)
sourceCode (any)
paymentType (any)

setAnalyticsForm

We are on a donation thank you page

setAnalyticsForm

setAnalyticsForm

Enables default information for form analytics given a selector and lastFieldName

setAnalyticsForm($form: any, lastFieldName: String, donationFormName: any, donationFormId: any, appealName: any, donorEmployer: any, howDidYouHear: any, formType: any): Boolean
Parameters
$form (any)
lastFieldName (String) The name of the last entered field
donationFormName (any)
donationFormId (any)
appealName (any)
donorEmployer (any)
howDidYouHear (any)
formType (any)
Returns
Boolean: If default analytics were set return true else return false

customizeEcard

Rewrites the eCard campaign page page

customizeEcard()

ecardSuccessRedirect

Attempt to redirect user to stashed 'ECARD_SUCCESS_URL', if available, with optional recipient data. Afterward, clear data.

ecardSuccessRedirect()

extractEcardRecipients

Extract array of recipients from ecard recipient textarea input.

extractEcardRecipients(input: any, jqEle: any): any
Parameters
input (any)
jqEle (any) jQuery collection containing the recipient list input.
Returns
any: array

modifyEcardFormRow

rearranges one row of the standard eCard form

modifyEcardFormRow(index: number, element: Element, buyerInfo: any)
Parameters
index (number) order of the row
element (Element) Javascript element representing a row
buyerInfo (any)

stashEcardRedirectData

Stash ecard redirect url & recipients so that we it can be used to redirect user after successful ecard send.

stashEcardRedirectData()

eCommerceBilling

Rewrites the content of the responsive eCommerce billing page

eCommerceBilling(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

eCommerceCart

Rewrites the content of the responsive eCommerce cart page

eCommerceCart(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

eCommerceCategoryPage

Rewrites the content of the responsive eCommmerce catalog pages

eCommerceCategoryPage(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

eCommerceEcard

Rewrites the eCommerce eCard page

eCommerceEcard(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

eCommerceGetSessionTimeoutRedirect

Checks if we are on an eCommerce timeout page & not on an events timeout page & returns a redirect URL

eCommerceGetSessionTimeoutRedirect(settings: Object): String
Parameters
settings (Object) Page settings
Returns
String: Redirect URL as a string

eCommerceProductPage

Rewrites the content of the responsive eCommerce product page

eCommerceProductPage(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

eCommerceReview

Rewrites the content of the responsive eCommerce confirmation/review page

eCommerceReview(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

eCommerceShipping

Rewrites the content of the responsive eCommerce shipping page

eCommerceShipping(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

eCommerceThankYou

Rewrites the content of the responsive eCommerce thank you page

eCommerceThankYou(settings: Object)
Parameters
settings (Object) A JSON object with various settings specific to this page

addProductToCart

global vars $body

addProductToCart(event: any)
Parameters
event (any)

addProductToCart

Handles the add to cart button submission

addProductToCart(event: Event)
Parameters
event (Event) JavaScript event fired by the form

countryStateDropdowns

Handles US/Canada and International states and country dropdowns

countryStateDropdowns($countrySelect: [type], $postalCode: [type], $state: [type], $stateSelect: [type], $stateProvinceRow: [type]): [type]
Parameters
$countrySelect ([type]) [ description ]
$postalCode ([type]) [ description ]
$state ([type]) [ description ]
$stateSelect ([type]) [ description ]
$stateProvinceRow ([type]) [ description ]
Returns
[type]: [ description ]

donationDropdown

dynamically adds the selected amount from the donation amount dropdown into the 'Add to Basket' button.

donationDropdown($buttonRow: any)
Parameters
$buttonRow (any)

expirationDateDropdownsEcomm

Adds "Month" & "Year" to expiration date dropdowns, sets up validation and some formatting so error appears elegantly.

expirationDateDropdownsEcomm($input: any)
Parameters
$input (any)

getFirstNumberFromDollarRange

takes in the string with dollar range and returns the first number

getFirstNumberFromDollarRange(dollarString: String): Number
Parameters
dollarString (String) a string in a format of $50 - 1,000+
Returns
Number: first number that appears in the string

getProductIndex

Get Product Index loops through a collection of products in local storage like 'stc-basket-items' it then returns the index of a particular product depending upon whether a product title or product ID has been passed in.

getProductIndex(allProducts: [array], productIdOrTitle: [type]): [number]
Parameters
allProducts ([array]) = an array of items typically from local storage.
productIdOrTitle ([type]) = either the title or ID of a product.
Returns
[number]: = returns the index of the located item in the given array.

nonShippableProducts

Adds 'shippable: false' property to all products in local storage that are not shippable. This allows us to hide the shipping address on the thank you page from non shippable products which is handled by remove-shipping-address.js

nonShippableProducts($productRow: [this], title: [string], basketItems: [array], basketClass: [type]): [type]
Parameters
$productRow ([this]) = $(this) and therefore points to each product "row"
title ([string]) = the name of the product
basketItems ([array]) = an array of basket items aka 'stc-basket-itmes' in local storage
basketClass ([type]) = a class wrapper that allows us to write back to local storage easily.
Returns
[type]: [ description ]

removeShippingPlaceholder

removes placeholders on shipping address fields, which are being set by luminate. EM 2017-12-20 TODO: Remove this function & replace calls with a new generic function setDelayedInputAttribute, which is a dervation of this function but made more generic for reuse with other attributes.

removeShippingPlaceholder($input: any)
Parameters
$input (any)

setBuyerInfo

Adds buyer's email, firstName and lastName to the stc-basket cookie Conditional to work with jQuery for standard eCommerce & Vue for Combo cart

setBuyerInfo($form: any)
Parameters
$form (any)

showMailingCardForm

Shows the mailing card form and prepopulates the changing values

showMailingCardForm(e: any)
Parameters
e (any)

showPrintedCardConfiguration

Shows a dialog box with a list of occasions and redirects a user to the final page based on that

showPrintedCardConfiguration(e: any): [type]
Parameters
e (any)
Returns
[type]: [ description ]

showPrintedCardForm

Shows a dialog box with a list of occasions and redirects a user to the final page based on that

showPrintedCardForm(event: Event, $form: any)
Parameters
event (Event) Event triggered by a click
$form (any)

showPrintedCard

Shows the printed card in a new window, gets called by a form submission

showPrintedCard($form: any): Boolean
Parameters
$form (any)
Returns
Boolean: Always return false to prevent default form submission

sortOptionsByText

sorts a list of options by the value of the text

sortOptionsByText(a: any, b: any): Number
Parameters
a (any)
b (any)
Returns
Number: -1, 1, or 0 if the a > b, a < b, or a == b

submitMailingCardForm

Submits the mailing card from to Luminate, assumes that the form has been validated and this function is called as a callback to the validator function.

submitMailingCardForm($form: any): Boolean
Parameters
$form (any)
Returns
Boolean: Always returns false to prevent default form submission

eCommerceMain

main function that determines which helper function to call on eCommerce pages

eCommerceMain()

formAbandonmentAnalytics

Tracks form abandonment

formAbandonmentAnalytics($form: any): [type]
Parameters
$form (any)
Returns
[type]: [ description ]

formAbandonmentAnalytics

enables analtyics to track from abandonment

formAbandonmentAnalytics($form: jQueryCollection)
Parameters
$form (jQueryCollection)

setAnalyticsError

Sets error for the analytics

setAnalyticsError(errorCode: String, errorMessage: String, errorType: String)
Parameters
errorCode (String = 422) HTTP error code, default 422
errorMessage (String) [ description ]
errorType (String) [ description ]

setDonationAnalytics

Sets the information about a donation transaction into analtyics. Note: this records variables that are then written into analytics when a form abandonment or a form submission is triggered.

setDonationAnalytics(activeDonationAmount: Number, formType: String, memberStatus: String, frequency: String, p2pRegAmount: Number, p2pEventName: String)
Parameters
activeDonationAmount (Number) Donation amount selected/chosen
formType (String) Donation/transactino form type
memberStatus (String) Member's status string
frequency (String) Is this a monthly payment
p2pRegAmount (Number = false) Registraiton amount for Teamraiser
p2pEventName (String = false) Name of the Teamraiser Event

setDonationFormAnalytics

A helper function for the enableFormValidation(). Sets the form analytics for a donation form. Since that logic is a bit customized, we're handing it as a special case.

setDonationFormAnalytics($form: jQuery)
Parameters
$form (jQuery) The form on which the validation is enabled

setFormLastField

Update the form object with the information about the last field that was updated in the form

setFormLastField($form: any, $input: any)
Parameters
$form (any)
$input (any)

submissionSuccessAnalytics

Triggers an analytics call rule on form submission that has passed validation.

submissionSuccessAnalytics($form: any)
Parameters
$form (any)

validationErrorAnalytics

Passes information to the Analytics when the form validation errors out. Used as a onErrorCallback

validationErrorAnalytics($form: any)
Parameters
$form (any)

zipPhoneMasking

Function that is responsible for handling zip & phone field masking as well as setting zip validation rules and showing/hiding international state field (optional).

zipPhoneMasking($countrySelect: any, $stateSelect: any, $phone: any, $zip: any, $stateContainer: any, $internationalStateInput: any, $zipLabel: any, zipAlwaysRequiredFlag: any, zipDefaultZeros: any)
Parameters
$countrySelect (any)
$stateSelect (any)
$phone (any)
$zip (any)
$stateContainer (any)
$internationalStateInput (any)
$zipLabel (any)
zipAlwaysRequiredFlag (any)
zipDefaultZeros (any)

zipPhoneMasking

formats zip input

zipPhoneMasking

addValidator

Add custom validator for cc expiration month & year. To apply this validation: 1. Add data-validation="cc_exp_month" to the month element 2. Add data-validation-expiration-year="{name of year input}" to month element. 3. Add data-validation="cc_exp_year" to the year element. 4. Add data-validation-expiration-month="{name of month input}" to the year element.

addValidator

addValidator

Add custom validator for birthday fields: day, month & year. To apply this validation:

  1. Add data-validation="birthday_day" to the day element

  2. Add data-validation-birthday-month="{name of month input}" to the day element.

  3. Add data-validation-birthday-year="{name of year input}" to the day element.

  4. Add data-validation="birthday_month" to the month element

  5. Add data-validation-birthday-day="{name of day input}" to the month element.

  6. Add data-validation-birthday-year="{name of year input}" to the month element.

  7. Add data-validation="birthday_year" to the year element.

  8. Add data-validation-birthday-day="{name of day input}" to the year element.

  9. Add data-validation-birthday-month="{name of month input}" to the year element.

addValidator

addValidator

End custom validation for CC month/year *

addValidator

End custom validation for birthday day/month/year *

disableFormValidation

Disables validation on a when a specific button or input has been clicked Example call $previousButton.on('click', disableFormValidation);

disableFormValidation(event: Event)
Parameters
event (Event) JavaScript event that envoked the call

disableFormValidation

Disables form validation

disableFormValidation(event: any)
Parameters
event (any)

enableFormValidation

Enables form validation on a form specified with formSelector, enables modules

enableFormValidation(formSelector: String, modules: String, onSuccessCallback: function, onErrorCallback: any, onValidateCallback: any): Boolean
Parameters
formSelector (String) A CSS form selector for the form
modules (String) A string list of modules that need to be enabled, defaults to html5
onSuccessCallback (function) A function reference. This function will be called when the form successfully validates, after the analytics function. The function's value will be returned; return false to prevent the form from submitting regularly
onErrorCallback (any)
onValidateCallback (any)
Returns
Boolean: if validation was enabled returns true otherwise false

enableFormValidation

Enable/update validations on a given form. Automatically hooks in form analytics tracking on error and submit

enableFormValidation(formSelector: any, modules: any, onSuccessCallback: any, onErrorCallback: any, string: any)
Parameters
formSelector (any)
modules (any)
onSuccessCallback (any)
onErrorCallback (any)
string (any) Selector for the form to validate

getParentContainer

Finds the proper parent container around the input for the placement of the error message. Mainly handles the case of radio and checkbox inputs that have a different format that other inputs.

getParentContainer($parentContainer: any, inputType: string)
Parameters
$parentContainer (any)
inputType (string) Type attribute from the input

modifyInputErrorMessage

Customizes the placement and the message of the default error messages of the validation library.

modifyInputErrorMessage($input: any, errorMessage: String, config: Object): undefined
Parameters
$input (any)
errorMessage (String) The default error message of the input, as set by the validation library
config (Object) Object with all the plugin configuration details
Returns
undefined: We don't return anything to the plugin as we don't want it to do anything for us.

monthYearValidationHandler

Month/year validation helper function. Reduces duplicated in logic between the cc_exp_month and cc_exp_year custom validations.

monthYearValidationHandler($month: any, $year: any, initiator: any, jQuery: any, jQuery: any, string: any): any
Parameters
$month (any)
$year (any)
initiator (any = 'month')
jQuery (any) Month field.
jQuery (any) Year field.
string (any) Initiator of the validation call ('month' | 'year')
Returns
any: bool

setErrorMessage

Rewrites the default error message on an invalid input.

setErrorMessage(errorMessage: [type], $input: [type], $label: [type])
Parameters
errorMessage ([type]) [ description ]
$input ([type]) [ description ]
$label ([type]) [ description ]

stcErrorMessages

List of customized error messages

stcErrorMessages

Country

Convenience wrapper to provide some useful details about a country. Primarily, whether a given country is considered 'domestic' or 'international'.

new Country(name: any)
Parameters
name (any = '')
Instance Members
isValid()
isUSA()
isCanada()
isDomestic()
isInternational()
setCountry(name, string)

BbcrmProxyInterface

Class which facilitates interaction with BBCRM proxy app. https://bitbucket.org/dnlomnimedia/stc-2017-bbcrm-proxy

Ex. // Get logged-in constituent's giving history from proxy let proxy = new BbcrmProxyInterface() proxy.getData('/webapi/givinghistory')

new BbcrmProxyInterface()
Instance Members
registerSession()
constituentAttributes()
givingHistory()
recurringGifts()
recurringGiftDetails(revID)
childSponsorships()
smartFields()
recurringGiftUpdate(data, obj)
giftUpdatePortalRedirect(id, string)
updateCreditCard(guid, data, string, obj)
updateLoPledgeId(guid, id, string, string)
updatePaymentMethod(guid, userOpts, string, obj)
convertStatement(guid, lomRecurringGiftId, ccUpdateObject, string, string, obj)
getData(endpoint, params, method, opts, obj)
_e(key, string)

getChildren

Get children from ODS api. If queryAll is false then query from PotentialSponsorships endpoint. Else, query from Children endpoint.

getChildren(options: any, queryAll: any, obj: any, bool: any): any
Parameters
options (any)
queryAll (any = false)
obj (any) Options to use in call
bool (any) Should all children be queries (true) or just available children (false)
Returns
any: jqXHR

lomOriginated

Predicates

lomOriginated

lomGiftType

Transformers

lomGiftType
Parameters
gift (any)

lomMergeGiftCount

Returns the number of merge gifts attached to LOM gift.

lomMergeGiftCount
Parameters
gift (object) LOM gift
Returns
number: Number of BBCRM gifts merged onto {gift}

lomGiftsFilterNotCancelled

Logic

lomGiftsFilterNotCancelled
Parameters
gifts (any)

lomApiFetchRecurringGifts

Ajax

lomApiFetchRecurringGifts
Parameters
callback (any)

lomTemplateHtmlDonationErrors

Templates

lomTemplateHtmlDonationErrors

scrollTo

scrolls the screen to the target

scrollTo(target: any, adjustmentMargin: Number)
Parameters
target (any)
adjustmentMargin (Number = 0) any adjustments that should be made that will be added to the top position of the target

pageviewAnalytics

Triggers a page view in Analytics

pageviewAnalytics(pageName: String)
Parameters
pageName (String) name of the page being viewed

videoAnalytics

Triggers a video progression tracking in analytics

videoAnalytics()

getAnalyticsUserType

Figure out what type of a user we have and return that value

getAnalyticsUserType(userTypeDefault: String, analyticsFormType: any)
Parameters
userTypeDefault (String) default user type to which we'll pre & append values
analyticsFormType (any)

getLoginType

Figure out what type of a login a user has and return it

getLoginType(analyticsFormType: any, userTypeDefault: String)
Parameters
analyticsFormType (any)
userTypeDefault (String) default user type to which we'll pre & append values

getUserDetails

Gets user details via the API. Information is needed for analytics and cookie

getUserDetails()

getUserInfoSetAnalytics

Grabs user's info from the API, sets cookies and then triggers an analytics call

getUserInfoSetAnalytics(analyticsFormType: String, userTypeDefault: String, firstName: String)
Parameters
analyticsFormType (String) Form type that will be tracked as 'userstate' in analytics
userTypeDefault (String) Default user type that will have values added for analytics, ex: e-prospect for login form, p2p for teamraiser
firstName (String = undefined) First name of the user to be set into the cookie, usually passed from the sign up form.

getUserInteractions

Gets user interactions via the API. Information is needed for analytics and cookie. Interaction types are: 19 - Login Success 37 - Login Success Rollup (not sure what this means) 75 - Login via External Site

getUserInteractions()

retrieveUserIntreactions

Calls the Luminate API and grabs all interactions with interactionTypeID. Returns dat in the deferred

retrieveUserIntreactions(interactionTypeId: any): Deferred
Parameters
interactionTypeId (any)
Returns
Deferred: [ description ]

parseUserDetails

Processes the Luminate API response and sets all the info into the stc-member cookie

parseUserDetails(data: object, interactionsData: object)
Parameters
data (object) API response data
interactionsData (object) API response data from getUserInteractions call

parseUserInteractions

Processes the Luminate API response and set

parseUserInteractions(loginInteractionData: any, externalLoginInteractionData: any, interactionsData: object)
Parameters
loginInteractionData (any)
externalLoginInteractionData (any)
interactionsData (object) API response data from getUserInteractions call

setAnalyticsParameters

Sets user analytics parameters

setAnalyticsParameters(analyticsFormType: [type], userTypeDefault: [type])
Parameters
analyticsFormType ([type]) [ description ]
userTypeDefault ([type]) [ description ]

setUserAnalytics

Sets up user analytics

setUserAnalytics(formType: String, userType: String, loginType: any, setUserObject: Boolean)
Parameters
formType (String) form type we are dealing with ex: sign in, registration
userType (String) a type of a user to be passed into analytics. Options used: new e-prospect, repeat e-prospect
loginType (any)
setUserObject (Boolean = false) Should the digitalData.user object be first set before triggering the action?

directive

Provide fallback behavior for a child's profile image. If the child's image fails to load then load a generic version for the boy/girl, as appropriate.

When using this plugin the src of the child's image as well as the child's gender should be provided via the directive's value as an object literal. Like so:

<img v-child-image-fallback="{src: src, gender: gender}"

directive

directive

Directive that expects an element selector and will slide the user to the target onclick. Requires jQuery.

// ex. Slide to #target-element Click Me relies on a global function scrollTo, which is included in the global library

directive

disableFormAbandonmentAnalytics

Disables abadonment tracking, used when we fake sponsorship form submission via a redirect

disableFormAbandonmentAnalytics()

validateForm

TODO: remove, as it does browser only validation. All forms need to use enableFormValidation method for consistent handling of errors. Accepts reference to jquery collection containing the FORM to validate and executates validation function. If fails, then scroll to error.

validateForm($form: any, jQueryCollection: any)
Parameters
$form (any)
jQueryCollection (any)

loginForm

Main login component Vue object Manages the login form

loginForm

surveyRendered

Reset the analytics data back to current form, after the registration form validation reset it after form load.

surveyRendered(msg: String)
Parameters
msg (String) Message

surveyRendered

When the survey rendered event is dispatched, propagate it back to children, namely login form

surveyRendered(msg: String)
Parameters
msg (String) Message

loginUser

Function gets called after the validation plugin assertained form's validity

loginUser(): Boolean
Returns
Boolean: Always returns false to prevent the standard HTML-based form submission

sendUsernamePw

Function gets called after the validation has passed by the plugin

sendUsernamePw(): Boolean
Returns
Boolean: Always returns false to prevent default form submission

else { if(responseMsg.match(successMsg)){ responseMsg = responseMsg.replace(successMsg, 'Your username and password has been emailed to'); } this.setMessage(responseMsg); }*

loginRegister

Register form component

loginRegister

loginSurvey

loginSurvey

getSurvey

get the survey via API

getSurvey(prefill: any, Boolean: any)
Parameters
prefill (any)
Boolean (any) prefill should values of inputs be preset

getSurvey

get the survey via API

getSurvey(prefill: any, Boolean: any)
Parameters
prefill (any)
Boolean (any) prefill should values of inputs be preset

parseSurvey

Gets API data, parses it and puts it into a uniform object

parseSurvey(data: any, prefill: any, Object: any, Boolean: any): [type]
Parameters
data (any)
prefill (any)
Object (any) data API JSON object
Boolean (any) prefill should input values be prepopulated?
Returns
[type]: [ description ]

parseSurvey

Gets API data, parses it and puts it into a uniform object

parseSurvey(data: any, prefill: any, Object: any, Boolean: any): [type]
Parameters
data (any)
prefill (any)
Object (any) data API JSON object
Boolean (any) prefill should input values be prepopulated?
Returns
[type]: [ description ]

orderQuestions

orders questions by rank of each question for ease of rendering and tracking

orderQuestions(questions: array): array
Parameters
questions (array) an array of unordered questions
Returns
array: an array of ordered questions

orderQuestions

orders questions by rank of each question for ease of rendering and tracking

orderQuestions(questions: array): array
Parameters
questions (array) an array of unordered questions
Returns
array: an array of ordered questions

processQuestion

goes through the question and assigns it's parameter

processQuestion(question: object, defaultValues: object): object
Parameters
question (object) the question object as returned by the api
defaultValues (object) default values of the object like id, name, label, rank
Returns
object: [ description ]

processQuestion

goes through the question and assigns it's parameter

processQuestion(question: object, defaultValues: object): object
Parameters
question (object) the question object as returned by the api
defaultValues (object) default values of the object like id, name, label, rank
Returns
object: [ description ]

submitSurvey

submits the survey to the API, the response is sent to submitSurveyCallback()

submitSurvey()

submitSurvey

submits the survey to the API, the response is sent to submitSurveyCallback()

submitSurvey()

submitSurveyCallback

process response of the Survey submission

submitSurveyCallback(data: any)
Parameters
data (any)

submitSurveyCallback

process response of the Survey submission

submitSurveyCallback(data: any)
Parameters
data (any)

ready

Login main app

ready

setSocialMediaAnalyticsData

Adds click triggers onto social media icons and writes data into a cookie The callback to the login process will write data into a member cookie Also adds in data-link-type attributes to the link on the form

setSocialMediaAnalyticsData()

loginTest

Sends a request to Luminate API to see if the user is logged in.

loginTest(store: object)
Parameters
store (object) vuex store object in format {dispatch, state}

loginUserCallback

Processes the Luminate API response

loginUserCallback(store: object, data: object, resetMsgs: boolean)
Parameters
store (object) vuex store
data (object) API response object
resetMsgs (boolean) should the messages be reset prior to response rendering

getUserInfo

Calls a global function that sets userCookie and login type and submits info to analytics

getUserInfo(store: any)
Parameters
store (any)

setValuesFromCookie

Sets app's data from the cookie, which was set by analytics scripts.

setValuesFromCookie(store: [type])
Parameters
store ([type]) [ description ]

loginStore

Stores the logged in state for the login app

loginStore

$buoop

displays browser update message in outdated browsers

$buoop

Checks if the current page is the same as where the link leads or if the current link is just a hash. And then gently scrolls to the section of the link's target.

handleScrollLink(event: any): String
Parameters
event (any)
Returns
String: Anchor where the user is taken to

maintainSession

Every 14 minutes updates the PixelServer image in the <div class="footer__irs" /> to make sure session is maintained

maintainSession()

rewriteBase

Rewrites <base> of pagebuilder pages to the PageNavigator format This allows for more elegant URLs in vue apps and prevents breakages when PageNavigator changes to Pageserver Also updates the JS paths as it was causing some issues with the native scripts on PB pages.

rewriteBase()

addPictureFill

adds picture fill for browsers that don't support out of the box

addPictureFill()

addURLParam

Apeends the param to the URL

addURLParam(URL: String, param: String, value: String)
Parameters
URL (String) URL that needs to be revised
param (String) The name of the parameter to be added in
value (String) The value of the parameter

getMenus

grabs menu jQuery object from the menuSources array

getMenus(menuSources: Array)
Parameters
menuSources (Array) array of jQuery objects

getUrlVars

Get variables from URL

getUrlVars(URL: any, string: any): any
Parameters
URL (any)
string (any) URL from which variables to be extracted
Returns
any: array or string - array of all parameters or a string value of a set parameter

handleSubmenuToggleClick

[handleSubmenuToggleClick description]

handleSubmenuToggleClick(event: Event, $parentItems: any)
Parameters
event (Event) Javascript click event
$parentItems (any)

hideSources

Hides the menus & search box when any other element within the header or nav__container are clicked. Function is disabled on menu & search boxes themselves

hideSources(event: Event, $menuButton: any, $searchButton: any)
Parameters
event (Event) Click event
$menuButton (any)
$searchButton (any)

isBrowser

Returns boolean if browser matches the type asked

isBrowser(browserType: string): Boolean
Parameters
browserType (string) a type of browser, setup to accept values 'ie' & 'webkit'
Returns
Boolean: true if userAgent has the browser keyword

setToggleSpanHeight

Adjusts a height of each individual toggle span in a main menu, based on the height of the link

setToggleSpanHeight(index: Number, element: any)
Parameters
index (Number) Index as returned by jQuery $.each() function
element (any)

signUpSubmitHandler

Handles sign up form submission

signUpSubmitHandler($myForm: any)
Parameters
$myForm (any)

submitPixelToCheetahMail

Send a subscription pixel to cheetah main

submitPixelToCheetahMail(formSource: String, email: String, firstName: String, lastName: String)
Parameters
formSource (String) source code of the form
email (String) email of the subscriber
firstName (String) first name of the subscriber
lastName (String) last name of the subscriber

trackSocialMediaAnalytics

Triggers the analtyics to track social media action. Triggers a social_share or social_follow in Analytics, after setting properties

trackSocialMediaAnalytics(event: any, socialAction: String)
Parameters
event (any)
socialAction (String) Either :share or :follow to indicate the type of action

scrubMonetary

Scrub monetary signs from value.

scrubMonetary(string: any)
Parameters
string (any)

submit

Submit PDF generator form.

submit()

sponsoredChildTemplate

Component is in used to render the children on the dashboard

sponsoredChildTemplate

bbcrmKeyMap

Maps & data

bbcrmKeyMap

bbcrmGiftPredicateActive

Predicates

bbcrmGiftPredicateActive

transposeBBCRMKeys

Transformers

transposeBBCRMKeys
Parameters
obj (any)

bbcrmFormatCcExpiryDate

Format an expiration date provided by BBCRM.

TW#10358693 - Due to a bug in the api, some expiration dates contain a date part of "00". Since we're omitting the date part from our formatted return string (M/YYYY) we're simply ignoring the date portion of the provided date.

bbcrmFormatCcExpiryDate
Parameters
dateString (any)
Date (string) to format in YYYYMMDD format.
Returns
string: Formatted date in M/YYYY format.

bbcrmGiftsFilterActive

Logic

bbcrmGiftsFilterActive
Parameters
gifts (any)

sfClone

File of utilities that aid in interactions with smart fields.

sfClone

sfClone

Gets clone of smartfields object from Vuex. Not accessing the clone was resulting in unusual results. Also, cache results for speed.

sfClone
Parameters
array (any) smartfields
Returns
any: array

sfExtractFieldsbyName

Extract array of smartfields by name.

sfExtractFieldsbyName(smartfields: any, names: any, array: any): any
Parameters
smartfields (any)
names (any)
array (any) Names
Returns
any: array

sfExtractField

Extract a smartfield by name. Else return null.

sfExtractField(smartfields: any, name: any, array: any, string: any): any
Parameters
smartfields (any)
name (any)
array (any) smartfields
string (any) Name
Returns
any: null|obj

sfExtractFieldValue

Extract a smartfield's value. If doesn't exist then return the default.

sfExtractFieldValue(smartfields: any, name: any, defaultValue: any, array: any, string: any): any
Parameters
smartfields (any)
name (any)
defaultValue (any = '')
array (any) smartfields
string (any) name of field
Returns
any: mixed

MemberCenter

Main app of the Member Center (not a Vue instance, that's provided by the router)

MemberCenter

bbcrmFetchData

Mixin for fetching transactiond data from "the window" via "the proxy" and stashing it in the vuex store.

TW#9919507 - Instead of automatically fetching all data onCreate, make the vm explicitly call the necessary methods or the inclusive bbcrmFetchAll method. This allows the logic to be repurposed across components.

bbcrmFetchData

cancelForm

formats cc inputs

cancelForm

formatCCinputs

formats cc inputs

formatCCinputs

giftDeduplicationMixin

Deduplicates LOM/BBCRM gifts in store by finding BBCRM gifts with an 'LOPledgeID' that matches an 'id' of a LOM gift. If found, add bbcrm gift to lom gift and remove BBCRM gift from store.

giftDeduplicationMixin

giftV2CanEditMixin

Some computeds which dictated whether a given gift can be editted by the user.

giftV2CanEditMixin

internationalAddressDetectionMixin

Provides some flags which indicate whether the the user is international or domestic.

Expects the user's data to be present in localAccount.

internationalAddressDetectionMixin

isICSMixin

Returns true if the current child has the same id as the ICS category

Note: For this mixin to work the child object must have been fetched from ODS and the sponsorship categories must also have been detched from ODS.

isICSMixin

lightboxMixin

Display's the element identified by this.$els[el] in a lightbox.

lightboxMixin

lomFetchData

Mixin which fetches transaction data from LOM.

lomFetchData

formats cc inputs

openHelpLink

setDefaultState

formats cc inputs

setDefaultState

SurveyMixin

SurveyMixin

isFormValid

Checks if all the required fields on the form have been entered

isFormValid(showErrors: any, skipFieldId: string): boolean
Parameters
showErrors (any)
skipFieldId (string) id of the field that you don't want to validate yet, needed in a 2-step survey.
Returns
boolean: returns true if all required fiels have been entered, false otherwise

updateSVGsMixin

Mixing that goes through the component, finds SVG images and triggers an SVG rewrite function

updateSVGsMixin

analyticsPageNameMap

Provides router path to pagename mapping fo the analytics.

analyticsPageNameMap

getLinkName

Returns the name of the link based on elements attributes or a current route

getLinkName
Parameters
$linkEl ([type]) [ description ]
routeName ([type]) [ description ]
Returns
[type]: [ description ]

setupAnalyticsClicks

Sets up a member center anlaytics handler after each transition. This enables us to accurately track clicked links in each page/view.

setupAnalyticsClicks
Parameters
transition (Object) Vue router transition

triggerPageView

Records a virtual page view in analytics

triggerPageView
Parameters
transition ([type]) [ description ]
Returns
[type]: [ description ]

updateIframes

Adds in resizing function to iframes, add in markup for analytics

updateIframes()

updateIframes

Adds in resizing function to iframes, add in markup for analytics

updateIframes()

enableValidation

Enables the form validation on all forms & sets up the validation success callbacks.

enableValidation(): [type]
Returns
[type]: [ description ]

enableZipMaskingValidation

Enables zip masking and validation based on the country

enableZipMaskingValidation(prefix: String, resetStateValue: Boolean)
Parameters
prefix (String) The prefix of the address fields in the form.
resetStateValue (Boolean) Should the initial value of the state be reset? Needed so we don't show 'None' when user w

mailingAddressCheckSetCustomError

Sets a custom error message next to the mailing address checkbox if mailing fields are empty. Removes it when we have fewer than 4 errors in the mailing form. TW#10167792

mailingAddressCheckSetCustomError($form: any)
Parameters
$form (any)

primaryIsMailing

Computes if the primary address is the same as mailing

primaryIsMailing(): [type]
Returns
[type]: [ description ]

save

Submits the forms within Manage My Account for saving by the Luminate.

save(form: String)
Parameters
form (String) Name of the form being saved.

setBillingAsPrimary

Updates the billing address based on "Make this my mailing address" checkbox. Sets the values of the billing address if the box is checks, sets to empty otherwise.

setBillingAsPrimary()

updateAlternativeAddressField

Helper function that updates one field in the alternative address

updateAlternativeAddressField(key: String, value: String)
Parameters
key (String) Key value of the string as it appears in this.localAccount
value (String) The value to which the field must be set.

enableFancybox

Enables fancybox interactions within the body content of the component

enableFancybox()

sponsorshipGiftsFetched


Giving getters


sponsorshipGiftsFetched(state: any)
Parameters
state (any)

alert

Starts the execution of the script by finding the first alert

alert(): [type]
Returns
[type]: An alert which we will show to the end users

buttonType

Set the color of the button

buttonType(): String
Returns
String: Class that will be set on the button

hasNoLocalStorage

Test if the page has no ability to store in local storage. Doing it as a property so we do it only once

hasNoLocalStorage(): Boolean
Returns
Boolean:

isErrorAlert

Is the alert an error and users should not proceed?

isErrorAlert(): Boolean
Returns
Boolean: [ description ]

sectionColor

Sets the color of the section.

sectionColor(): String
Returns
String: Class name of the section

isCurrent

Is the alert set to display at present time?

isCurrent(alert: any): Boolean
Parameters
alert (any)
Returns
Boolean:

isCustom

Is the custom alert set to display on the current page?

isCustom(alert: any): Boolean
Parameters
alert (any)
Returns
Boolean:

isCustomAlertForConstituents

Is the custom alert set to display on the current page for logged in constituents?

isCustomAlertForConstituents(alert: any): Boolean
Parameters
alert (any)
Returns
Boolean:

isDonation

Are we on a donation page and does the alert's id match the donation form's id?

isDonation(alert: any): Boolean
Parameters
alert (any)
Returns
Boolean:

isEcommerce

Are we on eCommerce page?

isEcommerce(alert: any, null: any): Boolean
Parameters
alert (any)
null (any) @param {JSON Object} alert Alert to be tested
Returns
Boolean:

isEcommerceCart

Are we on an eCommerce cart page?

isEcommerceCart(alert: any, null: any): Boolean
Parameters
alert (any)
null (any) @param {JSON Object} alert Alert to be tested
Returns
Boolean:

isMatchingAlert

Tests if the alert belongs on the current page

isMatchingAlert(alert: any): Boolean
Parameters
alert (any)
Returns
Boolean: True if the alert matches the page, false otherwise

isOnValidPage

Is the page a page on which the alert should display?

isOnValidPage(): Boolean
Returns
Boolean:

isSupporterCenter

Test if we are on a supporter center page. Relies on a global variable siteAlertsData, that is set by the server and contains user's information.

isSupporterCenter(alert: any): Boolean
Parameters
alert (any)
Returns
Boolean:

isSupporterCenterAndActiveSponsor

Test if we are on a supporter center page & user is an active sponsor.

isSupporterCenterAndActiveSponsor(alert: any, null: any): Boolean
Parameters
alert (any)
null (any) @param {JSON Object} alert Alert to be tested
Returns
Boolean:

isLoginRegistration

Is this a login/registration page?

isLoginRegistration(alert: any, null: any): Boolean
Parameters
alert (any)
null (any) @param {JSON Object} alert Alert to be tested
Returns
Boolean:

isTeamraiser

Is this a Teamraiser page?

isTeamraiser(alert: any, null: any): Boolean
Parameters
alert (any)
null (any) @param {JSON Object} alert Alert to be tested
Returns
Boolean:

isSponsorship

Is this a Sponsorship page?

isSponsorship(alert: any, null: any): Boolean
Parameters
alert (any)
null (any) @param {JSON Object} alert Alert to be tested
Returns
Boolean:

hasClass

Does the body of the page has a class?

hasClass(bodyClass: String): Boolean
Parameters
bodyClass (String) Name of the class to test
Returns
Boolean:

sortByRanking

Helper sort function that sorts alerts by rank

sortByRanking(alert1: any, alert2: any): Number
Parameters
alert1 (any)
alert2 (any)
Returns
Number: Difference between two ranks

enableSiteAlerts

Initializes site alerts Vue.js app.

enableSiteAlerts()

enableSiteAlerts

Loading the app right away, that way when the main scripts are called on document ready, the main file's alert() function will apply to all HTML rendered by this app.

enableSiteAlerts

sponsorshipChild

A list of children waiting to be sponsorted

sponsorshipChild

setChildAnalytics

Writes child profile details into analyics. Updated the number of child profiles viewed.

setChildAnalytics()

sponsorshipChildren

A list of children waiting to be sponsorted

sponsorshipChildren

sponsorshipLogin

Main login component Vue object Manages the login form & passes recurring payments management to the component

sponsorshipLogin

Calls the API to get the children, call the callback on success, sets error on failure

search()

getOdataFilter

Computes the filter for ODS API from component's filters

getOdataFilter(): string
Returns
string: filter paramter for the ODS API

setSearchAnalytics

Set filter's paramters into an analytics object

setSearchAnalytics()

imagesToSvg

replaces svg icons in the template with svg elements, do this only in the app body, don't touch header/footer

imagesToSvg(store: any)
Parameters
store (any)

SponsorshipMatrix

Facilitates construction of the general sponsor child matrix per the logic described in this.schema.

new SponsorshipMatrix()

setChildrenCountMixin

Increments the number of children viewed

setChildrenCountMixin

windowSizeMixin

Expose some handy computed's for detecting screen size.

windowSizeMixin

sponsorshipApp

Main app of the Sponsorship (not a Vue instance, that's provided by the router)

sponsorshipApp

childrenLoaded

When children are loaded (list or single profile) dispatch a page view event

childrenLoaded(pageName: String)
Parameters
pageName (String) Name of the page a user is on

rearrangeSurveyForm

Rearranges the survey form, adds validation and button disabling on submission

rearrangeSurveyForm(surveyFormSelector: String)
Parameters
surveyFormSelector (String) selector query for the survey form

rearrnageSurveyRow

Rearranges the rows of the survey to be uniform, include uniform layout and validation

rearrnageSurveyRow(index: number, element: element)
Parameters
index (number) index of the row as it appears in the survey
element (element) JavaScript element representing the <tr>