2018-05-30 13:35:32 +00:00
|
|
|
!function(e,t){e(function(){if(void 0!==t){var i=e(".edit-php.post-type-product"),o=i.find(".page-title-action:first");0===i.find(".woocommerce-BlankState").length?(t.urls.export_products&&o.after('<a href="'+t.urls.export_products+'" class="page-title-action">'+t.strings.export_products+"</a>"),t.urls.import_products&&o.after('<a href="'+t.urls.import_products+'" class="page-title-action">'+t.strings.import_products+"</a>")):o.hide(),e(".woocommerce-progress-form-wrapper .button-next").on("click",function(){return e(".wc-progress-form-content").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),!0}),e(document.body).on("wc_add_error_tip",function(i,o,n){var r=o.position();0===o.parent().find(".wc_error_tip").length&&(o.after('<div class="wc_error_tip '+n+'">'+t[n]+"</div>"),o.parent().find(".wc_error_tip").css("left",r.left+o.width()-o.width()/2-e(".wc_error_tip").width()/2).css("top",r.top+o.height()).fadeIn("100"))}).on("wc_remove_error_tip",function(t,i,o){i.parent().find(".wc_error_tip."+o).fadeOut("100",function(){e(this).remove()})}).on("click",function(){e(".wc_error_tip").fadeOut("100",function(){e(this).remove()})}).on("blur",".wc_input_decimal[type=text], .wc_input_price[type=text], .wc_input_country_iso[type=text]",function(){e(".wc_error_tip").fadeOut("100",function(){e(this).remove()})}).on("change",".wc_input_price[type=text], .wc_input_decimal[type=text], .wc-order-totals #refund_amount[type=text]",function(){var i;i=e(this).is(".wc_input_price")||e(this).is("#refund_amount")?new RegExp("[^-0-9%\\"+t.mon_decimal_point+"]+","gi"):new RegExp("[^-0-9%\\"+t.decimal_point+"]+","gi");var o=e(this).val(),n=o.replace(i,"");o!==n&&e(this).val(n)}).on("keyup",".wc_input_price[type=text], .wc_input_decimal[type=text], .wc_input_country_iso[type=text], .wc-order-totals #refund_amount[type=text]",function(){var i,o;e(this).is(".wc_input_price")||e(this).is("#refund_amount")?(i=new RegExp("[^-0-9%\\"+t.mon_decimal_point+"]+","gi"),o="i18n_mon_decimal_error"):e(this).is(".wc_input_country_iso")?(i=new RegExp("([^A-Z])+|(.){3,}","im"),o="i18n_country_iso_error"):(i=new RegExp("[^-0-9%\\"+t.decimal_point+"]+","gi"),o="i18n_decimal_error");var n=e(this).val();n!==n.replace(i,"")?e(document.body).triggerHandler("wc_add_error_tip",[e(this),o]):e(document.body).triggerHandler("wc_remove_error_tip",[e(this),o])}).on("change","#_sale_price.wc_input_price[type=text], .wc_input_price[name^=variable_sale_price]",function(){var i,o=e(this);i=-1!==o.attr("name").indexOf("variable")?o.parents(".variable_pricing").find(".wc_input_price[name^=variable_regular_price]"):e("#_regular_price"),parseFloat(window.accounting.unformat(o.val(),t.mon_decimal_point))>=parseFloat(window.accounting.unformat(i.val(),t.mon_decimal_point))&&e(this).val("")}).on("keyup","#_sale_price.wc_input_price[type=text], .wc_input_price[name^=variable_sale_price]",function(){var i,o=e(this);i=-1!==o.attr("name").indexOf("variable")?o.parents(".variable_pricing").find(".wc_input_price[name^=variable_regular_price]"):e("#_regular_price"),parseFloat(window.accounting.unformat(o.val(),t.mon_decimal_point))>=parseFloat(window.accounting.unformat(i.val(),t.mon_decimal_point))?e(document.body).triggerHandler("wc_add_error_tip",[e(this),"i18_sale_less_than_regular_error"]):e(document.body).triggerHandler("wc_remove_error_tip",[e(this),"i18_sale_less_than_regular_error"])}).on("init_tooltips",function(){e(".tips, .help_tip, .woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),e(".column-wc_actions .wc-action-button").tipTip({fadeIn:50,fadeOut:50,delay:200}),e(".parent-tips").each(function(){e(this).closest("a, th").attr("data-tip",e(this).data("tip")).tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}).css("cursor","help")})}),e(document.body).trigger("init_tooltips"),e(".wc_input_table.sortable tbody").sortable({items:"tr",cursor:"move",axis:"y",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(e,t){t.item.css("background-color","#f6f
|