2 lines
4.8 KiB
JavaScript
2 lines
4.8 KiB
JavaScript
"use strict";!function(n,t,i,r,o){n(t).on("load",function(){var t=0,e=n("#wf_str_replace tbody");function a(t){var e=t.closest("tr").find(".woo_feed_dynamic_attr_condition_value");"between"===t.val()?e.attr("placeholder","Ex: 10,20"):e.attr("placeholder","")}n(i).on("change","#custom2_attribute",function(t){n("#custom2_attribute_value").val("{".concat(n(this).val().trim(),"}"))}).on("change","#is_variations",function(t){var e=n(this).val();"both"===e||"n"===e?n(".WFVariablePriceTR").show():n(".WFVariablePriceTR").hide()}).on("change","#wpf_ptitle",function(){var t=n(this)[0].selectize,e=n("textarea[name='ptitle_show']"),a=e.val().trim().split("|");a.push(n(this).val()),e.val(a.filter(function(t){return""!==t}).join("|")),t.clear(!0),t.refreshOptions(!1)}).on("click","#wf_new_str_replace",function(){0===t?t=e.find("tr").length:t++,e.append(n("#wf_str_replace_template").text().trim().replace(/__idx__/g,t))}).on("click",".wf-add-row",function(t){t.preventDefault();var t=n(this),e=parseInt(t.data("idx")||0)+1,a=(/^</.test(t.data("template"))?t.data("template"):n(t.data("template")).text()).trim();n(t.data("target")).append(a.trim().replace(/__idx__/g,e)),r.helper.selectize(),t.data("idx",e)}).on("submit","#attribute-mapping-form",function(t){if(!n(this).find('[name^="value["]').length)return alert(o.form.one_item_required),!1}).on("click","#wf_newFilter",function(){n("#table-advanced-filter tbody tr:eq(0)").show().clone().find("input").val("").end().find("select").val("").end().insertAfter("#table-advanced-filter tbody tr:last"),n(".fsrow:gt(2)").prop("disabled",!1),n(".wf_concat_advance:last").prop("value","OR"),n(".daRow:eq(0)").hide()}).on("click","#wf_newCon",function(){n("#table-1 tbody tr:first").show().clone().find("input").val("").end().insertAfter("#table-1 tbody tr:last"),n(".fsrow:gt(7)").prop("disabled",!1),n(".daRow:eq(0)").hide(),n("#table-1 tbody tr:last td select.woo_feed_dynamic_attr_condition_select").change(function(){a(n(this))})}).on("change keyup",".treegrid-parent",function(){var t=n(this).val(),e=n(this).attr("data-cat_id");n(".treegrid-parent-"+e).val(t)}),n(".woo_feed_dynamic_attr_condition_select").change(function(){a(n(this))}),0<n("#attribute-mapping-form").length&&r.helper.sortable()}),n(i).on("feedEditor.init",function(){r.helper.fancySelect(n("#wf_product_post_status, .filter_mode"),{maxItemShow:2})}).one("click",'label[for="wf-tab-content-filter"]',function(t){var e={action:"woo_feed_filter_count",nonce:wpf_ajax_obj.ajax.nonce};n.ajax({method:"GET",url:wpf_ajax_obj.wpf_ajax_url,data:e,success:function(t){var e;t.data.backorder&&(e=1===t.data.backorder?"product is":"products are",n("#wf-tab-content-filter table tr:nth-of-type(1)").find(".help").after('<div class="counter"><span class="dashicons dashicons-info-outline" aria-hidden="true"></span>'+t.data.backorder+" "+e+" on backorder.</div>")),t.data.outOfStock&&(e=1===t.data.outOfStock?"product is":"products are",n("#wf-tab-content-filter table tr:nth-of-type(2)").find(".help").after('<div class="counter"><span class="dashicons dashicons-info-outline" aria-hidden="true"></span>'+t.data.outOfStock+" "+e+" out of stock.</div>")),t.data.hidden&&(e=1===t.data.hidden?"product is":"products are",n("#wf-tab-content-filter table tr:nth-of-type(3)").find(".help").after('<div class="counter"><span class="dashicons dashicons-info-outline" aria-hidden="true"></span>'+t.data.hidden+" "+e+" hidden.</div>")),t.data.noDesc&&(e=1===t.data.noDesc?"product has":"products are",n("#wf-tab-content-filter table tr:nth-of-type(4)").find(".help").after('<div class="counter"><span class="dashicons dashicons-info-outline" aria-hidden="true"></span>'+t.data.noDesc+" "+e+" no description.</div>")),t.data.noImg&&(e=1===t.data.noImg?"product has":"products have",n("#wf-tab-content-filter table tr:nth-of-type(5)").find(".help").after('<div class="counter"><span class="dashicons dashicons-info-outline" aria-hidden="true"></span>'+t.data.noImg+" "+e+" no image.</div>")),t.data.noPrice&&(e=1===t.data.noPrice?"product has":"products have",n("#wf-tab-content-filter table tr:nth-of-type(6)").find(".help").after('<div class="counter"><span class="dashicons dashicons-info-outline" aria-hidden="true"></span>'+t.data.noPrice+" "+e+" no price.</div>"))}})}),n(i).ready(function(){var t;0<n("#feedCurrency").length&&n("#feedCurrency").on("change",function(){n(".wf_attr.wf_attributes").each(function(t,e){var a=n("#feedCurrency").val(),e=n(e).val();-1!==n.inArray(e,["price","current_price","sale_price","price_with_tax","current_price_with_tax","sale_price_with_tax"])&&n('input[name^="suffix"]').eq(parseInt(t)).val(" "+a)})}),0<n("#editor").length&&(t=i.getElementById("editor"),CodeMirror.fromTextArea(t,{lineNumbers:!0,mode:"xml",matchBrackets:!0}).setSize(null,620))})}(jQuery,window,document,wf,(wp.ajax,wpf_ajax_obj));
|
|
//# sourceMappingURL=woo-feed-admin-pro.min.js.map
|