formAbandonmentAnalytics

Tracks form abandonment

Parameters

Returns [type] [description]

formAbandonmentAnalytics

enables analtyics to track from abandonment

Parameters

formHasResults

Checks if the form has search results. Used in Teamraiser

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.

Parameters

isBirthdayValid

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

Parameters

Returns Boolean Is the field is valid or not

setOtherMinimum

Sets the minimum validation on the other donation amount.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

Returns [type] [description]

textInputMaxLength

Sets a max length limit of 50 on text inputs

Parameters

textInputPattern

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

Parameters

setAnalyticsError

Sets error for the analytics

Parameters

setAnalyticsForm

Enables default information for form analytics given a selector and lastFieldName

Parameters

Returns Boolean If default analytics were set return true else return false

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.

Parameters

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.

Parameters

setFormLastField

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

Parameters

setTransactionAnalytics

Sets analytics info into 'transaction' trackingCode

Parameters

submissionSuccessAnalytics

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

Parameters

validationErrorAnalytics

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

Parameters

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).

Parameters

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

End custom validation for CC month/year *

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.

##

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);

Parameters

disableFormValidation

Disables form validation

Parameters

enableFormValidation

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

Parameters

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

Parameters

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.

Parameters

modifyInputErrorMessage

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

Parameters

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.

Parameters

Returns any bool

setErrorMessage

Rewrites the default error message on an invalid input.

Parameters

stcErrorMessages

List of customized error messages

Country

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

Parameters

isValid

Is this object populated with valid data?

Returns any bool

isUSA

Is this country the USA?

Returns any bool.

isCanada

Is this country Canada?

Returns any bool.

isDomestic

Is this country considered domestic?

Returns any bool

isInternational

Is this country international?

Returns any bool

setCountry

Sets the country name on this instance.

Parameters

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')

registerSession

Register session w/ proxy. This method should be called before any subsequent methods. First, we fetch user's loginTest() results from the LOM api then feed them to the proxy. Return the resulting promise.

constituentAttributes

Get consitutent attributes.

Returns any promise

givingHistory

Get giving history.

Returns any promise

recurringGifts

Get recurring gifts

Returns any promise

recurringGiftDetails

Get recurring gifts

Parameters

Returns any promise

childSponsorships

Get child sponsorships

Returns any promise

smartFields

Get smart fields

Returns any promise

recurringGiftUpdate

Update a recurring gift.

Parameters

Returns any promise

giftUpdatePortalRedirect

Redirects user to BBIS gift update portal.

Parameters

Returns any null

updateCreditCard

Update credit card for a gift.

Parameters

Returns any promise

updateLoPledgeId

Update LOPledgeId of gift.

Parameters

Returns any promise

updatePaymentMethod

Update payment method.

Parameters

Returns any promise

convertStatement

Converts a statment gift to an online credit card gift.

Parameters

Returns any promise

getData

Get data (via signed url) by endpoint.

Parameters

Returns any obj

_e

Used for creating error objects.

Parameters

Returns any obj

getChildren

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

Parameters

Returns any jqXHR

lomOriginated

Predicates

lomGiftType

Transformers

Parameters

lomMergeGiftCount

Returns the number of merge gifts attached to LOM gift.

Parameters

Returns number Number of BBCRM gifts merged onto {gift}

lomGiftsFilterNotCancelled

Logic

Parameters

lomApiFetchRecurringGifts

Ajax

Parameters

lomTemplateHtmlDonationErrors

Templates

scrollTo

scrolls the screen to the target

Parameters

pageviewAnalytics

Triggers a page view in Analytics

Parameters

videoAnalytics

Triggers a video progression tracking in analytics

getAnalyticsUserType

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

Parameters

getLoginType

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

Parameters

getUserDetails

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

getUserInfoSetAnalytics

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

Parameters

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

retrieveUserIntreactions

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

Parameters

Returns Deferred [description]

parseUserDetails

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

Parameters

parseUserInteractions

Processes the Luminate API response and set

Parameters

setAnalyticsParameters

Sets user analytics parameters

Parameters

setUserAnalytics

Sets up user analytics

Parameters

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}"

disableFormAbandonmentAnalytics

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

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.

Parameters