1jQuery(document).ready(function ($) { 2 $('.step__footer a.step__footer__continue-btn').click(function () { 3 var position = $(this).data('step-footer') 4 var current_position = position 5 switch (position) { 6 case 1: 7 $(".breadcrumb__item").removeClass('breadcrumb__item--current') 8 $('.breadcrumb__item[data-step="1"]').removeClass('active').addClass('breadcrumb__item--current') 9 $('.breadcrumb__item[data-step="2"]').addClass('breadcrumb__item--current').addClass('active') 10 $('.col-1').fadeOut(500) 11 $('.col-2').fadeIn(1000) 12 $('form.woocommerce-checkout').addClass('active') 13 break 14 case 2: 15 if (check_inputs_checkout() != false) { 16 $('.breadcrumb__item').removeClass('active').addClass('breadcrumb__item--current') 17 $('.breadcrumb__item[data-step="3"]').addClass('active') 18 $('.col-2').fadeOut(500) 19 $('.col-3').fadeIn(1000) 20 $('html, body').animate({ 21 scrollTop: $('#customer_details').offset().top - 80 }, 1000) 22 break 23 } else { 24 $('html, body').animate({ 25 scrollTop: $('#customer_details').offset().top - 50 }, 1000) 26 break 27 } 28 } 29 }) 30 31 $(".breadcrumb__item").click(function() { 32 var position = $(this).data("step"); 33 switch (position) { 34 case 1: 35 $(".breadcrumb__item").removeClass('breadcrumb__item--current').removeClass('active'); 36 $(this).addClass('breadcrumb__item--current').addClass('active'); 37 $('.col-3').fadeOut(500); 38 $('.col-2').fadeOut(500); 39 $('.col-1').fadeIn(1000); 40 $('form.woocommerce-checkout').removeClass('active'); 41 break; 42 case 2: 43 if(($('#billing_email').length > 0) && validateEmail($('#billing_email').val())){ 44 $(".breadcrumb__item").removeClass('breadcrumb__item--current').removeClass('active'); 45 $('.breadcrumb__item[data-step="1"]').addClass('breadcrumb__item--current'); 46 $(this).addClass('breadcrumb__item--current').addClass('active'); 47 $('.col-1').fadeOut(500); 48 $('.col-3').fadeOut(500); 49 $('.col-2').fadeIn(1000); 50 $('form.woocommerce-checkout').addClass('active'); 51 break; 52 } else { 53 break; 54 } 55 case 3: 56 if(check_inputs_checkout() != false){ 57 $(".breadcrumb__item").addClass('breadcrumb__item--current'); 58 $(this).addClass('active'); 59 $('.col-1').fadeOut(500); 60 $('.col-2').fadeOut(500); 61 $('.col-3').fadeIn(1000); 62 break; 63 } else { 64 $('html, body').animate({ 65 scrollTop: $("#customer_details").offset().top - 50 66 }, 1000); 67 break; 68 } 69 } 70 }); 71 // cart checkout 72 function custom_quantity(){ 73 jQuery('<div class="quantity-nav"><div class="quantity-button quantity-up">+</div><div class="quantity-button quantity-down">-</div></div>').insertAfter('.quantity input'); 74 jQuery('.quantity').each(function() { 75 var spinner = jQuery(this), 76 input = spinner.find('input[type="number"]'), 77 btnUp = spinner.find('.quantity-up'), 78 btnDown = spinner.find('.quantity-down'), 79 min = input.attr('min'), 80 max = input.attr('max'); 81 if(max == ''){ 82 max = 100; 83 } 84 85 btnUp.click(function() { 86 var oldValue = parseFloat(input.val()); 87 if (oldValue >= max) { 88 var newVal = oldValue; 89 } else { 90 var newVal = oldValue + 1; 91 } 92 spinner.find("input").val(newVal); 93 spinner.find("input").trigger("change"); 94 }); 95 96 btnDown.click(function() { 97 var oldValue = parseFloat(input.val()); 98 if (oldValue <= min) { 99 var newVal = oldValue; 100 } else { 101 var newVal = oldValue - 1; 102 } 103 spinner.find("input").val(newVal); 104 spinner.find("input").trigger("change"); 105 }); 106 }); 107 } 108 custom_quantity(); 109 110 jQuery( 'body' ).on( 'updated_checkout updated_cart_totals', function() { 111 custom_quantity(); 112 }); 113 114 function check_inputs_checkout(){
115 var validated_total = true; 116 $( 'form.checkout .woocommerce-billing-fields .input-text:not(.js-sv-wc-payment-gateway-credit-card-form-input), form.checkout .woocommerce-billing-fields select' ).each( function() { 117 var $this = $( this ), 118 $parent = $this.closest( '.form-row' ), 119 validated = true; 120 121 if ( $parent.is( '.validate-required' ) ) { 122 if ( $this.val() === '' ) { 123 $parent.removeClass( 'woocommerce-validated' ).addClass( 'woocommerce-invalid woocommerce-invalid-required-field' ); 124 validated = false; 125 } 126 } 127 128 if ( $parent.is( '.validate-email' ) ) { 129 if ( $this.val() ) { 130 131 /* http://stackoverflow.com/questions/2855865/jquery-validate-e-mail-address-regex */ 132 var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); 133 134 if ( ! pattern.test( $this.val() ) ) { 135 $parent.removeClass( 'woocommerce-validated' ).addClass( 'woocommerce-invalid woocommerce-invalid-email' ); 136 validated = false; 137 } 138 } 139 } 140 141 if ( validated ) { 142 $parent.removeClass( 'woocommerce-invalid woocommerce-invalid-required-field' ).addClass( 'woocommerce-validated' ); 143 } else { 144 validated_total = false; 145 } 146 } ); 147 return validated_total; 148 } 149 150 $(".woocommerce").on('click', '.hideshow', function(e) { 151 e.preventDefault(); 152 if($(this).hasClass('is_composite')){ 153 var id = $(this).data('product-id'); 154 console.log(id); 155 if($(this).find(".fa").hasClass("fa-angle-up")){ 156 $('.tam_tam_specification_' + id).removeClass('visible').addClass('invisible'); 157 $(this).find(".fa").removeClass("fa-angle-up"); 158 $(this).find(".fa").addClass("fa-angle-down"); 159 } else { 160 $('.tam_tam_specification_' + id).addClass('visible').removeClass('invisible'); 161 $(this).find(".fa").removeClass("fa-angle-down"); 162 $(this).find(".fa").addClass("fa-angle-up"); 163 } 164 }else { 165 if($(this).find(".fa").hasClass("fa-angle-up")){ 166 $(this).parent(".product-specifications").find(".variation").addClass("hidden").removeClass('show'); 167 $(this).find(".fa").removeClass("fa-angle-up"); 168 $(this).find(".fa").addClass("fa-angle-down"); 169 } else { 170 $(this).parent(".product-specifications").find(".variation").removeClass("hidden").addClass('show'); 171 $(this).find(".fa").removeClass("fa-angle-down"); 172 $(this).find(".fa").addClass("fa-angle-up"); 173 } 174 } 175 176 }); 177 178 var window_width = jQuery( window ).width(); 179 180 jQuery( window ).resize(function() { 181 182 window_width = jQuery( window ).width(); 183 184 make_sticky(); 185 186 187 }); 188 189 make_sticky(); 190 191 function make_sticky() { 192 if ($('body').hasClass('woocommerce')) { 193 if (window_width <= 1100) { 194 $("#order_review").trigger("sticky_kit:detach"); 195 } else { 196 $('#order_review').stick_in_parent({ 197 parent: '#wrapper', 198 offset_top: 50, 199 bottoming: true 200 }); 201 } 202 } 203 } 204 205 $(".carrito a").on('click', function(e) { 206 $("body").toggleClass('woofc-show'); 207 }); 208 209 $('#register-checkout-submit').on('click', function(e){ 210 if(!validateEmail($('#username').val())) { 211 212 } else { 213 $('#reg_email').val($('#username').val()); 214 $('#reg_password').val($('#password').val()); 215 $('form.register').submit(); 216 } 217 218 }); 219 220 function validateEmail($email) { 221 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 222 return emailReg.test( $email ); 223 } 224 225 $('#guest-checkout-submit').on('click', function(){ 226 var email = $('.guest-checkout-content .input-text').val(); 227 if((email.length > 0) && validateEmail(email)){ 228 $('#billing_email').val(email);
229 $('.step__footer a.step__footer__continue-btn[data-step-footer=1]').click(); 230 } 231 }); 232 233 $('.cart-in-checkout a, .close-minicart, .cart-in-checkout').on('click', function(){ 234 if($('.col-1').css('display') != 'none'){ 235 $('form.woocommerce-checkout').toggleClass('active'); 236 } 237 $('#order_review').toggleClass('active'); 238 }); 239 240 $(".coupon_2 a.button").on('click', function(e) { 241 var coupon = $(this).parents('.coupon_2').find('#coupon_code_2').val(); 242 $('#coupon_code').val(coupon); 243 $('form.checkout_coupon').submit(); 244 $(this).parents('.coupon_2').find('#coupon_code_2').val(''); 245 }); 246 247});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.