laipower/wp-content/plugins/easy-digital-downloads/assets/js/edd-admin-downloads.js

1 line
10 KiB
JavaScript
Raw Normal View History

!function(e){var t={};function i(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(a,n,function(t){return e[t]}.bind(null,n));return a},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=182)}({1:function(e,t){e.exports=jQuery},14:function(e,t,i){"use strict";(function(e,a){i.d(t,"a",(function(){return n}));var n=function(t){t.tooltip({content:function(){return e(this).prop("title")},tooltipClass:"edd-ui-tooltip",position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}})};a(document).ready((function(e){n(e(".edd-help-tip"))}))}).call(this,i(1),i(1))},182:function(e,t,i){"use strict";i.r(t),function(e,t){var a=i(5),n=i(14),d=(i(183),{init:function(){this.add(),this.move(),this.remove(),this.type(),this.prices(),this.files(),this.updatePrices(),this.showAdvanced()},clone_repeatable:function(t){var i,a=1;t.parent().find(".edd_repeatable_row").each((function(){var t=e(this).data("key");parseInt(t)>a&&(a=t)})),i=a+=1;var d=t.clone();return d.removeClass("edd_add_blank"),d.attr("data-key",i),d.find("input, select, textarea").val("").each((function(){var t=e(this),a=t.attr("name"),n=t.attr("id");a&&(a=a.replace(/\[(\d+)\]/,"["+parseInt(i)+"]"),t.attr("name",a)),t.attr("data-key",i),void 0!==n&&(n=n.replace(/(\d+)/,parseInt(i)),t.attr("id",n))})),d.find("select").each((function(){e(this).val(t.find('select[name="'+e(this).attr("name")+'"]').val())})),d.find('input[type="checkbox"]').each((function(){e(this).is(":checked")&&e(this).prop("checked",!1),e(this).val(1)})),d.find("span.edd_price_id").each((function(){e(this).text(parseInt(i))})),d.find("input.edd_repeatable_index").each((function(){e(this).val(parseInt(e(this).data("key")))})),d.find("span.edd_file_id").each((function(){e(this).text(parseInt(i))})),d.find(".edd_repeatable_default_input").each((function(){e(this).val(parseInt(i)).removeAttr("checked")})),d.find(".edd_repeatable_condition_field").each((function(){e(this).find("option:eq(0)").prop("selected","selected")})),d.find("label").each((function(){var t=e(this).attr("for");t&&e(this).attr("for",t.replace(/(\d+)/,parseInt(i)))})),d.find(".search-choice").remove(),d.find(".chosen-container").remove(),Object(n.a)(d.find(".edd-help-tip")),d},add:function(){e(document.body).on("click",".edd_add_repeatable",(function(t){t.preventDefault();var i=e(this).closest(".edd_repeatable_table").find(".edd_repeatable_row").last(),n=d.clone_repeatable(i);n.insertAfter(i).find("input, textarea, select").filter(":visible").eq(0).focus(),n.find(".edd-select-chosen").each((function(){var t=e(this);t.chosen(Object(a.a)(t))})),n.find(".edd-select-chosen").css("width","100%"),n.find(".edd-select-chosen .chosen-search input").attr("placeholder",edd_vars.search_placeholder)}))},move:function(){e(".edd_repeatable_table .edd-repeatables-wrap").sortable({axis:"y",handle:".edd-draghandle-anchor",items:".edd_repeatable_row",cursor:"move",tolerance:"pointer",containment:"parent",distance:2,opacity:.7,scroll:!0,update:function(){var t=0;e(this).find(".edd_repeatable_row").each((function(){e(this).find("input.edd_repeatable_index").each((function(){e(this).val(t)})),t++}))},start:function(e,t){t.placeholder.height(t.item.height()-2)}})},remove:function(){e(document.body).on("click",".edd-remove-row, .edd_remove_repeatable",(function(t){t.preventDefault();var i,a=e(this).parents(".edd_repea