PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
← All changes | assets/js/admin/charitable-admin-2.0.min.js +1 -1 1.8.11.3 → 1.8.13 View file →
@@ -1 +1 @@
1 -var CharitableAdminUI=window.CharitableAdminUI||function(i,a,t){var n={},o={},e={settings:{clickWatch:!1},init:function(){n=this.settings,t(e.ready)},ready:function(){e.moveNavigationElements(),o.$addNewCampaignButton=t("body.post-type-campaign .page-title-action"),e.bindUIActions();var n=new URLSearchParams(a.location.search);n.has("create")&&"campaign"===n.get("create")&&(e.newCampaignPopup(),n.delete("create"),a.history.pushState({},"","/wp-admin/edit.php?"+n.toString())),t(i).ready(function(){e.scrollToAnchor()}),t(a).on("hashchange",function(){e.scrollToAnchor()}),t("body").hasClass("charitable_page_charitable-dashboard")&&t("#charitable-plugin-notifications").find(".notification-cards-active .charitable-notification").length>0&&void 0!==charitable_admin.autoshow_plugin_notifications&&charitable_admin.autoshow_plugin_notifications&&(t("body").addClass("charitable-show-notifications"),t("#charitable-plugin-notifications").addClass("in"),t("body").find(".charitable-notifications-overlay").fadeIn())},moveNavigationElements:function(){t("body.post-type-charitable.edit-tags-php").length>0&&t("#charitable-tools-nav").insertBefore("h1.wp-heading-inline")},bindUIActions:function(){t("body.post-type-campaign").on("click",".charitable-campaign-list-banner a.button-link",function(i){i.preventDefault(),e.campaignListBannerPopup()}),t("body.post-type-campaign").on("click",".jconfirm-closeIcon",function(i){n.clickWatch=!1}),!1===n.clickWatch&&t("body.post-type-campaign").on("click","input.campaign_name",function(i){i.preventDefault(),t(this).select(),n.clickWatch=!0}),t(".charitable-blank-slate-create-campaign").length>0&&t("body.post-type-campaign").on("click",".charitable-blank-slate-create-campaign",function(i){i.preventDefault(),e.newCampaignPopup()}),e.initWelcome(),e.initUpgradeModal(),e.initNotifications(),e.initAMNotifications(),e.initSquareLegacyModal()},initAMNotifications:function(){t(".charitable-notification-inbox").length>0&&t("body").on("click",".charitable-notification-inbox, .charitable-close, #toplevel_page_charitable li.notifications, .charitable-report-card.charitable-dashboard-notifications .more a, p.charitable-view-notifications a",function(i){i.preventDefault(),t("body").toggleClass("charitable-show-notifications"),t("#charitable-plugin-notifications").toggleClass("in"),t("body").find(".charitable-notifications-overlay").fadeToggle()}),t(".charitable-notifications-overlay").length>0&&(t("body").on("click",".charitable-notifications-overlay",function(i){i.preventDefault(),t("body").removeClass("charitable-show-notifications"),t("#charitable-plugin-notifications").removeClass("in"),t("body").find(".charitable-notifications-overlay").fadeOut()}),t(".charitable-notification").on("click","a.dismiss",function(i){i.preventDefault();var a=t(this).closest(".charitable-notification").data("notification-id");t.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_notification_dismiss",notification_id:a,nonce:charitable_admin.nonce},success:function(i){if(i.success){var n=e.moveAMNotificationToDismissed(t("body").find('#charitable-plugin-notifications .charitable-notification[data-notification-id="'+a+'"]')),o=n.active_notification_count,c=n.dismissed_notification_count;if(0===o)t(".charitable-notification-cards.notification-cards-active .charitable-notification").remove(),t("#charitable-dashboard-report-sections").length>0&&t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notification").remove(),t(".charitable-dashboard-notifications").find(".no-items").removeClass("charitable-hidden"),t(".charitable-dashboard-notifications").find(".the-list").addClass("charitable-hidden"),t("#charitable-plugin-notifications .new-notifications").html("No new notifications"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .header h4").html("Notifications"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently no active notifications.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>'),t(".charitable-notification-inbox").find(".number").remove(),t("#toplevel_page_charitable").find("li.notifications .charitable-menu-notification-indicator").remove(),t("#charitable-plugin-notifications").find(".dismiss-all").remove();else t("#charitable-plugin-notifications").find("#new-notifications-count").html(o),t(".charitable-notification-inbox").find(".number").html(o),o>(s=t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .charitable-notification").length)?1===o?(t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(o+"+"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently one active notification.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>')):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s+"+"):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s);var s=t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .charitable-notification").length;t("#charitable-plugin-notifications").find("#new-notifications-count").html(o),o>s?1===o?(t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(o+"+"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently one active notification.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>')):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s+"+"):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s),1===o&&(e.replaceNotifications(".new-notifications.notifications-visible"),t("#charitable-dashboard-report-sections").length>0&&e.replaceNotifications(".charitable-dashboard-notifications .header h4")),t("#charitable-plugin-notifications").find("#dismissed-notifications-count").text(c),1===c?e.replaceNotifications("#charitable-plugin-notifications .old-notifications strong"):e.replaceNotification("#charitable-plugin-notifications .old-notifications strong")}}})}),t(".charitable-plugin-notifications .notification-menu").on("click",".dismiss-all a.dismiss",function(i){i.preventDefault();var a=t(this),n=[];t(".charitable-notification").each(function(){n.push(t(this).data("notification-id"))}),t.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_notification_dismiss_multiple",notification_ids:n,nonce:charitable_admin.nonce},success:function(i){if(i.success){a.remove();var n=0,o=0;t("#charitable-plugin-notifications .charitable-notification").each(function(){var i=e.moveAMNotificationToDismissed(t(this));n=i.active_notification_count,o=i.dismissed_notification_count}),t(".charitable-notification-cards.notification-cards-active .charitable-notification").remove(),t("#charitable-dashboard-report-sections").length>0&&t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notification").remove(),t(".charitable-dashboard-notifications").find(".no-items").removeClass("charitable-hidden"),t(".charitable-dashboard-notifications").find(".the-list").addClass("charitable-hidden"),t("#charitable-plugin-notifications .new-notifications").html("No new notifications"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .header h4").html("Notifications"),t(".charitable-notification-inbox").find(".number").remove(),t("#toplevel_page_charitable").find("li.notifications .charitable-menu-notification-indicator").remove(),t("#charitable-plugin-notifications").find("#new-notifications-count").html(n),t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(n),t("#charitable-plugin-notifications").find("#dismissed-notifications-count").html(o),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently no active notifications.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>')}}})}),t(".charitable-plugin-notifications .notification-menu").on("click",".dismissed-notifications a",function(i){i.preventDefault();var a=t(this),n=a.closest(".notification-menu"),o=n.find(".notification-cards-dismissed"),e=n.find(".notification-cards-active"),c=n.find(".new-notifications"),s=n.find(".old-notifications"),r=n.find(".dismiss-all a.dismiss"),l=t("#charitable-plugin-notifications .notification-cards-active .charitable-notification").length;t("#charitable-plugin-notifications .notification-cards-dismissed .charitable-notification").length;"active"!==a.data("status")?(1===l?a.html("Active Notification"):a.html("Active Notifications"),a.data("status","active")):(a.html("Dismissed Notification"),a.data("status","dismissed")),e.toggleClass("notification-cards-visible"),o.toggleClass("notification-cards-visible"),c.toggleClass("notifications-visible"),s.toggleClass("notifications-visible"),r.toggleClass("charitable-hidden")}))},replaceNotifications:function(i){t(i).each(function(){var i=t(this).text().replace(/Notifications/g,"Notification");t(this).text(i)})},replaceNotification:function(i){t(i).each(function(){var i=t(this).text().replace(/Notification/g,"Notifications");t(this).text(i)})},moveAMNotificationToDismissed:function(i){return t(".notification-no-dismissed-title").length>0&&t(".notification-no-dismissed-title").closest(".notification-card").remove(),i.find(".dismiss").remove(),i.appendTo("#charitable-plugin-notifications .notification-cards-dismissed").show(),t("#charitable-dashboard-report-sections").length>0&&t("#charitable-dashboard-report-sections").find('.charitable-dashboard-notifications .charitable-notification[data-notification-id="'+i.data("notification-id")+'"]').remove(),{active_notification_count:t("#charitable-plugin-notifications .notification-cards-active .charitable-notification").length,dismissed_notification_count:t("#charitable-plugin-notifications .notification-cards-dismissed .charitable-notification").length}},initNotifications:function(){t("body .charitable-dashboard-notification-navigation").on("click","a",function(i){i.preventDefault();var a=t(this),n=a.closest(".charitable-dashboard-notifications"),o=n.find(".charitable-dashboard-notification:not(.charitable-hidden)"),e=o.data("notification-number"),c=n.find(".charitable-dashboard-notification").length,s=e;a.hasClass("next")?++s>c&&(s=1):a.hasClass("prev")&&--s<1&&(s=c),o.fadeOut(200,function(){o.addClass("charitable-hidden").removeAttr("style"),n.find('.charitable-dashboard-notification[data-notification-number="'+s+'"]').hide().removeClass("charitable-hidden").fadeIn(200)}),n.find(".charitable-dashboard-notification-counter").text(s+" of "+c)}),t("body .charitable-dashboard-notifications").on("click",".charitable-remove-dashboard-notification",function(i){i.preventDefault();var a=t(this).closest(".charitable-dashboard-notifications"),n=a.find(".charitable-dashboard-notification:not(.charitable-hidden)").data("notification-id");t.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_disable_dashboard_notification",notification_id:n,nonce:charitable_admin.nonce},success:function(i){if(i.success){var t=a.find('.charitable-dashboard-notification[data-notification-id="'+n+'"]');t.fadeOut(200,function(){t.remove();var i=a.find(".charitable-dashboard-notification").length;if(0===i)a.fadeOut(200,function(){a.remove()});else if(a.find(".charitable-dashboard-notification").first().removeClass("charitable-hidden").hide().fadeIn(200),i<=1)a.find(".charitable-dashboard-notification-navigation").html("");else{var n=a.find(".charitable-dashboard-notification:not(.charitable-hidden)").first().data("notification-number");a.find(".charitable-dashboard-notification-counter").text(n+" of "+i)}})}}})})},scrollToAnchor:function(){var i=a.location.hash;if(i=i.substring(1)){i=i.replace(/[^a-zA-Z0-9-_]/g,"");var n=t("a#wpchr-"+i),o=!1;n.length&&(o=!!n.length&&n.closest(".charitable-growth-content")),t(".charitable-growth-content").removeClass("charitable-selected"),n.length&&(t("html, body").animate({scrollTop:n.offset().top-100},1e3),o.addClass("charitable-selected"))}},newCampaignPopup:function(){var i="undefined"!=typeof charitable_admin&&void 0!==charitable_admin.admin_url?charitable_admin.admin_url:"/wp-admin/",n=.5*t(a).width();n>770&&(n=770),t.confirm({title:"Create Campaign",content:'<form id="create-campaign-form" method="POST" action="'+i+'admin.php?page=charitable-campaign-builder&view=template" class="formName"><div class="form-group"><label>Name:</label><input type="text" placeholder="Campaign Name" value="My New Campaign" name="campaign_name" class="name campaign_name form-control" required /></div></form>',closeIcon:!0,boxWidth:n+"px",useBootstrap:!1,type:"create-campaign",animation:"none",buttons:{formSubmit:{text:"Create Campaign",btnClass:"btn-green",action:function(){return this.$content.find(".campaign_name").val().trim()?(t(".jconfirm-buttons button.btn").html("Creating..."),t("#create-campaign-form").submit(),!1):(t.alert("Please provide a valid campaign name."),!1)}}},onContentReady:function(){}})},campaignListBannerPopup:function(){var i=void 0!==charitable_admin.plugin_asset_dir?charitable_admin.plugin_asset_dir:"/wp-content/plugins/charitable/assets";t.confirm({title:!1,content:'<div class="charitable-lite-pro-popup"><div class="charitable-lite-pro-popup-left" ><h1>The Ambassadors Extension is only available for Charitable Pro users.</h1><h2>Harness the power of supporter networks and friends to reach more people and raise more money for your cause.</h2><ul><li><p>Create a crowdfunding platform (similar to GoFundMe)</p></li><li><p>Simplified fundraiser creation and management</p></li><li><p>Let supporters fundraise together through our Teams feature</p></li><li><p>Integrate with email marketing to follow up with campaign creators</p></li><li><p>Give people a place to fundraise for their own cause</p></li></ul><a href="https://wpcharitable.com/lite-vs-pro/?utm_source=WordPress&utm_medium=Ambassadors+Campaign+Modal+Unlock&utm_campaign=WP+Charitable" target="_blank" class="charitable-lite-pro-popup-button">Unlock Peer-to-Peer Fundraising</a><a href="https://wpcharitable.com/lite-vs-pro/?utm_source=WordPress&utm_medium=Ambassadors+Campaign+Modal+More&utm_campaign=WP+Charitable" target="_blank" class="charitable-lite-pro-popup-link">Or learn more about the Ambassadors extension &rarr;</a></div><div class="charitable-lite-pro-popup-right" ><img src="'+i+'images/lite-to-pro/ambassador.png" alt="Charitable Ambassador Extension" ></img></div>',closeIcon:!0,alignMiddle:!0,boxWidth:"986px",useBootstrap:!1,animation:"none",buttons:!1,type:"lite-pro-ad",onContentReady:function(){}})},initWelcome:function(){t(i).on("click","#charitable-welcome .play-video",function(i){i.preventDefault();"undefined"!=typeof jconfirm&&(jconfirm.defaults={closeIcon:!0,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",animateFromElement:!1},t.dialog({title:!1,content:'<div class="video-container"><iframe width="1280" height="720" src="https://www.youtube-nocookie.com/embed/834h3huzzk8?rel=0&amp;showinfo=0&amp;autoplay=1" frameborder="0" allowfullscreen></iframe></div>',closeIcon:!0,boxWidth:"1300"}))})},initUpgradeModal:function(){t(i).on("click",".charitable-upgrade-modal",function(){t.alert({title:charitable_admin.thanks_for_interest,content:charitable_admin.upgrade_modal,icon:"fa fa-info-circle",type:"blue",boxWidth:"550px",useBootstrap:!1,theme:"modern,charitable-install-form",closeIcon:!1,draggable:!1,buttons:{confirm:{text:charitable_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})})},initSquareLegacyModal:function(){t(i).on("click",'a[href*="charitable_action=enable_gateway"][href*="gateway_id=square_core"]',function(i){"undefined"!=typeof CHARITABLE&&CHARITABLE.square_legacy_active&&!CHARITABLE.square_core_active&&(i.preventDefault(),t.alert({title:CHARITABLE.heads_up,content:CHARITABLE.square_legacy_modal_message,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){t.post(CHARITABLE.ajax_url,{action:"charitable_switch_square_gateways",nonce:CHARITABLE.nonce},function(i){i.success?a.location.href=i.data.redirect_url:t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})}).fail(function(){t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})})}},cancel:{text:CHARITABLE.cancel,keys:["esc"]}}}))}),t(i).on("click",'a[href*="charitable_action=enable_gateway"][href*="gateway_id=square"]',function(i){"undefined"!=typeof CHARITABLE&&CHARITABLE.square_core_active&&!CHARITABLE.square_legacy_active&&(i.preventDefault(),t.alert({title:CHARITABLE.heads_up,content:CHARITABLE.square_core_modal_message,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){t.post(CHARITABLE.ajax_url,{action:"charitable_switch_square_core_to_legacy",nonce:CHARITABLE.nonce},function(i){i.success?a.location.href=i.data.redirect_url:t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})}).fail(function(){t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})})}},cancel:{text:CHARITABLE.cancel,keys:["esc"]}}}))})}};return e}(document,window,jQuery);CharitableAdminUI.init();
1 +var CharitableAdminUI=window.CharitableAdminUI||function(i,a,t){var n={},e={},o={settings:{clickWatch:!1},init:function(){n=this.settings,t(o.ready)},ready:function(){o.moveNavigationElements(),e.$addNewCampaignButton=t("body.post-type-campaign .page-title-action"),o.bindUIActions();var n=new URLSearchParams(a.location.search);n.has("create")&&"campaign"===n.get("create")&&(o.newCampaignPopup(),n.delete("create"),a.history.pushState({},"","/wp-admin/edit.php?"+n.toString())),t(i).ready(function(){o.scrollToAnchor()}),t(a).on("hashchange",function(){o.scrollToAnchor()}),t("body").hasClass("charitable_page_charitable-dashboard")&&t("#charitable-plugin-notifications").find(".notification-cards-active .charitable-notification").length>0&&void 0!==charitable_admin.autoshow_plugin_notifications&&charitable_admin.autoshow_plugin_notifications&&(t("body").addClass("charitable-show-notifications"),t("#charitable-plugin-notifications").addClass("in"),t("body").find(".charitable-notifications-overlay").fadeIn())},moveNavigationElements:function(){t("body.post-type-charitable.edit-tags-php").length>0&&t("#charitable-tools-nav").insertBefore("h1.wp-heading-inline")},bindUIActions:function(){t("body.post-type-campaign").on("click",".charitable-campaign-list-banner a.button-link",function(i){i.preventDefault(),o.campaignListBannerPopup()}),t("body.post-type-campaign").on("click",".jconfirm-closeIcon",function(i){n.clickWatch=!1}),!1===n.clickWatch&&t("body.post-type-campaign").on("click","input.campaign_name",function(i){i.preventDefault(),t(this).select(),n.clickWatch=!0}),t(".charitable-blank-slate-create-campaign").length>0&&t("body.post-type-campaign").on("click",".charitable-blank-slate-create-campaign",function(i){i.preventDefault(),o.newCampaignPopup()}),o.initWelcome(),o.initUpgradeModal(),o.initNotifications(),o.initAMNotifications(),o.initSquareLegacyModal()},initAMNotifications:function(){t(".charitable-notification-inbox").length>0&&t("body").on("click",".charitable-notification-inbox, .charitable-close, #toplevel_page_charitable li.notifications, .charitable-report-card.charitable-dashboard-notifications .more a, p.charitable-view-notifications a",function(i){i.preventDefault(),t("body").toggleClass("charitable-show-notifications"),t("#charitable-plugin-notifications").toggleClass("in"),t("body").find(".charitable-notifications-overlay").fadeToggle()}),t(".charitable-notifications-overlay").length>0&&(t("body").on("click",".charitable-notifications-overlay",function(i){i.preventDefault(),t("body").removeClass("charitable-show-notifications"),t("#charitable-plugin-notifications").removeClass("in"),t("body").find(".charitable-notifications-overlay").fadeOut()}),t(".charitable-notification").on("click","a.dismiss",function(i){i.preventDefault();var a=t(this).closest(".charitable-notification").data("notification-id");t.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_notification_dismiss",notification_id:a,nonce:charitable_admin.nonce},success:function(i){if(i.success){var n=o.moveAMNotificationToDismissed(t("body").find('#charitable-plugin-notifications .charitable-notification[data-notification-id="'+a+'"]')),e=n.active_notification_count,c=n.dismissed_notification_count;if(0===e)t(".charitable-notification-cards.notification-cards-active .charitable-notification").remove(),t("#charitable-dashboard-report-sections").length>0&&t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notification").remove(),t(".charitable-dashboard-notifications").find(".no-items").removeClass("charitable-hidden"),t(".charitable-dashboard-notifications").find(".the-list").addClass("charitable-hidden"),t("#charitable-plugin-notifications .new-notifications").html("No new notifications"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .header h4").html("Notifications"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently no active notifications.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>'),t(".charitable-notification-inbox").find(".number").remove(),t("#toplevel_page_charitable").find("li.notifications .charitable-menu-notification-indicator").remove(),t("#charitable-plugin-notifications").find(".dismiss-all").remove();else t("#charitable-plugin-notifications").find("#new-notifications-count").html(e),t(".charitable-notification-inbox").find(".number").html(e),e>(s=t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .charitable-notification").length)?1===e?(t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(e+"+"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently one active notification.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>')):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s+"+"):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s);var s=t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .charitable-notification").length;t("#charitable-plugin-notifications").find("#new-notifications-count").html(e),e>s?1===e?(t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(e+"+"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently one active notification.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>')):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s+"+"):t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(s),1===e&&(o.replaceNotifications(".new-notifications.notifications-visible"),t("#charitable-dashboard-report-sections").length>0&&o.replaceNotifications(".charitable-dashboard-notifications .header h4")),t("#charitable-plugin-notifications").find("#dismissed-notifications-count").text(c),1===c?o.replaceNotifications("#charitable-plugin-notifications .old-notifications strong"):o.replaceNotification("#charitable-plugin-notifications .old-notifications strong")}}})}),t(".charitable-plugin-notifications .notification-menu").on("click",".dismiss-all a.dismiss",function(i){i.preventDefault();var a=t(this),n=[];t(".charitable-notification").each(function(){n.push(t(this).data("notification-id"))}),t.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_notification_dismiss_multiple",notification_ids:n,nonce:charitable_admin.nonce},success:function(i){if(i.success){a.remove();var n=0,e=0;t("#charitable-plugin-notifications .charitable-notification").each(function(){var i=o.moveAMNotificationToDismissed(t(this));n=i.active_notification_count,e=i.dismissed_notification_count}),t(".charitable-notification-cards.notification-cards-active .charitable-notification").remove(),t("#charitable-dashboard-report-sections").length>0&&t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notification").remove(),t(".charitable-dashboard-notifications").find(".no-items").removeClass("charitable-hidden"),t(".charitable-dashboard-notifications").find(".the-list").addClass("charitable-hidden"),t("#charitable-plugin-notifications .new-notifications").html("No new notifications"),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications .header h4").html("Notifications"),t(".charitable-notification-inbox").find(".number").remove(),t("#toplevel_page_charitable").find("li.notifications .charitable-menu-notification-indicator").remove(),t("#charitable-plugin-notifications").find("#new-notifications-count").html(n),t("#charitable-dashboard-report-sections").find("#new-notifications-count-dashboard").html(n),t("#charitable-plugin-notifications").find("#dismissed-notifications-count").html(e),t("#charitable-dashboard-report-sections").find(".charitable-dashboard-notifications").find(".charitable-report-ui").html('<div class="no-items"><p><strong>There is currently no active notifications.</strong></p><p class="link charitable-view-notifications"><a href="#">View Notification<img src="/wp-content/plugins/charitable/assets/images/icons/east.svg"></a></p></div>')}}})}),t(".charitable-plugin-notifications .notification-menu").on("click",".dismissed-notifications a",function(i){i.preventDefault();var a=t(this),n=a.closest(".notification-menu"),e=n.find(".notification-cards-dismissed"),o=n.find(".notification-cards-active"),c=n.find(".new-notifications"),s=n.find(".old-notifications"),r=n.find(".dismiss-all a.dismiss"),l=t("#charitable-plugin-notifications .notification-cards-active .charitable-notification").length;t("#charitable-plugin-notifications .notification-cards-dismissed .charitable-notification").length;"active"!==a.data("status")?(1===l?a.html("Active Notification"):a.html("Active Notifications"),a.data("status","active")):(a.html("Dismissed Notification"),a.data("status","dismissed")),o.toggleClass("notification-cards-visible"),e.toggleClass("notification-cards-visible"),c.toggleClass("notifications-visible"),s.toggleClass("notifications-visible"),r.toggleClass("charitable-hidden")}),t(i).on("click","#charitable-notif-gear-btn",function(i){i.preventDefault(),i.stopPropagation();var a=t("#charitable-notif-settings-panel"),n=t(this),e=a.is(":visible");a.slideToggle(150),n.attr("aria-expanded",e?"false":"true")}),t(i).on("change",'#charitable-notif-settings-panel input[type="checkbox"]',function(){var i={};t('#charitable-notif-settings-panel input[type="checkbox"]').each(function(){i[t(this).data("category")]=t(this).is(":checked")}),t.post("undefined"!=typeof ajaxurl?ajaxurl:charitable_admin.ajax_url,{action:"charitable_save_notification_settings",nonce:CHARITABLE.nonce,settings:JSON.stringify(i)},function(i){i.success||console.log("Notification settings save failed",i)})}))},replaceNotifications:function(i){t(i).each(function(){var i=t(this).text().replace(/Notifications/g,"Notification");t(this).text(i)})},replaceNotification:function(i){t(i).each(function(){var i=t(this).text().replace(/Notification/g,"Notifications");t(this).text(i)})},moveAMNotificationToDismissed:function(i){return t(".notification-no-dismissed-title").length>0&&t(".notification-no-dismissed-title").closest(".notification-card").remove(),i.find(".dismiss").remove(),i.appendTo("#charitable-plugin-notifications .notification-cards-dismissed").show(),t("#charitable-dashboard-report-sections").length>0&&t("#charitable-dashboard-report-sections").find('.charitable-dashboard-notifications .charitable-notification[data-notification-id="'+i.data("notification-id")+'"]').remove(),{active_notification_count:t("#charitable-plugin-notifications .notification-cards-active .charitable-notification").length,dismissed_notification_count:t("#charitable-plugin-notifications .notification-cards-dismissed .charitable-notification").length}},initNotifications:function(){t("body .charitable-dashboard-notification-navigation").on("click","a",function(i){i.preventDefault();var a=t(this),n=a.closest(".charitable-dashboard-notifications"),e=n.find(".charitable-dashboard-notification:not(.charitable-hidden)"),o=e.data("notification-number"),c=n.find(".charitable-dashboard-notification").length,s=o;a.hasClass("next")?++s>c&&(s=1):a.hasClass("prev")&&--s<1&&(s=c),e.fadeOut(200,function(){e.addClass("charitable-hidden").removeAttr("style"),n.find('.charitable-dashboard-notification[data-notification-number="'+s+'"]').hide().removeClass("charitable-hidden").fadeIn(200)}),n.find(".charitable-dashboard-notification-counter").text(s+" of "+c)}),t("body .charitable-dashboard-notifications").on("click",".charitable-remove-dashboard-notification",function(i){i.preventDefault();var a=t(this).closest(".charitable-dashboard-notifications"),n=a.find(".charitable-dashboard-notification:not(.charitable-hidden)").data("notification-id");t.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_disable_dashboard_notification",notification_id:n,nonce:charitable_admin.nonce},success:function(i){if(i.success){var t=a.find('.charitable-dashboard-notification[data-notification-id="'+n+'"]');t.fadeOut(200,function(){t.remove();var i=a.find(".charitable-dashboard-notification").length;if(0===i)a.fadeOut(200,function(){a.remove()});else if(a.find(".charitable-dashboard-notification").first().removeClass("charitable-hidden").hide().fadeIn(200),i<=1)a.find(".charitable-dashboard-notification-navigation").html("");else{var n=a.find(".charitable-dashboard-notification:not(.charitable-hidden)").first().data("notification-number");a.find(".charitable-dashboard-notification-counter").text(n+" of "+i)}})}}})})},scrollToAnchor:function(){var i=a.location.hash;if(i=i.substring(1)){i=i.replace(/[^a-zA-Z0-9-_]/g,"");var n=t("a#wpchr-"+i),e=!1;n.length&&(e=!!n.length&&n.closest(".charitable-growth-content")),t(".charitable-growth-content").removeClass("charitable-selected"),n.length&&(t("html, body").animate({scrollTop:n.offset().top-100},1e3),e.addClass("charitable-selected"))}},newCampaignPopup:function(){var i="undefined"!=typeof charitable_admin&&void 0!==charitable_admin.admin_url?charitable_admin.admin_url:"/wp-admin/",n=.5*t(a).width();n>770&&(n=770),t.confirm({title:"Create Campaign",content:'<form id="create-campaign-form" method="POST" action="'+i+'admin.php?page=charitable-campaign-builder&view=template" class="formName"><div class="form-group"><label>Name:</label><input type="text" placeholder="Campaign Name" value="My New Campaign" name="campaign_name" class="name campaign_name form-control" required /></div></form>',closeIcon:!0,boxWidth:n+"px",useBootstrap:!1,type:"create-campaign",animation:"none",buttons:{formSubmit:{text:"Create Campaign",btnClass:"btn-green",action:function(){return this.$content.find(".campaign_name").val().trim()?(t(".jconfirm-buttons button.btn").html("Creating..."),t("#create-campaign-form").submit(),!1):(t.alert("Please provide a valid campaign name."),!1)}}},onContentReady:function(){}})},campaignListBannerPopup:function(){var i=void 0!==charitable_admin.plugin_asset_dir?charitable_admin.plugin_asset_dir:"/wp-content/plugins/charitable/assets";t.confirm({title:!1,content:'<div class="charitable-lite-pro-popup"><div class="charitable-lite-pro-popup-left" ><h1>The Ambassadors Extension is only available for Charitable Pro users.</h1><h2>Harness the power of supporter networks and friends to reach more people and raise more money for your cause.</h2><ul><li><p>Create a crowdfunding platform (similar to GoFundMe)</p></li><li><p>Simplified fundraiser creation and management</p></li><li><p>Let supporters fundraise together through our Teams feature</p></li><li><p>Integrate with email marketing to follow up with campaign creators</p></li><li><p>Give people a place to fundraise for their own cause</p></li></ul><a href="https://wpcharitable.com/lite-vs-pro/?utm_source=WordPress&utm_medium=Ambassadors+Campaign+Modal+Unlock&utm_campaign=WP+Charitable" target="_blank" class="charitable-lite-pro-popup-button">Unlock Peer-to-Peer Fundraising</a><a href="https://wpcharitable.com/lite-vs-pro/?utm_source=WordPress&utm_medium=Ambassadors+Campaign+Modal+More&utm_campaign=WP+Charitable" target="_blank" class="charitable-lite-pro-popup-link">Or learn more about the Ambassadors extension &rarr;</a></div><div class="charitable-lite-pro-popup-right" ><img src="'+i+'images/lite-to-pro/ambassador.png" alt="Charitable Ambassador Extension" ></img></div>',closeIcon:!0,alignMiddle:!0,boxWidth:"986px",useBootstrap:!1,animation:"none",buttons:!1,type:"lite-pro-ad",onContentReady:function(){}})},initWelcome:function(){t(i).on("click","#charitable-welcome .play-video",function(i){i.preventDefault();"undefined"!=typeof jconfirm&&(jconfirm.defaults={closeIcon:!0,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",animateFromElement:!1},t.dialog({title:!1,content:'<div class="video-container"><iframe width="1280" height="720" src="https://www.youtube-nocookie.com/embed/834h3huzzk8?rel=0&amp;showinfo=0&amp;autoplay=1" frameborder="0" allowfullscreen></iframe></div>',closeIcon:!0,boxWidth:"1300"}))})},initUpgradeModal:function(){t(i).on("click",".charitable-upgrade-modal",function(){t.alert({title:charitable_admin.thanks_for_interest,content:charitable_admin.upgrade_modal,icon:"fa fa-info-circle",type:"blue",boxWidth:"550px",useBootstrap:!1,theme:"modern,charitable-install-form",closeIcon:!1,draggable:!1,buttons:{confirm:{text:charitable_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})})},initSquareLegacyModal:function(){t(i).on("click",'a[href*="charitable_action=enable_gateway"][href*="gateway_id=square_core"]',function(i){"undefined"!=typeof CHARITABLE&&CHARITABLE.square_legacy_active&&!CHARITABLE.square_core_active&&(i.preventDefault(),t.alert({title:CHARITABLE.heads_up,content:CHARITABLE.square_legacy_modal_message,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){t.post(CHARITABLE.ajax_url,{action:"charitable_switch_square_gateways",nonce:CHARITABLE.nonce},function(i){i.success?a.location.href=i.data.redirect_url:t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})}).fail(function(){t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})})}},cancel:{text:CHARITABLE.cancel,keys:["esc"]}}}))}),t(i).on("click",'a[href*="charitable_action=enable_gateway"][href*="gateway_id=square"]',function(i){"undefined"!=typeof CHARITABLE&&CHARITABLE.square_core_active&&!CHARITABLE.square_legacy_active&&(i.preventDefault(),t.alert({title:CHARITABLE.heads_up,content:CHARITABLE.square_core_modal_message,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){t.post(CHARITABLE.ajax_url,{action:"charitable_switch_square_core_to_legacy",nonce:CHARITABLE.nonce},function(i){i.success?a.location.href=i.data.redirect_url:t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})}).fail(function(){t.alert({title:CHARITABLE.oops,content:CHARITABLE.square_legacy_switch_error,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:CHARITABLE.ok,btnClass:"btn-confirm",keys:["enter"]}}})})}},cancel:{text:CHARITABLE.cancel,keys:["esc"]}}}))})}};return o}(document,window,jQuery);CharitableAdminUI.init();