From 25787b0330883463ce437f76e976162d441a26be Mon Sep 17 00:00:00 2001 From: claudiosmweb Date: Wed, 30 Jul 2014 16:12:32 -0300 Subject: [PATCH] removed a console.log() --- assets/js/admin/meta-boxes-product-variation.js | 2 -- assets/js/admin/meta-boxes-product-variation.min.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index 7c7c3920b5d..c4ae2c69512 100644 --- a/assets/js/admin/meta-boxes-product-variation.js +++ b/assets/js/admin/meta-boxes-product-variation.js @@ -269,8 +269,6 @@ jQuery( function ( $ ) { new_value = current_value - mod_value; } - console.log( new_value ); - $( this ).val( accounting.formatNumber( new_value, woocommerce_admin_meta_boxes.currency_format_num_decimals, diff --git a/assets/js/admin/meta-boxes-product-variation.min.js b/assets/js/admin/meta-boxes-product-variation.min.js index 2c5000bc984..3698fe83f35 100644 --- a/assets/js/admin/meta-boxes-product-variation.min.js +++ b/assets/js/admin/meta-boxes-product-variation.min.js @@ -1 +1 @@ -jQuery(function(a){function b(){a(".woocommerce_variations .woocommerce_variation").each(function(b,c){a(".variation_menu_order",c).val(parseInt(a(c).index(".woocommerce_variations .woocommerce_variation"),10))})}var c={items:".woocommerce_variation",cursor:"move",axis:"y",handle:"h3",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,c){c.item.removeAttr("style"),b()}};a("#variable_product_options").on("click","button.add_variation",function(){a(".woocommerce_variations").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var b=a(".woocommerce_variation").size(),c={action:"woocommerce_add_variation",post_id:woocommerce_admin_meta_boxes_variations.post_id,loop:b,security:woocommerce_admin_meta_boxes_variations.add_variation_nonce};return a.post(woocommerce_admin_meta_boxes_variations.ajax_url,c,function(b){a(".woocommerce_variations").append(b),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50}),a("input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock").change(),a("input#_manage_stock").attr("checked")||a(".hide_if_parent_manage_stock_is_disabled").hide(),a(".woocommerce_variations").unblock(),a("#variable_product_options").trigger("woocommerce_variations_added")}),!1}),a("input#_manage_stock").on("change",function(){var b=a(".hide_if_parent_manage_stock_is_disabled");a(this).attr("checked")?(b.show(),a("input.variable_manage_stock").change()):b.hide()}).change(),a("#variable_product_options").on("click","button.link_all_variations",function(){var b=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_link_all_variations);if(b){a("#variable_product_options").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var c={action:"woocommerce_link_all_variations",post_id:woocommerce_admin_meta_boxes_variations.post_id,security:woocommerce_admin_meta_boxes_variations.link_variation_nonce};a.post(woocommerce_admin_meta_boxes_variations.ajax_url,c,function(b){var c=parseInt(b,10);if(window.alert(1===c?c+" "+woocommerce_admin_meta_boxes_variations.i18n_variation_added:0===c||c>1?c+" "+woocommerce_admin_meta_boxes_variations.i18n_variations_added:woocommerce_admin_meta_boxes_variations.i18n_no_variations_added),c>0){var d=window.location.toString();d=d.replace("post-new.php?","post.php?post="+woocommerce_admin_meta_boxes_variations.post_id+"&action=edit&"),a("#variable_product_options").load(d+" #variable_product_options_inner",function(){a("#variable_product_options").unblock(),a("#variable_product_options").trigger("woocommerce_variations_added"),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50})})}else a("#variable_product_options").unblock()})}return!1}),a("#variable_product_options").on("click","button.remove_variation",function(b){b.preventDefault();var c=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_remove_variation);if(c){var d=a(this).parent().parent(),e=a(this).attr("rel");if(e>0){a(d).block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var f={action:"woocommerce_remove_variation",variation_id:e,security:woocommerce_admin_meta_boxes_variations.delete_variation_nonce};a.post(woocommerce_admin_meta_boxes_variations.ajax_url,f,function(){a(d).fadeOut("300",function(){a(d).remove()})})}else a(d).fadeOut("300",function(){a(d).remove()})}return!1}),a(".wc-metaboxes-wrapper").on("click","a.bulk_edit",function(){var b,c,d,e=a("select#field_to_edit").val();switch(e){case"toggle_enabled":b=a('input[name^="variable_enabled"]'),b.attr("checked",!b.attr("checked"));break;case"toggle_downloadable":b=a('input[name^="variable_is_downloadable"]'),b.attr("checked",!b.attr("checked")),a("input.variable_is_downloadable").change();break;case"toggle_virtual":b=a('input[name^="variable_is_virtual"]'),b.attr("checked",!b.attr("checked")),a("input.variable_is_virtual").change();break;case"toggle_manage_stock":b=a('input[name^="variable_manage_stock"]'),b.attr("checked",!b.attr("checked")),a("input.variable_manage_stock").change();break;case"delete_all":if(c=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_delete_all_variations),c&&(c=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_last_warning))){var f=[];a(".woocommerce_variations .woocommerce_variation").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}}),a(".woocommerce_variations .woocommerce_variation .remove_variation").each(function(){var b=a(this).attr("rel");b>0&&f.push(b)});var g={action:"woocommerce_remove_variations",variation_ids:f,security:woocommerce_admin_meta_boxes_variations.delete_variations_nonce};a.post(woocommerce_admin_meta_boxes_variations.ajax_url,g,function(){a(".woocommerce_variations .woocommerce_variation").fadeOut("300",function(){a(".woocommerce_variations .woocommerce_variation").remove()})})}break;case"variable_regular_price_increase":case"variable_regular_price_decrease":case"variable_sale_price_increase":case"variable_sale_price_decrease":var h;h=0===e.lastIndexOf("variable_regular_price",0)?"variable_regular_price":"variable_sale_price",d=window.prompt(woocommerce_admin_meta_boxes_variations.i18n_enter_a_value_fixed_or_percent).toString(),a(':input[name^="'+h+'"]').each(function(){var b,c,f=accounting.unformat(a(this).val(),woocommerce_admin.mon_decimal_point);c=d.indexOf("%")>=0?f/100*accounting.unformat(d.replace(/\%/,""),woocommerce_admin.mon_decimal_point):accounting.unformat(d,woocommerce_admin.mon_decimal_point),b=-1!==e.indexOf("increase")?f+c:f-c,console.log(b),a(this).val(accounting.formatNumber(b,woocommerce_admin_meta_boxes.currency_format_num_decimals,woocommerce_admin_meta_boxes.currency_format_thousand_sep,woocommerce_admin_meta_boxes.currency_format_decimal_sep)).change()});break;case"variable_regular_price":case"variable_sale_price":case"variable_stock":case"variable_weight":case"variable_length":case"variable_width":case"variable_height":case"variable_download_limit":case"variable_download_expiry":d=window.prompt(woocommerce_admin_meta_boxes_variations.i18n_enter_a_value),a(':input[name^="'+e+'"]').not('[name*="dates"]').val(d).change();break;default:a("select#field_to_edit").trigger(e)}}),a("#variable_product_options").on("change","input.variable_is_downloadable",function(){a(this).closest(".woocommerce_variation").find(".show_if_variation_downloadable").hide(),a(this).is(":checked")&&a(this).closest(".woocommerce_variation").find(".show_if_variation_downloadable").show()}),a("#variable_product_options").on("change","input.variable_is_virtual",function(){a(this).closest(".woocommerce_variation").find(".hide_if_variation_virtual").show(),a(this).is(":checked")&&a(this).closest(".woocommerce_variation").find(".hide_if_variation_virtual").hide()}),a("#variable_product_options").on("change","input.variable_manage_stock",function(){a(this).closest(".woocommerce_variation").find(".show_if_variation_manage_stock").hide(),a(this).is(":checked")&&a(this).closest(".woocommerce_variation").find(".show_if_variation_manage_stock").show()}),a("input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock").change(),a("#variable_product_options").on("woocommerce_variations_added",function(){a(".woocommerce_variations").sortable(c)}),a(".woocommerce_variations").sortable(c);var d,e,f,g=wp.media.model.settings.post.id;a("#variable_product_options").on("click",".upload_image_button",function(b){var c=a(this),h=c.attr("rel"),i=c.closest(".upload_image");if(f=i,e=h,b.preventDefault(),c.is(".remove"))f.find(".upload_image_id").val(""),f.find("img").eq(0).attr("src",woocommerce_admin_meta_boxes_variations.woocommerce_placeholder_img_src),f.find(".upload_image_button").removeClass("remove");else{if(d)return d.uploader.uploader.param("post_id",e),void d.open();wp.media.model.settings.post.id=e,d=wp.media.frames.variable_image=wp.media({title:woocommerce_admin_meta_boxes_variations.i18n_choose_image,button:{text:woocommerce_admin_meta_boxes_variations.i18n_set_image},states:[new wp.media.controller.Library({title:woocommerce_admin_meta_boxes_variations.i18n_choose_image,filterable:"all"})]}),d.on("select",function(){var a=d.state().get("selection").first().toJSON(),b=a.sizes.thumbnail?a.sizes.thumbnail.url:a.url;f.find(".upload_image_id").val(a.id),f.find(".upload_image_button").addClass("remove"),f.find("img").eq(0).attr("src",b),wp.media.model.settings.post.id=g}),d.open()}}),a("a.add_media").on(" click",function(){wp.media.model.settings.post.id=g})}); \ No newline at end of file +jQuery(function(a){function b(){a(".woocommerce_variations .woocommerce_variation").each(function(b,c){a(".variation_menu_order",c).val(parseInt(a(c).index(".woocommerce_variations .woocommerce_variation"),10))})}var c={items:".woocommerce_variation",cursor:"move",axis:"y",handle:"h3",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(a,b){b.item.css("background-color","#f6f6f6")},stop:function(a,c){c.item.removeAttr("style"),b()}};a("#variable_product_options").on("click","button.add_variation",function(){a(".woocommerce_variations").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var b=a(".woocommerce_variation").size(),c={action:"woocommerce_add_variation",post_id:woocommerce_admin_meta_boxes_variations.post_id,loop:b,security:woocommerce_admin_meta_boxes_variations.add_variation_nonce};return a.post(woocommerce_admin_meta_boxes_variations.ajax_url,c,function(b){a(".woocommerce_variations").append(b),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50}),a("input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock").change(),a("input#_manage_stock").attr("checked")||a(".hide_if_parent_manage_stock_is_disabled").hide(),a(".woocommerce_variations").unblock(),a("#variable_product_options").trigger("woocommerce_variations_added")}),!1}),a("input#_manage_stock").on("change",function(){var b=a(".hide_if_parent_manage_stock_is_disabled");a(this).attr("checked")?(b.show(),a("input.variable_manage_stock").change()):b.hide()}).change(),a("#variable_product_options").on("click","button.link_all_variations",function(){var b=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_link_all_variations);if(b){a("#variable_product_options").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var c={action:"woocommerce_link_all_variations",post_id:woocommerce_admin_meta_boxes_variations.post_id,security:woocommerce_admin_meta_boxes_variations.link_variation_nonce};a.post(woocommerce_admin_meta_boxes_variations.ajax_url,c,function(b){var c=parseInt(b,10);if(window.alert(1===c?c+" "+woocommerce_admin_meta_boxes_variations.i18n_variation_added:0===c||c>1?c+" "+woocommerce_admin_meta_boxes_variations.i18n_variations_added:woocommerce_admin_meta_boxes_variations.i18n_no_variations_added),c>0){var d=window.location.toString();d=d.replace("post-new.php?","post.php?post="+woocommerce_admin_meta_boxes_variations.post_id+"&action=edit&"),a("#variable_product_options").load(d+" #variable_product_options_inner",function(){a("#variable_product_options").unblock(),a("#variable_product_options").trigger("woocommerce_variations_added"),a(".tips").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50})})}else a("#variable_product_options").unblock()})}return!1}),a("#variable_product_options").on("click","button.remove_variation",function(b){b.preventDefault();var c=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_remove_variation);if(c){var d=a(this).parent().parent(),e=a(this).attr("rel");if(e>0){a(d).block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var f={action:"woocommerce_remove_variation",variation_id:e,security:woocommerce_admin_meta_boxes_variations.delete_variation_nonce};a.post(woocommerce_admin_meta_boxes_variations.ajax_url,f,function(){a(d).fadeOut("300",function(){a(d).remove()})})}else a(d).fadeOut("300",function(){a(d).remove()})}return!1}),a(".wc-metaboxes-wrapper").on("click","a.bulk_edit",function(){var b,c,d,e=a("select#field_to_edit").val();switch(e){case"toggle_enabled":b=a('input[name^="variable_enabled"]'),b.attr("checked",!b.attr("checked"));break;case"toggle_downloadable":b=a('input[name^="variable_is_downloadable"]'),b.attr("checked",!b.attr("checked")),a("input.variable_is_downloadable").change();break;case"toggle_virtual":b=a('input[name^="variable_is_virtual"]'),b.attr("checked",!b.attr("checked")),a("input.variable_is_virtual").change();break;case"toggle_manage_stock":b=a('input[name^="variable_manage_stock"]'),b.attr("checked",!b.attr("checked")),a("input.variable_manage_stock").change();break;case"delete_all":if(c=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_delete_all_variations),c&&(c=window.confirm(woocommerce_admin_meta_boxes_variations.i18n_last_warning))){var f=[];a(".woocommerce_variations .woocommerce_variation").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_admin_meta_boxes_variations.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}}),a(".woocommerce_variations .woocommerce_variation .remove_variation").each(function(){var b=a(this).attr("rel");b>0&&f.push(b)});var g={action:"woocommerce_remove_variations",variation_ids:f,security:woocommerce_admin_meta_boxes_variations.delete_variations_nonce};a.post(woocommerce_admin_meta_boxes_variations.ajax_url,g,function(){a(".woocommerce_variations .woocommerce_variation").fadeOut("300",function(){a(".woocommerce_variations .woocommerce_variation").remove()})})}break;case"variable_regular_price_increase":case"variable_regular_price_decrease":case"variable_sale_price_increase":case"variable_sale_price_decrease":var h;h=0===e.lastIndexOf("variable_regular_price",0)?"variable_regular_price":"variable_sale_price",d=window.prompt(woocommerce_admin_meta_boxes_variations.i18n_enter_a_value_fixed_or_percent).toString(),a(':input[name^="'+h+'"]').each(function(){var b,c,f=accounting.unformat(a(this).val(),woocommerce_admin.mon_decimal_point);c=d.indexOf("%")>=0?f/100*accounting.unformat(d.replace(/\%/,""),woocommerce_admin.mon_decimal_point):accounting.unformat(d,woocommerce_admin.mon_decimal_point),b=-1!==e.indexOf("increase")?f+c:f-c,a(this).val(accounting.formatNumber(b,woocommerce_admin_meta_boxes.currency_format_num_decimals,woocommerce_admin_meta_boxes.currency_format_thousand_sep,woocommerce_admin_meta_boxes.currency_format_decimal_sep)).change()});break;case"variable_regular_price":case"variable_sale_price":case"variable_stock":case"variable_weight":case"variable_length":case"variable_width":case"variable_height":case"variable_download_limit":case"variable_download_expiry":d=window.prompt(woocommerce_admin_meta_boxes_variations.i18n_enter_a_value),a(':input[name^="'+e+'"]').not('[name*="dates"]').val(d).change();break;default:a("select#field_to_edit").trigger(e)}}),a("#variable_product_options").on("change","input.variable_is_downloadable",function(){a(this).closest(".woocommerce_variation").find(".show_if_variation_downloadable").hide(),a(this).is(":checked")&&a(this).closest(".woocommerce_variation").find(".show_if_variation_downloadable").show()}),a("#variable_product_options").on("change","input.variable_is_virtual",function(){a(this).closest(".woocommerce_variation").find(".hide_if_variation_virtual").show(),a(this).is(":checked")&&a(this).closest(".woocommerce_variation").find(".hide_if_variation_virtual").hide()}),a("#variable_product_options").on("change","input.variable_manage_stock",function(){a(this).closest(".woocommerce_variation").find(".show_if_variation_manage_stock").hide(),a(this).is(":checked")&&a(this).closest(".woocommerce_variation").find(".show_if_variation_manage_stock").show()}),a("input.variable_is_downloadable, input.variable_is_virtual, input.variable_manage_stock").change(),a("#variable_product_options").on("woocommerce_variations_added",function(){a(".woocommerce_variations").sortable(c)}),a(".woocommerce_variations").sortable(c);var d,e,f,g=wp.media.model.settings.post.id;a("#variable_product_options").on("click",".upload_image_button",function(b){var c=a(this),h=c.attr("rel"),i=c.closest(".upload_image");if(f=i,e=h,b.preventDefault(),c.is(".remove"))f.find(".upload_image_id").val(""),f.find("img").eq(0).attr("src",woocommerce_admin_meta_boxes_variations.woocommerce_placeholder_img_src),f.find(".upload_image_button").removeClass("remove");else{if(d)return d.uploader.uploader.param("post_id",e),void d.open();wp.media.model.settings.post.id=e,d=wp.media.frames.variable_image=wp.media({title:woocommerce_admin_meta_boxes_variations.i18n_choose_image,button:{text:woocommerce_admin_meta_boxes_variations.i18n_set_image},states:[new wp.media.controller.Library({title:woocommerce_admin_meta_boxes_variations.i18n_choose_image,filterable:"all"})]}),d.on("select",function(){var a=d.state().get("selection").first().toJSON(),b=a.sizes.thumbnail?a.sizes.thumbnail.url:a.url;f.find(".upload_image_id").val(a.id),f.find(".upload_image_button").addClass("remove"),f.find("img").eq(0).attr("src",b),wp.media.model.settings.post.id=g}),d.open()}}),a("a.add_media").on(" click",function(){wp.media.model.settings.post.id=g})}); \ No newline at end of file