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+"
'+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'+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 ';0===r(c).find(".column-handle").length&&(r(c).find("tr:not(.inline-edit-row)").append(i),m=".check-column input"),r(c).find(".column-handle").show(),r.wc_add_missing_sort_handles=function(){var e=r(c).find("tbody > 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(''),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('