1 line
2.5 KiB
JavaScript
1 line
2.5 KiB
JavaScript
|
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(r,s,function(t){return e[t]}.bind(null,s));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=184)}({1:function(e,t){e.exports=jQuery},184:function(e,t,n){(function(e,t){var n={init:function(){this.submit()},submit:function(){var t=this;e(document.body).on("submit",".edd-export-form",(function(n){n.preventDefault();var r=e(this),s=r.find('button[type="submit"]').first();if(!s.hasClass("button-disabled")&&!s.is(":disabled")){var i=r.serialize();s.hasClass("button-primary")&&s.removeClass("button-primary").addClass("button-secondary"),s.attr("disabled",!0).addClass("updating-message"),r.find(".notice-wrap").remove(),r.append('<div class="notice-wrap"><div class="edd-progress"><div></div></div></div>'),t.process_step(1,i,t)}}))},process_step:function(t,n,r){e.ajax({type:"POST",url:ajaxurl,data:{form:n,action:"edd_do_ajax_export",step:t},dataType:"json",success:function(t){if("done"===t.step||t.error||t.success){var s=e(".edd-export-form").find(".edd-progress").parent().parent(),i=s.find(".notice-wrap");if(s.find("button").attr("disabled",!1).removeClass("updating-message").addClass("updated-message"),s.find("button .spinner").hide().css("visibility","visible"),t.error){var o=t.message;i.html('<div class="updated error"><p>'+o+"</p></div>")}else if(t.success){var a=t.message;i.html('<div id="edd-batch-success" class="updated notice"><p>'+a+"</p></div>"),t.data&&e.each(t.data,(function(t,n){e(".edd_"+t).html(n)}))}else i.remove(),window.location=t.url}else e(".edd-progress div").animate({width:t.percentage+"%"},50,(function(){})),r.process_step(parseInt(t.step),n,r)}}).fail((function(e){window.console&&window.console.log&&console.log(e)}))}};t(document).ready((function(e){n.init()}))}).call(this,n(1),n(1))}});
|