1//Plugins JS v3.3.0 2 3//Removed the following plugins as they are no longer used in the new navigation design: 4 // Toggle sidebar 5 // Toggle advanced search (on mobile) 6 // Toggle Map 7 // Advert div 8 9//carousel 10var noSlides, 11 slidesDesktop, 12 tabletLandscape, 13 tabletPortrait, 14 slidesMobile, 15 finalSlides, 16 next, 17 prev; 18function calcSlides(predefinedSlides, swiperElements) { 19 predefinedSlides > swiperElements 20 ? (finalSlides = swiperElements) 21 : (finalSlides = predefinedSlides); 22 return finalSlides; 23} 24$(".swiper-container").each(function () { 25 var slidesDesktop = $(this).attr("data-slides-desktop"), 26 tabletLandscape = $(this).attr("data-slides-tablet-landscape"), 27 tabletPortrait = $(this).attr("data-slides-tablet-portrait"), 28 slidesMobile = $(this).attr("data-slides-mobile"), 29 randomInitSlide = $(this).attr("data-slides-random"), 30 noSlides = $(this).find(".swiper-slide").length; 31 if ( 32 $(this).parents( 33 ".row-background, .row-background-gradient, #sponsored-carousel" 34 ).length 35 ) { 36 next = $(this) 37 .parents(".row-background, .row-background-gradient, #sponsored-carousel") 38 .find(".swiper-next"); 39 prev = $(this) 40 .parents(".row-background, .row-background-gradient, #sponsored-carousel") 41 .find(".swiper-prev"); 42 } else { 43 next = $(this).siblings(".swiper-next"); 44 prev = $(this).siblings(".swiper-prev"); 45 } 46 if (noSlides > 1) { 47 const swiper = new Swiper(this, { 48 initialSlide: randomInitSlide ? Math.floor(Math.random() * noSlides) : 0, 49 slidesPerView: calcSlides(slidesMobile, noSlides), 50 spaceBetween: 16, 51 direction: "horizontal", 52 watchOverflow: true, 53 navigation: { 54 nextEl: ".swiper-next", 55 prevEl: ".swiper-prev", 56 }, 57 breakpoints: { 58 1024: { 59 slidesPerView: calcSlides(slidesDesktop, noSlides), 60 spaceBetween: 24 61 }, 62 769: { 63 slidesPerView: calcSlides(tabletLandscape, noSlides), 64 spaceBetween: 16 65 }, 66 641: { 67 slidesPerView: calcSlides(tabletPortrait, noSlides), 68 spaceBetween: 16 69 }, 70 }, 71 // Firefox fix 72 on: { 73 init: function () { 74 setTimeout(function () { 75 window.dispatchEvent(new Event("resize")); 76 }, 200); 77 }, 78 }, 79 }); 80 } else { 81 if ($(this).find(".previous-award-carousel").length === 0) { 82 $(this) 83 .find(".swiper-slide") 84 .css({ display: "flex", "justify-content": "center" }); 85 } else { 86 if ($(this).find(".swiper-lazy-preloader").length > 0) { 87 $(this).find(".swiper-lazy-preloader").css("display", "none"); 88 } 89 } 90 next.hide(); 91 prev.hide(); 92 } 93}); 94 95//Automatic background color 96 97backgroundColor = function (img, wrapper) { 98 if (wrapper) { 99 var vibrant = new Vibrant(img), 100 background, 101 colorVersion, 102 highRec = wrapper.find(".highly-recommended p"); 103 Vibrant.from(img.src).getPalette(function (err, palette) { 104 palette["Muted"] 105 ? (colorVersion = palette["Muted"]) 106 : (colorVersion = palette["Vibrant"]); 107 wrapper.find(".half-background").length 108 ? (background = wrapper.find(".half-background")) 109 : (background = wrapper); 110 if (highRec) highRec.css("background", colorVersion.getHex()); 111 wrapper.hasClass("row-background-gradient") 112 ? background.css( 113 "background", 114 "linear-gradient(180deg, #fff 0%, " + 115 colorVersion.getHex() + 116 " 100%)" 117 ) 118 : background.css("background", colorVersion.getHex()); 119 }); 120 } 121}; 122var wrappers = $( 123 ".row-background:not(.no-background), .row-background-gradient:not(.no-background), .row-background-sponsored:not(.no-background), .vibrant-background" 124); 125for (var i = 0, wLength = wrappers.length; i < wLength; i++) { 126 var wrapper = wrappers[i], 127 img = document.createElement("img"), 128 originalImg = $(wrapper).find(".vibrant-image")[0]; 129 if (!originalImg) 130 originalImg = $(wrapper).find( 131 ".swiper-wrapper .swiper-slide:not(.swiper-slide-duplicate) img" 132 )[0]; 133 if (originalImg) { 134 img.setAttribute("src", $(originalImg).attr("src")); 135 backgroundColor(img, $(wrapper)); 136 } 137} 138 139var lists = document.getElementsByClassName("list-nav")[0], 140 oldActive = $(".active"); 141 142if (lists) { 143 function sortActive(a) { 144 if ( 145 a.text().replace(/\s/g, "-") == /[^/]*$/.exec(window.location.pathname)[0] 146 ) 147 a.addClass("active"); 148 else a.removeClass("active"); 149 } 150 151 function updateBreadcrumb() { 152 var trail = document.getElementsByClassName("breadcrumb-trail")[0]; 153 if (!trail) return; 154 var slug = /[^/]*$/.exec(window.location.pathname)[0]; 155 var activeNav = lists.querySelector(".active"); 156 var label = activeNav ? activeNav.innerText : slug; 157 var anchors = trail.getElementsByTagName("a");
158 var crumb = anchors[anchors.length - 1]; 159 if (!crumb) return; 160 crumb.textContent = label; 161 crumb.setAttribute( 162 "href", 163 crumb.getAttribute("href").replace(/[^/]*$/, "") + slug 164 ); 165 } 166 167 // The first time a grid actually becomes visible, force one refresh 168 // of its own ad slots as a safety net, in case lazy load's automatic 169 // re-check on the hidden -> visible transition isn't reliable enough 170 // on its own. Never refreshes the same grid twice. 171 // 172 // window._gamState / window._gamMaybeRefresh are globals the GAM head 173 // script already exposes today, unmodified â this only reads/extends 174 // them, it doesn't touch that script. 175 var refreshedListContainers = []; 176 var pendingListContainer = null; 177 178 function doRefreshListAds(container) { 179 refreshedListContainers.push(container); 180 if (typeof googletag === "undefined" || !googletag.pubads) return; 181 // Wait a couple of frames so the browser has actually reflowed the 182 // grid we just unhid before GPT's lazy-load check runs â calling 183 // refresh() in the same tick as the class change risks GPT still 184 // seeing the pre-reflow (hidden, zero-size) geometry and skipping 185 // the fetch, which â since this only ever runs once per grid â 186 // would mean it never gets fetched at all. 187 requestAnimationFrame(function () { 188 requestAnimationFrame(function () { 189 googletag.cmd.push(function () { 190 var slots = googletag.pubads().getSlots().filter(function (slot) { 191 var el = document.getElementById(slot.getSlotElementId()); 192 return el && el.closest("[data-list]") === container; 193 }); 194 if (slots.length) googletag.pubads().refresh(slots); 195 }); 196 }); 197 }); 198 } 199 200 function refreshListAdsOnce(container) { 201 if (!container || refreshedListContainers.indexOf(container) !== -1) return; 202 if (!window._gamState || !window._gamState.slotsReady) { 203 pendingListContainer = container; // retry once slots are ready 204 return; 205 } 206 doRefreshListAds(container); 207 } 208 209 if (window._gamMaybeRefresh) { 210 var originalGamMaybeRefresh = window._gamMaybeRefresh; 211 window._gamMaybeRefresh = function () { 212 originalGamMaybeRefresh(); 213 if ( 214 pendingListContainer && 215 window._gamState && 216 window._gamState.slotsReady && 217 refreshedListContainers.indexOf(pendingListContainer) === -1 218 ) { 219 var container = pendingListContainer; 220 pendingListContainer = null; 221 doRefreshListAds(container); 222 } 223 }; 224 } 225 226 for (var i = 0, lisLength = lists.children.length; i < lisLength; i++) { 227 var replaced = lists.children[i].innerText.replace(/\s/g, "-"), 228 li = lists.children[i], 229 a = $(li).find("a"); 230 sortActive(a); 231 //sortActive(a, n) 232 if (i === lisLength && !$(".active")) oldActive.addClass("active"); 233 lists.children[i].addEventListener("click", function () { 234 replaced = this.innerText.replace(/\s/g, "-"); 235 window.history.pushState( 236 "object or string", 237 "", 238 window.location.pathname.replace(/[^/]*$/, "") + replaced 239 ); 240 //window.dispatchEvent(new HashChangeEvent('hashchange'));
241 242 //Support IE 243 var event; 244 if (typeof Event === "function") { 245 event = new Event("hashchange"); 246 } else { 247 event = document.createEvent("Event"); 248 event.initEvent("hashchange", true, true); 249 } 250 window.dispatchEvent(event); 251 252 $(".active").removeClass("active"); 253 $(this).find("a").addClass("active"); 254 }); 255 } 256 257 // Show/hide a single list grid 258 function setGridVisible($grid, visible) { 259 if (visible) { 260 $grid.removeClass("hidden").addClass("visible-list"); 261 } else { 262 $grid.addClass("hidden").removeClass("visible-list"); 263 } 264 } 265 266 toggleList = function (replaced, refreshed) { 267 // Select grids by the data-list attribute 268 let list = document.querySelectorAll("[data-list]"); 269 let activeContainer = null; 270 271 for (var i = 0, listLength = list.length; i < listLength; i++) { 272 let $list = $(list[i]); 273 let isActive = replaced ? list[i].dataset.list == replaced : false; 274 if (isActive) activeContainer = list[i]; 275 276 if (refreshed) { 277 if (replaced) setGridVisible($list, isActive); 278 279 setTimeout(function () { 280 var loader = document.getElementById("loader"); 281 if (loader) loader.classList.add("loaded"); 282 }, 700); 283 } else { 284 let li = lists.children[i], 285 a = $(li).find("a"); 286 287 sortActive(a); 288 289 setGridVisible($list, isActive); 290 } 291 } 292 293 refreshListAdsOnce(activeContainer); 294 295 updateBreadcrumb(); // keep the crumb in sync with every state change 296 }; 297 298 toggleList(/[^/]*$/.exec(window.location.pathname)[0], true); 299 300 window.onhashchange = function () { 301 toggleList(/[^/]*$/.exec(window.location.pathname)[0]); 302 }; 303 304 window.onpopstate = function (event) { 305 toggleList(/[^/]*$/.exec(window.location.pathname)[0]); 306 }; 307} 308// Loader safety net. 309setTimeout(function () { 310 var loader = document.getElementById("loader"); 311 if (loader) loader.classList.add("loaded"); 312}, 700);
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.