| 1 |
!function(t){t(".charitable-campaign-nav").on("click","li.tab_title a",function(a){a.preventDefault();var n=t(".charitable-campaign-preview"),o=t(this).parent().data("tab-id");n.find("li#tab_"+o+"_title").attr("data-tab-type");t(".tab-content ul li").removeClass("active"),t("nav li.tab_title").removeClass("active"),t(this).parent().addClass("active"),t(".tab-content ul li#tab_"+o+"_content").addClass("active"),t(".charitable-layout-options-tab .charitable-group").removeClass("active"),t(".charitable-layout-options-tab").find("[data-group_id="+o+"]").addClass("active").removeClass("charitable-closed"),t(".charitable-layout-options-tab").find("[data-group_id="+o+"]").find(".charitable-group-rows").show(),t(".charitable-layout-options-tab").find("[data-group_id="+o+"]").find(".charitable-toggleable-group i").removeClass(".charitable-angle-right").addClass("charitable-angle-down"),t("#layout-options a").click()}),t(".charitable-campaign-field").on("click","ul.charitable-template-donation-amounts li",function(a){if(t(this).parent().find("li").removeClass("selected"),t(this).addClass("selected"),t(this).find('input[type="radio"]').prop("checked",!0),t(this).hasClass("custom-donation-amount"));else{const a=t(this).find('input[type="radio"]').val();var n=null,o="";t(this).closest(".charitable-campaign-container").find('form.campaign-donation input[name="charitable_donation_amount"]').val(a),t("form#charitable-donation-form").length>0&&t(".charitable-donation-options").length>0&&((n=t(".charitable-donation-options").find('input[type="radio"][value="'+a+'"]')).prop("checked",!0),t("form#charitable-donation-form").find(".suggested-donation-amount").removeClass("selected"),n.closest(".suggested-donation-amount").addClass("selected"),t("form#charitable-donation-form").find(".charitable-your-donation-amount").length>0&&(o=n.closest(".suggested-donation-amount").find(".amount").text()).length>0&&t("form#charitable-donation-form").find(".charitable-your-donation-amount").find("p strong").text(o))}}),t(".charitable-campaign-field").on("keyup",'ul.charitable-template-donation-amounts input[name="custom_donation_amount"]',function(a){t(this).closest(".charitable-campaign-container").find('form.campaign-donation input[name="charitable_donation_amount"]').val(t(this).val());var n=null,o="";const e=t(this).val();t("form#charitable-donation-form").length>0&&t("form#charitable-donation-form").find('input[name="custom_donation_amount"]').length>0&&t(".charitable-template-donation-amounts").find('input[name="custom_donation_amount"]').length>0&&(o=t(".charitable-template-donation-amounts").find('input[name="custom_donation_amount"]').val()).length>0&&((n=t(".charitable-donation-options").find('input[type="radio"][value="'+e+'"]')).prop("checked",!0),t("form#charitable-donation-form").find('input[name="custom_donation_amount"]').val(o),t("form#charitable-donation-form").find(".suggested-donation-amount").removeClass("selected"),n.closest(".suggested-donation-amount").addClass("selected"),t("form#charitable-donation-form").find('input[type="radio"]').prop("checked",!1)),t("form#charitable-donation-form").find(".charitable-your-donation-amount").length>0&&(o=t(".charitable-template-donation-amounts").find('input[name="custom_donation_amount"]').val()).length>0&&t("form#charitable-donation-form").find(".charitable-your-donation-amount").find("p strong").text(o)});const a=document.querySelector(".charitable-mastodon-share");null!==a&&a.addEventListener("click",t=>{if(localStorage.getItem("mastodon-instance"))a.href=`\n https://${localStorage.getItem("mastodon-instance")}/share?text=${encodeURIComponent(document.title)}%0A${encodeURIComponent(location.href)}`;else{t.preventDefault();let a=window.prompt("Please tell me your Mastodon instance");localStorage.setItem("mastodon-instance",a)}})}(jQuery); |