PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.11.1
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.11.1
2.3.2 2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 All 60 releases
merchant / assets / js / modules / pre-orders / admin / preview.min.js

preview.min.js in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.11.1, at assets/js/modules/pre-orders/admin/preview.min.js

1 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(a=>{({init:function(){this.initEvents(),this.initPreview(),this.datePickers=[]},initEvents:function(){var l=this;a(document).on("change.merchant keyup",this.initPreview.bind(this)),a(document).on("click",".merchant-flexible-content-control.pre-orders-style .layout",this.updateActiveLayout.bind(this)),a(".merchant-flexible-content-control .layout:first-child").addClass("active").trigger("click"),a(document).on("initiated.merchant-datepicker",function(e,t,r,n,o){var i,c,a,d;r.closest(".merchant-flexible-content").length&&(d=r.closest(".merchant-field-pre_order_start"),i=r.closest(".merchant-field-pre_order_end"),c=r.closest(".layout-body").find(".merchant-field-shipping_date input"),d.length||i.length)&&(c.add(r.closest(".layout-body").find(".merchant-field-pre_order_start input")).add(r.closest(".layout-body").find(".merchant-field-pre_order_end input")).attr("data-datepicker-index",o),c.length)&&(a=c.data("datepicker-index"),(d=l.datePickers.find(function(e){return e.id===a}))?d.datePickers.push(t):l.datePickers.push({id:a,datePickers:[t]}),c.val()||(null!=t&&t.destroy(),t.opts={},t.$datepicker=""))}),a(document).on("change.merchant-datepicker",function(e,t,r,n){var o,i,c;null!=r&&r.closest(".merchant-field-shipping_date").length&&(r.css("borderColor",""),o=r.closest(".layout-body").find(".merchant-field-shipping_date input"),r=r.closest(".layout-body").find(".merchant-field-pre_order_start input, .merchant-field-pre_order_end input"),o.length)&&(i=o.data("datepicker-index"),o.val()?(c=[],r.each(function(){var e=new AirDatepicker(a(this).getPath(),_objectSpread(_objectSpread({},n),{},{selectedDates:""}));c.push(e)}),l.datePickers.push({id:i,datePickers:c})):l.datePickers=l.datePickers.filter(function(e){return e.id!==i||(e.datePickers.forEach(function(e){null!=e&&e.destroy(),null!=e&&e.clear(),e.opts={},e.$datepicker=""}),!1)}))}),a(document).on("click",".merchant-field-pre_order_start input, .merchant-field-pre_order_end input",function(){var e=a(this).closest(".layout-body").find(".merchant-field-shipping_date input");e.length&&!e.val()&&(e.css("borderColor","#f00"),alert((null==(e=merchant)?void 0:e.shipping_date_missing_text)||"Please set a shipping date first"))})},initPreview:function(){var e=a(".merchant-flexible-content-control.pre-orders-style").find(".layout.active"),t=e.find(".merchant-field-button_text input").val(),r=e.find(".merchant-field-text-color input").val(),n=e.find(".merchant-field-text-hover-color input").val(),o=e.find(".merchant-field-border-color input").val(),i=e.find(".merchant-field-border-hover-color input").val(),c=e.find(".merchant-field-background-color input").val(),e=e.find(".merchant-field-background-hover-color input").val();a(".merchant-pre-ordered-product .add_to_cart_button").text(t),a(".merchant-pre-ordered-product").css({"--mrc-po-text-color":r,"--mrc-po-text-hover-color":n,"--mrc-po-border-color":o,"--mrc-po-border-hover-color":i,"--mrc-po-background-color":c,"--mrc-po-background-hover-color":e})},updateActiveLayout:function(e){e=a(e.currentTarget);e.closest(".merchant-flexible-content-control.pre-orders-style").find(".layout").removeClass("active"),e.addClass("active"),this.initPreview()}}).init()})(jQuery);