1var Site = {} 2 3Site.setupAgent = () => { 4}; 5 6Site.getAgent = () => { 7 // Create a new URL object from the current window location 8 let url = new URL(window.location.href); 9 // Get the pathname 10 let pathname = url.pathname; 11 // Define a regular expression to match the pattern "/agent/{id}/{name}" 12 let regex = /^\/agent\/(\d+)\/[^\/]+$/; 13 // Test the path and extract the ID if it matches 14 15 let match = pathname.match(regex); 16 if (match) { 17 let id = match[1]; // Extract the ID (82 in your example) 18 return id; 19 } else { 20 return null; 21 } 22}; 23 24Site.setAgentFeaturedListing = async (agentId) => { 25 let flContainer = document.querySelector(".featuredListingContainer"); 26 if (flContainer == null) { 27 return 28 } 29 let response = await BaseHelper.MakeAJAXGetRequest("/AgentCarouselItems/" + agentId); 30 flContainer.innerHTML = response 31 32 // NEW multi carousel new - need to add this script 33 let items = document.querySelectorAll('.carousel.carousel-multi-item .carousel-item') 34 35 items.forEach((el) => { 36 const minPerSlide = 3 37 let next = el.nextElementSibling 38 for (var i = 1; i < minPerSlide; i++) { 39 if (!next) { 40 // wrap carousel by using first child 41 next = items[0] 42 } 43 let cloneChild = next.cloneNode(true) 44 el.appendChild(cloneChild.children[0]) 45 next = next.nextElementSibling 46 } 47 }) 48 // Favorite property toggle - need to add this script 49 //$("i").click(function () { 50 // $(this).toggleClass("bi-heart"); 51 //}); 52}; 53Site.onPageLoad = ()=>{ 54 Site.divSiteUserToolbarWidgetContainer = document.querySelector(".SiteUserToolbarWidgetContainer"); 55 Site.sutWidget = new Widgets.SiteUserToolbar(); 56 Site.sutWidget._initialize(); 57 Site.sutWidget.onReady(()=>{ 58 Site.divSiteUserToolbarWidgetContainer.innerHTML = ""; 59 Site.divSiteUserToolbarWidgetContainer.appendChild(Site.sutWidget.element); 60 }); 61 let agentId = Site.getAgent(); 62 if (agentId != null) { 63 Site.setAgentFeaturedListing(agentId); 64 } 65 let mfl = document.querySelector(".menuFeaturedListing"); 66 let afl = document.querySelector(".menuAdditionalFeaturedListing"); 67 if (mfl!=null){ 68 mfl.addEventListener("click", (e)=>{ 69 console.log("preload featured listing"); 70 BaseHelper.MakeAJAXPostJSONRequest("/api/Listing/PreloadFeaturedListings"); 71 }); 72 mfl.addEventListener("auxclick", (e)=>{ 73 console.log("preload featured listing"); 74 BaseHelper.MakeAJAXPostJSONRequest("/api/Listing/PreloadFeaturedListings"); 75 }); 76 } 77 if (afl!=null){ 78 afl.addEventListener("click", (e)=>{ 79 console.log("preload additional featured listing"); 80 BaseHelper.MakeAJAXPostJSONRequest("/api/Listing/PreloadAdditionalFeaturedListings"); 81 }); 82 afl.addEventListener("auxclick", (e)=>{ 83 console.log("preload additional featured listing"); 84 BaseHelper.MakeAJAXPostJSONRequest("/api/Listing/PreloadAdditionalFeaturedListings"); 85 }); 86 } 87};
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.