diff --git a/assets/js/admin/api-keys.min.js b/assets/js/admin/api-keys.min.js deleted file mode 100644 index 223801308f6..00000000000 --- a/assets/js/admin/api-keys.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(a){new(Backbone.View.extend({el:a("#key-fields"),events:{"click input#update_api_key":"saveKey"},initialize:function(){_.bindAll(this,"saveKey")},block:function(){a(this.el).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){a(this.el).unblock()},initTipTip:function(i){a(document.body).on("click",i,function(e){e.preventDefault(),document.queryCommandSupported("copy")?(a("#copy-error").text(""),wcClearClipboard(),wcSetClipboard(a.trim(a(this).prev("input").val()),a(i))):(a(i).parent().find("input").focus().select(),a("#copy-error").text(woocommerce_admin_api_keys.clipboard_failed))}).on("aftercopy",i,function(){a("#copy-error").text(""),a(i).tipTip({attribute:"data-tip",activation:"focus",fadeIn:50,fadeOut:50,delay:0}).focus()}).on("aftercopyerror",i,function(){a(i).parent().find("input").focus().select(),a("#copy-error").text(woocommerce_admin_api_keys.clipboard_failed)})},createQRCode:function(e,i){a("#keys-qrcode").qrcode({text:e+"|"+i,width:120,height:120})},saveKey:function(e){e.preventDefault();var t=this;t.block(),Backbone.ajax({method:"POST",dataType:"json",url:woocommerce_admin_api_keys.ajax_url,data:{action:"woocommerce_update_api_key",security:woocommerce_admin_api_keys.update_api_nonce,key_id:a("#key_id",t.el).val(),description:a("#key_description",t.el).val(),user:a("#key_user",t.el).val(),permissions:a("#key_permissions",t.el).val()},success:function(e){if(a(".wc-api-message",t.el).remove(),e.success){var i=e.data;if(a("h2, h3",t.el).first().append('

'+i.message+"

"),0

'+e.data.message+"

");t.unblock()}})}}))}(jQuery); \ No newline at end of file diff --git a/assets/js/admin/backbone-modal.min.js b/assets/js/admin/backbone-modal.min.js deleted file mode 100644 index ea8ee3a0e5e..00000000000 --- a/assets/js/admin/backbone-modal.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(o,e,n){"use strict";o.fn.WCBackboneModal=function(e){return this.each(function(){new o.WCBackboneModal(o(this),e)})},o.WCBackboneModal=function(e,t){var n=o.extend({},o.WCBackboneModal.defaultOptions,t);n.template&&new o.WCBackboneModal.View({target:n.template,string:n.variable})},o.WCBackboneModal.defaultOptions={template:"",variable:{}},o.WCBackboneModal.View=e.View.extend({tagName:"div",id:"wc-backbone-modal-dialog",_target:undefined,_string:undefined,events:{"click .modal-close":"closeButton","click #btn-ok":"addButton","touchstart #btn-ok":"addButton",keydown:"keyboardActions"},resizeContent:function(){var e=o(".wc-backbone-modal-content").find("article"),t=.75*o(window).height();e.css({"max-height":t+"px"})},initialize:function(e){var t=this;this._target=e.target,this._string=e.string,n.bindAll(this,"render"),this.render(),o(window).resize(function(){t.resizeContent()})},render:function(){var e=wp.template(this._target);this.$el.append(e(this._string)),o(document.body).css({overflow:"hidden"}).append(this.$el),this.resizeContent(),this.$(".wc-backbone-modal-content").attr("tabindex","0").focus(),o(document.body).trigger("init_tooltips"),o(document.body).trigger("wc_backbone_modal_loaded",this._target)},closeButton:function(e){e.preventDefault(),o(document.body).trigger("wc_backbone_modal_before_remove",this._target),this.undelegateEvents(),o(document).off("focusin"),o(document.body).css({overflow:"auto"}),this.remove(),o(document.body).trigger("wc_backbone_modal_removed",this._target)},addButton:function(e){o(document.body).trigger("wc_backbone_modal_response",[this._target,this.getFormData()]),this.closeButton(e)},getFormData:function(){var n={};return o(document.body).trigger("wc_backbone_modal_before_update",this._target),o.each(o("form",this.$el).serializeArray(),function(e,t){-1!==t.name.indexOf("[]")?(t.name=t.name.replace("[]",""),n[t.name]=o.makeArray(n[t.name]),n[t.name].push(t.value)):n[t.name]=t.value}),n},keyboardActions:function(e){var t=e.keyCode||e.which;13!==t||e.target.tagName&&("input"===e.target.tagName.toLowerCase()||"textarea"===e.target.tagName.toLowerCase())||this.addButton(e),27===t&&this.closeButton(e)}})}(jQuery,Backbone,_); \ No newline at end of file diff --git a/assets/js/admin/marketplace-suggestions.min.js b/assets/js/admin/marketplace-suggestions.min.js deleted file mode 100644 index 1d8723435a0..00000000000 --- a/assets/js/admin/marketplace-suggestions.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(h,v,d){h(function(){if(void 0!==v){window.wcTracks=window.wcTracks||{},window.wcTracks.recordEvent=window.wcTracks.recordEvent||function(){};var l=!1;v.suggestions_data&&(!function t(d){var u=[];h(".marketplace-suggestions-container").each(function(){var s=this.dataset.marketplaceSuggestionsContext,t=function c(t,e){var s=_.filter(t,function(t){return _.isArray(t.context)?_.contains(t.context,e):e===t.context});return s=_.filter(s,function(t){return!_.contains(v.dismissed_suggestions,t.slug)}),s=_.filter(s,function(t){return!_.contains(v.active_plugins,t.product)}),s=_.filter(s,function(t){return!t["show-if-active"]||0<_.intersection(v.active_plugins,t["show-if-active"]).length})}(d,s),n=_.sample(t,5);for(var e in n){var a=n[e]["link-text"],o=!0;n[e]["link-text"]&&(a=n[e]["link-text"],o=!1);var i=!0;!1===n[e]["allow-dismiss"]&&(i=!1);var r=g(s,n[e].product,n[e].promoted,n[e].slug,n[e].icon,n[e].title,n[e].copy,n[e].url,a,o,i);h(this).append(r),h(this).addClass("showing-suggestion"),u.push(s),m(s)||window.wcTracks.recordEvent("marketplace_suggestion_displayed",{suggestion_slug:n[e].slug,context:s,product:n[e].product||"",promoted:n[e].promoted||"",target:n[e].url||""})}h("ul.product_data_tabs li.marketplace-suggestions_options a").click(function(t){if(t.preventDefault(),"#marketplace_suggestions"!==l&&m(s))for(var e in n)window.wcTracks.recordEvent("marketplace_suggestion_displayed",{suggestion_slug:n[e].slug,context:s,product:n[e].product||"",promoted:n[e].promoted||"",target:n[e].url||""})})}),function s(t){var e=0<_.intersection(t,["products-list-empty-body","orders-list-empty-body"]).length;e&&(h("#screen-meta-links").hide(),h("#wpfooter").hide()),e||(h('.marketplace-suggestions-container[data-marketplace-suggestions-context="products-list-empty-header"]').hide(),h('.marketplace-suggestions-container[data-marketplace-suggestions-context="products-list-empty-footer"]').hide(),h('.marketplace-suggestions-container[data-marketplace-suggestions-context="orders-list-empty-header"]').hide(),h('.marketplace-suggestions-container[data-marketplace-suggestions-context="orders-list-empty-footer"]').hide())}(u),p()}(v.suggestions_data),h("ul.product_data_tabs").on("click","li a",function(t){t.preventDefault(),l=h(this).attr("href")})),function e(){h("a.marketplace-suggestion-manage-link").on("click",function(){window.wcTracks.recordEvent("marketplace_suggestions_manage_clicked")})}()}function f(e,s,n,a,o){var t=document.createElement("a");return t.classList.add("suggestion-dismiss"),t.setAttribute("title",v.i18n_marketplace_suggestions_dismiss_tooltip),t.setAttribute("href","#"),t.onclick=function(t){t.preventDefault(),function c(t,e,s,n,a){if(h("[data-suggestion-slug="+a+"]").fadeOut(function(){h(this).remove(),p()}),jQuery.post(d,{action:"woocommerce_add_dismissed_marketplace_suggestion",_wpnonce:v.dismiss_suggestion_nonce,slug:a}),_.contains(["products-list-inline"],t)){var o="woocommerce_snooze_suggestions__"+t;Cookies.set(o,"true",{expires:2});var i="woocommerce_dismissed_suggestions__"+t,r=parseInt(Cookies.get(i),10)||0;Cookies.set(i,r+1,{expires:31})}window.wcTracks.recordEvent("marketplace_suggestion_dismissed",{suggestion_slug:a,context:t,product:e||"",promoted:s||"",target:n||""})}(e,s,n,a,o)},t}function k(t,e,s,n,a,o,i){var r=document.createElement("a"),c=function u(e,t){var s={utm_source:"unknown",utm_campaign:"marketplacesuggestions",utm_medium:"product"},n=_.findKey({productstable:["products-list-inline"],productsempty:["products-list-empty-header","products-list-empty-footer","products-list-empty-body"],ordersempty:["orders-list-empty-header","orders-list-empty-footer","orders-list-empty-body"],editproduct:["product-edit-meta-tab-header","product-edit-meta-tab-footer","product-edit-meta-tab-body"]},function(t){return _.contains(t,e)});return n&&(s.utm_source=n),t+"?"+jQuery.param(s)}(t,a);if(r.setAttribute("href",c),r.setAttribute("target","blank"),r.textContent=o,r.onclick=function(){window.wcTracks.recordEvent("marketplace_suggestion_clicked",{suggestion_slug:n,context:t,product:e||"",promoted:s||"",target:a||""})},i)r.classList.add("button");else{r.classList.add("linkout");var d=document.createElement("span");d.classList.add("dashicons","dashicons-external"),r.appendChild(d)}return r}function g(t,e,s,n,a,o,i,r,c,d,u){var l=document.createElement("div");l.classList.add("marketplace-suggestion-container"),l.dataset.suggestionSlug=n;var g=function p(t){if(!t)return null;var e=document.createElement("img");return e.src=t,e.classList.add("marketplace-suggestion-icon"),e}(a);return g&&l.appendChild(g),l.appendChild(function m(t,e,s){var n=document.createElement("div");if(n.classList.add("marketplace-suggestion-container-content"),e){var a=document.createElement("h4");a.textContent=e,n.appendChild(a)}if(s){var o=document.createElement("p");o.textContent=s,n.appendChild(o)}if(-1!==["product-edit-empty-footer-browse-all","product-edit-meta-tab-footer-browse-all"].indexOf(t)){n.classList.add("has-manage-link");var i=document.createElement("a");i.classList.add("marketplace-suggestion-manage-link","linkout"),i.setAttribute("href",v.manage_suggestions_url),i.textContent=v.i18n_marketplace_suggestions_manage_suggestions,n.appendChild(i)}return n}(n,o,i)),l.appendChild(function _(t,e,s,n,a,o,i,r){var c=document.createElement("div");if(o||(o=v.i18n_marketplace_suggestions_default_cta),c.classList.add("marketplace-suggestion-container-cta"),a&&o){var d=k(t,e,s,n,a,o,i);c.appendChild(d)}return r&&c.appendChild(f(t,e,s,a,n)),c}(t,e,s,n,r,c,d,u)),l}function p(){if(h('.marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-body"]').children().length<=0){', .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-header"]',', .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-footer"]',h('.marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-body"], .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-header"], .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-footer"]').fadeOut({complete:function(){h(".marketplace-suggestions-metabox-nosuggestions-placeholder").fadeIn()}})}}function m(t){return _.includes(["product-edit-meta-tab-header","product-edit-meta-tab-body","product-edit-meta-tab-footer"],t)}})}(jQuery,marketplace_suggestions,ajaxurl); \ No newline at end of file diff --git a/assets/js/admin/meta-boxes-coupon.min.js b/assets/js/admin/meta-boxes-coupon.min.js deleted file mode 100644 index 45c63da786e..00000000000 --- a/assets/js/admin/meta-boxes-coupon.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(function(i){({init:function(){i("select#discount_type").on("change",this.type_options).change()},type_options:function(){"fixed_cart"!==i(this).val()?i(".limit_usage_to_x_items_field").show():i(".limit_usage_to_x_items_field").hide()}}).init()}); \ No newline at end of file diff --git a/assets/js/admin/meta-boxes-order.min.js b/assets/js/admin/meta-boxes-order.min.js deleted file mode 100644 index 33661865163..00000000000 --- a/assets/js/admin/meta-boxes-order.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(function(u){var p={states:null,init:function(){"undefined"!=typeof woocommerce_admin_meta_boxes_order&&"undefined"!=typeof woocommerce_admin_meta_boxes_order.countries&&(this.states=u.parseJSON(woocommerce_admin_meta_boxes_order.countries.replace(/"/g,'"'))),u(".js_field-country").selectWoo().change(this.change_country),u(".js_field-country").trigger("change",[!0]),u(document.body).on("change","select.js_field-state",this.change_state),u("#woocommerce-order-actions input, #woocommerce-order-actions a").click(function(){window.onbeforeunload=""}),u("a.edit_address").click(this.edit_address),u("a.billing-same-as-shipping").on("click",this.copy_billing_to_shipping),u("a.load_customer_billing").on("click",this.load_billing),u("a.load_customer_shipping").on("click",this.load_shipping),u("#customer_user").on("change",this.change_customer_user)},change_country:function(e,o){if(void 0===o&&(o=!1),null!==p.states){var t,a=u(this),i=a.val(),n=a.parents("div.edit_address").find(":input.js_field-state"),r=n.parent(),c=n.attr("name"),d=n.attr("id"),m=a.data("woocommerce.stickState-"+i)?a.data("woocommerce.stickState-"+i):n.val(),_=n.attr("placeholder");if(o&&a.data("woocommerce.stickState-"+i,m),r.show().find(".select2-container").remove(),u.isEmptyObject(p.states[i]))t=u('').prop("id",d).prop("name",c).prop("placeholder",_).addClass("js_field-state").val(m),n.replaceWith(t);else{var s=p.states[i],l=u('').text(woocommerce_admin_meta_boxes_order.i18n_select_state_text);t=u("").prop("id",d).prop("name",c).prop("placeholder",_).addClass("js_field-state select short").append(l),u.each(s,function(e){var o=u("").prop("value",e).text(s[e]);t.append(o)}),t.val(m),n.replaceWith(t),t.show().selectWoo().hide().change()}u(document.body).trigger("contry-change.woocommerce",[i,u(this).closest("div")]),u(document.body).trigger("country-change.woocommerce",[i,u(this).closest("div")])}},change_state:function(){var e=u(this),o=e.val(),t=e.parents("div.edit_address").find(":input.js_field-country"),a=t.val();t.data("woocommerce.stickState-"+a,o)},init_tiptip:function(){u("#tiptip_holder").removeAttr("style"),u("#tiptip_arrow").removeAttr("style"),u(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200})},edit_address:function(e){e.preventDefault();var o=u(this),t=o.closest(".order_data_column"),a=t.find("div.edit_address"),i=t.find("div.address"),n=a.find(".js_field-country"),r=a.find(".js_field-state");i.hide(),o.parent().find("a").toggle(),n.val()||(n.val(woocommerce_admin_meta_boxes_order.default_country).change(),r.val(woocommerce_admin_meta_boxes_order.default_state).change()),a.show()},change_customer_user:function(){u("#_billing_country").val()||(u("a.edit_address").click(),p.load_billing(!0),p.load_shipping(!0))},load_billing:function(e){if(!0===e||window.confirm(woocommerce_admin_meta_boxes.load_billing)){var o=u("#customer_user").val();if(!o)return window.alert(woocommerce_admin_meta_boxes.no_customer_selected),!1;var t={user_id:o,action:"woocommerce_get_customer_details",security:woocommerce_admin_meta_boxes.get_customer_details_nonce};u(this).closest("div.edit_address").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),u.ajax({url:woocommerce_admin_meta_boxes.ajax_url,data:t,type:"POST",success:function(e){e&&e.billing&&u.each(e.billing,function(e,o){u(":input#_billing_"+e).val(o).change()}),u("div.edit_address").unblock()}})}return!1},load_shipping:function(e){if(!0===e||window.confirm(woocommerce_admin_meta_boxes.load_shipping)){var o=u("#customer_user").val();if(!o)return window.alert(woocommerce_admin_meta_boxes.no_customer_selected),!1;var t={user_id:o,action:"woocommerce_get_customer_details",security:woocommerce_admin_meta_boxes.get_customer_details_nonce};u(this).closest("div.edit_address").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),u.ajax({url:woocommerce_admin_meta_boxes.ajax_url,data:t,type:"POST",success:function(e){e&&e.billing&&u.each(e.shipping,function(e,o){u(":input#_shipping_"+e).val(o).change()}),u("div.edit_address").unblock()}})}return!1},copy_billing_to_shipping:function(){return window.confirm(woocommerce_admin_meta_boxes.copy_billing)&&u('.order_data_column :input[name^="_billing_"]').each(function(){var e=u(this).attr("name");e=e.replace("_billing_","_shipping_"),u(":input#"+e).val(u(this).val()).change()}),!1}},c={init:function(){this.stupidtable.init(),u("#woocommerce-order-items").on("click","button.add-line-item",this.add_line_item).on("click","button.add-coupon",this.add_coupon).on("click","a.remove-coupon",this.remove_coupon).on("click","button.refund-items",this.refund_items).on("click",".cancel-action",this.cancel).on("click","button.add-order-item",this.add_item).on("click","button.add-order-fee",this.add_fee).on("click","button.add-order-shipping",this.add_shipping).on("click","button.add-order-tax",this.add_tax).on("click","button.save-action",this.save_line_items).on("click","a.delete-order-tax",this.delete_tax).on("click","button.calculate-action",this.recalculate).on("click","a.edit-order-item",this.edit_item).on("click","a.delete-order-item",this.delete_item).on("click",".delete_refund",this.refunds.delete_refund).on("click","button.do-api-refund, button.do-manual-refund",this.refunds.do_refund).on("change",".refund input.refund_line_total, .refund input.refund_line_tax",this.refunds.input_changed).on("change keyup",".wc-order-refund-items #refund_amount",this.refunds.amount_changed).on("change","input.refund_order_item_qty",this.refunds.refund_quantity_changed).on("change","input.quantity",this.quantity_changed).on("keyup change",".split-input :input",function(){var e=u(this).parent().prev().find(":input");e&&(""===e.val()||e.is(".match-total"))&&e.val(u(this).val()).addClass("match-total")}).on("keyup",".split-input :input",function(){u(this).removeClass("match-total")}).on("click","button.add_order_item_meta",this.item_meta.add).on("click","button.remove_order_item_meta",this.item_meta.remove).on("wc_order_items_reload",this.reload_items).on("wc_order_items_reloaded",this.reloaded_items),u(document.body).on("wc_backbone_modal_loaded",this.backbone.init).on("wc_backbone_modal_response",this.backbone.response)},block:function(){u("#woocommerce-order-items").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){u("#woocommerce-order-items").unblock()},reload_items:function(){var e={order_id:woocommerce_admin_meta_boxes.post_id,action:"woocommerce_load_order_items",security:woocommerce_admin_meta_boxes.order_item_nonce};c.block(),u.ajax({url:woocommerce_admin_meta_boxes.ajax_url,data:e,type:"POST",success:function(e){u("#woocommerce-order-items").find(".inside").empty(),u("#woocommerce-order-items").find(".inside").append(e),c.reloaded_items(),c.unblock()}})},reloaded_items:function(){p.init_tiptip(),c.stupidtable.init()},quantity_changed:function(){var n=u(this).closest("tr.item"),r=u(this).val(),c=u(this).attr("data-qty"),e=u("input.line_total",n),o=u("input.line_subtotal",n),t=accounting.unformat(e.attr("data-total"),woocommerce_admin.mon_decimal_point)/c;e.val(parseFloat(accounting.formatNumber(t*r,woocommerce_admin_meta_boxes.rounding_precision,"")).toString().replace(".",woocommerce_admin.mon_decimal_point));var a=accounting.unformat(o.attr("data-subtotal"),woocommerce_admin.mon_decimal_point)/c;o.val(parseFloat(accounting.formatNumber(a*r,woocommerce_admin_meta_boxes.rounding_precision,"")).toString().replace(".",woocommerce_admin.mon_decimal_point)),u("input.line_tax",n).each(function(){var e=u(this),o=e.data("tax_id"),t=accounting.unformat(e.attr("data-total_tax"),woocommerce_admin.mon_decimal_point)/c,a=u('input.line_subtotal_tax[data-tax_id="'+o+'"]',n),i=accounting.unformat(a.attr("data-subtotal_tax"),woocommerce_admin.mon_decimal_point)/c;0';return o.append(a),!1},remove:function(){if(window.confirm(woocommerce_admin_meta_boxes.remove_item_meta)){var e=u(this).closest("tr");e.find(":input").val(""),e.hide()}return!1}},backbone:{init:function(e,o){"wc-modal-add-products"===o&&(u(document.body).trigger("wc-enhanced-select-init"),u(this).on("change",".wc-product-search",function(){if(u(this).closest("tr").is(":last-child")){var e=u(this).closest("table.widefat").find("tbody"),o=e.find("tr").length,t=e.data("row").replace(/\[0\]/g,"["+o+"]");e.append(""+t+""),u(document.body).trigger("wc-enhanced-select-init")}}))},response:function(e,o,t){if("wc-modal-add-tax"===o){var a=t.add_order_tax,i="";t.manual_tax_rate_id&&(i=t.manual_tax_rate_id),c.backbone.add_tax(a,i)}if("wc-modal-add-products"===o){var n=u(this).find("table.widefat").find("tbody").find("tr"),r=[];return u(n).each(function(){var e=u(this).find(':input[name="item_id"]').val(),o=u(this).find(':input[name="item_qty"]').val();r.push({id:e,qty:o||1})}),c.backbone.add_items(r)}},add_items:function(e){c.block();var o={action:"woocommerce_add_order_item",order_id:woocommerce_admin_meta_boxes.post_id,security:woocommerce_admin_meta_boxes.order_item_nonce,data:e};"true"===u("button.cancel-action").attr("data-reload")&&(o.items=u("table.woocommerce_order_items :input[name], .wc-order-totals-items :input[name]").serialize()),u.ajax({type:"POST",url:woocommerce_admin_meta_boxes.ajax_url,data:o,success:function(e){e.success?(u("#woocommerce-order-items").find(".inside").empty(),u("#woocommerce-order-items").find(".inside").append(e.data.html),e.data.notes_html&&(u("ul.order_notes").empty(),u("ul.order_notes").append(u(e.data.notes_html).find("li"))),c.reloaded_items(),c.unblock()):(c.unblock(),window.alert(e.data.error))},dataType:"json"})},add_tax:function(e,o){if(o&&(e=o),!e)return!1;var t=u(".order-tax-id").map(function(){return u(this).val()}).get();if(-1===u.inArray(e,t)){c.block();var a={action:"woocommerce_add_order_tax",rate_id:e,order_id:woocommerce_admin_meta_boxes.post_id,security:woocommerce_admin_meta_boxes.order_item_nonce};u.ajax({url:woocommerce_admin_meta_boxes.ajax_url,data:a,dataType:"json",type:"POST",success:function(e){e.success?(u("#woocommerce-order-items").find(".inside").empty(),u("#woocommerce-order-items").find(".inside").append(e.data.html),c.reloaded_items()):window.alert(e.data.error),c.unblock()}})}else window.alert(woocommerce_admin_meta_boxes.i18n_tax_rate_already_exists)}},stupidtable:{init:function(){u(".woocommerce_order_items").stupidtable(),u(".woocommerce_order_items").on("aftertablesort",this.add_arrows)},add_arrows:function(e,o){var t=u(this).find("th"),a="asc"===o.direction?"↑":"↓",i=o.column;t.find(".wc-arrow").remove(),t.eq(i).append(''+a+"")}}},e={init:function(){u("#woocommerce-order-notes").on("click","button.add_note",this.add_order_note).on("click","a.delete_note",this.delete_order_note)},add_order_note:function(){if(u("textarea#add_order_note").val()){u("#woocommerce-order-notes").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var e={action:"woocommerce_add_order_note",post_id:woocommerce_admin_meta_boxes.post_id,note:u("textarea#add_order_note").val(),note_type:u("select#order_note_type").val(),security:woocommerce_admin_meta_boxes.add_order_note_nonce};return u.post(woocommerce_admin_meta_boxes.ajax_url,e,function(e){u("ul.order_notes").prepend(e),u("#woocommerce-order-notes").unblock(),u("#add_order_note").val("")}),!1}},delete_order_note:function(){if(window.confirm(woocommerce_admin_meta_boxes.i18n_delete_note)){var e=u(this).closest("li.note");u(e).block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var o={action:"woocommerce_delete_order_note",note_id:u(e).attr("rel"),security:woocommerce_admin_meta_boxes.delete_order_note_nonce};u.post(woocommerce_admin_meta_boxes.ajax_url,o,function(){u(e).remove()})}return!1}},o={init:function(){u(".order_download_permissions").on("click","button.grant_access",this.grant_access).on("click","button.revoke_access",this.revoke_access).on("click","#copy-download-link",this.copy_link).on("aftercopy","#copy-download-link",this.copy_success).on("aftercopyfailure","#copy-download-link",this.copy_fail)},grant_access:function(){var e=u("#grant_access_id").val();if(e){u(".order_download_permissions").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var o={action:"woocommerce_grant_access_to_download",product_ids:e,loop:u(".order_download_permissions .wc-metabox").length,order_id:woocommerce_admin_meta_boxes.post_id,security:woocommerce_admin_meta_boxes.grant_access_nonce};return u.post(woocommerce_admin_meta_boxes.ajax_url,o,function(e){e?u(".order_download_permissions .wc-metaboxes").append(e):window.alert(woocommerce_admin_meta_boxes.i18n_download_permission_fail),u(document.body).trigger("wc-init-datepickers"),u("#grant_access_id").val("").change(),u(".order_download_permissions").unblock()}),!1}},revoke_access:function(){if(window.confirm(woocommerce_admin_meta_boxes.i18n_permission_revoke)){var e=u(this).parent().parent(),o=u(this).attr("rel").split(",")[0],t=u(this).attr("rel").split(",")[1],a=u(this).data("permission_id");if(0').submit():a.append('').submit()},cancel_variations:function(){var a=parseInt(d("#variable_product_options").find(".woocommerce_variations").attr("data-page"),10);return d("#variable_product_options").find(".woocommerce_variations .variation-needs-update").removeClass("variation-needs-update"),d(".variations-defaults select").each(function(){d(this).val(d(this).attr("data-current"))}),m.go_to_page(a),!1},add_variation:function(){n.block();var a={action:"woocommerce_add_variation",post_id:woocommerce_admin_meta_boxes_variations.post_id,loop:d(".woocommerce_variation").length,security:woocommerce_admin_meta_boxes_variations.add_variation_nonce};return d.post(woocommerce_admin_meta_boxes_variations.ajax_url,a,function(a){var e=d(a);e.addClass("variation-needs-update"),d("#variable_product_options").find(".woocommerce_variations").prepend(e),d("button.cancel-variation-changes, button.save-variation-changes").removeAttr("disabled"),d("#variable_product_options").trigger("woocommerce_variations_added",1),n.unblock()}),!1},remove_variation:function(){if(n.check_for_changes(),window.confirm(woocommerce_admin_meta_boxes_variations.i18n_remove_variation)){var a=d(this).attr("rel"),e=[],i={action:"woocommerce_remove_variations"};n.block(),0'+c+"";d(".page-selector",n).empty().html(s),0===i?(o.not(".toolbar-top, .toolbar-buttons").hide(),n.hide(),d("option, optgroup",t).hide(),d(".variation_actions").val("add_variation"),d('option[data-global="true"]',t).show()):(o.show(),n.show(),d("option, optgroup",t).show(),d(".variation_actions").val("add_variation"),1===_?r.hide():r.show())},check_is_enabled:function(a){return!d(a).hasClass("disabled")},change_classes:function(a,e){var i=d(".variations-pagenav .first-page"),o=d(".variations-pagenav .prev-page"),t=d(".variations-pagenav .next-page"),n=d(".variations-pagenav .last-page");1===a?(i.addClass("disabled"),o.addClass("disabled")):(i.removeClass("disabled"),o.removeClass("disabled")),e===a?(t.addClass("disabled"),n.addClass("disabled")):(t.removeClass("disabled"),n.removeClass("disabled"))},set_page:function(a){d(".variations-pagenav .page-selector").val(a).first().change()},go_to_page:function(a,e){a=a||1,e=e||0,m.set_paginav(e),m.set_page(a)},page_selector:function(){var a=parseInt(d(this).val(),10),e=d("#variable_product_options").find(".woocommerce_variations");d(".variations-pagenav .page-selector").val(a),n.check_for_changes(),m.change_classes(a,parseInt(e.attr("data-total_pages"),10)),n.load_variations(a)},first_page:function(){return m.check_is_enabled(this)&&m.set_page(1),!1},prev_page:function(){if(m.check_is_enabled(this)){var a=d("#variable_product_options").find(".woocommerce_variations"),e=parseInt(a.attr("data-page"),10)-1,i=0 ul.categorychecklist').each(function(){var t=n(this),e=t.find(":checked").first();if(e.length){var i=t.find("input").position().top,o=e.position().top;t.closest(".tabs-panel").scrollTop(o-i+5)}})}),n("#upsell_product_data").bind("keypress",function(t){if(13===t.keyCode)return!1}),n(".type_box").appendTo("#woocommerce-product-data .hndle span"),n(function(){n("#woocommerce-product-data").find(".hndle").unbind("click.postboxes"),n("#woocommerce-product-data").on("click",".hndle",function(t){n(t.target).filter("input, option, label, select").length||n("#woocommerce-product-data").toggleClass("closed")})}),n("#catalog-visibility").find(".edit-catalog-visibility").click(function(){return n("#catalog-visibility-select").is(":hidden")&&(n("#catalog-visibility-select").slideDown("fast"),n(this).hide()),!1}),n("#catalog-visibility").find(".save-post-visibility").click(function(){n("#catalog-visibility-select").slideUp("fast"),n("#catalog-visibility").find(".edit-catalog-visibility").show();var t=n("input[name=_visibility]:checked").attr("data-label");return n("input[name=_featured]").is(":checked")&&(t=t+", "+woocommerce_admin_meta_boxes.featured_label,n("input[name=_featured]").attr("checked","checked")),n("#catalog-visibility-display").text(t),!1}),n("#catalog-visibility").find(".cancel-post-visibility").click(function(){n("#catalog-visibility-select").slideUp("fast"),n("#catalog-visibility").find(".edit-catalog-visibility").show();var t=n("#current_visibility").val(),e=n("#current_featured").val();n("input[name=_visibility]").removeAttr("checked"),n("input[name=_visibility][value="+t+"]").attr("checked","checked");var i=n("input[name=_visibility]:checked").attr("data-label");return"yes"===e?(i=i+", "+woocommerce_admin_meta_boxes.featured_label,n("input[name=_featured]").attr("checked","checked")):n("input[name=_featured]").removeAttr("checked"),n("#catalog-visibility-display").text(i),!1}),n("select#product-type").change(function(){var t=n(this).val();"variable"===t?(n("input#_manage_stock").change(),n("input#_downloadable").prop("checked",!1),n("input#_virtual").removeAttr("checked")):"grouped"===t?(n("input#_downloadable").prop("checked",!1),n("input#_virtual").removeAttr("checked")):"external"===t&&(n("input#_downloadable").prop("checked",!1),n("input#_virtual").removeAttr("checked")),i(),n("ul.wc-tabs li:visible").eq(0).find("a").click(),n(document.body).trigger("woocommerce-product-type-change",t,n(this))}).change(),n("input#_downloadable, input#_virtual").change(function(){i()}),n(".sale_price_dates_fields").each(function(){var t=n(this),e=!1,i=t.closest("div, table");t.find("input").each(function(){""!==n(this).val()&&(e=!0)}),e?(i.find(".sale_schedule").hide(),i.find(".sale_price_dates_fields").show()):(i.find(".sale_schedule").show(),i.find(".sale_price_dates_fields").hide())}),n("#woocommerce-product-data").on("click",".sale_schedule",function(){var t=n(this).closest("div, table");return n(this).hide(),t.find(".cancel_sale_schedule").show(),t.find(".sale_price_dates_fields").show(),!1}),n("#woocommerce-product-data").on("click",".cancel_sale_schedule",function(){var t=n(this).closest("div, table");return n(this).hide(),t.find(".sale_schedule").show(),t.find(".sale_price_dates_fields").hide(),t.find(".sale_price_dates_fields").find("input").val(""),!1}),n("#woocommerce-product-data").on("click",".downloadable_files a.insert",function(){return n(this).closest(".downloadable_files").find("tbody").append(n(this).data("row")),!1}),n("#woocommerce-product-data").on("click",".downloadable_files a.delete",function(){return n(this).closest("tr").remove(),!1}),n("input#_manage_stock").change(function(){if(n(this).is(":checked"))n("div.stock_fields").show(),n("p.stock_status_field").hide();else{var t=n("select#product-type").val();n("div.stock_fields").hide(),n("p.stock_status_field:not( .hide_if_"+t+" )").show()}n("input.variable_manage_stock").change()}).change(),n(".sale_price_dates_fields").each(function(){n(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,onSelect:function(){t(n(this))}}),n(this).find("input").each(function(){t(n(this))})});var o,a,e,c=n(".product_attributes").find(".woocommerce_attribute").get();function r(){n(".product_attributes .woocommerce_attribute").each(function(t,e){n(".attribute_position",e).val(parseInt(n(e).index(".product_attributes .woocommerce_attribute"),10))})}c.sort(function(t,e){var i=parseInt(n(t).attr("rel"),10),o=parseInt(n(e).attr("rel"),10);return i'+t.name+""),e.find("select.attribute_values").change()),n(".product_attributes").unblock()})}else n(".product_attributes").unblock();return!1}),n(".save_attributes").on("click",function(){n(".product_attributes").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var t=n(".product_attributes").find("input, select, textarea"),e={post_id:woocommerce_admin_meta_boxes.post_id,product_type:n("#product-type").val(),data:t.serialize(),action:"woocommerce_save_attributes",security:woocommerce_admin_meta_boxes.save_attributes_nonce};n.post(woocommerce_admin_meta_boxes.ajax_url,e,function(t){if(t.error)window.alert(t.error);else if(t.data){n(".product_attributes").html(t.data.html),n(".product_attributes").unblock(),i(),n("select.attribute_taxonomy").find("option").prop("disabled",!1),n(".product_attributes .woocommerce_attribute").each(function(t,e){"none"!==n(e).css("display")&&n(e).is(".taxonomy")&&n("select.attribute_taxonomy").find('option[value="'+n(e).data("taxonomy")+'"]').prop("disabled",!0)});var e=window.location.toString();e=e.replace("post-new.php?","post.php?post="+woocommerce_admin_meta_boxes.post_id+"&action=edit&"),n("#variable_product_options").load(e+" #variable_product_options_inner",function(){n("#variable_product_options").trigger("reload")})}})}),n(document.body).on("click",".upload_file_button",function(t){var e=n(this);if(a=e.closest("tr").find("td.file_url input"),t.preventDefault(),o)o.open();else{var i=[new wp.media.controller.Library({library:wp.media.query(),multiple:!0,title:e.data("choose"),priority:20,filterable:"uploaded"})];(o=wp.media.frames.downloadable_file=wp.media({title:e.data("choose"),library:{type:""},button:{text:e.data("update")},multiple:!0,states:i})).on("select",function(){var e="";o.state().get("selection").map(function(t){(t=t.toJSON()).url&&(e=t.url)}),a.val(e).change()}),o.on("ready",function(){o.uploader.options.uploader.params={type:"downloadable_product"}}),o.open()}}),n(".downloadable_files tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65});var l=n("#product_image_gallery"),s=n("#product_images_container").find("ul.product_images");n(".add_product_images").on("click","a",function(t){var o=n(this);t.preventDefault(),e||(e=wp.media.frames.product_gallery=wp.media({title:o.data("choose"),button:{text:o.data("update")},states:[new wp.media.controller.Library({title:o.data("choose"),filterable:"all",multiple:!0})]})).on("select",function(){var t=e.state().get("selection"),i=l.val();t.map(function(t){if((t=t.toJSON()).id){i=i?i+","+t.id:t.id;var e=t.sizes&&t.sizes.thumbnail?t.sizes.thumbnail.url:t.url;s.append('
  • ")}}),l.val(i)}),e.open()}),s.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(t,e){e.item.css("background-color","#f6f6f6")},stop:function(t,e){e.item.removeAttr("style")},update:function(){var e="";n("#product_images_container").find("ul li.image").css("cursor","default").each(function(){var t=n(this).attr("data-attachment_id");e=e+t+","}),l.val(e)}}),n("#product_images_container").on("click","a.delete",function(){n(this).closest("li.image").remove();var e="";return n("#product_images_container").find("ul li.image").css("cursor","default").each(function(){var t=n(this).attr("data-attachment_id");e=e+t+","}),l.val(e),n("#tiptip_holder").removeAttr("style"),n("#tiptip_arrow").removeAttr("style"),!1})}); \ No newline at end of file diff --git a/assets/js/admin/meta-boxes.min.js b/assets/js/admin/meta-boxes.min.js deleted file mode 100644 index b95b587430f..00000000000 --- a/assets/js/admin/meta-boxes.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(function(o){!function t(){o("#tiptip_holder").removeAttr("style"),o("#tiptip_arrow").removeAttr("style"),o(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200})}(),o("#titlediv").find("#title").keyup(function(t){if("9"===(t.keyCode||t.which)&&0 h3",function(){o(this).parent(".wc-metabox").toggleClass("closed").toggleClass("open")}),o(document.body).on("wc-init-tabbed-panels",function(){o("ul.wc-tabs").show(),o("ul.wc-tabs a").click(function(t){t.preventDefault();var e=o(this).closest("div.panel-wrap");o("ul.wc-tabs li",e).removeClass("active"),o(this).parent().addClass("active"),o("div.panel",e).hide(),o(o(this).attr("href")).show()}),o("div.panel-wrap").each(function(){o(this).find("ul.wc-tabs li").eq(0).find("a").click()})}).trigger("wc-init-tabbed-panels"),o(document.body).on("wc-init-datepickers",function(){o(".date-picker-field, .date-picker").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0})}).trigger("wc-init-datepickers"),o(".wc-metaboxes-wrapper").on("click",".wc-metabox h3",function(t){o(t.target).filter(":input, option, .sort").length||o(this).next(".wc-metabox-content").stop().slideToggle()}).on("click",".expand_all",function(){return o(this).closest(".wc-metaboxes-wrapper").find(".wc-metabox > .wc-metabox-content").show(),!1}).on("click",".close_all",function(){return o(this).closest(".wc-metaboxes-wrapper").find(".wc-metabox > .wc-metabox-content").hide(),!1}),o(".wc-metabox.closed").each(function(){o(this).find(".wc-metabox-content").hide()})}); \ No newline at end of file diff --git a/assets/js/admin/network-orders.min.js b/assets/js/admin/network-orders.min.js deleted file mode 100644 index e283ac2d35c..00000000000 --- a/assets/js/admin/network-orders.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(o,e,r){if("undefined"!=typeof woocommerce_network_orders){var t=[],n=[],s=[],a=o(document.getElementById("network-orders-tbody")),c=e.template(o(document.getElementById("network-orders-row-template")).text()),d=o(document.getElementById("woocommerce-network-order-table-loading")),i=o(document.getElementById("woocommerce-network-order-table")),m=o(document.getElementById("woocommerce-network-orders-no-orders"));if(!woocommerce_network_orders.sites.length)return d.removeClass("is-active"),i.removeClass("is-active"),m.addClass("is-active");o.each(woocommerce_network_orders.sites,function(r,e){n[r]=o.Deferred(),s.push(o.ajax({url:woocommerce_network_orders.order_endpoint,data:{_wpnonce:woocommerce_network_orders.nonce,network_orders:!0,blog_id:e},type:"GET"}).success(function(e){var o;for(o in e)t.push(e[o]);n[r].resolve()}).fail(function(){n[r].resolve()}))}),0'),d.post(ajaxurl,{action:"woocommerce_product_ordering",id:i,previd:o,nextid:n},function(t){d.each(t,function(t,e){d("#inline_"+t+" .menu_order").html(e)}),e.item.find(".check-column input").show().siblings("img").remove(),d("table.widefat tbody th, table.widefat tbody td").css("cursor","move"),d("table.widefat tbody").sortable("enable")}),d("table.widefat tbody tr").each(function(){d("table.widefat tbody tr").index(this)%2==0?d(this).addClass("alternate"):d(this).removeClass("alternate")})}})}); \ No newline at end of file diff --git a/assets/js/admin/quick-edit.min.js b/assets/js/admin/quick-edit.min.js deleted file mode 100644 index 48828de40db..00000000000 --- a/assets/js/admin/quick-edit.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(function(q){q("#the-list").on("click",".editinline",function(){inlineEditPost.revert();var e=q(this).closest("tr").attr("id");e=e.replace("post-","");var t=q("#woocommerce_inline_"+e),i=t.find(".sku").text(),n=t.find(".regular_price").text(),o=t.find(".sale_price ").text(),d=t.find(".weight").text(),s=t.find(".length").text(),l=t.find(".width").text(),c=t.find(".height").text(),a=t.find(".shipping_class").text(),r=t.find(".visibility").text(),_=t.find(".stock_status").text(),m=t.find(".stock").text(),p=t.find(".featured").text(),f=t.find(".manage_stock").text(),u=t.find(".menu_order").text(),h=t.find(".tax_status").text(),w=t.find(".tax_class").text(),k=t.find(".backorders").text(),v=n.replace(".",woocommerce_admin.mon_decimal_point),x=o.replace(".",woocommerce_admin.mon_decimal_point);q('input[name="_sku"]',".inline-edit-row").val(i),q('input[name="_regular_price"]',".inline-edit-row").val(v),q('input[name="_sale_price"]',".inline-edit-row").val(x),q('input[name="_weight"]',".inline-edit-row").val(d),q('input[name="_length"]',".inline-edit-row").val(s),q('input[name="_width"]',".inline-edit-row").val(l),q('input[name="_height"]',".inline-edit-row").val(c),q('select[name="_shipping_class"] option:selected',".inline-edit-row").attr("selected",!1).change(),q('select[name="_shipping_class"] option[value="'+a+'"]').attr("selected","selected").change(),q('input[name="_stock"]',".inline-edit-row").val(m),q('input[name="menu_order"]',".inline-edit-row").val(u),q('select[name="_tax_status"] option, select[name="_tax_class"] option, select[name="_visibility"] option, select[name="_stock_status"] option, select[name="_backorders"] option').removeAttr("selected"),q('select[name="_tax_status"] option[value="'+h+'"]',".inline-edit-row").attr("selected","selected"),q('select[name="_tax_class"] option[value="'+w+'"]',".inline-edit-row").attr("selected","selected"),q('select[name="_visibility"] option[value="'+r+'"]',".inline-edit-row").attr("selected","selected"),q('select[name="_stock_status"] option[value="'+_+'"]',".inline-edit-row").attr("selected","selected"),q('select[name="_backorders"] option[value="'+k+'"]',".inline-edit-row").attr("selected","selected"),"yes"===p?q('input[name="_featured"]',".inline-edit-row").attr("checked","checked"):q('input[name="_featured"]',".inline-edit-row").removeAttr("checked");var g=t.find(".product_type").text(),y=t.find(".product_is_virtual").text(),b="external"!==g,A="external"!==g&&"grouped"!==g;q(".stock_fields, .manage_stock_field, .stock_status_field, .backorder_field").show(),A?"yes"===f?(q(".stock_qty_field, .backorder_field",".inline-edit-row").show().removeAttr("style"),q(".stock_status_field").hide(),q(".manage_stock_field input").prop("checked",!0)):(q(".stock_qty_field, .backorder_field",".inline-edit-row").hide(),q(".stock_status_field").show().removeAttr("style"),q(".manage_stock_field input").prop("checked",!1)):b?q(".stock_fields, .manage_stock_field, .backorder_field").hide():q(".stock_fields, .manage_stock_field, .stock_status_field, .backorder_field").hide(),"simple"===g||"external"===g?q(".price_fields",".inline-edit-row").show().removeAttr("style"):q(".price_fields",".inline-edit-row").hide(),"yes"===y?q(".dimension_fields",".inline-edit-row").hide():q(".dimension_fields",".inline-edit-row").show().removeAttr("style"),q('input[name="comment_status"]').parent().find(".checkbox-title").text(woocommerce_quick_edit.strings.allow_reviews)}),q("#the-list").on("change",'.inline-edit-row input[name="_manage_stock"]',function(){q(this).is(":checked")?(q(".stock_qty_field, .backorder_field",".inline-edit-row").show().removeAttr("style"),q(".stock_status_field").hide()):(q(".stock_qty_field, .backorder_field",".inline-edit-row").hide(),q(".stock_status_field").show().removeAttr("style"))}),q("#wpbody").on("click","#doaction, #doaction2",function(){q("input.text",".inline-edit-row").val(""),q("#woocommerce-fields").find("select").prop("selectedIndex",0),q("#woocommerce-fields-bulk").find(".inline-edit-group .change-input").hide()}),q("#wpbody").on("change","#woocommerce-fields-bulk .inline-edit-group .change_to",function(){0'+a+"").css({top:e-16,left:t+20}).appendTo("body").fadeIn(200)}var o=null,s=null;f(".chart-placeholder").bind("plothover",function(t,e,a){if(a){if((o!==a.dataIndex||s!==a.seriesIndex)&&(o=a.dataIndex,s=a.seriesIndex,f(".chart-tooltip").remove(),a.series.points.show||a.series.enable_tooltip)){var n=a.series.data[a.dataIndex][1],i="";a.series.prepend_label&&(i=i+a.series.label+": "),a.series.prepend_tooltip&&(i+=a.series.prepend_tooltip),i+=n,a.series.append_tooltip&&(i+=a.series.append_tooltip),a.series.pie.show?r(e.pageX,e.pageY,i):r(a.pageX,a.pageY,i)}}else f(".chart-tooltip").remove(),o=null}),f(".wc_sparkline.bars").each(function(){var t=[{data:f(this).data("sparkline"),color:f(this).data("color"),bars:{fillColor:f(this).data("color"),fill:!0,show:!0,lineWidth:1,barWidth:f(this).data("barwidth"),align:"center"},shadowSize:0}];f.plot(f(this),t,{grid:{show:!1}})}),f(".wc_sparkline.lines").each(function(){var t=[{data:f(this).data("sparkline"),color:f(this).data("color"),lines:{fill:!1,show:!0,lineWidth:1,align:"center"},shadowSize:0}];f.plot(f(this),t,{grid:{show:!1}})});var a=f(".range_datepicker").datepicker({changeMonth:!0,changeYear:!0,defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,minDate:"-20Y",maxDate:"+1D",showButtonPanel:!0,showOn:"focus",buttonImageOnly:!0,onSelect:function(){var t=f(this).is(".from")?"minDate":"maxDate",e=f(this).datepicker("getDate");a.not(this).datepicker("option",t,e)}});"undefined"==typeof document.createElement("a").download&&f(".export_csv").hide(),f(".export_csv").click(function(){var a=f(this).data("exclude_series")||"";a=(a=a.toString()).split(",");var t,e,n,i=f(this).data("xaxes"),r=f(this).data("groupby"),o=f(this).data("index_type"),s=f(this).data("export"),l="data:text/csv;charset=utf-8,\ufeff";if("table"===s)f(this).offsetParent().find("thead tr,tbody tr").each(function(){f(this).find("th, td").each(function(){var t=f(this).text();t=t.replace("[?]","").replace("#",""),l+='"'+t+'",'}),l=l.substring(0,l.length-1),l+="\n"}),f(this).offsetParent().find("tfoot tr").each(function(){f(this).find("th, td").each(function(){var t=f(this).text();if(t=t.replace("[?]","").replace("#",""),l+='"'+t+'",',0n}),_.map(i,function(t){return t.tax_rate_order++,c[t.tax_rate_id]=_.extend(c[t.tax_rate_id]||{},{tax_rate_order:t.tax_rate_order}),t})):(l.tax_rate_order=1+_.max(_.pluck(s,"tax_rate_order"),function(t){return parseInt(t,10)}),r.page=r.qty_pages),s[l.tax_rate_id]=l,c[l.tax_rate_id]=l,o.set("rates",s),o.logChanges(c),r.render()},onDeleteRow:function(t){var e,a,n=t.data.view,i=n.model,r=_.indexBy(i.get("rates"),"tax_rate_id"),o={};t.preventDefault(),(e=u.children(".current"))?(e.each(function(){a=p(this).data("id"),delete r[a],o[a]=_.extend(o[a]||{},{deleted:"deleted"})}),i.set("rates",r),i.logChanges(o),n.render()):window.alert(g.strings.no_rows_selected)},onSearchField:function(t){t.data.view.updateUrl(),t.data.view.render()},onPageChange:function(t){var e=p(t.currentTarget);t.preventDefault(),t.data.view.page=e.data("goto")?e.data("goto"):e.val(),t.data.view.render(),t.data.view.updateUrl()},onExport:function(t){var n="data:application/csv;charset=utf-8,"+g.strings.csv_data_cols.join(",")+"\n";return p.each(t.data.view.model.getFilteredRates(),function(t,e){var a="";a+=e.tax_rate_country+",",a+=e.tax_rate_state+",",a+=(e.postcode?e.postcode.join("; "):"")+",",a+=(e.city?e.city.join("; "):"")+",",a+=e.tax_rate+",",a+=e.tax_rate_name+",",a+=e.tax_rate_priority+",",a+=e.tax_rate_compound+",",a+=e.tax_rate_shipping+",",a+=g.current_class,n+=a+"\n"}),p(this).attr("href",encodeURI(n)),!0},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,a.prop("disabled",!1)},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,a.prop("disabled",!0)},unloadConfirmation:function(t){if(t.data.view.needsUnloadConfirm)return t.returnValue=g.strings.unload_confirmation_msg,window.event.returnValue=g.strings.unload_confirmation_msg,g.strings.unload_confirmation_msg},updateModelOnChange:function(t){var e=t.data.view.model,a=p(t.target),n=a.closest("tr").data("id"),i=a.data("attribute"),r=a.val();"city"!==i&&"postcode"!==i||(r=r.split(";"),r=p.map(r,function(t){return t.trim()})),"tax_rate_compound"!==i&&"tax_rate_shipping"!==i||(r=a.is(":checked")?1:0),e.setRateAttribute(n,i,r)},sanitizePage:function(t){return(t=parseInt(t,10))<1?t=1:t>this.qty_pages&&(t=this.qty_pages),t}}),l=new r({rates:g.rates}),h=new o({model:l,el:"#rates"});h.render()})}(jQuery,htmlSettingsTaxLocalizeScript,wp,ajaxurl); \ No newline at end of file diff --git a/assets/js/admin/settings.min.js b/assets/js/admin/settings.min.js deleted file mode 100644 index 1d37c18b678..00000000000 --- a/assets/js/admin/settings.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(c,r,a){c(function(){c("select#woocommerce_allowed_countries").change(function(){"specific"===c(this).val()?(c(this).closest("tr").next("tr").hide(),c(this).closest("tr").next().next("tr").show()):("all_except"===c(this).val()?c(this).closest("tr").next("tr").show():c(this).closest("tr").next("tr").hide(),c(this).closest("tr").next().next("tr").hide())}).change(),c("select#woocommerce_ship_to_countries").change(function(){"specific"===c(this).val()?c(this).closest("tr").next("tr").show():c(this).closest("tr").next("tr").hide()}).change(),c("input#woocommerce_manage_stock").change(function(){c(this).is(":checked")?c(this).closest("tbody").find(".manage_stock_field").closest("tr").show():c(this).closest("tbody").find(".manage_stock_field").closest("tr").hide()}).change(),c(".colorpick").iris({change:function(t,e){c(this).parent().find(".colorpickpreview").css({backgroundColor:e.color.toString()})},hide:!0,border:!0}).on("click focus",function(t){t.stopPropagation(),c(".iris-picker").hide(),c(this).closest("td").find(".iris-picker").show(),c(this).data("original-value",c(this).val())}).on("change",function(){c(this).is(".iris-error")&&(c(this).data("original-value").match(/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/)?c(this).val(c(this).data("original-value")).change():c(this).val("").change())}),c("body").on("click",function(){c(".iris-picker").hide()}),c(function(){var t=!1;c("input, textarea, select, checkbox").change(function(){t=!0}),c(".woo-nav-tab-wrapper a").click(function(){window.onbeforeunload=t?function(){return r.i18n_nav_warning}:""}),c(".submit :input").click(function(){window.onbeforeunload=""})}),c("table.wc_gateways tbody, table.wc_shipping tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(t,e){return e.children().each(function(){c(this).width(c(this).width())}),e.css("left","0"),e},start:function(t,e){e.item.css("background-color","#f6f6f6")},stop:function(t,e){e.item.removeAttr("style"),e.item.trigger("updateMoveButtons")}}),c(".woocommerce").on("click",".select_all",function(){return c(this).closest("td").find("select option").attr("selected","selected"),c(this).closest("td").find("select").trigger("change"),!1}),c(".woocommerce").on("click",".select_none",function(){return c(this).closest("td").find("select option").removeAttr("selected"),c(this).closest("td").find("select").trigger("change"),!1}),c(".wc-item-reorder-nav").find(".wc-move-up, .wc-move-down").on("click",function(){var t=c(this),e=t.closest("tr");t.focus();var i=t.is(".wc-move-up"),o=t.is(".wc-move-down");if(i){var n=e.prev("tr");n&&n.length&&(n.before(e),a.a11y.speak(r.i18n_moved_up))}else if(o){var s=e.next("tr");s&&s.length&&(s.after(e),a.a11y.speak(r.i18n_moved_down))}t.focus(),t.closest("table").trigger("updateMoveButtons")}),c(".wc-item-reorder-nav").closest("table").on("updateMoveButtons",function(){var t=c(this),e=c(this).find("tbody tr:last"),i=c(this).find("tbody tr:first");t.find(".wc-item-reorder-nav .wc-move-disabled").removeClass("wc-move-disabled").attr({tabindex:"0","aria-hidden":"false"}),i.find(".wc-item-reorder-nav .wc-move-up").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"}),e.find(".wc-item-reorder-nav .wc-move-down").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"})}),c(".wc-item-reorder-nav").closest("table").trigger("updateMoveButtons")})}(jQuery,woocommerce_settings_params,wp); \ No newline at end of file diff --git a/assets/js/admin/system-status.min.js b/assets/js/admin/system-status.min.js deleted file mode 100644 index d8b7164956a..00000000000 --- a/assets/js/admin/system-status.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(function(c){({init:function(){c(document.body).on("click","a.help_tip, a.woocommerce-help-tip",this.preventTipTipClick).on("click","a.debug-report",this.generateReport).on("click","#copy-for-support",this.copyReport).on("aftercopy","#copy-for-support",this.copySuccess).on("aftercopyfailure","#copy-for-support",this.copyFail)},preventTipTipClick:function(){return!1},generateReport:function(){var a="";c(".wc_status_table thead, .wc_status_table tbody").each(function(){if(c(this).is("thead")){var t=c(this).find("th:eq(0)").data("export-label")||c(this).text();a=a+"\n### "+c.trim(t)+" ###\n\n"}else c("tr",c(this)).each(function(){var t=c(this).find("td:eq(0)").data("export-label")||c(this).find("td:eq(0)").text(),e=c.trim(t).replace(/(<([^>]+)>)/gi,""),i=c(this).find("td:eq(2)").clone();i.find(".private").remove(),i.find(".dashicons-yes").replaceWith("✔"),i.find(".dashicons-no-alt, .dashicons-warning").replaceWith("❌");var o=c.trim(i.text()),n=o.split(", ");if(1 tr"),n=r(c).find("tbody > tr > td.column-handle").parent();e.length!==n.length&&e.each(function(e,t){n.is(t)||r(t).append(i)}),r(c).find(".column-handle").show()},r(document).ajaxComplete(function(e,t,n){t&&4===t.readyState&&200===t.status&&n.data&&(0<=n.data.indexOf("_inline_edit")||0<=n.data.indexOf("add-tag"))&&(r.wc_add_missing_sort_handles(),r(document.body).trigger("init_tooltips"))}),r(c).sortable({items:"tbody tr:not(.inline-edit-row)",cursor:"move",handle:".column-handle",axis:"y",forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"product-cat-placeholder",scrollSensitivity:40,start:function(e,t){t.item.hasClass("alternate")||t.item.css("background-color","#ffffff"),t.item.children("td, th").css("border-bottom-width","0"),t.item.css("outline","1px solid #aaa")},stop:function(e,t){t.item.removeAttr("style"),t.item.children("td, th").css("border-bottom-width","1px")},update:function(e,t){var n,i,d=t.item.find(m).val(),a=t.item.find(".parent").html(),o=t.item.prev().find(m).val(),l=t.item.next().find(m).val();o!==undefined&&(n=t.item.prev().find(".parent").html())!==a&&(o=undefined),l!==undefined&&(i=t.item.next().find(".parent").html())!==a&&(l=undefined),o===undefined&&l===undefined||l===undefined&&i===o||l!==undefined&&n===d?r(c).sortable("cancel"):(t.item.find(".check-column input").hide(),t.item.find(".check-column").append('processing'),r.post(ajaxurl,{action:"woocommerce_term_ordering",id:d,nextid:l,thetaxonomy:woocommerce_term_ordering_params.taxonomy},function(e){"children"===e?window.location.reload():(t.item.find(".check-column input").show(),t.item.find(".check-column").find("img").remove())}),r("table.widefat tbody tr").each(function(){jQuery("table.widefat tbody tr").index(this)%2==0?jQuery(this).addClass("alternate"):jQuery(this).removeClass("alternate")}))}})}); \ No newline at end of file diff --git a/assets/js/admin/users.min.js b/assets/js/admin/users.min.js deleted file mode 100644 index fad4c0ab856..00000000000 --- a/assets/js/admin/users.min.js +++ /dev/null @@ -1 +0,0 @@ -jQuery(function(g){var f={states:null,init:function(){"undefined"!=typeof wc_users_params.countries&&(this.states=g.parseJSON(wc_users_params.countries.replace(/"/g,'"'))),g(".js_field-country").selectWoo().change(this.change_country),g(".js_field-country").trigger("change",[!0]),g(document.body).on("change","select.js_field-state",this.change_state),g(document.body).on("click","button.js_copy-billing",this.copy_billing)},change_country:function(e,t){if(void 0===t&&(t=!1),null!==f.states){var a,n=g(this),o=n.val(),i=n.parents(".form-table").find(":input.js_field-state"),c=i.parent(),s=i.attr("name"),l=i.attr("id"),r="woocommerce.stickState-"+o,p=n.data(r)?n.data(r):i.val(),d=i.attr("placeholder");if(t&&n.data("woocommerce.stickState-"+o,p),c.show().find(".select2-container").remove(),g.isEmptyObject(f.states[o]))a=g('').prop("id",l).prop("name",s).prop("placeholder",d).addClass("js_field-state regular-text").val(p),i.replaceWith(a);else{var u=f.states[o],h=g('').text(f.i18n_select_state_text);a=g('').prop("id",l).prop("name",s).prop("placeholder",d).addClass("js_field-state").append(h),g.each(u,function(e){var t=g("").prop("value",e).text(u[e]);a.append(t)}),a.val(p),i.replaceWith(a),a.show().selectWoo().hide().change()}g(document.body).trigger("contry-change.woocommerce",[o,g(this).closest("div")]),g(document.body).trigger("country-change.woocommerce",[o,g(this).closest("div")])}},change_state:function(){var e=g(this),t=e.val(),a=e.parents(".form-table").find(":input.js_field-country"),n=a.val();a.data("woocommerce.stickState-"+n,t)},copy_billing:function(e){e.preventDefault(),g("#fieldset-billing").find("input, select").each(function(e,t){var a=t.name.replace(/^billing_/,"shipping_"),n=g('[name="'+a+'"]');n.length&&n.val(t.value).trigger("change")})}};f.init()}); \ No newline at end of file diff --git a/assets/js/admin/wc-clipboard.min.js b/assets/js/admin/wc-clipboard.min.js deleted file mode 100644 index 48cb989bdc4..00000000000 --- a/assets/js/admin/wc-clipboard.min.js +++ /dev/null @@ -1 +0,0 @@ -function wcSetClipboard(e,r){void 0===r&&(r=jQuery(document));var t=jQuery('