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 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 All 212 releases
charitable / assets / js / admin / charitable-admin-notice.min.js

charitable-admin-notice.min.js in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at assets/js/admin/charitable-admin-notice.min.js

1 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 !function(e){e(document).ready(function(){document.querySelectorAll(".charitable-admin-notice-five-star-rating").forEach(e=>{const a=e.querySelectorAll("[data-navigate]");a&&a.forEach(e=>{e.addEventListener("click",({target:e})=>{const a=e.dataset.navigate,t=document.querySelector(`.charitable-admin-notice-five-star-rating[data-step="${a}"]`),n=document.querySelectorAll(`.charitable-admin-notice-five-star-rating:not([data-step="${a}"])`);t&&(t.style.display="block"),n.length>0&&n.forEach(e=>{e.style.display="none"})})})}),e(".charitable-notice.is-dismissible").each(function(){var a=e(this);a.find(".notice-dismiss").on("click",function(t){t.preventDefault(),e.ajax({type:"POST",data:{action:"charitable_dismiss_notice",notice:a.data("notice")},dataType:"json",url:ajaxurl,xhrFields:{withCredentials:!0},success:function(e){window.console&&window.console.log&&console.log(e)},error:function(e){window.console&&window.console.log&&console.log(e)}}).fail(function(e){window.console&&window.console.log&&console.log(e)})}),a.css("position","relative")}),e(".charitable-banner").each(function(){const a=jQuery(this),t=a.data("id"),n=a.data("nonce"),i=a.data("lifespan");a.on("click",".banner-dismiss, .charitable-banner-dismiss",()=>{event.preventDefault(),e.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_dismiss_admin_banner",banner_id:t,nonce:n,lifespan:i},dataType:"json",success(){a.slideUp("fast");const e=`charitable-banner-${t}-seen-0`;window.localStorage.removeItem(e)}})})}),e(".charitable-campaign-list-banner").each(function(){const a=jQuery(this),t=a.closest("tr.child"),n=a.data("id"),i=a.data("nonce"),o=a.data("lifespan");a.on("click",".banner-dismiss, .notice-dismiss, .charitable-close",()=>{event.preventDefault(),e.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_dismiss_admin_list_banner",banner_id:n,nonce:i,lifespan:o},dataType:"json",success(){t.fadeOut("fast");const e=`charitable-banner-${n}-seen-0`;window.localStorage.removeItem(e)}})})});const a=jQuery(".charitable-admin-banner-top-of-page");if(a.length>0){const e=a.detach();jQuery("#charitable-admin-header").length>0?jQuery("#charitable-admin-header").before(e):jQuery("#wpbody-content").prepend(e);const t=0,n=`charitable-banner-${e.data("id")}-seen-${t}`;window.localStorage.getItem(n)?e.show():setTimeout(()=>{window.localStorage.setItem(n,!0),a.slideDown()},1500)}e(".charitable-admin-notice-five-star-rating").each(function(){const a=jQuery(this),t=a.data("id");a.on("click",".charitable-notice-dismiss",()=>{e.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_dismiss_admin_five_star_rating",banner_id:t},success(){e(".notice-five-star-review").remove()}})})});const t=jQuery(".notice-five-star-review");if(t.length>0){const e=t.detach(),n=jQuery("#charitable-admin-header");jQuery("#screen-meta-links").length>0?(jQuery("#screen-meta-links").after(e),e.addClass("screen-meta-space").show()):n.length>0?(n.after(e),e.show()):a.length>0?(a.after(e),e.show()):(jQuery("#wpbody-content").prepend(e),e.show())}const n=jQuery(".notice.charitable-notice");if(n.length>0){const e=n.detach(),t=jQuery("#charitable-admin-header");jQuery("#screen-meta-links").length>0?(jQuery("#screen-meta-links").after(e),e.addClass("screen-meta-space").show()):t.length>0?(t.after(e),e.show()):a.length>0?(a.after(e),e.show()):(jQuery("#wpbody-content").prepend(e),e.show())}const i=jQuery(".charitable-remove-dashboard-notice, .charitable-remove-dashboard-notice-link");if(i.length>0){const a=i.closest(".charitable-important");i.on("click",function(t){t.preventDefault(),e.ajax({type:"POST",url:ajaxurl,data:{action:"charitable_dismiss_dashboard_notice",notice_ids:a.data("notice-ids")},success(){a.remove()}})})}e("#charitable-growth-tools-notice").on("click",".charitable-remove-growth-tools",function(a){a.preventDefault();const t=e(this).closest(".charitable-growth-tools-notice"),n=t.hasClass("charitable-growth-tools-dashboard")?"charitable_dismiss_growth_tools_dashboard_notice":"charitable_dismiss_growth_tools_notice",i=t.data("nonce");e.ajax({type:"POST",url:ajaxurl,data:{action:n,nonce:i,notice_type:t.data("notice-type")},success(){t.fadeOut("fast",function(){t.remove()})}})}),e("#charitable-growth-tools-notice").on("click",".charitable-dashboard-notice-another-suggestion a",function(a){a.preventDefault();const t=e(this).closest(".charitable-growth-tools-notice-interior");e.ajax({type:"POST",url:ajaxurl,data:{action:"ajax_get_dashboard_notice_html",nonce:charitable_admin.nonce},success(e){e.success&&e.data&&t.fadeOut("fast",function(){t.html(e.data),t.fadeIn("fast")})}})})})}(jQuery);