PageSourceSearch

https://columbustwc.org/wp-content/plugins/charitable-recurring/as…/js/charitable-recurring.min.js?ver=2.2.0

js columbustwc.org collected 2026-10-09 21:35:06 UTC 15,827 bytes, 1 lines download raw bytes

1CHARITABLE_RECURRING=function($){var methods={init:function(){$("html").addClass("js");$(".recurring-donation").find("input:checked").each(function(){$(this).addClass("selected")});$(".recurring-donation-amounts").on("click change","input[name=donation_amount]",function(){var $input=$(this);var $form=$input.closest("form");var $fallback=$form.find('input[name=donation_amount_fallback][data-recurring="true"]');if($fallback.length&&$input.val()&&$input.val()!=="recurring-custom"){$fallback.val($input.val());if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&CHARITABLE_RECURRING_VARS.form_debug&&typeof console!=="undefined"&&console.log){console.log("[Charitable Recurring] Updated fallback to:",$input.val())}}});$(".recurring-donation-options").on("change","input[name=recurring_donation]",function(event){CHARITABLE_RECURRING.toggle_tabs($(this))});$(".charitable-recurring-donation-options .recurring-donation-period [name=recurring_donation_period][value=once]").parent().addClass("one-time-donation-period").hide();$(".recurring-donation-option").on("change","input[name=recurring_donation]",function(event){if($(this).is(":checked")){CHARITABLE_RECURRING.toggle_gateways()}else{CHARITABLE_RECURRING.toggle_gateways(true)}});$(".recurring-donation-options [name=recurring_donation]").change();CHARITABLE_RECURRING.init_stripe_payment_method_filtering()},toggle_tabs:function($radio){var $form=$radio.closest("form");$form.find(".recurring-donation-option").removeClass("selected");$("input[name=recurring_donation]:checked",$form).closest("li").addClass("selected");var val=$("input[name=recurring_donation]:checked",$form).val();if(val=="once"){$form.find(".charitable-recurring-donation-options").hide().removeClass("active");$form.find(".charitable-donation-options:not(.charitable-recurring-donation-options)").show().addClass("active");$form.find(".charitable-recurring-donation-options .recurring-donation-period .one-time-donation-period input").prop("checked",true);CHARITABLE_RECURRING.toggle_gateways(true);CHARITABLE_RECURRING.enable_all_stripe_payment_methods()}else{$form.find(".charitable-recurring-donation-options").show().addClass("active");$form.find(".charitable-donation-options:not(.charitable-recurring-donation-options)").hide().removeClass("active");CHARITABLE_RECURRING.toggle_gateways();CHARITABLE_RECURRING.disable_incompatible_stripe_payment_methods()}},toggle_gateways:function(show_all){var show_all;if(typeof show_all==="undefined"){show_all=false}if(show_all==true){$("#charitable-gateway-selector li").show()}else{$("#charitable-gateway-selector").find("input").each(function(){if($.inArray($(this).val(),Charitable_Recurring.supported_gateways)!==-1){$(this).parent().show()}else{$(this).prop("checked",false).parent().hide()}})}},init_stripe_payment_method_filtering:function(){$(document).on("change","input[name=recurring_donation]",function(){CHARITABLE_RECURRING.handle_recurring_donation_change($(this))});$(document).on("change","input[name=recurring_donation_period]",function(){CHARITABLE_RECURRING.handle_recurring_donation_change($(this))});$(document).on("change",'input[name="gateway"]',function(){CHARITABLE_RECURRING.validate_donate_button_state()});$(document).on("charitable:gateway:changed",function(event,gatewayId){CHARITABLE_RECURRING.validate_donate_button_state()});$(document).on("submit",".charitable-donation-form",function(e){if(CHARITABLE_RECURRING.is_donate_button_disabled()){e.preventDefault();CHARITABLE_RECURRING.show_submission_alert();return false}});$(document).on("click",'button[type="submit"], input[type="submit"], .donate-button',function(e){if(CHARITABLE_RECURRING.is_donate_button_disabled()){e.preventDefault();CHARITABLE_RECURRING.show_submission_alert();return false}});CHARITABLE_RECURRING.check_recurring_donation_state();setTimeout(function(){CHARITABLE_RECURRING.check_recurring_donation_state()},500)},handle_recurring_donation_change:function($input){var $form=$input.closest("form");var is_recurring=CHARITABLE_RECURRING.is_recurring_donation_selected($form);if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Recurring donation change detected");console.log("Input value:",$input.val());
1console.log("Is recurring:",is_recurring)}if(is_recurring){CHARITABLE_RECURRING.disable_incompatible_stripe_payment_methods();if(CHARITABLE_RECURRING.has_incompatible_gateways_on_form()){CHARITABLE_RECURRING.show_recurring_warning_message()}else{CHARITABLE_RECURRING.hide_recurring_warning_message()}}else{CHARITABLE_RECURRING.enable_all_stripe_payment_methods();CHARITABLE_RECURRING.hide_recurring_warning_message()}CHARITABLE_RECURRING.validate_donate_button_state()},is_recurring_donation_selected:function($form){var $recurring_input=$form.find("input[name=recurring_donation]:checked");if($recurring_input.length===0){return false}var value=$recurring_input.val();if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Recurring donation value:",value)}return value!="once"&&value!=""&&value!=undefined},check_recurring_donation_state:function(){var $form=$(".charitable-donation-form");if($form.length===0){return}var is_recurring=CHARITABLE_RECURRING.is_recurring_donation_selected($form);if(is_recurring){CHARITABLE_RECURRING.disable_incompatible_stripe_payment_methods();if(CHARITABLE_RECURRING.has_incompatible_gateways_on_form()){CHARITABLE_RECURRING.show_recurring_warning_message()}else{CHARITABLE_RECURRING.hide_recurring_warning_message()}}else{CHARITABLE_RECURRING.enable_all_stripe_payment_methods();CHARITABLE_RECURRING.hide_recurring_warning_message()}CHARITABLE_RECURRING.validate_donate_button_state()},disable_incompatible_stripe_payment_methods:function(){var incompatible_methods=["stripe_ach_direct_debit","stripe_becs_direct_debit","stripe_cash_app"];if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.disable_offline_for_recurring){incompatible_methods.push("offline")}incompatible_methods.forEach(function(method_id){var $tab=$('.charitable-gateway-tab[data-gateway-id="'+method_id+'"]');var $radio=$('input[value="'+method_id+'"]');if($tab.length>0){$tab.addClass("disabled-for-recurring");$tab.attr("title","This payment method is not available for recurring donations");if($radio.is(":checked")){$radio.prop("checked",false).trigger("change")}}});$("#charitable-gateway-selector li").each(function(){var $li=$(this);var $input=$li.find('input[type="radio"]');var gateway_value=$input.val();if(incompatible_methods.indexOf(gateway_value)!==-1){$li.addClass("disabled-for-recurring");$li.attr("title","This payment method is not available for recurring donations");if($input.is(":checked")){$input.prop("checked",false).trigger("change")}}})},enable_all_stripe_payment_methods:function(){$(".charitable-gateway-tab.disabled-for-recurring").removeClass("disabled-for-recurring").removeAttr("title");$("#charitable-gateway-selector li.disabled-for-recurring").removeClass("disabled-for-recurring").removeAttr("title")},show_recurring_warning_message:function(){if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Showing recurring payment warning message")}var $warning=$(".charitable-recurring-payment-method-warning");if($warning.length===0){var warning_message=CHARITABLE_RECURRING.get_warning_message();$warning=$('<div class="charitable-recurring-payment-method-warning charitable-notice charitable-notice-warning">'+"<p><strong>Note:</strong> "+warning_message+"</p></div>");var $gateway_tabs=$("#charitable-gateway-tabs");if($gateway_tabs.length>0){$gateway_tabs.before($warning)}else{var $gateway_selector=$("#charitable-gateway-selector");if($gateway_selector.length>0){$gateway_selector.before($warning)}else{$("#charitable-gateway-fields").prepend($warning)}}}$warning.show();$warning.css({width:"100%",display:"block","box-sizing":"border-box"})},hide_recurring_warning_message:function(){if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Hiding recurring payment warning message");console.log("Warning elements found:",$(".charitable-recurring-payment-method-warning").length)}$(".charitable-recurring-payment-method-warning").remove()},validate_donate_button_state:function(){var $form=$(".charitable-donation-form");var is_recurring=this.is_recurring_donation_selected($form);var $submit_button=$form.find('button[type="submit"], input[type="submit"], .donate-button');if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("validate_donate_button_state called");console.log("Form found:",$form.length);console.log("Submit button found:",$submit_button.length);
1console.log("Is recurring:",is_recurring);console.log("Submit button disabled:",$submit_button.prop("disabled"));console.log("Submit button classes:",$submit_button.attr("class"))}if(is_recurring){var selected_gateway=this.get_selected_gateway($form);var incompatible_methods=["stripe_ach_direct_debit","stripe_becs_direct_debit","stripe_cash_app"];if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.disable_offline_for_recurring){incompatible_methods.push("offline")}if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Selected gateway:",selected_gateway);console.log("Incompatible methods:",incompatible_methods);console.log("Is incompatible:",incompatible_methods.indexOf(selected_gateway)!==-1)}if(incompatible_methods.indexOf(selected_gateway)!==-1){$submit_button.prop("disabled",true).addClass("disabled-for-recurring");this.show_donate_button_error();if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Button disabled and error shown")}}else{$submit_button.prop("disabled",false).removeClass("disabled-for-recurring");this.hide_donate_button_error();if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Button enabled and error hidden")}}}else{$submit_button.prop("disabled",false).removeClass("disabled-for-recurring");this.hide_donate_button_error();if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Not recurring - button enabled")}}},get_selected_gateway:function($form){if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("=== Gateway Detection Debug ===");console.log("All gateway inputs:",$form.find('input[name="gateway"]').length);console.log("All gateway fields:",$form.find(".charitable-gateway-fields").length);console.log("All gateway tabs:",$form.find(".charitable-gateway-tab").length);console.log("Visible gateway fields:",$form.find(".charitable-gateway-fields:visible").length)}var $gateway_input=$form.find('input[name="gateway"]:checked');if($gateway_input.length){if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log('Gateway found via input[name="gateway"]:',$gateway_input.val())}return $gateway_input.val()}var $gateway_fields=$form.find(".charitable-gateway-fields[data-gateway]");if($gateway_fields.length){var gateway=$gateway_fields.filter(":visible").first().attr("data-gateway");if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Gateway found via data-gateway attribute:",gateway)}return gateway}var $active_tab=$form.find(".charitable-gateway-tab.active, .charitable-gateway-tab.selected");if($active_tab.length){var gateway=$active_tab.attr("data-gateway-id")||$active_tab.attr("id");if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Gateway found via active tab:",gateway)}return gateway}var $visible_fields=$form.find(".charitable-gateway-fields:visible");if($visible_fields.length){var gateway=$visible_fields.first().attr("data-gateway");if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Gateway found via visible fields:",gateway)}return gateway}var $any_gateway_input=$form.find('input[name*="gateway"], input[name*="payment"], input[name*="stripe"]');if($any_gateway_input.length){if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("Found inputs with gateway-related names:",$any_gateway_input.map(function(){return this.name+"="+this.value}).get())}}if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.debug_enabled&&typeof console!=="undefined"&&console.log){console.log("No gateway detected")}return""},is_donate_button_disabled:function(){var $form=$(".charitable-donation-form");var $submit_button=$form.find('button[type="submit"], input[type="submit"], .donate-button');return $submit_button.hasClass("disabled-for-recurring")||$submit_button.prop("disabled")},show_submission_alert:function(){alert("The selected payment method is not available with recurring donations at this time. Please choose a different payment method.")},show_donate_button_error:function(){if($(".charitable-recurring-payment-method-error").length){return}var $error=$('<div class="charitable-recurring-payment-method-error charitable-notice charitable-notice-error">'+"<p>The selected payment method is not available with recurring donations at this time. Please choose a different payment method.</p>"+"</div>");var $form=$(".charitable-donation-form");$form.find('button[type="submit"], input[type="submit"], .donate-button').after($error)},hide_donate_button_error:function(){$(".charitable-recurring-payment-method-error").remove()},has_incompatible_gateways_on_form:function(){var incompatible_methods=["stripe_ach_direct_debit","stripe_becs_direct_debit","stripe_cash_app"];if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.disable_offline_for_recurring){incompatible_methods.push("offline")}var found=false;incompatible_methods.forEach(function(method_id){if($('.charitable-gateway-tab[data-gateway-id="'+method_id+'"]').length>0){found=true}if($('input[name="gateway"][value="'+method_id+'"]').length>0){found=true}if($('#charitable-gateway-selector input[value="'+method_id+'"]').length>0){found=true}});return found},get_warning_message:function(){if(typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.warning_message){return CHARITABLE_RECURRING_VARS.warning_message}var include_offline=typeof CHARITABLE_RECURRING_VARS!=="undefined"&&CHARITABLE_RECURRING_VARS.disable_offline_for_recurring;if(include_offline){return"Some payment methods (ACH, BECS, Cash App, and offline/check payments) are not available for recurring donations only. Please select a different payment method to continue."}else{return"Some payment methods (ACH, BECS, and Cash App) are not available for recurring donations only. Please select a different payment method to continue."}}};return methods}(jQuery);(function($){$("body").on("charitable:form:initialize",function(){CHARITABLE_RECURRING.init(
1)})})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.