1$(document).ready(function () { 2 3 if ($('.slicker-hero').length > 0) { 4 $(".slicker-hero").slick({ 5 lazyLoad: "ondemand", 6 dots: false, 7 speed: 500, 8 fade: true, 9 cssEase: 'linear', 10 slidesToShow: 1, 11 infinite: true, 12 adaptiveHeight: false, 13 prevArrow: "<button class=\"slick-arrow-left\" aria-label=\"Previous\"><span class=\"fas fa-chevron-left\" aria-hidden=\"true\" aria-label=\"Previous\"></span></button>", 14 nextArrow: "<button class=\"slick-arrow-right\" aria-label=\"Next\"><span class=\"fas fa-chevron-right\" aria-hidden=\"true\" aria-label=\"Next\"></span></button>" 15 }); 16 } 17 18 $('.btn-html5-find-location').click(function() { 19 if (navigator.geolocation) { 20 navigator.geolocation.getCurrentPosition(function (position) { 21 let gLatLng = '('+ position.coords.latitude + ', ' + position.coords.longitude + ')'; 22 Cookies.set('geo', gLatLng, { expires: 7, sameSite: 'strict', secure: true }); // save location in cookies 23 location.reload(); 24 }); 25 } 26 }); 27 28 29 // collection dropdown 30 $('.btn-select-collection').on('change', function() { 31 if (this.value != "") { 32 url = window.docLangPath + 'collection/' + encodeURI(this.value); 33 window.location = url; 34 } 35 }); 36 37 if (document.getElementById('color-picker')) { 38 let colorPicker; 39 const defaultColor = "#EEEEEE"; 40 window.addEventListener("load", startup, false); 41 function startup() { 42 colorPicker = document.querySelector("#color-picker"); 43 colorPicker.value = defaultColor; 44 colorPicker.addEventListener("input", updateFirst, false); 45 colorPicker.addEventListener("change", updateFirst, false); 46 /* colorPicker.select(); */ 47 } 48 function updateFirst(event) { 49 const p = document.querySelectorAll(".btn-img-swatch"); 50 p.forEach((userItem) => { 51 userItem.style.backgroundColor = event.target.value; 52 }); 53 } 54 55 const checkbox = document.getElementById('btn-wallcolor'); 56 57 checkbox.addEventListener('change', (event) => { 58 if (event.currentTarget.checked) { 59 addWalls(); 60 } else { 61 removeWalls(); 62 } 63 }); 64 /* 65 function addWalls() { 66 let m = document.querySelectorAll(".variant-container .variant-img"); 67 m.forEach((el) => { 68 el.insertAdjacentHTML('afterbegin', '<img src="https://www.richmondflooring.ca/img/moulding.png" class="img-fluid moulding-img" alt="moulding trim">'); 69 }); 70 let n = document.querySelectorAll(".variant-container .btn-img-swatch"); 71 n.forEach((el) => { 72 el.classList.add("moulding-enabled"); 73 }); 74 } 75 */ 76 function addWalls() { 77 let pc = document.querySelector(".color-picker-container"); 78 pc.classList.add("moulding-enabled"); 79 80 let p = document.querySelector("#color-picker"); 81 p.disabled = false; 82 83 let n = document.querySelectorAll(".variant-container .btn-img-swatch"); 84 n.forEach((el) => { 85 el.classList.add("moulding-enabled"); 86 }); 87 let m = document.querySelectorAll(".variant-container .moulding-img"); 88 m.forEach((el) => { 89 el.classList.add("moulding-enabled"); 90 }); 91 } 92 function removeWalls() { 93 let pc = document.querySelector(".color-picker-container"); 94 pc.classList.remove("moulding-enabled"); 95 96 let p = document.querySelector("#color-picker"); 97 p.disabled = true; 98 99 let n = document.querySelectorAll(".variant-container .btn-img-swatch"); 100 n.forEach((el) => { 101 el.classList.remove("moulding-enabled"); 102 }); 103 let m = document.querySelectorAll(".variant-container .moulding-img"); 104 m.forEach((el) => { 105 el.classList.remove("moulding-enabled"); 106 }); 107 } 108 } 109 110 // move elements on mobile 111 function reportWindowSize() { 112 let dom_share = document.querySelector(".btn-share-container"); 113 let dom_collection = document.querySelector(".container-collection"); 114 if (window.innerWidth <= 991) { 115 document.querySelector(".grid-hero").prepend(dom_share); 116 document.querySelector(".grid-hero").prepend(dom_collection); 117 } else { 118 document.querySelector(".grid-menu").prepend(dom_share); 119 document.querySelector(".grid-menu").prepend(dom_collection); 120 121 } 122 } 123 124 window.addEventListener("resize", reportWindowSize); 125 reportWindowSize(); 126 127 128});
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.