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