Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" id="bloomerangForm3331072"></script>
- <pre><script type="text/javascript">
- var insertForm3331072 = function() {
- var html3331072 = '<style text=\'text/css\'>' +
- '.donation-form label{color: #404040;' +
- ' display: block;}' +
- '' +
- '.donation-form label.error{color:#900;' +
- ' display: inline-block; ' +
- ' padding: 0 10px;}' +
- '' +
- '.donation-form section{padding: 5px;}' +
- '' +
- '.donation-form .field{padding: 4px 0;}' +
- '' +
- '.donation-form .field .required-star{color: #aa0000; ' +
- ' display: inline-block; ' +
- ' margin-left: 5px;}' +
- '' +
- '.donation-form .field .checkboxes{max-width:275px;' +
- ' border: 1px solid #A9A9A9;' +
- ' -webkit-transition: all .3s ease-out;' +
- ' -moz-transition: all .3s ease-out;' +
- ' transition: all .3s ease-out;}' +
- '' +
- '.donation-form .field .checkbox{display:block;' +
- ' position:relative;' +
- ' -moz-box-sizing:border-box;' +
- ' box-sizing:border-box;' +
- ' height:30px;' +
- ' line-height:26px;' +
- ' padding:2px 28px 2px 8px;' +
- ' border-bottom:1px solid rgba(0,0,0,0.1);' +
- ' color:#404040; ' +
- ' overflow:hidden;' +
- ' text-decoration:none; }' +
- '' +
- '.donation-form .field .checkbox input{opacity:0.01;' +
- ' position:absolute;' +
- ' left:-50px; ' +
- ' z-index:-5;}' +
- '' +
- '.donation-form .field .checkbox:last-child{border-bottom:none;}' +
- '' +
- '.donation-form .field .checkbox.selected{background: rgb(50, 142, 253);' +
- ' color:#fff; }' +
- '' +
- '.donation-form .field .checkbox.selected:before{color:#fff;' +
- ' text-shadow:1px 2px 1px rgba(0,0,0,0.25);' +
- ' line-height:30px;' +
- ' position:absolute;' +
- ' right:10px; }' +
- '' +
- '.donation-form .field input,' +
- ' .donation-form .field select,' +
- ' .donation-form .field textarea{padding: 4px; ' +
- ' width: 275px;}' +
- '' +
- '.donation-form .section.recurring{padding-left: 30px}' +
- '' +
- '.donation-form .field.radio label,' +
- ' .donation-form .field.checkbox label{display: block;' +
- ' padding-left: 9px;' +
- ' text-indent: -15px;}' +
- '' +
- '.donation-form .field.radio input,' +
- ' .donation-form .field.checkbox input{width: 25px;' +
- ' height: 13px;' +
- ' padding: 0;' +
- ' margin:0;' +
- ' vertical-align: bottom;' +
- ' position: relative;' +
- ' top: -4px;' +
- ' *overflow: hidden;}' +
- '' +
- '.donation-form #expiration-month,' +
- ' .donation-form #expiration-year{width: 85px;}' +
- '' +
- '.donation-form #security-code{width: 55px;}' +
- '' +
- '.donation-form .field .sidenote{color: #999;' +
- ' font-size: 10px; }' +
- '' +
- '.donation-form .field.other-option,' +
- ' .donation-form .field.other-amount,' +
- ' .donation-form .field.expiration-month,' +
- ' .donation-form .field.expiration-year{display: inline-block;}' +
- '' +
- '.donation-form .field.other-amount{padding-left: 6px;}' +
- '' +
- '.donation-form .field.expiration-year{padding-left: 20px;}' +
- '' +
- '.donation-form #other-amount{width: 65px;}' +
- '' +
- '.donation-form #frequency{width: 85px;}' +
- '' +
- '.donation-form #start-date{width: 150px;}' +
- '' +
- '.donation-form .errors{border: 1px solid #900;' +
- ' color: #900; ' +
- ' padding: 10px;}' +
- '' +
- '.donation-form .radio label.error{display: inline-block;' +
- ' padding-right: 86%; ' +
- ' float: right;}' +
- '' +
- '.donation-form .hidden{display: none;}' +
- '' +
- '.btn-group .btn-submit-donation{padding: 4px 10px;}' +
- '' +
- '</style>' +
- '' +
- '<div id="donation-form-container">' +
- ' <form id="express-form" class="donation-form" method="post" action="javascript:bloomerangSubmit()" onsubmit="bloomerangSubmit()">' +
- ' <div class="errors hidden"></div>' +
- ' <div class="section donation">' +
- ' <h3>Donation</h3>' +
- ' <div class="field text amount required">' +
- '<label for="donation-amount">Amount<span class="required-star">*</span></label>' +
- '<input id="donation-amount" name="donation-amount" class="currency required" type="text" placeholder="$0.00"></input>' +
- '</div>' +
- '' +
- '</div>' +
- ' <div class="section recurring">' +
- ' <div class="field checkbox recurring">' +
- '<label for="recurring"><input id="recurring" name="recurring" type="checkbox" maxlength="255"></input>I would like to make this a recurring donation, so Legacy can guarantee the ability to provide its vital services month-to-month</label>' +
- '</div>' +
- '<div class="field recurring">*Recurring donors will receive one donation receipt in December recognizing the total amount of their contribution that year</div>' +
- '<div class="field frequency required hidden">' +
- '<label for="frequency">Frequency<span class="required-star">*</span></label>' +
- '<select id="frequency" name="frequency" class="required"><option value=""></option>' +
- '<option value="Weekly">Weekly</option>' +
- '<option value="Monthly" selected>Monthly</option>' +
- '<option value="Quarterly">Quarterly</option>' +
- '<option value="Yearly">Yearly</option>' +
- '</select>' +
- '</div>' +
- '<div class="field date start-date required hidden">' +
- '<label for="start-date">Start Date<span class="required-star">*</span></label>' +
- '<input id="start-date" name="start-date" class="validDate required" type="date" placeholder="mm/dd/yyyy"></input>' +
- '</div>' +
- '' +
- '</div>' +
- ' ' +
- ' <div class="section contact">' +
- ' <h3>Contact Information</h3>' +
- ' <div class="field text first-name required">' +
- '<label for="first-name">First Name<span class="required-star">*</span></label>' +
- '<input id="first-name" name="first-name" class="required" type="text"></input>' +
- '</div>' +
- '<div class="field text last-name required">' +
- '<label for="last-name">Last Name<span class="required-star">*</span></label>' +
- '<input id="last-name" name="last-name" class="required" type="text"></input>' +
- '</div>' +
- '<div class="field email email-address required">' +
- '<label for="email-address">Email<span class="required-star">*</span></label>' +
- '<input id="email-address" name="email-address" class="email required" type="email" placeholder="[email protected]"></input>' +
- '</div>' +
- '' +
- '</div>' +
- ' <div class="section billing-address">' +
- ' <h3>Billing Address</h3>' +
- ' <div class="field street-address required">' +
- '<label for="street-address">Address<span class="required-star">*</span></label>' +
- '<textarea id="street-address" name="street-address" class="required"></textarea>' +
- '</div>' +
- '<div class="field text city required">' +
- '<label for="city">City<span class="required-star">*</span></label>' +
- '<input id="city" name="city" class="required" type="text"></input>' +
- '</div>' +
- '<div class="field state required">' +
- '<label for="state">State<span class="required-star">*</span></label>' +
- '<select id="state" name="state" class="required"><option value=""></option>' +
- '<option value="AL">Alabama</option>' +
- '<option value="AK">Alaska</option>' +
- '<option value="AZ">Arizona</option>' +
- '<option value="AR">Arkansas</option>' +
- '<option value="CA">California</option>' +
- '<option value="CO">Colorado</option>' +
- '<option value="CT">Connecticut</option>' +
- '<option value="DE">Delaware</option>' +
- '<option value="DC">District of Columbia</option>' +
- '<option value="FL">Florida</option>' +
- '<option value="GA">Georgia</option>' +
- '<option value="HI">Hawaii</option>' +
- '<option value="ID">Idaho</option>' +
- '<option value="IL">Illinois</option>' +
- '<option value="IN">Indiana</option>' +
- '<option value="IA">Iowa</option>' +
- '<option value="KS">Kansas</option>' +
- '<option value="KY">Kentucky</option>' +
- '<option value="LA">Louisiana</option>' +
- '<option value="ME">Maine</option>' +
- '<option value="MD">Maryland</option>' +
- '<option value="MA">Massachusetts</option>' +
- '<option value="MI">Michigan</option>' +
- '<option value="MN">Minnesota</option>' +
- '<option value="MS">Mississippi</option>' +
- '<option value="MO">Missouri</option>' +
- '<option value="MT">Montana</option>' +
- '<option value="NE">Nebraska</option>' +
- '<option value="NV">Nevada</option>' +
- '<option value="NH">New Hampshire</option>' +
- '<option value="NJ">New Jersey</option>' +
- '<option value="NM">New Mexico</option>' +
- '<option value="NY">New York</option>' +
- '<option value="NC">North Carolina</option>' +
- '<option value="ND">North Dakota</option>' +
- '<option value="OH">Ohio</option>' +
- '<option value="OK">Oklahoma</option>' +
- '<option value="OR">Oregon</option>' +
- '<option value="PA">Pennsylvania</option>' +
- '<option value="RI">Rhode Island</option>' +
- '<option value="SC">South Carolina</option>' +
- '<option value="SD">South Dakota</option>' +
- '<option value="TN">Tennessee</option>' +
- '<option value="TX">Texas</option>' +
- '<option value="UT">Utah</option>' +
- '<option value="VT">Vermont</option>' +
- '<option value="VA">Virginia</option>' +
- '<option value="WA">Washington</option>' +
- '<option value="WV">West Virginia</option>' +
- '<option value="WI">Wisconsin</option>' +
- '<option value="WY">Wyoming</option>' +
- '<option value="AS">American Samoa</option>' +
- '<option value="GU">Guam</option>' +
- '<option value="PR">Puerto Rico</option>' +
- '<option value="VI">US Virgin Islands</option>' +
- '</select>' +
- '</div>' +
- '<div class="field text postal-code required">' +
- '<label for="postal-code">Postal Code<span class="required-star">*</span></label>' +
- '<input id="postal-code" name="postal-code" class="zipcodeUS required" type="text" maxlength="10"></input>' +
- '</div>' +
- '<div class="field text phone-number">' +
- '<label for="phone-number">Phone</label>' +
- '<input id="phone-number" name="phone-number" class="phoneUS" type="text"></input>' +
- '</div>' +
- '' +
- '</div>' +
- ' <div class="section payment" style="display: none">' +
- ' <h3>Payment Information</h3>' +
- ' <div class="field text card-number required">' +
- '<label for="card-number">Card Number<span class="required-star">*</span></label>' +
- '<input id="card-number" name="card-number" class="creditcard required" type="text"></input>' +
- '</div>' +
- '<div class="field expiration-month required">' +
- '<label for="expiration-month">Month<span class="required-star">*</span></label>' +
- '<select id="expiration-month" name="expiration-month" class="required"><option value=""></option>' +
- '<option value="1">1</option>' +
- '<option value="2">2</option>' +
- '<option value="3">3</option>' +
- '<option value="4">4</option>' +
- '<option value="5">5</option>' +
- '<option value="6">6</option>' +
- '<option value="7">7</option>' +
- '<option value="8">8</option>' +
- '<option value="9">9</option>' +
- '<option value="10">10</option>' +
- '<option value="11">11</option>' +
- '<option value="12">12</option>' +
- '</select>' +
- '</div>' +
- '<div class="field text expiration-year required">' +
- '<label for="expiration-year">Year<span class="required-star">*</span></label>' +
- '<select id="expiration-year" name="expiration-year" class="required"><option value=""></option>' +
- '<option value="2014">2014</option>' +
- '<option value="2015">2015</option>' +
- '<option value="2016">2016</option>' +
- '<option value="2017">2017</option>' +
- '<option value="2018">2018</option>' +
- '<option value="2019">2019</option>' +
- '<option value="2020">2020</option>' +
- '<option value="2021">2021</option>' +
- '<option value="2022">2022</option>' +
- '<option value="2023">2023</option>' +
- '<option value="2024">2024</option>' +
- '<option value="2025">2025</option>' +
- '<option value="2026">2026</option>' +
- '<option value="2027">2027</option>' +
- '<option value="2028">2028</option>' +
- '<option value="2029">2029</option>' +
- '<option value="2030">2030</option>' +
- '<option value="2031">2031</option>' +
- '<option value="2032">2032</option>' +
- '<option value="2033">2033</option>' +
- '<option value="2034">2034</option>' +
- '<option value="2035">2035</option>' +
- '<option value="2036">2036</option>' +
- '<option value="2037">2037</option>' +
- '<option value="2038">2038</option>' +
- '<option value="2039">2039</option>' +
- '<option value="2040">2040</option>' +
- '<option value="2041">2041</option>' +
- '<option value="2042">2042</option>' +
- '</select>' +
- '</div>' +
- '<div class="field text security-code required">' +
- '<label for="security-code">Security Code<span class="required-star">*</span></label>' +
- '<input id="security-code" name="security-code" class="number required" type="text"></input>' +
- '</div>' +
- '' +
- '</div>' +
- ' <div class="section custom-fields">' +
- ' <h3>Additional Information</h3>' +
- ' <div class="field text CustomAccountField_3270656">' +
- '<label for="CustomAccountField_3270656">Donation Referral</label>' +
- '<select id="CustomAccountField_3270656" name="CustomAccountField_3270656"><option value=""></option>' +
- '<option value="3271680">Social Media (Facebook, Twitter, etc.)</option>' +
- '<option value="3272707">Website</option>' +
- '<option value="3272704">Email Newsletter</option>' +
- '<option value="3272705">Friend</option>' +
- '<option value="3271681">Client</option>' +
- '<option value="3272706">Other</option>' +
- '</select>' +
- '</div>' +
- '<div class="field text CustomAccountField_3832832">' +
- '<label for="CustomAccountField_3832832">I give permission to Legacy to recognize my donation in their social media (e.g., Facebook, Twitter, etc.).</label>' +
- '<select id="CustomAccountField_3832832" name="CustomAccountField_3832832"><option value=""></option>' +
- '<option value="3834880">No</option>' +
- '<option value="3833856">Yes</option>' +
- '</select>' +
- '</div>' +
- '<div class="field text CustomAccountField_3832833">' +
- '<label for="CustomAccountField_3832833">I would like to remain anonymous</label>' +
- '<select id="CustomAccountField_3832833" name="CustomAccountField_3832833"><option value=""></option>' +
- '<option value="3834881">No</option>' +
- '<option value="3833857">Yes</option>' +
- '</select>' +
- '</div>' +
- '' +
- '</div>' +
- ' <div class="section comment">' +
- ' <div class="field text comment">' +
- '<label for="comment">Comments</label>' +
- '<textarea id="comment" name="comment" type="text" value="Comments"></textarea>' +
- '</div>' +
- '' +
- '</div>' +
- ' <div class="btn-group">' +
- ' <input class="btn btn-submit btn-submit-donation" type="submit" value="Donate" id="express-submit" disabled="true" />' +
- ' </div>' +
- ' </form>' +
- '</div>' +
- '' +
- '' + '';var successHtml3331072 = '<div class=\'donation-success\'>' +
- ' <h2>Thank You for Your Donation!</h2>' +
- ' <p>Your generous gift has been processed. We truly appreciate your continued support.</p>' +
- ' ' +
- '</div>';( function($) {if (!Bloomerang.useDonationId('3331072')) {
- html3331072 = '<p style="color: red">Only one donation or event registration form can be used on each page.</p>';
- }if (jQuery('#bloomerangForm3331072').length) {
- if (window.ActiveXObject) { // they are using IE < 11, which doesn't support TLS 1.1
- html3331072 = '<p style="color: red">Your browser does not support the minimum security requirements for keeping your Credit Card information safe when processing payments. Please upgrade your browser or download the latest version of' +
- ' <a target=\'_blank\' href=\'https://www.google.com/chrome/browser/desktop/\'>Chrome</a> or <a target=\'_blank\' href=\'https://www.mozilla.org/en-US/firefox/new/\'>Firefox</a>.</p>';
- }
- jQuery('#bloomerangForm3331072').after(html3331072);
- if (!Bloomerang.SpreedlyScriptLoaded) {
- Bloomerang.Util.load('https://core.spreedly.com/iframe/express-2.min.js',
- function() { return SpreedlyExpress != undefined; },
- function() {
- SpreedlyExpress.onInit(function() { jQuery('#express-submit').attr('disabled', false); });
- Bloomerang.initSpreedly = function() {
- SpreedlyExpress.init('OqOMv1ksjPtXEYHtCYsVXzEpCbR', { 'company_name': 'Legacy Counseling Center' });
- };
- Bloomerang.initSpreedly();
- });
- }
- Bloomerang.SpreedlyScriptLoaded = true;
- };
- if (Bloomerang.paymentFormLoaded) {
- return false;
- }
- Bloomerang.paymentFormLoaded = true;
- window.captchaLoadCallback = function() {
- Bloomerang.gRecaptchaLoaded = true;
- };
- Bloomerang.Util.load('https://www.google.com/recaptcha/api.js?onload=captchaLoadCallback&render=explicit',
- function() { return Bloomerang.gRecaptchaLoaded; },
- function() {
- jQuery('.section.captcha').removeAttr('style');
- jQuery('form.donation-form').data('captcha-id', grecaptcha.render('captcha3331072', { 'sitekey' : '6LcXfScUAAAAAGdVKQy2GQsWIhNWTMtTboHvaaL4' }));
- },
- true,
- true);
- Bloomerang.transactionFee = 0.3; Bloomerang.transactionFeeRate = 0.022; Bloomerang.transactionFeeEft =
- Bloomerang.useKey('pub_51d2f830-16f8-11e3-a756-02a718d18e56');
- // Register proper callbacks for various stages/outcomes of submission
- Bloomerang.Api.OnSubmit = Bloomerang.Widget.Donation.OnSubmit = function (args) {
- jQuery(".btn-submit-donation").val("Donating...").prop("disabled", true).addClass("disabled");
- var val = function (selector) { return jQuery(selector).val(); };
- Bloomerang.Account
- .individual()
- .firstName(val(".donation-form #first-name"))
- .middleName(val(".donation-form #middle-name"))
- .lastName(val(".donation-form #last-name"))
- .homeAddress(val(".donation-form #street-address"), val(".donation-form #city"), val(".donation-form #state"), val(".donation-form #postal-code"))
- .homeEmail(val(".donation-form #email-address"))
- .homePhone(val(".donation-form #phone-number"))
- .applyCustomFields();
- var amount = val(".donation-form .section.donation input[name='donation-level']:checked") || val(".donation-form #donation-amount");
- if (jQuery(".donation-form #recurring").prop("checked")) {
- Bloomerang.RecurringDonation
- .amount(amount)
- .fundId(val(".donation-form #fund"))
- .note(val(".donation-form #comment"))
- .frequency(val(".donation-form #frequency") || "Monthly")
- .startDate(val(".donation-form #start-date"))
- .applyCustomFields();
- } else {
- Bloomerang.Donation
- .amount(amount)
- .fundId(val(".donation-form #fund"))
- .note(val(".donation-form #comment"))
- .applyCustomFields();
- }
- Bloomerang.CreditCard
- .expirationMonth(val(".donation-form #expiration-month"))
- .expirationYear(val(".donation-form #expiration-year"))
- ;
- };
- Bloomerang.Api.OnSuccess = Bloomerang.Widget.Donation.OnSuccess = function (response) {
- jQuery("#donation-form-container").html(successHtml3331072);
- };
- Bloomerang.Api.OnError = Bloomerang.Widget.Donation.OnError = function (response) {
- jQuery(".btn-submit-donation").prop("disabled", false).removeClass("disabled").val("Donate");
- jQuery("#donation-form-container .errors").removeClass("hidden").html(response.Message); Bloomerang.cancelFinancialSubmission($("#express-form"));
- window.scrollTo(0, 0);
- };
- Bloomerang.Util.applyCustomFields = function (obj, type) {
- // Clear any fields from a previous failed submission
- obj.clearCustomFields();
- // Apply all <input> (not multiselect), <select> and <textarea> fields
- jQuery(".donation-form .section.custom-fields :input:not(a > input, select)[id*=" + type + "]").each(function() {
- if (jQuery(this).val().hasValue()) {
- obj.customFreeformField(jQuery(this).attr("id").toUntypedValue(), jQuery(this).val());
- }
- });
- // Apply all <select> fields
- jQuery(".donation-form .section.custom-fields select[id*=" + type + "]").each(function() {
- if (jQuery(this).val().hasValue()) {
- obj.customPickField(jQuery(this).attr("id").toUntypedValue(), jQuery(this).val());
- }
- });
- // Apply all multiselect fields
- jQuery(".donation-form .section.custom-fields .checkboxes[id*=" + type + "]").each(function() {
- obj.customPickField(jQuery(this).attr("id").toUntypedValue(),
- jQuery.map(jQuery(this).children(".checkbox.selected"), function(v) { return jQuery(v).attr("data-id"); }));
- });
- };
- String.prototype.hasValue = function() {
- return (this && this.trim());
- };
- Bloomerang.Account.applyCustomFields = function () {
- Bloomerang.Util.applyCustomFields(this, "Account");
- return this;
- };
- Bloomerang.Donation.applyCustomFields = function () {
- Bloomerang.Util.applyCustomFields(this, "Transaction");
- return this;
- };
- Bloomerang.RecurringDonation.applyCustomFields = function () {
- Bloomerang.Util.applyCustomFields(this, "Transaction");
- return this;
- };
- String.prototype.toUntypedValue = function() {
- return this.substring(this.indexOf('_') + 1);
- };
- Date.prototype.toDateInputValue = function() {
- var local = new Date(this);
- local.setMinutes(this.getMinutes() - this.getTimezoneOffset());
- return local.toJSON().slice(0,10);
- };
- jQuery(document).ready(function() {
- jQuery(".donation-form .field.start-date input").val(new Date().toDateInputValue());
- });
- // Hide recurring donation options if recurring donation box is unchecked
- jQuery(".donation-form .field.recurring").change(function() {
- jQuery(".donation-form .field.recurring").siblings().each(function() {
- jQuery(this).toggleClass('hidden');
- });
- })
- // The other-amount field is only equired when the "Other" donation-level is selected
- jQuery(".donation-form .section.donation input[name='donation-level']").change(function () {
- if (jQuery(this).attr('id') == "other-option") {
- jQuery(".donation-form #other-amount").addClass("required");
- } else {
- jQuery(".donation-form #other-amount").removeClass("required");
- }
- });
- // Changing the value of other-amount should change the value of other-option
- jQuery(".donation-form #other-amount").change(function () {
- jQuery(".donation-form #other-option").val(jQuery(this).val());
- });
- // Clicking into the other-amount field should select the other-option
- jQuery(".donation-form #other-amount").click(function() { jQuery(".donation-form #other-option").prop('checked',true); });
- jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
- var digits = phone_number.replace(/\D/g, "");
- return this.optional(element) || digits.length == 7 || digits.length == 10 || digits.length == 11;
- }, "Please specify a valid phone number");
- jQuery.validator.addMethod("zipcodeUS", function (value, element) {
- return this.optional(element) || /\d{5}-\d{4}$|^\d{5}$/.test(value)
- }, "The specified US ZIP Code is invalid");
- jQuery.validator.addMethod("currency", function (value, element, options) {
- return !value ||
- value
- .replace("$", "")
- .replace(".", "")
- .split(",").join("")
- .match(/^\d+$/g);
- }, "Not a valid currency");
- jQuery.validator.classRuleSettings.currency = { currency: true };
- jQuery.validator.addMethod("number", function (value, element, options) {
- return !value ||
- value
- .replace(".", "")
- .split(",").join("")
- .match(/^\d+$/g);
- }, "Not a valid number");
- jQuery.validator.classRuleSettings.number = { number: true };
- jQuery.validator.addMethod("validYear", function (value, element, options) {
- try {
- return (!value || value.match(/^[1-9]\d\d\d$/)) ? true : false;
- }
- catch (e) {
- return false;
- }
- }, function () { return "Must be a 4 digit year"; });
- jQuery.validator.classRuleSettings.validYear = { validYear: true };
- // Intercept form submission to validate then submit via API
- bloomerangSubmit = function () {
- var form = jQuery('#express-form');
- if (!form.valid()) {
- return false;
- }
- if (jQuery('#payment_method_token').length) {
- if (!Bloomerang.continueFinancialSubmission(form)) { return false; }
- Bloomerang.Api.OnSubmit = Bloomerang.Widget.Donation.OnSubmit;
- Bloomerang.Api.OnSuccess = Bloomerang.Widget.Donation.OnSuccess;
- Bloomerang.Api.OnError = Bloomerang.Widget.Donation.OnError;
- Bloomerang.CreditCard.spreedlyToken(jQuery('#payment_method_token').val());
- var tmp = jQuery('.donation-form #recurring').prop('checked')
- ? Bloomerang.Api.recurringDonate()
- : Bloomerang.Api.donate();
- }
- else {
- var val = function (selector) { return jQuery(selector).val(); };
- var amount = val(".donation-form .section.donation input[name='donation-level']:checked") || val('.donation-form #donation-amount');
- var selectedDonationLevel = jQuery(".donation-form .section.donation input[name='donation-level']:checked").parent().text();
- selectedDonationLevel = (selectedDonationLevel.indexOf('-') == -1 ? '' : selectedDonationLevel.substr(selectedDonationLevel.indexOf('-') + 2) );
- jQuery('#express-script').attr('data-amount', '$' + amount)
- .attr('data-full-name', val('.donation-form #first-name') + ' ' + val('.donation-form #last-name'))
- .attr('data-email', val('.donation-form #email-address'))
- .attr('data-phone_number', val('.donation-form #phone-number'))
- .attr('data-address1', val('.donation-form #street-address'))
- .attr('data-city', val('.donation-form #city'))
- .attr('data-state', val('.donation-form #state'))
- .attr('data-zip', val('.donation-form #postal-code'))
- .attr('data-sidebar-bottom-description',selectedDonationLevel);
- continueToExpress = true;
- }
- }
- })(jQuery);
- };
- var startBloomerangLoad = function() {
- if (window.bloomerangLoadStarted == undefined) {
- window.bloomerangLoadStarted = true;
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.src = 'https://crm.bloomerang.co/Content/Scripts/Api/Bloomerang-v2.js?nocache=2017-10-17';
- document.getElementsByTagName('head')[0].appendChild(script);
- waitForBloomerangLoad(function() { Bloomerang.Util.requireJQueryValidation(function() { insertForm3331072(); })});
- }
- else {
- waitForBloomerangLoad(function() { Bloomerang.Util.requireJQueryValidation(function() { insertForm3331072(); })});
- }
- };
- var waitForBloomerangLoad = function(callback) {
- if (typeof(Bloomerang) === 'undefined' || !Bloomerang._isReady) {
- setTimeout(function () { waitForBloomerangLoad(callback) }, 500);
- }
- else {
- if (true) {
- callback();
- } else {
- window.bloomerangLoadStarted = undefined;
- Bloomerang = undefined; // The version of Blomerang.js is not what we want. So blow it away and reload.
- startBloomerangLoad();
- }
- }
- };
- startBloomerangLoad();
- </script></pre>
Advertisement
Add Comment
Please, Sign In to add comment