1jQuery(document).ready(function() 2{ 3 jQuery('.linkRvw a, .linkRvwp a').click(function() { 4 if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { 5 var target = jQuery(this.hash); 6 target = target.length ? target : jQuery('[name=' + this.hash.slice(1) + ']'); 7 if (target.length) { 8 jQuery('html, body').animate({ 9 scrollTop: target.offset().top - 70 10 }, 900); 11 return false; 12 } 13 } 14 }); 15 16 if (jQuery('#shipping_country').length > 0) { 17 jQuery("#shipping_country").val('US'); 18 } 19 20 jQuery('#shipping_method input:radio').change(function() { 21 alert("click"); 22 }); 23 24 jQuery('#wc-authorize-net-cim-credit-card-use-new-payment-method').change(function() { 25 // window.location='my-account/payment-methods/'; 26 }); 27 28 //jQuery(".woocommerce-order-pay .user_add_new").hide(); 29 jQuery(".woocommerce-order-pay #wc-authorize-net-cim-credit-card-use-new-payment-method").val(''); 30 31 var numberSpinner = (function() { 32 jQuery('.number-spinner>.ns-btn>a').click(function() { 33 var btn = jQuery(this), 34 oldValue = btn.closest('.number-spinner').find('input').val().trim(), 35 newVal = 0; 36 37 if (btn.attr('data-dir') === 'up') { 38 newVal = parseInt(oldValue) + 1; 39 } 40 else { 41 if (oldValue > 1) { 42 newVal = parseInt(oldValue) - 1; 43 } else { 44 newVal = 1; 45 } 46 } 47 btn.closest('.number-spinner').find('input').val(newVal); 48 }); 49 jQuery('.number-spinner>input').keypress(function(evt) { 50 evt = (evt) ? evt : window.event; 51 var charCode = (evt.which) ? evt.which : evt.keyCode; 52 if (charCode > 31 && (charCode < 48 || charCode > 57)) { 53 return false; 54 } 55 return true; 56 }); 57 })(); 58 59 jQuery('.slider-prod').slick({ 60 slidesToShow: 1, 61 slidesToScroll: 1, 62 arrows: false, 63 fade: true, 64 adaptiveHeight: false, 65 asNavFor: '.slider-thumb' 66 }); 67 68 jQuery('.prodSlider').slick({ 69 slidesToShow: 1, 70 slidesToScroll: 1, 71 arrows: true, 72 dots: true, 73 fade: false, 74 nextArrow: '<i class="fas fa-chevron-right slick-next"></i>', 75 prevArrow: '<i class="fas fa-chevron-left slick-prev"></i>', 76 adaptiveHeight: false, 77 responsive: [ 78 { 79 breakpoint: 767, 80 settings: { 81 dots: true, 82 arrows: false, 83 } 84 } 85 ] 86 }); 87 88 jQuery('.overview_image_slider').slick({ 89 slidesToShow: 1, 90 slidesToScroll: 1, 91 arrows: false, 92 dots: true, 93 fade: false, 94 nextArrow: '<i class="fas fa-chevron-right slick-next"></i>', 95 prevArrow: '<i class="fas fa-chevron-left slick-prev"></i>', 96 adaptiveHeight: false, 97 responsive: [ 98 { 99 breakpoint: 767, 100 settings: { 101 dots: true, 102 arrows: false, 103 } 104 } 105 ] 106 }); 107 jQuery(document).ready(function(){ 108 jQuery('.ms-carousel-related-product').slick({ 109 slidesToShow: 2, 110 arrows: false, 111 dots: true, 112 responsive: [ 113 { 114 breakpoint: 767, 115 settings: { 116 slidesToShow: 1, 117 } 118 } 119 ] 120 }); 121 }); 122 jQuery('.ms-blog-carousel').slick({ 123 slidesToShow: 3, 124 arrows: false, 125 dots: false, 126 responsive: [ 127 { 128 breakpoint: 1025, 129 settings: { 130 slidesToShow: 2 131 } 132 }, 133 { 134 breakpoint: 767, 135 settings: { 136 slidesToShow: 1 137 } 138 } 139 ] 140 }); 141 /* LITEHOUSE MOD: FIX PARAGRAPH AFTER ZIPCODE IN CUSTOMER ACCOUNT WHEN CHANGING ADDRESSES */ 142 jQuery(window).load(function(){ 143 jQuery('#shipping_postcode_field').after('<div class="clear"></div>'); 144 transformFormInputs(); 145 }); 146 147 jQuery(document).on('click', function() { 148 transformFormInputs(); 149 }) 150 151 function transformFormInputs() 152 { 153 jQuery('.form-row input, .form-row textarea, .form-row select').each(function() 154 { 155 var val = jQuery(this).val().trim(); 156 157 // LITEHOUSE MOD: NEW VERSION OF WOOCOM PUTS <span> AROUND INPUT FIELDS, REMOVE IT TO FIX CUSTOM STYLES 158 //if (jQuery(this).parent().hasClass(".woocommerce-input-wrapper")) -> DOESN'T WORK 159 if (jQuery(this).parent().is(".woocommerce-input-wrapper")){ 160 jQuery(this).unwrap(); 161 } 162 163 // don't add n-focus to select fields 164 //if (jQuery(this).not("select")) 165 if (!jQuery(this).is("select")) 166 { 167 if (val == ''){ 168 //alert('input empty'); 169 } 170 else { 171 172 jQuery(this).parent('.form-row').addClass('n-focus'); 173 } 174 } 175 }); 176 } 177 178 jQuery(document).on('click', '#ship-to-different-address label',function (){ 179 jQuery('.address-plus').toggleClass('address-minus'); 180 }); 181 182 jQuery('.nav_icon').click(function(){ 183 jQuery("body").toggleClass('open_nav'); 184 }); 185 186 jQuery('.overlay').click(function(){ 187 jQuery('body').removeClass("open_nav"); 188 }); 189 190 jQuery('.menu-item-has-children').click(function(){ 191 jQuery("body").toggleClass('submenu_open'); 192 }); 193 194 jQuery('.account_menu').click(function() { 195 jQuery("body").toggleClass('submenu_acount'); 196 }); 197 198 jQuery('ul.nav-dropdown:before').click(function() { 199 jQuery("body").removeClass('submenu_acount'); 200 }); 201 202 jQuery('.reco-a').click(function (){ 203 jQuery('.recomend').slideToggle(); 204 }); 205 206 jQuery(document).on('click',".dropdown-menu",function(e){
207 e.stopPropagation(); 208 }); 209 210 jQuery(document).on('click',".cart-top",function(e){ 211 e.stopPropagation(); 212 }); 213 214 //product slider 215 jQuery('.slider-for').slick({ 216 slidesToShow: 1, 217 slidesToScroll: 1, 218 arrows: false, 219 fade: true, 220 adaptiveHeight: false, 221 asNavFor: '.slider-nav', 222 responsive: [{ 223 breakpoint: 768, 224 settings: { 225 arrows:true 226 } 227 }] 228 }); 229 230 jQuery('.slider-nav').slick({ 231 slidesToShow: 3, 232 slidesToScroll: 1, 233 asNavFor: '.slider-for', 234 centerMode: true, 235 focusOnSelect: true 236 }); 237 238 jQuery(function() { 239 return jQuery(".modal").on("show.bs.modal", function() { 240 var curModal; 241 curModal = this; 242 jQuery(".modal").each(function() { 243 if (this !== curModal) { 244 jQuery(this).modal("hide"); 245 } 246 }); 247 }); 248 }); 249 250 if (jQuery('.woocommerce-checkout #shipping_country').length > 0) { 251 jQuery('.woocommerce-checkout #shipping_country').select2(); 252 } 253 254 jQuery( document.body ).on( 'cfw-after-field-country-to-state-changed', function(){ 255 if (jQuery('.woocommerce-checkout select#shipping_state').length) { 256 jQuery('.woocommerce-checkout select#shipping_state').select2(); 257 } 258 else { 259 jQuery('.woocommerce-checkout #shipping_state_field .select2').remove(); 260 } 261 262 if (jQuery('.woocommerce-checkout select#billing_state').length) { 263 jQuery('.woocommerce-checkout select#billing_state').select2(); 264 } 265 else { 266 jQuery('.woocommerce-checkout #billing_state_field .select2').remove(); 267 } 268 }); 269 270 jQuery( document.body ).on( 'cfw-payment-tab-loaded', function(){ 271 jQuery('.woocommerce-checkout #billing_country').select2(); 272 jQuery('.woocommerce-checkout #billing_country').change(); 273 }); 274 275 jQuery('.single-product button.addtoCart').prop("disabled", false); 276}); 277 278// NEWS-LETTER SUBSCRIPTION SCRIPT 279jQuery(document).ready(function(){ 280 281 jQuery('#subSign').on('click', function(e){ 282 e.preventDefault(); 283 var email = jQuery('#subEml').val(); 284 var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 285 if(!re.test(email)){ 286 jQuery('.subscrIn-newsLtr p').css('color','red').text('Please enter a valid email.'); 287 } 288 else 289 { 290 var ajaxurl = jQuery("#mfAjaxUrl").val(); 291 var query_string = 'action=mc_subscribe&email='+email; 292 jQuery('#subSign').prop('disabled',true); 293 jQuery.ajax({ 294 url : ajaxurl, 295 cache: false, 296 type : 'POST', 297 data : query_string, 298 success : function(results){ 299 console.log(results); 300 jQuery('#subEml').val(''); 301 jQuery('#subSign').prop('disabled',false); 302 if(jQuery.trim(results)=='200'){ 303 jQuery('.subscrIn-newsLtr div').css('color','green').text('Please check your email and confirm your subscription.'); 304 } 305 else 306 { 307 if(jQuery.trim(results)=='400'){ 308 jQuery('.subscrIn-newsLtr div').css('color','red').text('This email address is already subscribed.'); 309 } 310 else{ 311 jQuery('.subscrIn-newsLtr div').css('color','green').text('Unable to contact mailchimp server. Try again later.'); 312 } 313 } 314 } 315 }); 316 } 317 }); 318}); 319 320jQuery(window).load(function(){
321 if(jQuery('.woocommerce-edit-address .woocommerce-address-fields #billing_address_2').length){ 322 jQuery('.woocommerce-edit-address .woocommerce-address-fields #billing_address_2').removeAttr('placeholder'); 323 } 324 if(jQuery('.woocommerce-edit-address .woocommerce-address-fields #shipping_address_2').length){ 325 jQuery('.woocommerce-edit-address .woocommerce-address-fields #shipping_address_2').removeAttr('placeholder'); 326 } 327 328 jQuery('#checkout #cfw-shipping-method #cfw-shipping-action a.cfw-primary-btn').on('click',function(){ 329 //jQuery(this).addClass('disabled'); 330 }); 331}); 332 333// Checkout : Open Summary Dropdown in Mobile 334jQuery(window).load(function() 335{ 336 if(jQuery('body.woocommerce-checkout').length){ 337 setTimeout(function() { 338 jQuery('#cfw-expand-cart').trigger('click'); 339 }, 1000) 340 } 341}); 342 343// Fixed product title clickable 344jQuery(document).ready(function() 345{ 346 if(jQuery('div.product_inner').length) 347 { 348 jQuery('div.product_inner').each(function(){ 349 var hrefVal = jQuery(this).find('.img_product_outer a').attr('href'); 350 jQuery(this).find('.product_des h2').wrap('<a href="'+hrefVal+'"></a>'); 351 }); 352 } 353}); 354 355// Remove old "cookies", "session storage", "local storage" (since 02/26/2022) 356function mf_deleteAllCookies() 357{ 358 var cookies = document.cookie.split("; "); 359 for (var c = 0; c < cookies.length; c++) { 360 var d = window.location.hostname.split("."); 361 while (d.length > 0) { 362 var cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path='; 363 var p = location.pathname.split('/'); 364 document.cookie = cookieBase + '/'; 365 while (p.length > 0) { 366 document.cookie = cookieBase + p.join('/'); 367 p.pop(); 368 }; 369 d.shift(); 370 } 371 } 372} 373 374function mf_deleteOldBrowserData() 375{ 376 var odDel = localStorage.getItem("odDel"); 377 378 if(!odDel) 379 { 380 // remove all "cookies" 381 mf_deleteAllCookies(); 382 383 // remove all "session storage" 384 sessionStorage.clear(); 385 386 // remove all "local storage" 387 localStorage.clear(); 388 389 // set local storage 390 localStorage.setItem("odDel", '1'); 391 } 392} 393 394jQuery(window).load(function(){ 395 setTimeout(function() { 396 mf_deleteOldBrowserData(); 397 }, 1000) 398}); 399 400// My Account Password show/hide script 401 402// Update Reactivte Button URL 403jQuery(document).ready(function() 404{ 405 if(jQuery('body.page-my-account .shop_table.subscription_details a.button.reactivate').length) 406 { 407 jQuery('body.page-my-account .shop_table.subscription_details a.button.reactivate').click(function(e) 408 { 409 e.preventDefault(); 410 var getHref = jQuery(this).attr('href'); 411 localStorage.setItem("user_act", 'reactivate'); 412 window.location.href = getHref; 413 }); 414 } 415 416 if(!jQuery('body.woocommerce-checkout').length && localStorage.getItem("user_act")){ 417 localStorage.removeItem("user_act"); 418 } 419 420 if(jQuery('body.woocommerce-checkout').length) 421 { 422 var isRenewStep = false; 423 var isReactivateStep = false; 424 var user_act = localStorage.getItem("user_act"); 425 var messageExist = false; 426 427 jQuery('body.woocommerce-checkout .cfw-alert.cfw-alert-success').each(function() 428 { 429 var message = jQuery(this).find('.message').text(); 430 431 if(message.includes('Complete checkout to renew now.') && user_act == 'reactivate'){ 432 jQuery(this).find('.message').html('Complete checkout to reactivate subscription now.'); 433 messageExist = true; 434 } 435 }) 436 437 if(!messageExist && user_act == 'reactivate'){ 438 var addMessage = '<div class="cfw-alert cfw-alert-success"><div class="message">Complete checkout to reactivate subscription now.</div></div>' 439 jQuery('#cfw-alert-container').prepend(addMessage); 440 } 441 442 jQuery('body.woocommerce-checkout .cfw-alert.cfw-alert-success').show(); 443 } 444 445 /** Blog: make "References" button expandable. */ 446 jQuery('.refHeading').click(function () { 447 jQuery(this).parent().toggleClass('showRef'); 448 }); 449}); 450 451// Enable/Disable subscription details box while waiting for Reschedule ajax query 452// to complete and populate the calendar picker. 453jQuery(document).ajaxSend(function(event, jqXHR, ajaxOptions) { 454 if (ajaxOptions.data && typeof ajaxOptions.data === 'string' && ajaxOptions.data.indexOf('action=sf_change_payment_date_subscription') !== -1) { 455 jQuery('.subscription_details').block({ 456 message: null, 457 overlayCSS: { 458 background: '#fff', 459 opacity: 0.6 460 } 461 }); 462 } 463}); 464 465jQuery(document).ajaxComplete(function(event, jqXHR, ajaxOptions) { 466 if (ajaxOptions.data && typeof ajaxOptions.data === 'string' && ajaxOptions.data.indexOf('action=sf_change_payment_date_subscription') !== -1) { 467 jQuery('.subscription_details').unblock(); 468 } 469});
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.