1$(ajax.messages).on( 2 'ga4_add_to_cart', 3 function(e, data) { 4 let products = []; 5 data.products.forEach((el) => { 6 products.push({ 7 name: el.product, 8 id: el.productcode, 9 price: el.price, 10 category: el.category, 11 quantity: el.quantity, 12 }); 13 }); 14 15 if (products.length > 0) { 16 dataLayer = dataLayer || []; 17 dataLayer.push({ ecommerce: null }); 18 dataLayer.push({ 19 event: "add_to_cart", 20 ecommerce: { 21 add_to_cart: { 22 products: products 23 } 24 }, 25 } 26 ); 27 } 28 } 29); 30$( document ).ready(function() { 31 $('body').on('click', '.qty-dec', function (e) { 32 e.preventDefault(); 33 let input = $(this).siblings('input[type=text]'); 34 let value = parseInt(input[0].value); 35 if (isNaN(value)) { 36 value = 0; 37 } 38 value = value > 0 ? value - 1 : 0; 39 input[0].value = value; 40 }); 41 42 $('body').on('click', '.qty-inc', function (e) { 43 e.preventDefault(); 44 let input = $(this).siblings('input[type=text]'); 45 let value = parseInt(input[0].value); 46 if (isNaN(value)) { 47 value = 0; 48 } 49 value = value + 1; 50 input[0].value = value; 51 }); 52 53 $('#fs-load-more').on('click', function(e) { 54 e.preventDefault(); 55 ajax.core.loadBlock($('.fs-products-list'), 'category_products', { 56 cat: this.dataset.cat, 57 objects_per_page: this.dataset.objectsPerPage, 58 sort: this.dataset.sort, 59 sort_direction: this.dataset.sortDirection, 60 }); 61 }); 62 63 $('.opc-container').on('click', '.link-money-cta-text-button', function (e) { 64 e.preventDefault(); 65 }); 66 67 setTimeout(function () { 68 $.getScript("//guarantee-cdn.com/Web/Seal/gjs.aspx?SN=946519466"); 69 }, 5000) 70 71 $('.fs-search-widget').fsSearch(); 72 73 let searchPageForm = document.getElementsByClassName('fs-search-page-form'); 74 for (let i = 0; i < searchPageForm.length; i++) { 75 let form = searchPageForm[i]; 76 let substring = form.querySelector('#substring'); 77 let query = substring.value.split(' '); 78 if (query.length > 1) { 79 for (let j = 0; j < query.length; j++) { 80 if (isNaN(query[j])) { 81 if (form.querySelector('#' + query[j].toString())) { 82 form.querySelector('#' + query[j].toString()).checked = true; 83 } 84 } 85 } 86 } 87 } 88 89 $('.fs-search-page-form').on('click', '.fs-filter-input', function (e) { 90 // $('.fs-filter-input').attr("disabled", true); 91 let form = e.delegateTarget; 92 let substring = form.querySelector('#substring'); 93 let query = new Set(substring.value.split(' ')); 94 query.delete(' '); 95 if (!query.has(this.id)) { 96 query.add(this.id); 97 } else { 98 query.delete(this.id); 99 } 100 substring.value = [...query].join(' '); 101 form.submit(); 102 }); 103 104 $('body').on( 105 'click', 106 'a.toggle-link', 107 function (e) { 108 $('#' + $(this).attr('id').replace('link', 'box')).toggle(); 109 } 110 ); 111 112 $('.fs-cart-container').on('click', '.gr_verify_top', function (e) { 113 e.preventDefault(); 114 $([document.documentElement, document.body]).animate({ 115 scrollTop: $(".fs-coupon-block").offset().top 116 }, 500); 117 $('.fs-coupon-block').show(); 118 }) 119 $('.fs-cart-container').on('click', '.fs-show-coupon-info', function (e) { 120 e.preventDefault(); 121 $('.fs-coupon-block').slideToggle(); 122 }); 123 if ($(window).width() < 760) { 124 if ($("#product-tabs-container").length > 0) { 125 $("#product-tabs-container").tabs({ 126 create: function (event, ui) { 127 $('#product-tabs-container').tabs("destroy"); 128 $('#product-tabs-container > div').accordion({ 129 header: "h3", 130 collapsible: true, 131 active: false, 132 }); 133 } 134 }); 135 } 136 } 137 138 139 let headerOffset = $('#header').outerHeight(); 140 let fixedBlock = $('.fs-fixed-block'); 141 let topBar = $('.top-bar'); 142 143 fsScroll(); 144 $(document.body).on('touchmove', fsScroll); 145 $(window).on('scroll', fsScroll); 146 147 function fsScroll() { 148 if (window.pageYOffset > topBar.outerHeight()) { 149 fixedBlock.addClass('fixed'); 150 $('#page-container').css('padding-top', topBar.outerHeight()); 151 } else { 152 if (fixedBlock.hasClass('fixed')) { 153 fixedBlock.removeClass('fixed'); 154 $('#page-container').css('padding-top', 0); 155 } 156 } 157 if (window.pageYOffset > headerOffset) { 158 if ($(window).width() < 781) { 159 $('#content-container').css('padding-top', headerOffset); 160 } 161 $('#header').addClass('fixed'); 162 $('#header').css('top', fixedBlock.outerHeight()); 163 164 } else { 165 $('#content-container').css('padding-top', 0); 166 $('#header').removeClass('fixed'); 167 $('#header').css('top', 0); 168 169 } 170 } 171 172 $('.fs-faq-item').accordion({ 173 header: "h3", 174 collapsible: true, 175 active: false, 176 }); 177 178 $('.open-country-list').on('click', function (e) { 179 $(this).parents('.ui-accordion-content').css({'height': 'auto'}); 180 }); 181 182 $(".fs-tracking-button").on('click', function (e) { 183 e.preventDefault(); 184 $(".fs-tracking-container").slideToggle(); 185 }); 186 187 if (navigator.userAgent.match ( /FBAN|FBAV/i)) { 188 $('#fs-socials .a-link-normal.google').hide() 189 } 190 191 $('.fs-payment-time').each(function() { 192 let date = new Date(this.dataset.timestamp * 1000); 193 this.innerText = date.getHours() + ':' + ("0" + date.getMinutes()).substr(-2) 194 }) 195 196 $('.fs-subcategory.fs-subcategory-current').on('click', function (e) { 197 e.preventDefault(); 198 if (this.dataset.categoryid) { 199 $('html, body').animate({scrollTop: $('#all_' + this.dataset.categoryid).offset().top}, 1000); 200 } 201 }); 202}); 203 204 205var resizeTimer; 206$(window).on('resize', function (e) { 207 clearTimeout(resizeTimer); 208 resizeTimer = setTimeout(function() { 209 tabControl(); 210 }, 250); 211}); 212 213function tabControl() { 214 var tabsContainer = $('#product-tabs-container'); 215 var tabs = tabsContainer.find('.ui-tabs-nav'); 216 if(tabs.is(':visible')) { 217 tabsContainer.find('.ui-tabs-panel').each(function (index, element){ 218 if (tabs.find('.ui-state-active').attr('aria-controls') === element.i
218d) { 219 $(element).slideDown(); 220 } else { 221 $(element).slideUp(); 222 } 223 }); 224 } else { 225 tabsContainer.find('.ui-tabs-panel').slideUp(); 226 } 227} 228 229function freeCheck(n, o, xx, yy) { 230 if (onsale_jw_valid_qty_in_cart == '') { onsale_jw_valid_qty_in_cart = 0; } 231 if (onsale_jw_valid_qty_in_cart < onsale_jw_max_free_qty) { 232 offset = cumulativeOffset(o); 233 x = offset['left'] + xx; 234 y = offset['top'] + yy; 235 obj = document.getElementById('OnSalCationMessge'); 236 if (x) {obj.style.left = x + 'px';} 237 if (y) {obj.style.top = y + 'px';} 238 if (n == 1) { // mouse over 239 obj.style.display = 'block'; 240 clearTimeout(onsale_jw_cc); 241 } else { // mouseout 242 onsale_jw_cc = setTimeout("obj.style.display='none';", 1000); 243 } 244 } 245} 246 247function cumulativeOffset(element) { 248 var top = 0, left = 0; 249 do { 250 top += element.offsetTop || 0; 251 left += element.offsetLeft || 0; 252 element = element.offsetParent; 253 } while (element); 254 255 return { 256 top: top, 257 left: left 258 }; 259}
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.