1var lazyElementShouldLoad = function( container, lazyness ) { 2 var shouldLoad = false; 3 4 if ( lazyness ) { 5 var bounding = container.getBoundingClientRect(); 6 var viewport = { 7 x : 0, 8 y : 0, 9 width : window.innerWidth || document.documentElement.clientWidth, 10 height : window.innerHeight || document.documentElement.clientHeight 11 }; 12 13 viewport.x = ( viewport.width * -1 * lazyness ) + viewport.width; 14 viewport.y = ( viewport.height * -1 * lazyness ) + viewport.height; 15 viewport.width *= lazyness; 16 viewport.height *= lazyness; 17 18 if( viewport.x > 0 ) 19 viewport.x = 0; 20 21 if( viewport.y > 0 ) 22 viewport.y = 0; 23 24 if( ! ( bounding.bottom < viewport.y || 25 bounding.top > viewport.height || 26 bounding.right < viewport.x || 27 bounding.left > viewport.width ) ) { 28 var element = container; 29 var hidden = false; 30 31 while( element != document ) { 32 var style = window.getComputedStyle( element ); 33 34 hidden = style.display == 'none'; 35 36 if( hidden ) 37 break; 38 39 element = element.parentNode; 40 } 41 42 shouldLoad = ! hidden; 43 } 44 } else { 45 shouldLoad = true; 46 } 47 48 return shouldLoad; 49}; 50 51jQuery(document).ready(function() { 52 jQuery(document).on('click touch', 'a.CybotCookiebotDialogBodyLink', function() { 53 // Don't check the Statistics & Marketing boxes by default if a user invokes the 'Settings' link in Cookiebot modal 54 jQuery('input#CybotCookiebotDialogBodyLevelButtonStatistics').prop('checked', false); 55 jQuery('input#CybotCookiebotDialogBodyLevelButtonMarketing').prop('checked', false); 56 jQuery('#CybotCookiebotDialogDetailBodyContentTextIAB input[type=checkbox]').prop('checked', false); 57 }); 58 59 jQuery('p#breadcrumbs a').click(function() { 60 // Track breadcrumb clicks 61 62 var url = jQuery(this).attr('href'); 63 64 if(typeof ga != 'undefined') { 65 ga('send', 'event', 66 'breadcrumb', //eventCategory 67 'click', //eventAction 68 url, //eventLabel 69 ); 70 } 71 if(typeof gtag != 'undefined') { 72 gtag('event', 'click', { 73 'event_category': 'breadcrumb', 74 'event_label': url 75 }); 76 } 77 }); 78 79 jQuery('header ul li a.nav__link').click(function() { 80 // Track top menu clicks 81 82 var url = jQuery(this).attr('href'); 83 84 if(typeof ga != 'undefined') { 85 ga('send', 'event', 86 'menu_header', //eventCategory 87 'click', //eventAction 88 url, //eventLabel 89 ); 90 } 91 if(typeof gtag != 'undefined') { 92 gtag('event', 'click', { 93 'event_category': 'menu_header', 94 'event_label': url 95 }); 96 } 97 }); 98 99 jQuery('div.off-canvas a').click(function() { 100 // Track side menu clicks 101 102 var url = jQuery(this).attr('href'); 103 104 if(typeof ga != 'undefined') { 105 ga('send', 'event', 106 'menu_side', //eventCategory 107 'click', //eventAction 108 url, //eventLabel 109 ); 110 } 111 if(typeof gtag != 'undefined') { 112 gtag('event', 'click', { 113 'event_category': 'menu_side', 114 'event_label': url 115 }); 116 } 117 }); 118 119 jQuery('footer a').click(function() { 120 // Track footer link clicks 121 122 var url = jQuery(this).attr('href'); 123 124 if(typeof ga != 'undefined') { 125 ga('send', 'event', 126 'footer_link', //eventCategory 127 'click', //eventAction 128 url, //eventLabel 129 ); 130 } 131 if(typeof gtag != 'undefined') { 132 gtag('event', 'click', { 133 'event_category': 'footer_link', 134 'event_label': url 135 }); 136 } 137 }); 138 139 jQuery('div.tiles-shortcode a.travel__link').click(function() { 140 // Track tile clicks 141 142 var url = jQuery(this).attr('href'); 143 144 if(typeof ga != 'undefined') { 145 ga('send', 'event', 146 'tile_link', //eventCategory 147 'click', //eventAction 148 url, //eventLabel 149 ); 150 } 151 if(typeof gtag != 'undefined') { 152 gtag('event', 'click', { 153 'event_category': 'tile_link', 154 'event_label': url 155 }); 156 } 157 }); 158 159 jQuery('#row-related-links-sidebar a').click(function() { 160 // Track tile clicks 161 162 var url = jQuery(this).attr('href'); 163 164 if(typeof ga != 'undefined') { 165 ga('send', 'event', 166 'related_link', //eventCategory 167 'click', //eventAction 168 url, //eventLabel 169 ); 170 } 171 if(typeof gtag != 'undefined') { 172 gtag('event', 'click', { 173 'event_category': 'related_link', 174 'event_label': url 175 }); 176 } 177 }); 178 179 jQuery('#row-related-links a').click(function() { 180 // Track tile clicks 181 182 var url = jQuery(this).attr('href'); 183 184 if(typeof ga != 'undefined') { 185 ga('send', 'event', 186 'related_link', //eventCategory 187 'click', //eventAction 188 url, //eventLabel 189 ); 190 } 191 if(typeof gtag != 'undefined') { 192 gtag('event', 'click', { 193 'event_category': 'related_link', 194 'event_label': url 195 }); 196 } 197 }); 198 199 200 201 // Off Canvas - replacing this with our own JS logic, becuase the Foundation-supplied logic is too slow 202 jQuery('.offcanvas-toggle').click(function() { 203 jQuery('.off-canvas').addClass('is-open'); 204 jQuery('.off-canvas').removeClass('is-closed'); 205 206 jQuery('.off-canvas-content').addClass('is-open-right has-transition-push has-position-right'); 207 jQuery('.js-off-canvas-overlay').addClass('is-overlay-fixed is-visible is-closable'); 208 }); 209 210 jQuery('.off-canvas button.close-button, .js-off-canvas-overlay').click(function() { 211 jQuery('.off-canvas').removeClass('is-open'); 212 jQuery('.off-canvas').addClass('is-closed'); 213 214 jQuery('.off-canvas-content').removeClass('is-open-right has-transition-push has-position-right'); 215 jQuery('.js-off-canvas-overlay').removeClass('is-overlay-fixed is-visible is-closable'); 216 }); 217}); 218 219 220jQuery(window).on('scroll resize', function(event) { 221 // Sticky ads (mainly intended for the header/leaderboard area and sidebars) 222 jQuery('.sticky-ad-unit').each(function (){ 223 224 var elem = jQuery(this); 225 var currentScroll = jQuery(window).scrollTop(); 226 227 // Store the original offset from the top of the document 228 if(typeof elem.attr('original_top') == 'undefined') { 229 elem.attr('original_top', elem.offset().top - parseInt(elem.css('marginTop'))); 230 } 231 232 // Try and get width from parent #phg_ad_sidebar_placement 233 var parentWidth = elem.closest("#phg_ad_sidebar_placement").width(); 234 if(typeof parentWidth != 'undefined' && parentWidth > 0) { 235 elem.attr('original_width', parseInt(parentWidth)); 236 237 } else if(typeof elem.attr('original_width') == 'undefined' && parseInt(elem.css("width")) > 0) { 238 // Store the original width of the item itself 239 elem.attr('original_width', parseInt(elem.css("width"))); 240 241 } 242 243 // Store the original height 244 if(typeof elem.attr('original_height') == 'undefined') { 245 elem.attr('original_height', elem.height() + parseInt(elem.css('marginTop')) + parseInt(elem.css('marginBottom'))); 246 } 247 248 // Store the original left offset 249 if(typeof elem.attr('original_left') == 'undefined' || event.originalEvent.type == 'resize') { 250 elem.attr('original_left', elem.parent().offset().left); 251 } 252 253 var parent = elem.parent(); 254 var elemDefaultTop = parseInt(elem.attr('original_top')); 255 var elemDefaultWidth = parseInt(elem.attr('original_width')); 256 var elemDefaultHeight = parseInt(elem.attr('original_height')); 257 var elemDefaultLeft = parseInt(elem.attr('original_left')); 258 259 // Scroll-on handling: hide until we reach the scroll point 260 var scrollOnAttr = elem.attr('data-sticky-scroll-on'); 261 var scrollOnPoint = (typeof scrollOnAttr !== 'undefined') ? parseInt(scrollOnAttr, 10) : null; 262 263 if(scrollOnPoint !== null && currentScroll < scrollOnPoint) { 264 elem.css('position', 'fixed'); 265 elem.css('top', window.innerHeight + 'px'); 266 elem.css('left', elemDefaultLeft); 267 elem.css('width', elemDefaultWidth); 268 jQuery('div.dummy', elem.parent()).remove(); 269 return; 270 271 } else if(scrollOnPoint !== null && currentScroll >= scrollOnPoint && currentScroll < scrollOnPoint + window.innerHeight) { 272 // Partially scrolled on 273 var diff = window.innerHeight - (currentScroll - scrollOnPoint); 274 if(diff <= 0) { 275 diff = 0; 276 } 277 elem.css('position', 'fixed'); 278 elem.css('top', diff + 'px'); 279 elem.css('left', elemDefaultLeft); 280 elem.css('width', elemDefaultWidth); 281 return; 282 283 } 284 285 // Determine when the sticky element should start scrolling off the screen 286 var scrollOffAttr = elem.attr('data-sticky-scroll-off'); 287 var scrollOffAttr2 = elem.attr('data-sticky-height'); 288 var scrollOffPoint = (typeof scrollOffAttr !== 'undefined') ? parseInt(scrollOffAttr, 10) : (typeof scrollOffAttr2 !== 'undefined') ? parseInt(scrollOffAttr2, 10) : 0; 289 290 if(currentScroll <= elemDefaultTop) { 291 // The original position is active 292 if(elem.css('position') != 'relative') { 293 elem.css('position', 'relative'); 294 } 295 if(elem.css('top') != '0px') { 296 elem.css('top', '0px'); 297 } 298 if(elem.css('left') != '0px') { 299 elem.css('left', '0px'); 300 } 301 if(elem.css('width') != 'inherit') { 302 elem.css('width', 'inherit'); 303 } 304 305 // Remove the dummy element 306 jQuery('div.dummy', parent).remove(); 307 308 return; 309 310 } else if(currentScroll > elemDefaultTop) { 311 312 if(scrollOffPoint > 0 && currentScroll > scrollOffPoint) { 313 // Fixed in position (scroll off the page) 314 var diff = scrollOffPoint - currentScroll; 315 elem.css('top', diff + 'px'); 316 return; 317 } 318 319 // Scrolling down the page 320 if(elem.css('position') != 'fixed') { 321 elem.css('position', 'fixed'); 322 } 323 if(elem.css('top') != '0px') { 324 elem.css('top', '0px'); 325 } 326 if(elem.css('left') != elemDefaultLeft) { 327 elem.css('left', elemDefaultLeft); 328 } 329 if(elem.css('width') != elemDefaultWidth) { 330 elem.css('width', elemDefaultWidth); 331 } 332 if(elem.css('z-index') != '1000') { 333 elem.css('z-index', '1000'); 334 } 335 } 336 337 // Add a dummy element into the original spot on the page, so the page doesn't jump 338 if(parent.find('div.dummy').length == 0) { 339 // Add dummy object 340 var dummyObject = jQuery('<div/>', { 341 "class": 'dummy' 342 }); 343 dummyObject.css("width", elemDefaultWidth); 344 dummyObject.css("height", elemDefaultHeight); 345 346 parent.append(dummyObject); 347 } 348 349 }); 350});
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.