1/* 2NOT LOGGED USERS GET KEY -1 3USERS WITH GROUP NOT IN CONFIG SAME AS NOT LOGGED -1 4RECOMMENDED TO SET ONE OF ONLY/HIDE FOR DELIVERY NOT BOTH 5RECOMMENDED TO SET ONE OF ONLY/HIDE FOR PAYMENT NOT BOTH 6*/ 7let custom_user_basket = { 8 '-1': { 9 'delivery_only': [], 10 'payment_only': [], 11 'delivery_hide': [25], 12 'payment_hide': [18], 13 }, 14 '3': { 15 'delivery_only': [25], 16 'payment_only': [18], 17 'delivery_hide': [], 18 'payment_hide': [], 19 }, 20} 21 22/*shopcademy start*/ 23function scStart(){var t=[].slice.call(document.querySelectorAll("img.data-lazy"));if("IntersectionObserver"in window){console.log("ok inteo");var e=new IntersectionObserver((function(t,a){t.forEach((function(t){if(t.isIntersecting){console.log("ok intersecting");var a=t.target;a.src=a.dataset.src,a.srcset=a.dataset.src,a.classList.remove("data-lazy"),e.unobserve(a)}else $("img.data-lazy").each((function(){$(this).attr("src",$(this).attr("data-src"))}))}))}));t.forEach((function(t){e.observe(t)}))}else $("img.data-lazy").each((function(){$(this).attr("src",$(this).attr("data-src"))}));var a=[].slice.call(document.querySelectorAll("iframe.data-lazy2"));if("IntersectionObserver"in window){var r=new IntersectionObserver((function(t,e){t.forEach((function(t){if(t.isIntersecting){var e=t.target;e.src=e.dataset.src,e.srcset=e.dataset.src,e.classList.remove("data-lazy2"),r.unobserve(e)}else $("iframe.data-lazy2").each((function(){$(this).attr("src",$(this).attr("data-src"))}))}))}));a.forEach((function(t){r.observe(t)}))}else $("iframe.data-lazy2").each((function(){$(this).attr("src",$(this).attr("data-src"))}))}"loading"!==document.readyState?scStart():document.addEventListener("DOMContentLoaded",(function(){scStart()})); 24/*shopcademy end*/ 25 26let customUserBasket = function () { 27 let self = this; 28 this.init = function (data) { 29 self.d = data; 30 self.s = {}; 31 self.s.user_group = $('.wrap.rwd[data-user-group]').attr('data-user-group'); 32 if( typeof self.d[ self.s.user_group ] == 'undefined' ) self.s.user_group = '-1'; 33 if( typeof self.d[ self.s.user_group ] == 'undefined' ) return true; 34 self.d = self.d[ self.s.user_group ]; 35 if( typeof self.d.delivery_only != 'undefined' && self.d.delivery_only.length ) 36 self.filterBasket(self.d.delivery_only, $('#cart-options .delivery-container .delivery'), 'only'); 37 if( typeof self.d.payment_only != 'undefined' && self.d.payment_only.length ) 38 self.filterBasket(self.d.payment_only, $('#cart-options .payment-container .payment'), 'only'); 39 if( typeof self.d.delivery_hide != 'undefined' && self.d.delivery_hide.length ) 40 self.filterBasket(self.d.delivery_hide, $('#cart-options .delivery-container .delivery'), 'hide'); 41 if( typeof self.d.payment_hide != 'undefined' && self.d.payment_hide.length ) 42 self.filterBasket(self.d.payment_hide, $('#cart-options .payment-container .payment'), 'hide'); 43 self.delivery_fix(); 44 self.payment_fix(); 45 } 46 self.filterBasket = function (data, elems, type) { 47 elems.each(function (i, e) { 48 let id = parseInt( $(e).find('input[type="radio"]').attr('value') ); 49 if( type === 'hide' && data.indexOf( id ) > -1 ){ 50 $(e).addClass('force-none'); 51 }else if( type === 'only' && data.indexOf( id ) < 0 ){ 52 $(e).addClass('force-none'); 53 } 54 }); 55 } 56 this.delivery_fix = function () { 57 if( $('.delivery-container .delivery.force-none input[type="radio"]:checked').length ){ 58 $('.delivery-container .delivery:not(.none):not(.force-none) input[type="radio"]').eq(0).prop('checked', true).change(); 59 } 60 } 61 this.payment_fix = function () { 62 if( $('.payment-container .payment.force-none input[type="radio"]:checked').length ){ 63 $('.payment-container .payment:not(.none):not(.force-none) input[type="radio"]').eq(0).prop('checked', true).change(); 64 } 65 } 66} 67 68$( document ).ready(function() { 69 if( typeof custom_user_basket != 'undefined' && typeof customUserBasket != 'undefined' && $('body.shop_basket').length ){ 70 new customUserBasket().init(custom_user_basket); 71 } 72});
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.