Version Description
31-07-2022 =
Fix: dependency script updated for product page settings save issue
Update:
is_admin()
check removed for some theme support
Download this release
Release Info
Developer | EmranAhmed |
Plugin | WooCommerce Variation Swatches |
Version | 2.0.6 |
Comparing to | |
See all releases |
Code changes from version 2.0.5 to 2.0.6
- README.txt +5 -0
- assets/css/admin.css +1 -1
- assets/css/frontend.css +1 -1
- assets/js/admin.js +11 -4
- assets/js/admin.min.js +1 -1
- assets/js/frontend.js +1 -1
- assets/js/wp-color-picker-alpha.js +1 -1
- includes/class-woo-variation-swatches-settings.php +2 -2
- includes/getwooplugins/js/getwooplugins-form-field-dependency.js +2 -1
- languages/woo-variation-swatches.pot +1 -1
- woo-variation-swatches.php +2 -2
README.txt
CHANGED
@@ -616,6 +616,11 @@ And your are ready to go.
|
|
616 |
|
617 |
== Changelog ==
|
618 |
|
|
|
|
|
|
|
|
|
|
|
619 |
= 2.0.5 - 20-07-2022 =
|
620 |
|
621 |
* Add: `woo_variation_swatches_html` filter to modify swatches output
|
616 |
|
617 |
== Changelog ==
|
618 |
|
619 |
+
= 2.0.6 - 31-07-2022 =
|
620 |
+
|
621 |
+
* Fix: dependency script updated for product page settings save issue
|
622 |
+
* Update: `is_admin()` check removed for some theme support
|
623 |
+
|
624 |
= 2.0.5 - 20-07-2022 =
|
625 |
|
626 |
* Add: `woo_variation_swatches_html` filter to modify swatches output
|
assets/css/admin.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
-
* Date: 7/
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
.button.button-danger {
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
+
* Date: 7/31/2022, 4:31:22 PM
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
.button.button-danger {
|
assets/css/frontend.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
-
* Date: 7/
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
.woo-variation-swatches.wvs-tooltip .radio-variable-item[data-wvstooltip] {
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
+
* Date: 7/31/2022, 4:31:22 PM
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
.woo-variation-swatches.wvs-tooltip .radio-variable-item[data-wvstooltip] {
|
assets/js/admin.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
-
* Date: 7/
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
/******/ (function() { // webpackBootstrap
|
@@ -120,8 +120,10 @@ var PluginHelper = function ($) {
|
|
120 |
$selector.unblock();
|
121 |
}).done(function (termsMarkup) {
|
122 |
if (termsMarkup) {
|
123 |
-
$selector.html(termsMarkup);
|
124 |
-
|
|
|
|
|
125 |
}
|
126 |
});
|
127 |
}
|
@@ -605,6 +607,11 @@ var PluginHelper = function ($) {
|
|
605 |
window.console.log(err);
|
606 |
}
|
607 |
}
|
|
|
|
|
|
|
|
|
|
|
608 |
}, {
|
609 |
key: "savingDialog",
|
610 |
value: function savingDialog($wrapper, $dialog, taxonomy) {
|
@@ -758,7 +765,7 @@ jQuery(function ($) {
|
|
758 |
PluginHelper.InitTooltip();
|
759 |
PluginHelper.SelectWoo();
|
760 |
PluginHelper.ColorPicker();
|
761 |
-
PluginHelper.
|
762 |
PluginHelper.SetAttributeTypePaging($selector);
|
763 |
});
|
764 |
/*$('#woocommerce-product-data').on('woocommerce_variations_loaded', function () {
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
+
* Date: 7/31/2022, 4:31:22 PM
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
/******/ (function() { // webpackBootstrap
|
120 |
$selector.unblock();
|
121 |
}).done(function (termsMarkup) {
|
122 |
if (termsMarkup) {
|
123 |
+
$selector.html(termsMarkup); // _.delay(() => {
|
124 |
+
|
125 |
+
$(document.body).trigger('woo_variation_swatches_product_term_paging_done', $selector); // }, 300)
|
126 |
+
//$('#woocommerce-product-data').trigger('woocommerce_variations_loaded');
|
127 |
}
|
128 |
});
|
129 |
}
|
607 |
window.console.log(err);
|
608 |
}
|
609 |
}
|
610 |
+
}, {
|
611 |
+
key: "FieldDependencyTrigger",
|
612 |
+
value: function FieldDependencyTrigger() {
|
613 |
+
$(document.body).trigger('init_form_field_dependency');
|
614 |
+
}
|
615 |
}, {
|
616 |
key: "savingDialog",
|
617 |
value: function savingDialog($wrapper, $dialog, taxonomy) {
|
765 |
PluginHelper.InitTooltip();
|
766 |
PluginHelper.SelectWoo();
|
767 |
PluginHelper.ColorPicker();
|
768 |
+
PluginHelper.FieldDependencyTrigger();
|
769 |
PluginHelper.SetAttributeTypePaging($selector);
|
770 |
});
|
771 |
/*$('#woocommerce-product-data').on('woocommerce_variations_loaded', function () {
|
assets/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(){var t,e={825:function(t,e,o){"use strict";function a(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,a)}return o}function n(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function i(t,e){for(var o=0;o<e.length;o++){var a=e[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}o.r(e),o.d(e,{PluginHelper:function(){return r}});var r=function(t){var e=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,r,c;return o=e,c=[{key:"GWPAdmin",value:function(){t().gwp_live_feed&&t().gwp_live_feed(),t().gwp_deactivate_popup&&t().gwp_deactivate_popup("woo-variation-swatches")}},{key:"GalleryNotification",value:function(){t(".woocommerce_variation").each((function(){var e=t(this).find(".options:first");t(this).find(".woo-variation-gallery-message").insertBefore(e)})),t("input.upload_image_id").on("change",(function(e){t.trim(t(this).val())?t(this).closest(".data").find(".woo-variation-gallery-message").addClass("enable"):t(this).closest(".data").find(".woo-variation-gallery-message").removeClass("enable")})),t("a.install-woo-variation-gallery-action").on("click",(function(e){e.preventDefault();var o=t(this).parent(),a=o.data("installing"),n=o.data("activated"),i=o.data("nonce");o.text(a),wp.ajax.send("install_woo_variation_gallery",{data:{nonce:i},success:function(e){o.text(n),_.delay((function(){t(".woocommerce_variable_attributes .woo-variation-gallery-message").remove()}),5e3)},error:function(e){o.text(n),_.delay((function(){t(".woocommerce_variable_attributes .woo-variation-gallery-message").remove()}),5e3)}})}))}},{key:"PaginationAjax",value:function(e,o,a,n,i){t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_load_product_terms"),method:"POST",data:{offset:n,product_id:e,attribute_id:o,attribute_name:a,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(t,e){i.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,o){console.error("not available on: ".concat(e," ").concat($attribute_key,"."),o)})).always((function(){i.unblock()})).done((function(e){e&&(i.html(e),t(document.body).trigger("woo_variation_swatches_product_term_paging_done",i))}))}},{key:"MetaboxToggle",value:function(){t("#woo_variation_swatches_variation_product_options").on("click",".wc-metabox > h4",(function(e){var o=t(this).parent(".wc-metabox"),a=t(this).next(".wc-metabox-content");if(t(e.target).filter(":input, option, .sort, select, label, .select2-selection__rendered").length)return!1;o.hasClass("closed")?(o.removeClass("closed open").addClass("open"),a.slideDown()):(o.removeClass("closed open").addClass("closed"),a.slideUp())}))}},{key:"AttributeTypeSwitch",value:function(){t("#woo_variation_swatches_variation_product_options").on("change","select.woo_variation_swatches_attribute_type_switch",(function(e){var o=t(this).val();["select"].includes(o),["image","color","button"].includes(o)&&t(this).closest(".wc-metabox").find(".wc-metabox-content select.woo_variation_swatches_attribute_term_type_switch").val(o).trigger("change")})).on("change","select.woo_variation_swatches_attribute_term_type_switch",(function(e){var o=t(this).closest(".woo-variation-swatches-attribute-options-wrapper").find("select.woo_variation_swatches_attribute_type_switch").val();t(this).val()!==o&&t(this).closest(".woo-variation-swatches-attribute-options-wrapper").find("select.woo_variation_swatches_attribute_type_switch").val("mixed").trigger("change")}))}},{key:"SetAttributeTypePaging",value:function(e){var o=t(e).closest(".woo-variation-swatches-attribute-options-wrapper").find("select.woo_variation_swatches_attribute_type_switch").val();t(e).find("select.woo_variation_swatches_attribute_term_type_switch").hasClass("new-mode"),["image","color","button"].includes(o)&&t(e).find("select.woo_variation_swatches_attribute_term_type_switch.new-mode").val(o).trigger("change"),t(e).find("select.woo_variation_swatches_attribute_term_type_switch.new-mode").each((function(){t(this).val()}))}},{key:"LoadProductAttributes",value:function(){t("#woocommerce-product-data").on("woocommerce_variations_loaded",(function(e){var o=t("#woo_variation_swatches_variation_product_options").data("product_id");t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_load_product_options"),method:"POST",data:{product_id:o,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(e,o){t("#woo_variation_swatches_variation_product_options_inner").block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,e){console.error("not load option: ".concat(o,"."),e)})).always((function(){t("#woo_variation_swatches_variation_product_options_inner").unblock()})).done((function(e){t(document.body).trigger("woo_variation_swatches_variation_product_options_loaded",o)}))}))}},{key:"SaveProductAttributes",value:function(){var e=!1,o=t("#woo_variation_swatches_variation_product_options");o.on("change input color-changed",":input:not(.wvs-skip-field)",(function(){e||(window.onbeforeunload=function(){return woo_variation_swatches_admin.nav_warning},e=!0)})).on("click",".woo_variation_swatches_save_product_attributes, .woo_variation_swatches_reset_product_attributes",(function(){window.onbeforeunload=""})).on("click",".woo_variation_swatches_save_product_attributes",(function(e){e.preventDefault();var a,n=o.find(":input:not(.wvs-skip-field)").serializeJSON({disableColonTypes:!0}),i=Object.keys(n)?Object.keys(n).shift():"woo_variation_swatches_product_options",r=o.data("product_id");t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_save_product_options"),method:"POST",data:{data:n[i],product_id:r,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(e,o){clearTimeout(a),t("#woo_variation_swatches_variation_product_options_inner").block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,e){console.error("not saved on: ".concat(r,"."),e)})).always((function(){t("#woo_variation_swatches_variation_product_options_inner").unblock()})).done((function(e){t("#saved-message").show(),a=setTimeout((function(){t("#saved-message").hide(600)}),5e3),t(document.body).trigger("woo_variation_swatches_variation_product_options_saved",r)}))})).on("click",".woo_variation_swatches_reset_product_attributes",(function(e){if(e.preventDefault(),confirm(woo_variation_swatches_admin.reset_notice)){var o=t(this).data("product_id");t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_reset_product_options"),method:"POST",data:{product_id:o,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(e,o){t("#woo_variation_swatches_variation_product_options_inner").block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,e){console.error("not reset on: ".concat(o,"."),e)})).always((function(){t("#woo_variation_swatches_variation_product_options_inner").unblock()})).done((function(e){var a=t(e).find("#woo_variation_swatches_variation_product_options_inner").html();t("#woo_variation_swatches_variation_product_options_inner").html(a),t(document.body).trigger("woo_variation_swatches_variation_product_options_reset",o)}))}}))}},{key:"ResetProductAttributes",value:function(){t("#woo_variation_swatches_variation_product_options")}},{key:"Pagination",value:function(){var e=this,o=!1;t("#woo_variation_swatches_variation_product_options").on("change input color-changed",":input:not(.wvs-skip-field)",(function(t){o||(o=!0)})).on("click",".woo_variation_swatches_reset_product_attributes",(function(t){t.preventDefault(),o=!1})).on("click",".woo_variation_swatches_save_product_attributes",(function(t){t.preventDefault(),o=!1})).on("click",".first-page:not(.disabled), .prev-page:not(.disabled), .last-page:not(.disabled), .next-page:not(.disabled)",(function(t){o&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),alert(woo_variation_swatches_admin.nav_warning))})).on("click",".first-page.disabled, .prev-page.disabled, .last-page.disabled, .next-page.disabled",(function(t){t.preventDefault()})).on("click",".first-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination"),i=a.data("product_id"),r=a.data("attribute_id"),c=a.data("attribute_name");e.PaginationAjax(i,r,c,0,a),n.find(".next-page, .last-page").removeClass("disabled"),n.find(".current-page").text(1),a.data("current",1),n.find(".first-page, .prev-page").addClass("disabled")})).on("click",".prev-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination");a.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}});var i=a.data("product_id"),r=(a.data("pages"),a.data("attribute_id")),c=a.data("attribute_name"),s=a.data("current"),l=a.data("limit"),d=(a.data("total"),(s-1)*l-l),u=s-1;e.PaginationAjax(i,r,c,d,a),n.find(".next-page, .last-page").removeClass("disabled"),n.find(".current-page").text(u),a.data("current",u),0===d&&n.find(".first-page, .prev-page").addClass("disabled")})).on("click",".next-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination");a.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}});var i=a.data("product_id"),r=a.data("pages"),c=a.data("attribute_id"),s=a.data("attribute_name"),l=a.data("current"),d=a.data("limit"),u=(a.data("total"),l*d),_=l+1;e.PaginationAjax(i,c,s,u,a),n.find(".first-page, .prev-page").removeClass("disabled"),n.find(".current-page").text(_),a.data("current",_),r===_&&n.find(".next-page, .last-page").addClass("disabled")})).on("click",".last-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination");a.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}});var i=a.data("product_id"),r=a.data("pages"),c=a.data("attribute_id"),s=a.data("attribute_name"),l=(a.data("current"),a.data("limit")),d=r*l-l;e.PaginationAjax(i,c,s,d,a),n.find(".first-page, .prev-page").removeClass("disabled"),n.find(".current-page").text(r),a.data("current",r),n.find(".next-page, .last-page").addClass("disabled")}))}},{key:"ResetAfterTermCreate",value:function(){t(document.body).on("woo_variation_swatches_admin_term_meta_added",this.ClearImagePicker),t(document.body).on("woo_variation_swatches_admin_term_meta_added",this.ClearColorPicker),t(document).ajaxComplete((function(e,o,a){try{var n=Object.fromEntries(new URLSearchParams(a.data));"add-tag"===n.action&&""===t("#tag-name").val()&&_.delay((function(){t(document.body).trigger("woo_variation_swatches_admin_term_meta_added",n)}),300)}catch(t){}}))}},{key:"ImageUploader",value:function(){t(document.body).off("click","button.wvs_upload_image_button"),t(document.body).on("click","button.wvs_upload_image_button",this.AddImage),t(document.body).on("click","button.wvs_remove_image_button",this.RemoveImage)}},{key:"AddImage",value:function(e){var o,a=this;if(e.preventDefault(),e.stopPropagation(),"undefined"!=typeof wp&&wp.media&&wp.media.editor){if(o)return void o.open();(o=wp.media.frames.select_image=wp.media({title:woo_variation_swatches_admin.media_title,button:{text:woo_variation_swatches_admin.button_title},multiple:!1})).on("select",(function(){var e=o.state().get("selection").first().toJSON();if(""!==t.trim(e.id)){var n=void 0===e.sizes.thumbnail?e.sizes.full.url:e.sizes.thumbnail.url;t(a).prev().val(e.id),t(a).closest(".meta-image-field-wrapper").find("img").attr("src",n),t(a).next().show()}})),o.on("open",(function(){var e=o.state().get("selection"),n=t(a).prev().val(),i=wp.media.attachment(n);i.fetch(),e.add(i?[i]:[])})),o.open()}}},{key:"RemoveImage",value:function(e){e.preventDefault(),e.stopPropagation();var o=t(this).closest(".meta-image-field-wrapper").find("img").data("placeholder");return t(this).closest(".meta-image-field-wrapper").find("img").attr("src",o),t(this).prev().prev().val(""),t(this).hide(),!1}},{key:"ClearImagePicker",value:function(){t("#addtag").find(".wvs_remove_image_button").trigger("click")}},{key:"__SelectWoo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"select.wvs-select-woo";try{t(document.body).on("woo_variation_swatches_select_woo_init",(function(o){t(e).selectWoo({allowClear:!0})})).trigger("woo_variation_swatches_select_woo_init")}catch(t){window.console.log(t)}}},{key:"InitTooltip",value:function(){t(document.body).trigger("init_tooltips")}},{key:"SelectWoo",value:function(){try{t(document.body).trigger("wc-enhanced-select-init")}catch(t){window.console.log(t)}}},{key:"ColorPicker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"input.wvs-color-picker";try{t(document.body).on("woo_variation_swatches_color_picker_init",(function(o){t(e).wpColorPicker({change:function(o,a){t(e).trigger("color-changed")},clear:function(){t(e).trigger("color-changed")}})})).trigger("woo_variation_swatches_color_picker_init")}catch(t){window.console.log(t)}}},{key:"ClearColorPicker",value:function(){t("#addtag").find(".wp-picker-clear").trigger("click")}},{key:"FieldDependency",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"[data-gwp_dependency]";try{t(document.body).on("init_form_field_dependency",(function(){t(e).GWPFormFieldDependency()})).trigger("init_form_field_dependency")}catch(t){window.console.log(t)}}},{key:"savingDialog",value:function(e,o,i){var r={},c="";if(o.find("input, select").each((function(){var e=t(this).attr("name"),o=t(this).val();e&&("tag_name"===e?c=o:r[e]=o,t(this).val(""))})),c){t(".product_attributes").block({message:null,overlayCSS:{background:"#FFFFFF",opacity:.6}});var s=function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?a(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({action:"woocommerce_add_new_attribute",taxonomy:i,term:c,security:woocommerce_admin_meta_boxes.add_attribute_nonce},r);t.post(woocommerce_admin_meta_boxes.ajax_url,s,(function(o){o.error?window.alert(o.error):o.slug&&(e.find("select.attribute_values").append('<option value="'+o.term_id+'" selected="selected">'+o.name+"</option>"),e.find("select.attribute_values").change()),t(".product_attributes").unblock()}))}else t(".product_attributes").unblock()}},{key:"AttributeDialog",value:function(){var e=this;t(".product_attributes").on("click","button.wvs_add_new_attribute",(function(o){o.preventDefault();var a=t(this).closest(".woocommerce_attribute"),n=a.data("taxonomy"),i=t(this).data("dialog_title");t(".wvs-attribute-dialog-for-"+n).dialog({title:"",dialogClass:"wp-dialog wvs-attribute-dialog",classes:{"ui-dialog":"wp-dialog wvs-attribute-dialog"},autoOpen:!1,draggable:!0,width:"auto",modal:!0,resizable:!1,closeOnEscape:!0,position:{my:"center",at:"center",of:window},open:function(){t(".ui-widget-overlay").bind("click",(function(){t("#attribute-dialog").dialog("close")}))},create:function(){}}).dialog("option","title",i).dialog("option","buttons",[{text:woo_variation_swatches_admin.dialog_save,click:function(){e.savingDialog(a,t(this),n),t(this).dialog("close").dialog("destroy")}},{text:woo_variation_swatches_admin.dialog_cancel,click:function(){t(this).dialog("close").dialog("destroy")}}]).dialog("open")}))}}],(r=null)&&i(o.prototype,r),c&&i(o,c),Object.defineProperty(o,"prototype",{writable:!1}),e}();return e}(jQuery)},794:function(t,e,o){function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function n(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,o=new WeakMap;return(n=function(t){return t?o:e})(t)}jQuery((function(t){Promise.resolve().then((function(){return function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==a(t)&&"function"!=typeof t)return{default:t};var o=n(e);if(o&&o.has(t))return o.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=r?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(i,c,s):i[c]=t[c]}return i.default=t,o&&o.set(t,i),i}(o(825))})).then((function(e){var o=e.PluginHelper;o.ResetAfterTermCreate(),o.ColorPicker(),o.ImageUploader(),o.FieldDependency(),o.Pagination(),o.MetaboxToggle(),o.AttributeTypeSwitch(),o.SaveProductAttributes(),t(document.body).on("woo_variation_swatches_variation_product_options_reset woo_variation_swatches_product_term_paging_done",(function(t,e){o.InitTooltip(),o.SelectWoo(),o.ColorPicker(),o.FieldDependency(),o.SetAttributeTypePaging(e)}))}))}))},193:function(){},262:function(){}},o={};function a(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,a),i.exports}a.m=e,t=[],a.O=function(e,o,n,i){if(!o){var r=1/0;for(d=0;d<t.length;d++){o=t[d][0],n=t[d][1],i=t[d][2];for(var c=!0,s=0;s<o.length;s++)(!1&i||r>=i)&&Object.keys(a.O).every((function(t){return a.O[t](o[s])}))?o.splice(s--,1):(c=!1,i<r&&(r=i));if(c){t.splice(d--,1);var l=n();void 0!==l&&(e=l)}}return e}i=i||0;for(var d=t.length;d>0&&t[d-1][2]>i;d--)t[d]=t[d-1];t[d]=[o,n,i]},a.d=function(t,e){for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t={801:0,706:0,438:0};a.O.j=function(e){return 0===t[e]};var e=function(e,o){var n,i,r=o[0],c=o[1],s=o[2],l=0;if(r.some((function(e){return 0!==t[e]}))){for(n in c)a.o(c,n)&&(a.m[n]=c[n]);if(s)var d=s(a)}for(e&&e(o);l<r.length;l++)i=r[l],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0;return a.O(d)},o=self.webpackChunkwoo_variation_swatches=self.webpackChunkwoo_variation_swatches||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))}(),a.O(void 0,[706,438],(function(){return a(794)})),a.O(void 0,[706,438],(function(){return a(193)}));var n=a.O(void 0,[706,438],(function(){return a(262)}));n=a.O(n)}();
|
1 |
+
!function(){var t,e={825:function(t,e,o){"use strict";function a(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,a)}return o}function n(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function i(t,e){for(var o=0;o<e.length;o++){var a=e[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}o.r(e),o.d(e,{PluginHelper:function(){return r}});var r=function(t){var e=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,r,c;return o=e,c=[{key:"GWPAdmin",value:function(){t().gwp_live_feed&&t().gwp_live_feed(),t().gwp_deactivate_popup&&t().gwp_deactivate_popup("woo-variation-swatches")}},{key:"GalleryNotification",value:function(){t(".woocommerce_variation").each((function(){var e=t(this).find(".options:first");t(this).find(".woo-variation-gallery-message").insertBefore(e)})),t("input.upload_image_id").on("change",(function(e){t.trim(t(this).val())?t(this).closest(".data").find(".woo-variation-gallery-message").addClass("enable"):t(this).closest(".data").find(".woo-variation-gallery-message").removeClass("enable")})),t("a.install-woo-variation-gallery-action").on("click",(function(e){e.preventDefault();var o=t(this).parent(),a=o.data("installing"),n=o.data("activated"),i=o.data("nonce");o.text(a),wp.ajax.send("install_woo_variation_gallery",{data:{nonce:i},success:function(e){o.text(n),_.delay((function(){t(".woocommerce_variable_attributes .woo-variation-gallery-message").remove()}),5e3)},error:function(e){o.text(n),_.delay((function(){t(".woocommerce_variable_attributes .woo-variation-gallery-message").remove()}),5e3)}})}))}},{key:"PaginationAjax",value:function(e,o,a,n,i){t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_load_product_terms"),method:"POST",data:{offset:n,product_id:e,attribute_id:o,attribute_name:a,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(t,e){i.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,o){console.error("not available on: ".concat(e," ").concat($attribute_key,"."),o)})).always((function(){i.unblock()})).done((function(e){e&&(i.html(e),t(document.body).trigger("woo_variation_swatches_product_term_paging_done",i))}))}},{key:"MetaboxToggle",value:function(){t("#woo_variation_swatches_variation_product_options").on("click",".wc-metabox > h4",(function(e){var o=t(this).parent(".wc-metabox"),a=t(this).next(".wc-metabox-content");if(t(e.target).filter(":input, option, .sort, select, label, .select2-selection__rendered").length)return!1;o.hasClass("closed")?(o.removeClass("closed open").addClass("open"),a.slideDown()):(o.removeClass("closed open").addClass("closed"),a.slideUp())}))}},{key:"AttributeTypeSwitch",value:function(){t("#woo_variation_swatches_variation_product_options").on("change","select.woo_variation_swatches_attribute_type_switch",(function(e){var o=t(this).val();["select"].includes(o),["image","color","button"].includes(o)&&t(this).closest(".wc-metabox").find(".wc-metabox-content select.woo_variation_swatches_attribute_term_type_switch").val(o).trigger("change")})).on("change","select.woo_variation_swatches_attribute_term_type_switch",(function(e){var o=t(this).closest(".woo-variation-swatches-attribute-options-wrapper").find("select.woo_variation_swatches_attribute_type_switch").val();t(this).val()!==o&&t(this).closest(".woo-variation-swatches-attribute-options-wrapper").find("select.woo_variation_swatches_attribute_type_switch").val("mixed").trigger("change")}))}},{key:"SetAttributeTypePaging",value:function(e){var o=t(e).closest(".woo-variation-swatches-attribute-options-wrapper").find("select.woo_variation_swatches_attribute_type_switch").val();t(e).find("select.woo_variation_swatches_attribute_term_type_switch").hasClass("new-mode"),["image","color","button"].includes(o)&&t(e).find("select.woo_variation_swatches_attribute_term_type_switch.new-mode").val(o).trigger("change"),t(e).find("select.woo_variation_swatches_attribute_term_type_switch.new-mode").each((function(){t(this).val()}))}},{key:"LoadProductAttributes",value:function(){t("#woocommerce-product-data").on("woocommerce_variations_loaded",(function(e){var o=t("#woo_variation_swatches_variation_product_options").data("product_id");t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_load_product_options"),method:"POST",data:{product_id:o,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(e,o){t("#woo_variation_swatches_variation_product_options_inner").block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,e){console.error("not load option: ".concat(o,"."),e)})).always((function(){t("#woo_variation_swatches_variation_product_options_inner").unblock()})).done((function(e){t(document.body).trigger("woo_variation_swatches_variation_product_options_loaded",o)}))}))}},{key:"SaveProductAttributes",value:function(){var e=!1,o=t("#woo_variation_swatches_variation_product_options");o.on("change input color-changed",":input:not(.wvs-skip-field)",(function(){e||(window.onbeforeunload=function(){return woo_variation_swatches_admin.nav_warning},e=!0)})).on("click",".woo_variation_swatches_save_product_attributes, .woo_variation_swatches_reset_product_attributes",(function(){window.onbeforeunload=""})).on("click",".woo_variation_swatches_save_product_attributes",(function(e){e.preventDefault();var a,n=o.find(":input:not(.wvs-skip-field)").serializeJSON({disableColonTypes:!0}),i=Object.keys(n)?Object.keys(n).shift():"woo_variation_swatches_product_options",r=o.data("product_id");t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_save_product_options"),method:"POST",data:{data:n[i],product_id:r,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(e,o){clearTimeout(a),t("#woo_variation_swatches_variation_product_options_inner").block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,e){console.error("not saved on: ".concat(r,"."),e)})).always((function(){t("#woo_variation_swatches_variation_product_options_inner").unblock()})).done((function(e){t("#saved-message").show(),a=setTimeout((function(){t("#saved-message").hide(600)}),5e3),t(document.body).trigger("woo_variation_swatches_variation_product_options_saved",r)}))})).on("click",".woo_variation_swatches_reset_product_attributes",(function(e){if(e.preventDefault(),confirm(woo_variation_swatches_admin.reset_notice)){var o=t(this).data("product_id");t.ajax({global:!1,url:woo_variation_swatches_admin.wc_ajax_url.toString().replace("%%endpoint%%","woo_variation_swatches_reset_product_options"),method:"POST",data:{product_id:o,nonce:woo_variation_swatches_admin.nonce},beforeSend:function(e,o){t("#woo_variation_swatches_variation_product_options_inner").block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}})}}).fail((function(t,e){console.error("not reset on: ".concat(o,"."),e)})).always((function(){t("#woo_variation_swatches_variation_product_options_inner").unblock()})).done((function(e){var a=t(e).find("#woo_variation_swatches_variation_product_options_inner").html();t("#woo_variation_swatches_variation_product_options_inner").html(a),t(document.body).trigger("woo_variation_swatches_variation_product_options_reset",o)}))}}))}},{key:"ResetProductAttributes",value:function(){t("#woo_variation_swatches_variation_product_options")}},{key:"Pagination",value:function(){var e=this,o=!1;t("#woo_variation_swatches_variation_product_options").on("change input color-changed",":input:not(.wvs-skip-field)",(function(t){o||(o=!0)})).on("click",".woo_variation_swatches_reset_product_attributes",(function(t){t.preventDefault(),o=!1})).on("click",".woo_variation_swatches_save_product_attributes",(function(t){t.preventDefault(),o=!1})).on("click",".first-page:not(.disabled), .prev-page:not(.disabled), .last-page:not(.disabled), .next-page:not(.disabled)",(function(t){o&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),alert(woo_variation_swatches_admin.nav_warning))})).on("click",".first-page.disabled, .prev-page.disabled, .last-page.disabled, .next-page.disabled",(function(t){t.preventDefault()})).on("click",".first-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination"),i=a.data("product_id"),r=a.data("attribute_id"),c=a.data("attribute_name");e.PaginationAjax(i,r,c,0,a),n.find(".next-page, .last-page").removeClass("disabled"),n.find(".current-page").text(1),a.data("current",1),n.find(".first-page, .prev-page").addClass("disabled")})).on("click",".prev-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination");a.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}});var i=a.data("product_id"),r=(a.data("pages"),a.data("attribute_id")),c=a.data("attribute_name"),s=a.data("current"),l=a.data("limit"),d=(a.data("total"),(s-1)*l-l),u=s-1;e.PaginationAjax(i,r,c,d,a),n.find(".next-page, .last-page").removeClass("disabled"),n.find(".current-page").text(u),a.data("current",u),0===d&&n.find(".first-page, .prev-page").addClass("disabled")})).on("click",".next-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination");a.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}});var i=a.data("product_id"),r=a.data("pages"),c=a.data("attribute_id"),s=a.data("attribute_name"),l=a.data("current"),d=a.data("limit"),u=(a.data("total"),l*d),_=l+1;e.PaginationAjax(i,c,s,u,a),n.find(".first-page, .prev-page").removeClass("disabled"),n.find(".current-page").text(_),a.data("current",_),r===_&&n.find(".next-page, .last-page").addClass("disabled")})).on("click",".last-page:not(.disabled)",(function(o){o.preventDefault();var a=t(o.currentTarget).closest(".product-term-label-settings").find(".product-term-label-settings-contents"),n=t(o.currentTarget).closest(".product-term-label-settings-pagination");a.block({message:null,overlayCSS:{background:"#DDDDDD",opacity:.6}});var i=a.data("product_id"),r=a.data("pages"),c=a.data("attribute_id"),s=a.data("attribute_name"),l=(a.data("current"),a.data("limit")),d=r*l-l;e.PaginationAjax(i,c,s,d,a),n.find(".first-page, .prev-page").removeClass("disabled"),n.find(".current-page").text(r),a.data("current",r),n.find(".next-page, .last-page").addClass("disabled")}))}},{key:"ResetAfterTermCreate",value:function(){t(document.body).on("woo_variation_swatches_admin_term_meta_added",this.ClearImagePicker),t(document.body).on("woo_variation_swatches_admin_term_meta_added",this.ClearColorPicker),t(document).ajaxComplete((function(e,o,a){try{var n=Object.fromEntries(new URLSearchParams(a.data));"add-tag"===n.action&&""===t("#tag-name").val()&&_.delay((function(){t(document.body).trigger("woo_variation_swatches_admin_term_meta_added",n)}),300)}catch(t){}}))}},{key:"ImageUploader",value:function(){t(document.body).off("click","button.wvs_upload_image_button"),t(document.body).on("click","button.wvs_upload_image_button",this.AddImage),t(document.body).on("click","button.wvs_remove_image_button",this.RemoveImage)}},{key:"AddImage",value:function(e){var o,a=this;if(e.preventDefault(),e.stopPropagation(),"undefined"!=typeof wp&&wp.media&&wp.media.editor){if(o)return void o.open();(o=wp.media.frames.select_image=wp.media({title:woo_variation_swatches_admin.media_title,button:{text:woo_variation_swatches_admin.button_title},multiple:!1})).on("select",(function(){var e=o.state().get("selection").first().toJSON();if(""!==t.trim(e.id)){var n=void 0===e.sizes.thumbnail?e.sizes.full.url:e.sizes.thumbnail.url;t(a).prev().val(e.id),t(a).closest(".meta-image-field-wrapper").find("img").attr("src",n),t(a).next().show()}})),o.on("open",(function(){var e=o.state().get("selection"),n=t(a).prev().val(),i=wp.media.attachment(n);i.fetch(),e.add(i?[i]:[])})),o.open()}}},{key:"RemoveImage",value:function(e){e.preventDefault(),e.stopPropagation();var o=t(this).closest(".meta-image-field-wrapper").find("img").data("placeholder");return t(this).closest(".meta-image-field-wrapper").find("img").attr("src",o),t(this).prev().prev().val(""),t(this).hide(),!1}},{key:"ClearImagePicker",value:function(){t("#addtag").find(".wvs_remove_image_button").trigger("click")}},{key:"__SelectWoo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"select.wvs-select-woo";try{t(document.body).on("woo_variation_swatches_select_woo_init",(function(o){t(e).selectWoo({allowClear:!0})})).trigger("woo_variation_swatches_select_woo_init")}catch(t){window.console.log(t)}}},{key:"InitTooltip",value:function(){t(document.body).trigger("init_tooltips")}},{key:"SelectWoo",value:function(){try{t(document.body).trigger("wc-enhanced-select-init")}catch(t){window.console.log(t)}}},{key:"ColorPicker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"input.wvs-color-picker";try{t(document.body).on("woo_variation_swatches_color_picker_init",(function(o){t(e).wpColorPicker({change:function(o,a){t(e).trigger("color-changed")},clear:function(){t(e).trigger("color-changed")}})})).trigger("woo_variation_swatches_color_picker_init")}catch(t){window.console.log(t)}}},{key:"ClearColorPicker",value:function(){t("#addtag").find(".wp-picker-clear").trigger("click")}},{key:"FieldDependency",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"[data-gwp_dependency]";try{t(document.body).on("init_form_field_dependency",(function(){t(e).GWPFormFieldDependency()})).trigger("init_form_field_dependency")}catch(t){window.console.log(t)}}},{key:"FieldDependencyTrigger",value:function(){t(document.body).trigger("init_form_field_dependency")}},{key:"savingDialog",value:function(e,o,i){var r={},c="";if(o.find("input, select").each((function(){var e=t(this).attr("name"),o=t(this).val();e&&("tag_name"===e?c=o:r[e]=o,t(this).val(""))})),c){t(".product_attributes").block({message:null,overlayCSS:{background:"#FFFFFF",opacity:.6}});var s=function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?a(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({action:"woocommerce_add_new_attribute",taxonomy:i,term:c,security:woocommerce_admin_meta_boxes.add_attribute_nonce},r);t.post(woocommerce_admin_meta_boxes.ajax_url,s,(function(o){o.error?window.alert(o.error):o.slug&&(e.find("select.attribute_values").append('<option value="'+o.term_id+'" selected="selected">'+o.name+"</option>"),e.find("select.attribute_values").change()),t(".product_attributes").unblock()}))}else t(".product_attributes").unblock()}},{key:"AttributeDialog",value:function(){var e=this;t(".product_attributes").on("click","button.wvs_add_new_attribute",(function(o){o.preventDefault();var a=t(this).closest(".woocommerce_attribute"),n=a.data("taxonomy"),i=t(this).data("dialog_title");t(".wvs-attribute-dialog-for-"+n).dialog({title:"",dialogClass:"wp-dialog wvs-attribute-dialog",classes:{"ui-dialog":"wp-dialog wvs-attribute-dialog"},autoOpen:!1,draggable:!0,width:"auto",modal:!0,resizable:!1,closeOnEscape:!0,position:{my:"center",at:"center",of:window},open:function(){t(".ui-widget-overlay").bind("click",(function(){t("#attribute-dialog").dialog("close")}))},create:function(){}}).dialog("option","title",i).dialog("option","buttons",[{text:woo_variation_swatches_admin.dialog_save,click:function(){e.savingDialog(a,t(this),n),t(this).dialog("close").dialog("destroy")}},{text:woo_variation_swatches_admin.dialog_cancel,click:function(){t(this).dialog("close").dialog("destroy")}}]).dialog("open")}))}}],(r=null)&&i(o.prototype,r),c&&i(o,c),Object.defineProperty(o,"prototype",{writable:!1}),e}();return e}(jQuery)},794:function(t,e,o){function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function n(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,o=new WeakMap;return(n=function(t){return t?o:e})(t)}jQuery((function(t){Promise.resolve().then((function(){return function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==a(t)&&"function"!=typeof t)return{default:t};var o=n(e);if(o&&o.has(t))return o.get(t);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var s=r?Object.getOwnPropertyDescriptor(t,c):null;s&&(s.get||s.set)?Object.defineProperty(i,c,s):i[c]=t[c]}return i.default=t,o&&o.set(t,i),i}(o(825))})).then((function(e){var o=e.PluginHelper;o.ResetAfterTermCreate(),o.ColorPicker(),o.ImageUploader(),o.FieldDependency(),o.Pagination(),o.MetaboxToggle(),o.AttributeTypeSwitch(),o.SaveProductAttributes(),t(document.body).on("woo_variation_swatches_variation_product_options_reset woo_variation_swatches_product_term_paging_done",(function(t,e){o.InitTooltip(),o.SelectWoo(),o.ColorPicker(),o.FieldDependencyTrigger(),o.SetAttributeTypePaging(e)}))}))}))},193:function(){},262:function(){}},o={};function a(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,a),i.exports}a.m=e,t=[],a.O=function(e,o,n,i){if(!o){var r=1/0;for(d=0;d<t.length;d++){o=t[d][0],n=t[d][1],i=t[d][2];for(var c=!0,s=0;s<o.length;s++)(!1&i||r>=i)&&Object.keys(a.O).every((function(t){return a.O[t](o[s])}))?o.splice(s--,1):(c=!1,i<r&&(r=i));if(c){t.splice(d--,1);var l=n();void 0!==l&&(e=l)}}return e}i=i||0;for(var d=t.length;d>0&&t[d-1][2]>i;d--)t[d]=t[d-1];t[d]=[o,n,i]},a.d=function(t,e){for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t={801:0,706:0,438:0};a.O.j=function(e){return 0===t[e]};var e=function(e,o){var n,i,r=o[0],c=o[1],s=o[2],l=0;if(r.some((function(e){return 0!==t[e]}))){for(n in c)a.o(c,n)&&(a.m[n]=c[n]);if(s)var d=s(a)}for(e&&e(o);l<r.length;l++)i=r[l],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0;return a.O(d)},o=self.webpackChunkwoo_variation_swatches=self.webpackChunkwoo_variation_swatches||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))}(),a.O(void 0,[706,438],(function(){return a(794)})),a.O(void 0,[706,438],(function(){return a(193)}));var n=a.O(void 0,[706,438],(function(){return a(262)}));n=a.O(n)}();
|
assets/js/frontend.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
-
* Date: 7/
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
/******/ (function() { // webpackBootstrap
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
+
* Date: 7/31/2022, 4:31:22 PM
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
/******/ (function() { // webpackBootstrap
|
assets/js/wp-color-picker-alpha.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
-
* Date: 7/
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
/******/ (function() { // webpackBootstrap
|
2 |
* Variation Swatches for WooCommerce
|
3 |
*
|
4 |
* Author: Emran Ahmed ( emran.bd.08@gmail.com )
|
5 |
+
* Date: 7/31/2022, 4:31:22 PM
|
6 |
* Released under the GPLv3 license.
|
7 |
*/
|
8 |
/******/ (function() { // webpackBootstrap
|
includes/class-woo-variation-swatches-settings.php
CHANGED
@@ -476,7 +476,7 @@
|
|
476 |
'desc' => esc_html__( 'Swatches Selected tick color. Default is: #ffffff', 'woo-variation-swatches' ),
|
477 |
'css' => 'width: 6em;',
|
478 |
'default' => '#ffffff',
|
479 |
-
'is_new' => true,
|
480 |
'custom_attributes' => array(// 'data-alpha-enabled' => 'true'
|
481 |
)
|
482 |
),
|
@@ -488,7 +488,7 @@
|
|
488 |
'desc' => esc_html__( 'Swatches cross color. Default is: #ff0000', 'woo-variation-swatches' ),
|
489 |
'css' => 'width: 6em;',
|
490 |
'default' => '#ff0000',
|
491 |
-
'is_new' => true,
|
492 |
'custom_attributes' => array(// 'data-alpha-enabled' => 'true'
|
493 |
)
|
494 |
),
|
476 |
'desc' => esc_html__( 'Swatches Selected tick color. Default is: #ffffff', 'woo-variation-swatches' ),
|
477 |
'css' => 'width: 6em;',
|
478 |
'default' => '#ffffff',
|
479 |
+
//'is_new' => true,
|
480 |
'custom_attributes' => array(// 'data-alpha-enabled' => 'true'
|
481 |
)
|
482 |
),
|
488 |
'desc' => esc_html__( 'Swatches cross color. Default is: #ff0000', 'woo-variation-swatches' ),
|
489 |
'css' => 'width: 6em;',
|
490 |
'default' => '#ff0000',
|
491 |
+
//'is_new' => true,
|
492 |
'custom_attributes' => array(// 'data-alpha-enabled' => 'true'
|
493 |
)
|
494 |
),
|
includes/getwooplugins/js/getwooplugins-form-field-dependency.js
CHANGED
@@ -85,7 +85,8 @@
|
|
85 |
|
86 |
let values = []
|
87 |
|
88 |
-
if (selector) {
|
|
|
89 |
let inputType = $(selector).prop('type').toLowerCase()
|
90 |
|
91 |
let currentSelector = selector;
|
85 |
|
86 |
let values = []
|
87 |
|
88 |
+
if (selector && $(selector).length > 0) {
|
89 |
+
|
90 |
let inputType = $(selector).prop('type').toLowerCase()
|
91 |
|
92 |
let currentSelector = selector;
|
languages/woo-variation-swatches.pot
CHANGED
@@ -7,7 +7,7 @@ msgstr ""
|
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
9 |
"Language-Team: Emran Ahmed <emran.bd.08@gmail.com>\n"
|
10 |
-
"POT-Creation-Date: 2022-07-
|
11 |
"X-Poedit-Basepath: ..\n"
|
12 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
13 |
"X-Poedit-SearchPath-0: .\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
9 |
"Language-Team: Emran Ahmed <emran.bd.08@gmail.com>\n"
|
10 |
+
"POT-Creation-Date: 2022-07-31 10:31+0000\n"
|
11 |
"X-Poedit-Basepath: ..\n"
|
12 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
13 |
"X-Poedit-SearchPath-0: .\n"
|
woo-variation-swatches.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: https://wordpress.org/plugins/woo-variation-swatches/
|
5 |
* Description: Beautiful colors, images and buttons variation swatches for woocommerce product attributes. Requires WooCommerce 5.6+
|
6 |
* Author: Emran Ahmed
|
7 |
-
* Version: 2.0.
|
8 |
* Domain Path: /languages
|
9 |
* Requires PHP: 7.0
|
10 |
* Requires at least: 5.6
|
@@ -18,7 +18,7 @@
|
|
18 |
defined( 'ABSPATH' ) or die( 'Keep Silent' );
|
19 |
|
20 |
if ( ! defined( 'WOO_VARIATION_SWATCHES_PLUGIN_VERSION' ) ) {
|
21 |
-
define( 'WOO_VARIATION_SWATCHES_PLUGIN_VERSION', '2.0.
|
22 |
}
|
23 |
|
24 |
if ( ! defined( 'WOO_VARIATION_SWATCHES_PLUGIN_FILE' ) ) {
|
4 |
* Plugin URI: https://wordpress.org/plugins/woo-variation-swatches/
|
5 |
* Description: Beautiful colors, images and buttons variation swatches for woocommerce product attributes. Requires WooCommerce 5.6+
|
6 |
* Author: Emran Ahmed
|
7 |
+
* Version: 2.0.6
|
8 |
* Domain Path: /languages
|
9 |
* Requires PHP: 7.0
|
10 |
* Requires at least: 5.6
|
18 |
defined( 'ABSPATH' ) or die( 'Keep Silent' );
|
19 |
|
20 |
if ( ! defined( 'WOO_VARIATION_SWATCHES_PLUGIN_VERSION' ) ) {
|
21 |
+
define( 'WOO_VARIATION_SWATCHES_PLUGIN_VERSION', '2.0.6' );
|
22 |
}
|
23 |
|
24 |
if ( ! defined( 'WOO_VARIATION_SWATCHES_PLUGIN_FILE' ) ) {
|