%PDF- %PDF-
Direktori : /var/www/projetos/stb.ind.br/wp-content/plugins/woo-variation-swatches/assets/js/ |
Current File : /var/www/projetos/stb.ind.br/wp-content/plugins/woo-variation-swatches/assets/js/admin.min.js |
!function(e){var t={};function o(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=e,o.c=t,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){o(1),o(3),o(4),o(5),o(6),o(7),e.exports=o(8)},function(e,t,o){jQuery(function(e){Promise.resolve().then(function(){return o(2)}).then(function(t){var o=t.PluginHelper;o.GWPAdmin(),o.SelectWoo(),o.ColorPicker(),o.FieldDependency(),o.ImageUploader(),o.AttributeDialog(),e("#woocommerce-product-data").on("woocommerce_variations_loaded",function(){o.GalleryNotification()}),e("#variable_product_options").on("woocommerce_variations_added",function(){o.GalleryNotification()}),e(document.body).on("woocommerce_added_attribute",function(){o.SelectWoo(),o.ColorPicker(),o.ImageUploader(),o.AttributeDialog()}),e(document.body).on("wvs_pro_product_swatches_variation_loaded",function(){o.ColorPicker(),o.ImageUploader()})})})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o.d(t,"PluginHelper",function(){return r});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},a=function(){function e(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,o,i){return o&&e(t.prototype,o),i&&e(t,i),t}}();var n,r=(n=jQuery,function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"GWPAdmin",value:function(){n().gwp_live_feed&&n().gwp_live_feed(),n().gwp_deactivate_popup&&n().gwp_deactivate_popup("woo-variation-swatches")}},{key:"GalleryNotification",value:function(){n(".woocommerce_variation").each(function(){var e=n(this).find(".options:first");n(this).find(".woo-variation-gallery-message").insertBefore(e)}),n("input.upload_image_id").on("change",function(e){n.trim(n(this).val())?n(this).closest(".data").find(".woo-variation-gallery-message").addClass("enable"):n(this).closest(".data").find(".woo-variation-gallery-message").removeClass("enable")}),n("a.install-woo-variation-gallery-action").on("click",function(e){e.preventDefault();var t=n(this).parent(),o=t.data("installing"),i=t.data("activated"),a=t.data("nonce");t.text(o),wp.ajax.send("install_woo_variation_gallery",{data:{nonce:a},success:function(e){t.text(i),_.delay(function(){n(".woocommerce_variable_attributes .woo-variation-gallery-message").remove()},5e3)},error:function(e){t.text(i),_.delay(function(){n(".woocommerce_variable_attributes .woo-variation-gallery-message").remove()},5e3)}})})}},{key:"ImageUploader",value:function(){n(document).off("click","button.wvs_upload_image_button"),n(document).on("click","button.wvs_upload_image_button",this.AddImage),n(document).on("click","button.wvs_remove_image_button",this.RemoveImage)}},{key:"AddImage",value:function(e){var t=this;e.preventDefault(),e.stopPropagation();var o=void 0;if("undefined"!=typeof wp&&wp.media&&wp.media.editor){if(o)return void o.open();(o=wp.media.frames.select_image=wp.media({title:WVSPluginObject.media_title,button:{text:WVSPluginObject.button_title},multiple:!1})).on("select",function(){var e=o.state().get("selection").first().toJSON();if(""!==n.trim(e.id)){var i=void 0===e.sizes.thumbnail?e.sizes.full.url:e.sizes.thumbnail.url;n(t).prev().val(e.id),n(t).closest(".meta-image-field-wrapper").find("img").attr("src",i),n(t).next().show()}}),o.on("open",function(){var e=o.state().get("selection"),i=n(t).prev().val(),a=wp.media.attachment(i);a.fetch(),e.add(a?[a]:[])}),o.open()}}},{key:"RemoveImage",value:function(e){e.preventDefault(),e.stopPropagation();var t=n(this).closest(".meta-image-field-wrapper").find("img").data("placeholder");return n(this).closest(".meta-image-field-wrapper").find("img").attr("src",t),n(this).prev().prev().val(""),n(this).hide(),!1}},{key:"SelectWoo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"select.wvs-selectwoo";n().selectWoo&&n(e).selectWoo({allowClear:!0})}},{key:"ColorPicker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"input.wvs-color-picker";n().wpColorPicker&&n(e).wpColorPicker()}},{key:"FieldDependency",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"[data-wvsdepends]";n().FormFieldDependency&&n(e).FormFieldDependency()}},{key:"savingDialog",value:function(e,t,o){var a={},r="";if(t.find("input, select").each(function(){var e=n(this).attr("name"),t=n(this).val();e&&("tag_name"===e?r=t:a[e]=t,n(this).val(""))}),r){n(".product_attributes").block({message:null,overlayCSS:{background:"#FFFFFF",opacity:.6}});var l=i({action:"woocommerce_add_new_attribute",taxonomy:o,term:r,security:woocommerce_admin_meta_boxes.add_attribute_nonce},a);n.post(woocommerce_admin_meta_boxes.ajax_url,l,function(t){t.error?window.alert(t.error):t.slug&&(e.find("select.attribute_values").append('<option value="'+t.term_id+'" selected="selected">'+t.name+"</option>"),e.find("select.attribute_values").change()),n(".product_attributes").unblock()})}else n(".product_attributes").unblock()}},{key:"AttributeDialog",value:function(){var e=this;n(".product_attributes").on("click","button.wvs_add_new_attribute",function(t){t.preventDefault();var o=n(this).closest(".woocommerce_attribute"),i=o.data("taxonomy"),a=n(this).data("dialog_title");n(".wvs-attribute-dialog-for-"+i).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(){n(".ui-widget-overlay").bind("click",function(){n("#attribute-dialog").dialog("close")})},create:function(){}}).dialog("option","title",a).dialog("option","buttons",[{text:WVSPluginObject.dialog_save,click:function(){e.savingDialog(o,n(this),i),n(this).dialog("close").dialog("destroy")}},{text:WVSPluginObject.dialog_cancel,click:function(){n(this).dialog("close").dialog("destroy")}}]).dialog("open")})}}]),e}())},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){}]);