1 2( function( $ ) { 3 $(document).ready(function() { 4 /* 5 $(window).resize(function() { 6 if ($(window).width() < 1200) { 7 $("div.language-switcher").appendTo('.navbar-collapse'); 8 $(".social-links-header").appendTo('.navbar-collapse'); 9 } else { 10 $("div.language-switcher").appendTo('#language-switcher-container'); 11 $(".social-links-header").appendTo('#header-social-container'); 12 } 13 }); 14 if ($(window).width() < 1200) { 15 $(".language-switcher").appendTo('.navbar-collapse'); 16 $(".social-links-header").appendTo('.navbar-collapse'); 17 18 } 19 */ 20 21 $('div.back-to-main').clone().addClass('d-block').addClass('d-xl-none').appendTo('.navbar-collapse'); 22 $("div.language-switcher").clone().addClass('d-block').addClass('d-xl-none').appendTo('.navbar-collapse'); 23 $(".social-links-header").clone().addClass('d-block').addClass('d-xl-none').appendTo('.navbar-collapse'); 24 25 if ($('.cta-container').length){ 26 //$('.cta-container').addClass('floating'); 27 } 28 29 $.fn.isVis = function(elem){ 30 var elem = $(elem); 31 var toScroll = $(this).offset().top - $(window).height() + elem.height(); 32 var scrollTop = $(window).scrollTop(); 33 //console.log(scrollTop); 34 return (scrollTop >= toScroll); 35 } 36 37 38 $.wait = function( callback, seconds){ 39 return window.setTimeout( callback, seconds * 1000 ); 40 } 41 $(window).on('scroll', function () { 42 if($('footer#colophon').isVis('.cta-container')){ 43 //$.wait( function(){ $('.cta-container').removeClass('floating') }, 0.25); 44 } 45 else{ 46 //$('.cta-container').addClass('floating'); 47 //$.wait( function(){ $('.cta-container').addClass('floating') }, 0.25); 48 } 49 50 }); 51 52 53 //scroll to top 54 $(window).scroll(function() { 55 var height = $(window).scrollTop(); 56 if (height > 1000) { 57 $('#btn-up').fadeIn(); 58 } else { 59 $('#btn-up').fadeOut(); 60 } 61 }); 62 63 $(function () { 64 $('[data-toggle="popover"]').popover() 65 }) 66 $('.popover-dismiss').popover({ 67 trigger: 'focus' 68 }) 69 70 71 72 function makeTimer() { 73 74 var eventdate = $('#event-countdown').data('start-time'); 75 76 var endTime = new Date(eventdate); 77 endTime = (Date.parse(endTime) / 1000); 78 79 var now = new Date(); 80 81 now = (Date.parse(now) / 1000); 82 83 var timeLeft = endTime - now; 84 85 if (timeLeft > 0){ 86 var days = Math.floor(timeLeft / 86400); 87 var hours = Math.floor((timeLeft - (days * 86400)) / 3600); 88 var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600 )) / 60); 89 var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60))); 90 91 if (hours < "10") { hours = "0" + hours; } 92 if (minutes < "10") { minutes = "0" + minutes; } 93 if (seconds < "10") { seconds = "0" + seconds; } 94 95 $("#days").html(days + "<span>" + maybePlural(days, time_words.day) + "</span>"); 96 $("#hours").html(hours + "<span>" + maybePlural(hours, time_words.hour) + "</span>"); 97 $("#minutes").html(minutes + "<span>" + maybePlural(minutes, time_words.min) + "</span>"); 98 $("#seconds").html(seconds + "<span>" + maybePlural(seconds, time_words.sec) + "</span>"); 99 } 100 else{ 101 $('#event-countdown').html(""); 102 } 103 104 } 105 106 function maybePlural(count, word){ 107 if (parseInt(count) == 1){ 108 return word; 109 } 110 else{ 111 switch(word){ 112 case time_words.day: 113 return time_words.days; 114 case time_words.hour: 115 return time_words.hours; 116 case time_words.min: 117 return time_words.mins; 118 case time_words.sec: 119 return time_words.secs; 120 } 121 } 122 } 123 124 setInterval(function() { makeTimer(); }, 1000); 125 126 $('select.language-switcher').change(function(){ 127 window.location.replace($(this).val()); 128 }); 129 setTimeout(function() { 130 $(".speaker-carousel.owl-carousel").owlCarousel({ 131 nav : true, // Show next and prev buttons 132 dots : true, 133 loop : true, 134 paginationSpeed : 400, 135 singleItem:true, 136 items : 1, 137 itemsDesktop : false, 138 itemsDesktopSmall : false, 139 itemsTablet: false, 140 itemsMobile : false, 141 autoplay: true, 142 autoplayTimeout:6000, 143 144 }); 145 }, 10); 146 setTimeout(function() { 147 $(".single-carousel.owl-carousel").owlCarousel({ 148 nav : true, // Show next and prev buttons 149 dots : true, 150 loop : true, 151 paginationSpeed : 400, 152 singleItem:true, 153 items : 1, 154 itemsDesktop : false, 155 itemsDesktopSmall : false, 156 itemsTablet: false, 157 itemsMobile : false, 158 autoplay: true, 159 autoplayTimeout:6000, 160 161 }); 162 }, 10); 163 $(".sa-content-slider .owl-carousel").owlCarousel({ 164 165 navigation : true, // Show next and prev buttons 166 slideSpeed : 300, 167 paginationSpeed : 400, 168 singleItem:true, 169 loop : true, 170 items : 1, 171 itemsDesktop : false, 172 itemsDesktopSmall : false, 173 itemsTablet: false, 174 itemsMobile : false, 175 autoplay: true, 176 autoplayTimeout:3000, 177 onChanged: changedCallback, 178 }); 179 180 $('.partner-carousel.owl-carousel').owlCarousel({ 181 loop:true, 182 margin:10, 183 responsiveClass:true, 184 responsive:{ 185 0:{ 186 items:1, 187 nav:true 188 }, 189 600:{ 190 items:2, 191 nav:false 192 }, 193 1000:{ 194 items:$(this).data('item-count'), 195 nav:true, 196 loop:false 197 } 198 } 199 }) 200 201 // Latest news carousel - mobile only 202 function initLatestNewsCarousel() { 203 var $carousel = $('.latest-news-carousel'); 204 205 if ($(window).width() < 768) { 206 if (!$carousel.hasClass('owl-carousel')) { 207 $carousel.addClass('owl-carousel'); 208 } 209 if (!$carousel.hasClass('owl-loaded')) { 210 $carousel.owlCarousel({ 211 loop: false, 212 margin: 0, 213 nav: true, 214 dots: true, 215 items: 1, 216 autoplay: false, 217 autoWidth: false, 218 stagePadding: 0, 219 center: false, 220 onInitialized: function(event) { 221 // Force correct width after initialization 222 var containerWidth = $carousel.width(); 223 $carousel.find('.owl-item').css('width', containerWidth + 'px'); 224 }, 225 onResized: function(event) { 226 // Force correct width on resize 227 var containerWidth = $carousel.width(); 228 $carousel.find('.owl-item').css('width', containerWidth + 'px'); 229 } 230 }); 231 } 232 } else { 233 if ($carousel.hasClass('owl-loaded')) { 234 $carousel.trigger('destroy.owl.carousel'); 235 $carousel.removeClass('owl-carousel owl-loaded'); 236 $carousel.find('.owl-stage-outer').children().unwrap(); 237 $carousel.find('.owl-stage').children().unwrap(); 238 $carousel.find('.owl-item').children().unwrap(); 239 } 240 } 241 } 242 243 initLatestNewsCarousel(); 244 245 // Features carousel - mobile only 246 function initFeaturesCarousel() { 247 var $carousel = $('.features-carousel'); 248 249 if ($(window).width() < 992) { 250 if (!$carousel.hasClass('owl-carousel')) { 251 $carousel.addClass('owl-carousel'); 252 } 253 if (!$carousel.hasClass('owl-loaded')) { 254 $carousel.owlCarousel({ 255 loop: false, 256 margin: 0, 257 nav: false, 258 dots: true, 259 autoplay: false, 260 autoWidth: false, 261 stagePadding: 0, 262 responsive: { 263 0: { 264 items: 1 265 }, 266 768: { 267 items: 2 268 } 269 }, 270 onInitialized: function(event) { 271 var containerWidth = $carousel.width(); 272 var itemsPerSlide = $(window).width() >= 768 ? 2 : 1; 273 var itemWidth = containerWidth / itemsPerSlide; 274 $carousel.find('.owl-item').css('width', itemWidth + 'px'); 275 }, 276 onResized: function(event) { 277 var containerWidth = $carousel.width(); 278 var itemsPerSlide = $(window).width() >= 768 ? 2 : 1; 279 var itemWidth = containerWidth / itemsPerSlide; 280 $carousel.find('.owl-item').css('width', itemWidth + 'px'); 281 } 282 }); 283 } 284 } else { 285 if ($carousel.hasClass('owl-loaded')) { 286 $carousel.trigger('destroy.owl.carousel'); 287 $carousel.removeClass('owl-carousel owl-loaded'); 288 $carousel.find('.owl-stage-outer').children().unwrap(); 289 $carousel.find('.owl-stage').children().unwrap(); 290 $carousel.find('.owl-item').children().unwrap(); 291 } 292 } 293 } 294 295 initFeaturesCarousel(); 296 297 // Image Row Carousel - mobile only 298 function initImageRowCarousel() { 299 $('.image-row-carousel-items').each(function() { 300 var $carousel = $(this); 301 302 if ($(window).width() < 768) { 303 if (!$carousel.hasClass('owl-carousel')) { 304 $carousel.addClass('owl-carousel'); 305 } 306 if (!$carousel.hasClass('owl-loaded')) { 307 $carousel.owlCarousel({ 308 loop: false, 309 margin: 0, 310 nav: false, 311 dots: true, 312 items: 1, 313 autoplay: false, 314 autoWidth: false, 315 stagePadding: 0, 316 center: false, 317 onInitialized: function(event) { 318 var containerWidth = $carousel.width(); 319 $carousel.find('.owl-item').css('width', containerWidth + 'px'); 320 }, 321 onResized: function(event) { 322 var containerWidth = $carousel.width(); 323 $carousel.find('.owl-item').css('width', containerWidth + 'px'); 324 } 325 }); 326 } 327 } else { 328 if ($carousel.hasClass('owl-loaded')) { 329 $carousel.trigger('destroy.owl.carousel'); 330 $carousel.removeClass('owl-carousel owl-loaded'); 331 $carousel.find('.owl-stage-outer').children().unwrap(); 332 $carousel.find('.owl-stage').children().unwrap(); 333 $carousel.find('.owl-item').children().unwrap(); 334 } 335 } 336 }); 337 } 338 339 initImageRowCarousel(); 340 341 // Simple news carousel - real carousel at all breakpoints, owl handles its own responsive re-layout. 342 // 343 // Owl computes itemWidth as (containerWidth/items).toFixed(3) - margin, which algebraically 344 // makes items*(itemWidth+margin) land exactly on containerWidth - so in theory there's no ga
344p. 345 // The only way a gap still shows is if owl measured containerWidth before web fonts finished 346 // loading/reflowing the page, then never recalculated against the final, larger width. Rather 347 // than patching owl's output after the fact (tried before, unreliable), force owl to fully 348 // recompute everything itself once the page has truly finished loading. 349 $('.simple-news-carousel').each(function() { 350 var $carousel = $(this).owlCarousel({ 351 loop: false, 352 margin: 24, 353 nav: true, 354 dots: false, 355 responsive: { 356 0: { 357 items: 2 358 }, 359 1000: { 360 items: 4 361 } 362 } 363 }); 364 365 $(window).on('load', function() { 366 $carousel.trigger('refresh.owl.carousel'); 367 }); 368 }); 369 370 var resizeTimer; 371 $(window).on('resize', function() { 372 clearTimeout(resizeTimer); 373 resizeTimer = setTimeout(function() { 374 initLatestNewsCarousel(); 375 initFeaturesCarousel(); 376 initImageRowCarousel(); 377 }, 250); 378 }); 379 380 function changedCallback(event){ 381 if (event.item.index == 2){ 382 $('.counter-element .number .count-up').counterUp({ 383 delay: 5, 384 time: 1000 385 }); 386 } 387 } 388 389 function init_collapse(){ 390 $('.sa-collapse').click(function(){ 391 var target = $(this).data('target'); 392 if ($(target).hasClass('show')){ 393 //animate height 0 394 //remove class show 395 //add class in 396 $(target).slideUp('slow', function(){ 397 $(target).removeClass('show'); 398 $(target).addClass('in'); 399 }); 400 } 401 else{ 402 //close all others 403 $('.collapse.show').slideUp('fast', function(){ 404 $('.collapse.show').removeClass('show'); 405 $('.collapse.show').addClass('in'); 406 }); 407 $(target).slideDown('slow', function(){ 408 $(target).addClass('show'); 409 $(target).addClass('in'); 410 }); 411 } 412 }); 413 } 414 init_collapse(); 415 416 $(document).on('facetwp-loaded', function() { 417 init_collapse(); 418 }); 419 420 421 $('#modal-link').on('click', function() { 422 $.fancybox.open( $('#modal'), { 423 touch: false 424 }); 425 }); 426 427 $('.fancybox').fancybox(); 428 $("[data-fancybox]").fancybox(); 429 430 431 $(window).scroll(function() 432 { 433 if ($(this).scrollTop() > 200) 434 { 435 $('#masthead').addClass("sticky_header"); 436 } 437 else 438 { 439 $('#masthead').removeClass("sticky_header"); 440 } 441 442 }); 443 444 if ($('.sa-stats .count-up').length){ 445 $('.sa-stats .count-up').counterUp({ 446 delay: 10, 447 time: 1500 448 }); 449 } 450 451 452 453 454 455 456 457 }); 458} )( jQuery );
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.