PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets / 4.9.5
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / utils / feedback / assets / js / shopengine-deactivation-modal.js
shopengine / utils / feedback / assets / js Last commit date
shopengine-deactivation-modal.js 2 months ago
shopengine-deactivation-modal.js
1 lines
1 !function(e){"use strict";var n="open",i={modal:null,form:null,deactivateLink:null,isProcessing:!1,deactivateLinkHref:null,init:function(){"undefined"!=typeof ShopEngineDeactivation&&!1===ShopEngineDeactivation.show_modal||(this.cacheElements(),this.bindEvents(),this.syncFeedbackState())},cacheElements:function(){this.modal=e("#shopengine-deactivation-modal"),this.form=e("#shopengine-deactivation-form"),this.deactivateLink=e('#deactivate-shopengine, tr[data-slug="shopengine"] .deactivate a, a[href*="plugin=shopengine/shopengine.php"][href*="deactivate"], a[href*="shopengine.php"][href*="deactivate"]')},bindEvents:function(){var i=this;this.deactivateLink.length&&this.deactivateLink.on("click.shopengineModal",(function(n){n.preventDefault(),i.deactivateLinkHref=e(this).attr("href"),e(".shopengine-deactivation-skip").data("deactivate-link",i.deactivateLinkHref),i.openModal()})),this.form.on("submit.shopengineModal",(function(e){e.preventDefault(),i.submitForm()})),e(".shopengine-deactivation-close").on("click.shopengineModal",(function(){i.closeModal()})),e(".shopengine-deactivation-skip").on("click.shopengineModal",(function(){var n=e(this).data("deactivate-link");n&&(window.location.href=n)})),this.form.on("change.shopengineModal",'input[name="reason"]',(function(){i.hideAllFeedbacks(),i.showFeedbackForReason(e(this).closest(".shopengine-deactivation-radio-item").data("reason-key"))})),this.modal.on("click.shopengineModal",(function(n){e(n.target).is(i.modal)&&i.closeModal()})),e(document).on("keydown.shopengineModal",(function(e){"Escape"===e.key&&i.modal.hasClass(n)&&i.closeModal()}))},openModal:function(){this.modal.addClass(n),e("body").css("overflow","hidden"),this.hideErrorMessage(),this.syncFeedbackState()},closeModal:function(){this.modal.removeClass(n),e("body").css("overflow",""),this.form[0].reset(),this.hideErrorMessage(),this.hideAllFeedbacks()},syncFeedbackState:function(){var e=this.form.find('input[name="reason"]:checked');e.length&&(this.hideAllFeedbacks(),this.showFeedbackForReason(e.closest(".shopengine-deactivation-radio-item").data("reason-key")))},submitForm:function(){var n=this;if(!this.isProcessing){var i=this.form.find('input[name="reason"]:checked'),a=i.val();if(a){var o=i.closest(".shopengine-deactivation-radio-item"),t=o.data("reason-key"),s={action:"shopengine_deactivation_feedback",shopengine_nonce:this.form.find('input[name="shopengine_nonce"]').val(),reason:a,reason_key:o.find(".shopengine-reason-key").val()||"",reason_label:o.find(".shopengine-reason-label").val()||a,feedback:o.find('textarea[name="feedback_'+t+'"]').val()||""};this.setProcessing(!0),e.ajax({type:"POST",url:ShopEngineDeactivation.ajaxurl,data:s,success:function(){},error:function(e,n,i){window.console.error("ShopEngine: deactivation feedback error —",i)},complete:function(){n.setProcessing(!1);var i=e(".shopengine-deactivation-skip").data("deactivate-link");i&&(window.location.href=i)}})}else this.showErrorMessage("Please select a reason first.")}},hideAllFeedbacks:function(){e(".shopengine-deactivation-radio-feedback").removeClass("active")},showFeedbackForReason:function(n){n&&e('.shopengine-deactivation-radio-item[data-reason-key="'+n+'"] .shopengine-deactivation-radio-feedback').addClass("active")},showErrorMessage:function(n){e("#shopengine-deactivation-error-message").html(n).slideDown(300)},hideErrorMessage:function(){var n=e("#shopengine-deactivation-error-message");n.slideUp(300,(function(){n.html("")}))},setProcessing:function(n){this.isProcessing=n,e(".shopengine-deactivation-submit").prop("disabled",n).toggleClass("loading",n)}};e(document).ready((function(){i.init()})),window.ShopEngineDeactivationModal=i}(jQuery);