1/* Build: 2026.09.09.03 */ 2console.log("site 1c"); 3var stickySidebarObj = false; 4var processingLink = false; 5 function getCharsBefore(str, chr) { 6 var index = str.indexOf(chr); 7 if (index != -1) { 8 return(str.substring(0, index)); 9 } 10 return(""); 11 } 12 13$(document).ready(function () { 14 if (!Cookie.read('promo-close')) { 15 $(".promo-wrapper").show(); 16 } else { 17 $(".promo-wrapper").hide(); 18 } 19 var didScroll; 20 var lastScrollTop = 0; 21 var delta = 75; 22 var navbarHeight = $('header').outerHeight(); 23 24 $(window).scroll(function (event) { 25 didScroll = true; 26 }); 27 28 setInterval(function () { 29 if (didScroll) { 30 hasScrolled(); 31 didScroll = false; 32 } 33 }, 250); 34 35 function hasScrolled() { 36 var st = $(this).scrollTop(); 37 38 // Make sure they scroll more than delta 39 if (Math.abs(lastScrollTop - st) <= delta) 40 return; 41 42 if (!Cookie.read('newsletter-close')) { 43 if ($(this).scrollTop()>500) 44 { 45 $(".newsletter").show(); 46 }; 47 } 48 49 // The header stays put in both directions, so nothing here hides or reveals it. 50 51 lastScrollTop = st; 52 } 53 page_init(); 54 var sliderAdaptiveHeight = function () { 55 var heights = []; 56 var items = $('.award-slider .slick-slide'); 57 items.each(function () { 58 heights.push($(this).height()); 59 }); 60 //console.log("Setting to " + (Math.max.apply(null, heights) + 35)); 61 $('.award-slider .slick-list, .award-slider .slick-slide').height((Math.max.apply(null, heights) + 35)); 62 } 63 sliderAdaptiveHeight(); 64 65}); 66 67function inline_swap(link) { 68 if (processingLink == true) { 69 //console.log("Swap called when already mid-fire; exiting."); 70 return false; 71 }; 72 processingLink = true; 73 $('#content_grab').load(link + ' #content_grab > *', function (responseTxt, statusTxt, xhr) { 74 console.log(statusTxt); 75 if (statusTxt == "error") { 76 console.log("Danger Will Robinson!"); 77 document.location = link; 78 return true; 79 } 80 else if (responseTxt.includes('id="content_grab"') && statusTxt == "success") { 81 if (history.pushState) { 82 history.pushState(null, null, link); 83 } 84 jQuery("#content_grab").removeClass("force-recalc").addClass("force-recalc"); 85 $('.inner-sticky-side').stickySidebar({ topSpacing: 60, containerSelector: '.primary-container', resizeSensor: true, bottomSpacing: 20, innerWrapperSelector: '.inner__side' }); 86 $('.inner-sticky-side').stickySidebar("updateSticky"); //updateSticky", {topSpacing: 60,containerSelector: '.primary-container',resizeSensor: true,bottomSpacing: 20}); 87 $('html, body').animate({ scrollTop: ($("#content_grab").offset().top - 100) }, 450, 'linear'); 88 $("#content_grab img.lazy-hidden:visible").each(function (i) { 89 if ($(this).attr('data-lazy-srcset')) { 90 $(this).attr('srcset', $(this).attr('data-lazy-srcset')); 91 } 92 $(this).attr("src", $(this).attr('data-lazy-src')); 93 $(this).removeClass("lazy-hidden").addClass("lazy-loaded"); 94 }); 95 page_init(); 96 } else { 97 //console.log("Failed"); 98 document.location = link; 99 } 100 processingLink = false; 101 }); 102}; 103 104function page_init() { 105 console.log("Page init -- intellam 20201109.a"); 106 checkVisible(); 107 if ($(".search-btn").length > 0) { 108 $(".search-btn").on("click", function() { 109 //$(".search-form .input-wrapper").toggle(); 110 }); 111 } 112 $(".error-buttons .btn-search").on("click", function(e) { 113 e.preventDefault() 114 $(".error-form").toggle(); 115 }); 116 //hamburger 117 $(".hamburger").on("click", function() { 118 $(".navbar1").show(); 119 }); 120 //close-btn 121 $(".close-btn, .close-cir").on("click", function() { 122 $(".navbar").hide(); 123 Cookie.write('navbar-close', true); 124 }); 125 $(".follow-link").on("click", function() { 126 $(".follow-navbar").show(); 127 }); 128 if ($(".res-list li a, a.load-inline").length > 0) { 129 $(".res-list li a, a.load-inline").on("click", function(e) { 130 console.log("Internal link auto-fired"); 131 e.preventDefault(); 132 e.stopPropagation(); // Stops event from bubbling to .res-child 133 if (processingLink == true) { 134 //console.log("Mid-fire; exiting."); 135 return false; 136 }; 137 processingLink = true; 138 var link = $(this); 139 console.log(link); 140 if (link.attr("href") == '#' || link.attr("href") == '') return false;
141 console.log(link.attr("href").indexOf("#")); 142 if (link.attr("href").indexOf("#") > 1) 143 { 144 console.log("Intra-page target"); 145 var curPage = getCharsBefore(window.location.href, "#"); 146 if (curPage == "") { curPage = window.location.href }; 147 var newPage = getCharsBefore(link.attr("href"),"#"); 148console.log("CurPage: " + curPage + " newPage: " + newPage); 149 if (newPage == curPage) 150 { 151 console.log("Target is on this page..." + link.attr("href").replace(curPage,'')); 152 $([document.documentElement, document.body]).animate({ 153 scrollTop: $(link.attr("href").replace(curPage,'')).offset().top 154 }, 2000); 155 processingLink = false; 156 return true; 157 } else { 158 console.log("Target is on a different page..."); 159 document.location = link.attr("href") ; 160 return true; 161 }; 162 }; 163 if (link.parent().hasClass("force-load")) 164 { 165 console.log("Force Load detected"); 166 document.location = link.attr("href"); 167 return true; 168 }; 169 $('#content_grab').load(link.attr("href") + ' #content_grab > *', function(responseTxt, statusTxt, xhr) { 170 console.log(statusTxt); 171 if (statusTxt == "error") 172 { 173 console.log("Danger Will Robinson!"); 174 document.location = link.attr("href"); 175 return true; 176 } 177 else if (responseTxt.includes('id="content_grab"') && statusTxt == "success") 178 { 179 if (history.pushState) { 180 history.pushState(null, null, link.attr("href")); 181 } 182 //jQuery(link).closest(".res-list").find('li').removeClass("current-menu-item current-menu-parent"); 183 // //jQuery(link).closest(".res-list").find('li').removeClass("current-menu-parent"); 184 //jQuery(link).parent().addClass("current-menu-item"); 185 //jQuery(".res-list > li > ul > li.current-menu-item").parent().parent().addClass("current-menu-parent"); 186 jQuery("#content_grab").removeClass("force-recalc").addClass("force-recalc"); 187 console.log("Recreating reconfig sticky "); 188 $('.inner-sticky-side').stickySidebar({topSpacing: 60,containerSelector: '.primary-container',resizeSensor: true,bottomSpacing: 20,innerWrapperSelector: '.inner__side'}); 189 $('.inner-sticky-side').stickySidebar("updateSticky"); //updateSticky", {topSpacing: 60,containerSelector: '.primary-container',resizeSensor: true,bottomSpacing: 20}); 190 $('html, body').animate({ scrollTop: ($("#content_grab").offset().top - 100) }, 450, 'linear'); 191 192 // $('.inner-wrapper-sticky').css('top', '60px !important'); 193 $("#content_grab img.lazy-hidden:visible").each(function(i) { 194 //console.log("Image..."); 195 if ($(this).attr('data-lazy-srcset')){ 196 //console.log("...srcset"); 197 $(this).attr('srcset', $(this).attr('data-lazy-srcset')); 198 } 199 $(this).attr("src", $(this).attr('data-lazy-src')); 200 $(this).removeClass("lazy-hidden").addClass("lazy-loaded"); 201 }); 202 page_init(); 203 processingLink = false; 204 return false; 205 } else { 206 console.log("Failed"); 207 document.location = link.attr("href") ; 208 return true; 209 } 210 }); 211 console.log("End"); 212 }); 213 }; 214 if ($(".res-link").length > 0) { 215 $(".res-link").on("click", function() { 216 $(".resource-navbar").show(); 217 }); 218 } 219 $(".follow-heading").on("click", function() { 220 $(".follow-navbar").hide(); 221 $(".navbar1").show(); 222 }); 223 $(".account-heading").on("click", function() { 224 $(".account-navbar").hide(); 225 $(".navbar1").show(); 226 }); 227 if ($(".resource-heading").length > 0) { 228 $(".resource-heading").on("click", function() { 229 $(".resource-navbar").hide(); 230 $(".navbar1").show(); 231 }); 232 } 233 $(".win-link").on("click", function() { 234 $(".winner-navbar").show(); 235 }); 236 $(".win-heading").on("click", function() { 237 $(".winner-navbar").hide(); 238 $("resource-navbar").show(); 239 }); 240 if ($(".res-child").length > 0) { 241 $(".res-child > a").each(function() { 242 if ($(this).siblings('.res-toggle').length === 0) { 243 $('<div class="res-toggle"></div>').insertAfter($(this)); 244 } 245 }); 246 247 $(".res-toggle").on("click", function(e) { 248 e.preventDefault(); 249 e.stopPropagation(); 250 var parent = $(this).closest('.res-child'); 251 if (parent.hasClass('current-menu-item') || parent.hasClass('current-menu-parent') || parent.hasClass('current-menu-ancestor')) { 252 return; 253 } 254 parent.toggleClass("res-open"); 255 }); 256 } 257 258 if ($(window).width < 768) { 259 $(".account-link").on("click", function() { 260 $(".account-navbar").show(); 261 }); 262 } 263 //select explore 264 if ($(".explore-select").length > 0) { 265 $(".explore-select").selectmenu({ 266 appendTo : ".select-wrap" 267 }); 268 } 269 //category slider 270 if ($(".category-slider").length > 0) { 271 $('.category-slider').slick({ 272 mobileFirst : true, 273 slidesToScroll : 1, 274 slidesToShow : 2, 275 centerMode : true, 276 arrows : false, 277 278 responsive : [{ 279 breakpoint : 575, 280 settings : { 281 slidesToShow : 3 282 } 283 }, { 284 breakpoint : 991, 285 settings : { 286 slidesToShow : 4 287 } 288 }, { 289 breakpoint : 1199, 290 settings : { 291 slidesToShow : 8 292 } 293 }] 294 }); 295 } 296 //webby slider 297 if ($(".webby-slider .webby-slides").length == 2) { 298 $(".webby-slider").addClass("two-slides"); 299 } else if ($(".webby-slider .webby-slides").length == 3) { 300 $(".webby-slider").removeClass(".webby-slides").addClass("three-slides"); 301 } else { 302 $(".webby-slider").removeClass("three-slides, two-slides"); 303 } 304 if ($(".webby-slider .webby-slides").length > 0) 305 { 306 $('.webby-slider').each(function() { 307 var $this = $(this); 308 if ($this.children().length > 3) { 309 $this.slick({ 310 mobileFirst : true, 311 slidesToScroll : 1, 312 slidesToShow : 2, 313 arrows : false, 314 infinite : true, 315 autoplay : false, 316 cssEase: 'linear', 317 speed : 0, 318 responsive : [{ 319 breakpoint : 575, 320 settings : { 321 slidesToScroll : 2, 322 slidesToShow : 2 323 } 324 }, {
325 breakpoint : 767, 326 settings : { 327 slidesToScroll : 3, 328 slidesToShow : 3 329 } 330 }, { 331 breakpoint : 991, 332 settings : { 333 slidesToShow : 4, 334 slidesToScroll : 4, 335 } 336 }] 337 }); 338 } 339 }); 340 }; 341 // The home hero. Dots only, as the design shows; one slide leaves it a plain block. 342 if ($('[data-hero-slider] .hero-slide').length > 1) { 343 $('[data-hero-slider] .hero-slider__track').slick({ 344 slidesToShow : 1, 345 slidesToScroll : 1, 346 arrows : false, 347 dots : true, 348 infinite : true, 349 autoplay : true, 350 autoplaySpeed : 6000, 351 pauseOnHover : true, 352 adaptiveHeight : false 353 }); 354 355 /* 356 * The loop clones slides, and a clone of the first one would put a second <h1> on the page. 357 * The clones are decoration, so their heading is demoted to match the other slides. 358 */ 359 $('[data-hero-slider] .slick-cloned h1').each(function () { 360 var h1 = $(this); 361 h1.replaceWith($('<h2>').attr('class', h1.attr('class')).html(h1.html())); 362 }); 363 } 364 365 // The video button opens the YouTube embed in place rather than leaving the page. 366 if ($('.hero-slide__btn--video').length > 0 && $.fn.fancybox) { 367 $('.hero-slide__btn--video').fancybox({ 368 openEffect : 'fade', 369 closeEffect : 'fade', 370 helpers : { overlay : { locked : false } }, 371 width : 960, 372 height : 540, 373 aspectRatio : true 374 }); 375 } 376 377 //latest-slider 378 if ($(".global2-slider").length > 0) { 379 $('.global2-slider').slick({ 380 mobileFirst : true, 381 slidesToScroll : 1, 382 slidesToShow : 2, 383 autoplay: false, 384 arrows : false, 385 infinite : true, 386 speed : 0, 387 responsive : [{ 388 breakpoint : 575, 389 settings : { 390 slidesToShow : 2, 391 slidesToScroll : 2, 392 } 393 },, { 394 breakpoint : 767, 395 settings : { 396 slidesToScroll : 3, 397 slidesToShow : 3 398 } 399 }, { 400 breakpoint : 991, 401 settings : { 402 slidesToShow : 4, 403 slidesToScroll : 4, 404 } 405 }] 406 }); 407 } 408 //website-slider 409 if ($(".global-slider").length > 0) { 410 $('.global-slider').slick({ 411 mobileFirst : true, 412 slidesToScroll : 2, 413 autoplay: false, 414 slidesToShow : 3, 415 arrows : false, 416 infinite : true, 417 speed : 0, 418 responsive : [{ 419 breakpoint : 575, 420 settings : { 421 slidesToShow : 2, 422 slidesToScroll : 3, 423 } 424 },, { 425 breakpoint : 767, 426 settings : { 427 slidesToScroll : 4, 428 slidesToShow : 4 429 } 430 }, { 431 breakpoint : 991, 432 settings : { 433 slidesToShow : 4, 434 slidesToScroll : 4, 435 } 436 }] 437 }); 438 } 439 440 //eve-slider 441 if ($(".eve-slider").length > 0) { 442 $('.eve-slider').slick({ 443 mobileFirst : true, 444 slidesToScroll : 1, 445 slidesToShow : 2, 446 arrows : false, 447 infinite : true, 448 speed:0, 449 responsive : [{ 450 breakpoint : 767, 451 settings : { 452 slidesToShow : 4, 453 slidesToScroll : 4, 454 } 455 }] 456 }); 457 } 458 459 //testimonial slider 460 if ($(".testimonial-slider").length > 0 && !$(".testimonial-slider").hasClass('slick-initialized')) { 461 $(".testimonial-slider").slick({ 462 mobileFirst : true, 463 slidesToScroll : 1, 464 slidesToShow : 2, 465 arrows : false, 466 infinite : true, 467 responsive : [{ 468 breakpoint : 575, 469 settings : { 470 slidesToShow : 3 471 } 472 }, { 473 breakpoint : 991, 474 settings : { 475 slidesToShow : 4 476 } 477 }, { 478 breakpoint : 1199, 479 settings : { 480 slidesToShow : 7 481 } 482 }] 483 }); 484 } 485 //header selectbox 486 if ($(".account-list").length > 0) { 487 $(".account-list").selectmenu({ 488 appendTo : ".account-select" 489 }); 490 } 491 //header myaccount 492 $(".account").on("click", function() { 493 $(this).toggleClass("account-active") 494 $(".account-navbar").toggle(); 495 }); 496 //newsletter 497 $(".close-news").on("click", function() { 498 $(".newsletter").hide(); 499 Cookie.write('newsletter-close', true); 500 }); 501 $(".close-circle.close-cir").on("click", function() { 502 $(this).hide(); 503 $(".newsletter").hide(); 504 Cookie.write('newsletter-close', true); 505 }); 506 //promo 507 if ($(".promo-close").length > 0) { 508 $(".promo-close").on("click", function() { 509 $(".promo-wrapper").hide(); 510 Cookie.write('promo-close', true); 511 }); 512 } 513 //number-slider 514 if ($(".num-slider").length > 0) { 515 $(".num-slider").slick({ 516 slidesToShow : 1, 517 slidesToScroll : 1, 518 arrows : false, 519 dots : true, 520 fade:true, 521 infinite : false, 522 autoplay : true, 523 autoplaySpeed : 5000, 524 }); 525 } 526 527 528 //parallax 529 if ($(".banner").length > 0) { 530 $('.banner').parallax(); 531 } 532 //slider 533 if ($(".award-slider, .speech-slider").length > 0) { 534 $(".award-slider, .speech-slider").slick({ 535 slidesToShow : 1, 536 slidesToScroll : 1, 537 dots : false, 538 arrow : true, 539 fade:true, 540 infinite : false, 541 nextArrow : '<button class="slick-next slick-arrow outline-btn"><i><img src="/wp-content/themes/Webbys-2020/assets/images/refresh.svg" alt="refresh" class="normal-img"><img src="/wp-content/themes/Webbys-2020/assets/images/refresh-white.svg" alt="refresh" class="hover-img"></i>See Another</button>' 542 }); 543 } 544 $(".award-slider .slick-next").on("click", function() { 545 $(".award-slider .slick-active h2").addClass("animate"); 546 }); 547 $(".speech-slider .slick-next").on("click", function() { 548 $(".speech-slider .slick-active h2").addClass("animate"); 549 $(".speech-slider .slick-active .web-img").addClass("fade"); 550 }); 551 552 if ($(".year-select select").length > 0) { 553 $(".year-select select").selectmenu({ 554 appendTo : ".year-select", 555 change: function (event, ui) { 556 console.log("Changed!"); 557 $('.tab-link.tab-current').click(); 558 } 559 }); 560 } 561 if ($(".topic-select select").length > 0) { 562 $(".topic-select select").selectmenu({ 563 appendTo: ".topic-select", 564 change: function (event, ui) { 565 console.log("Changed!"); 566 $('.tab-link.tab-current').click(); 567 } 568 }); 569 } 570 571 if ($("#content_grab .form-field--select:not(.select-list) select").length > 0) { 572 $("#content_grab .form-field--select:not(.select-list) select").each(function() { 573 $(this).closest(".form-group").addClass("select-list"); 574 $(this).selectmenu({ 575 appendTo: ".form-field--select" 576 }); 577 }) 578 } 579 580 if ($(".redirect-select select").length > 0) { 581 $(".redirect-select select").selectmenu({ 582 appendTo: ".redirect-select", 583 change: function (event, ui) { 584 console.log(ui.item.value); 585 if (ui.item.value) 586 { 587 inline_swap(ui.item.value); 588 } 589 } 590 }); 591 } 592 593 //tabbing 594 if ($(".tab-link").length > 0) { 595 $('.tab-link').click(function() { 596 console.log("tab click"); 597 var tab_id = $(this).attr('data-tab'); 598 $('.tab-link').removeClass('tab-current'); 599 //$('.tab-content').removeClass('tab-current'); 600 $(this).addClass('tab-current'); 601 //$("#" + tab_id).addClass('tab-current'); 602 var url = "/features/?"; 603 if ($(this).attr('data-type')) { 604 if($(this).attr('data-type') == "all-events" || $(this).attr('data-type') == "insights" || $(this).attr('data-type') == "events") 605 { 606 url = "/events-and-insights/?"; 607 } 608 if($(this).attr('data-type') != "all-events") 609 { 610 url += "filter_type=" + $(this).attr('data-type') + '&'; 611 }; 612 } 613 console.log(jQuery("select[name=filter_cat]").prop('selectedIndex')); 614 console.log(jQuery("select[name=filter_year]").prop('selectedIndex')); 615 616 if (jQuery("select[name=filter_cat]").val() && jQuery("select[name=filter_cat]").prop('selectedIndex') != 0) 617 { 618 url += "filter_cat=" + jQuery("select[name=filter_cat]").val() + '&'; 619 } 620 if (jQuery("select[name=filter_year]").val() && jQuery("select[name=filter_year]").prop('selectedIndex') != 0) { 621 url += "filter_year=" + jQuery("select[name=filter_year]").val() + '&'; 622 } 623 console.log("loading " + url); 624 processingLink = true 625 $("#content-grid").load(url + ' #content-grid > *', function (responseTxt, statusTxt, xhr) { 626 console.log(statusTxt); 627 if (statusTxt == "error") { 628 console.log("Danger Will Robinson!"); 629 document.location = url; 630 return true; 631 } 632 else if (responseTxt.includes('id="content-grid"') && statusTxt == "success") { 633 if (history.pushState) { 634 history.pushState(null, null, url); 635 } 636 jQuery("#content_grab").removeClass("force-recalc").addClass("force-recalc"); 637 $("#content_grab img.lazy-hidden:visible").each(function (i) { 638 if ($(this).attr('data-lazy-srcset')) { 639 $(this).attr('srcset', $(this).attr('data-lazy-srcset')); 640 } 641 $(this).attr("src", $(this).attr('data-lazy-src')); 642 $(this).removeClass("lazy-hidden").addClass("lazy-loaded"); 643 }); 644 page_init(); 645 processingLink = false;
646 return false; 647 } else { 648 console.log("Failed"); 649 document.location = url; 650 return true; 651 } 652 }); 653 }); 654 } 655 656 //share sticky 657 658 if ($(".button-share").length > 0) { 659 $(".button-share").on("click", function(e) { 660 e.stopPropagation(); 661 $(".share-wrap").show(); 662 $("body").addClass("noscroll"); 663 $(".overlay").show(); 664 }); 665 } 666 if ($(".share-close").length > 0) { 667 $(".share-close").on("click", function() { 668 $(".share-wrap").hide(); 669 $("body").removeClass("noscroll"); 670 $(".overlay").hide(); 671 }); 672 } 673 674 if ($(".light1").length > 0) { 675 $(".light1").on("click", function() { 676 $(".lightbox-popup").show().removeClass("light-color light-color2"); 677 $("body").addClass("noscroll"); 678 }); 679 } 680 681 if ($(".light2").length > 0) { 682 $(".light2").on("click", function() { 683 $(".lightbox-popup").show().removeClass("light-color2").addClass("light-color"); 684 $("body").addClass("noscroll"); 685 }); 686 } 687 688 if ($(".light3").length > 0) { 689 $(".light3").on("click", function() { 690 $(".lightbox-popup").show().removeClass("light-color").addClass("light-color2"); 691 $("body").addClass("noscroll"); 692 }); 693 } 694 if ($(".lightbox-close").length > 0) { 695 $(".lightbox-close").on("click", function() { 696 $(".lightbox-popup").hide(); 697 $("body").removeClass("noscroll"); 698 }); 699 } 700 //faq 701 if ($(".acc-ques").length > 0) { 702 $('.acc-ques').click(function(e) { 703 e.preventDefault(); 704 let 705 $this = $(this); 706 if ($this.next().hasClass('show')) { 707 $this.next().removeClass('show'); 708 $this.next().slideUp(350); 709 } else { 710 $this.parent().parent().find('li .inner').removeClass('show'); 711 $this.parent().parent().find('li .inner').slideUp(350); 712 $this.next().toggleClass('show'); 713 $this.next().slideToggle(350); 714 } 715 }); 716 717 $('.acc-ques').click(function(e) { 718 e.preventDefault(); 719 if ($(this).hasClass('rotate')) { 720 $(this).removeClass('rotate'); 721 } else { 722 $(this).addClass('rotate'); 723 $(this).parent().siblings().find('.acc-ques').removeClass('rotate'); 724 } 725 }); 726 } 727 //recap slider 728 if ($(".recap-slider").length > 0) { 729 $('.recap-slider').slick({ 730 slidesToScroll : 1, 731 slidesToShow : 2, 732 arrows : false, 733 infinite : true, 734 autoplay : false, 735 cssEase: 'linear', 736 speed : 0, 737 }); 738 } 739 740 /* 741 if ($(window).width() > 767) { 742 if ($(".win-slider").length > 0) { 743 // Custom Pagination for Slider 744 $('.win-slider').on('init', function(event, slick) { 745 $(this).append('<div class="slick-counter"><span class="current"></span> / <span class="total"></span></div>'); 746 var sc = slick.currentSlide + 1; 747 var tc = slick.slideCount; 748 if (tc < 10) { 749 $('.total').text("0" + tc); 750 } else { 751 $('.total').text(tc); 752 } 753 if (sc < 10) { 754 $('.current').text("0" + sc); 755 } else { 756 $('.current').text(sc); 757 } 758 }).on('beforeChange', function(event, slick, currentSlide, nextSlide) { 759 var ns = nextSlide + 1; 760 if (ns < 10) { 761 $('.current').text("0" + ns); 762 } else { 763 $('.current').text(ns); 764 } 765 }); 766 $('.win-slider').slick({ 767 slidesToScroll : 1, 768 slidesToShow : 1, 769 arrows : true, 770 infinite : false, 771 fade:true, 772 }); 773 } 774 } 775 */ 776 777 //calendar acccordion 778 if ($(".date-top").length > 0) { 779 $('.date-top').click(function(e) { 780 e.preventDefault(); 781 let 782 $this = $(this); 783 if ($this.next().hasClass('show-content')) { 784 $this.next().removeClass('show-content'); 785 $this.next().slideUp(350); 786 } else { 787 $this.parent().parent().find('li .date-content').removeClass('show-content'); 788 $this.parent().parent().find('li .date-content').slideUp(350); 789 $this.next().toggleClass('show-content'); 790 $this.next().slideToggle(350); 791 } 792 }); 793 $('.date-top').click(function(e) { 794 e.preventDefault(); 795 if ($(this).hasClass('show-rotate')) { 796 $(this).removeClass('show-rotate'); 797 } else { 798 $(this).addClass('show-rotate'); 799 $(this).parent().siblings().find('.date-top').removeClass('show-rotate'); 800 } 801 }); 802 } 803 804 if ($(".win-buttons").length > 0) { 805 $('.win-buttons').stickySidebar({ 806 topSpacing: 200, 807 bottomSpacing: 20, 808 containerSelector: '.win-slider', 809 innerWrapperSelector: '.win-buttons-inner' 810 }); 811 812 } 813 $(window).scroll(function () { 814 if ($(".details-wrapper").length > 0) { 815 if ($(window).scrollTop() >= $('.details-wrapper').offset().top) { 816 $(".inner-sticky").addClass('sticky-detail'); 817 } 818 } 819 820 if ($(".more-features").length > 0) { 821 if ($(window).scrollTop() >= $('.more-features').offset().top + 10) { 822 $(".inner-sticky").removeClass('sticky-detail'); 823 } 824 } 825 826 if ($(".sticky-tab-wrap").length > 0) { 827 if ($(window).scrollTop() >= $('.sticky-tab-wrap').offset().top) { 828 $(".inner-sticky2").addClass('sticky-detail'); 829 } 830 } 831 if ($(".footer").length > 0) { 832 if ($(window).scrollTop() >= $('.footer').offset().top) { 833 $(".inner-sticky2").removeClass('sticky-detail'); 834 } 835 } 836 837 if ($(window).scrollTop() >= 900) { 838 $('.search-form').addClass('sticky-search'); 839 } else { 840 $('.search-form').removeClass('sticky-search'); 841 } 842 checkVisible(); 843 $(".speech-slider .web-img").removeClass("fade"); 844 845 if ($(window).width() < 768) { 846 if ($(window).scrollTop() > 1400) { 847 $(".feature-tabs").addClass("sticky-tab"); 848 } else { 849 $('.feature-tabs').removeClass('sticky-tab'); 850 } 851 } 852 if ($(window).width() < 768) { 853 if ($(window).scrollTop() >= 580) { 854 $(".list-icon-wrap").addClass("sticky-btn"); 855 } else { 856 $(".list-icon-wrap").removeClass("sticky-btn"); 857 } 858 } 859 //sticky anchors 860 if ($(window).scrollTop() >= 550) { 861 $(".sticky-container").addClass("sticky-anchors"); 862 } else { 863 $(".sticky-container").removeClass("sticky-anchors"); 864 } 865 // The title and share controls scroll with the article; the header holds the top of the 866 // viewport now, and .sticky-detail pins to top: 20px underneath it. 867 if ($(".hide-ads").length > 0) { 868 if (($('.inner-sticky').offset().top + $('.inner-sticky').height() + 50) >= $('.hide-ads').offset().top) { 869 $(".inner-sticky").removeClass('sticky-detail'); 870 } 871 } 872 });
873 // Updated Inview Code for slider 874 $('.webby-slider').on('inview', function (event, isInView) { 875 if (isInView) { 876 $(this).addClass('slider-go'); 877 } 878 }); 879 $('.promo-content').on('inview', function (event, isInView) { 880 console.log('promo-content:'+ isInView); 881 if (isInView) { 882 $(this).parent().parent().siblings().find('.header').addClass('nav-down-pushed'); 883 } 884 else 885 { 886 $(this).parent().parent().siblings().find('.header').removeClass('nav-down-pushed'); 887 } 888 }); 889 $('.eve-slider').on('inview', function (event, isInView) { 890 if (isInView) { 891 $(this).addClass('slider-go'); 892 } 893 }); 894 $('.global2-slider').on('inview', function (event, isInView) { 895 if (isInView) { 896 $(this).addClass('slider-go'); 897 } 898 }); 899 $('.global-slider').on('inview', function (event, isInView) { 900 if (isInView) { 901 $(this).addClass('slider-go'); 902 } 903 }); 904 905 $('.number-text').on('inview', function (event, isInView) { 906 if (isInView) { 907 $(this).addClass('num-animate'); 908 } 909 }); 910 911 912 $('.text-banner').on('inview', function (event, isInView) { 913 if (isInView) { 914 $(".inner-sticky").removeClass('sticky-detail'); 915 } 916 }); 917 918 $('.featured-stories').on('inview', function (event, isInView) { 919 if (isInView) { 920 $(".inner-sticky2").removeClass('sticky-detail'); 921 } 922 }); 923 /* 924 * The category renderer stood here: 66 lines that fetched 550 KB of uncompressed JSON 925 * from api.recogmedia.net and built the Webby category list in the browser. It was 926 * gated on a #load_from_api div being present, but the code itself shipped on every 927 * page of the site. The list is rendered on the server now, by 928 * mu-plugins/rm-categories and rm-categories/webbys.php. 929 */ 930 //sticky-search 931 if ($(".inner-sticky-side").length > 0) { 932 console.log(stickySidebarObj); 933 if (typeof stickySidebarObj == 'object') 934 { 935 $('.inner-sticky-side').stickySidebar("updateSticky"); 936 } 937 else 938 { 939 stickySidebarObj = $('.inner-sticky-side').stickySidebar({ 940 topSpacing: 60, 941 containerSelector: '.primary-container', 942 resizeSensor: true, 943 /*bottomSpacing: 20,*/ 944 innerWrapperSelector: '.inner__side' 945 }); 946 }; 947 } 948 //Sticky Nav Resource 949 if ($(".sticky-nav").length > 0) { 950 var cSlide = $('.custom-slide .win-wrap').length; 951 if (cSlide < 10) { 952 $('.sticky-nav .total').text("0" + cSlide); 953 } else { 954 $('.sticky-nav .total').text(cSlide); 955 } 956 957 } 958 $(window).scroll(function () { 959 var scrollDistance = $(window).scrollTop(); 960 var headerHeight = $('.header').height(); 961 var finalH = scrollDistance + headerHeight + 100; 962 963 var slides = document.querySelectorAll('.custom-slide .win-wrap'); 964 for (var i = 0; i < $('.custom-slide .win-wrap').length; i++) { 965 if ($('.custom-slide .win-wrap').eq(i).offset().top <= finalH && finalH <= $('.custom-slide .win-wrap').eq(i).offset().top + $('.custom-slide .win-wrap').eq(i).height()) { 966 $('.custom-slide .win-wrap').removeClass('custom-active'); 967 $('.custom-slide .win-wrap').eq(i).addClass('custom-active') 968 var count = i + 1; 969 count > 9 ? $('.sticky-nav .current').text(count) : $('.sticky-nav .current').text("0" + count); 970 } 971 } 972 }) 973 $(document).ready(function () { 974 $('#next').bind('click', function (e) { 975 e.preventDefault(); 976 var sNext = $('.custom-active').next('.win-wrap').offset().top - 100; 977 $('html, body').animate({ 978 scrollTop: sNext 979 }, "slow"); 980 return false; 981 }); 982 983 $('#prev').bind('click', function (e) { 984 e.preventDefault(); 985 var sNexta = $('.custom-active').prev('.win-wrap').offset().top - 100; 986 $('html, body').animate({ 987 scrollTop: sNexta 988 }, "slow"); 989 return false; 990 }); 991 }); 992}; 993 994 995 996 997//inview 998function checkVisible() { 999 // Slider Slide Auto Start End 1000 if ($(".heading-animation").length > 0) { 1001 $('.heading-animation').each(function(i, k) { 1002 if ($(this).visible()) { 1003 $(k).addClass('animate'); 1004 } 1005 }); 1006 } 1007 if ($(".honor").length > 0) { 1008 if ($('.ani-head').visible()) { 1009 $('.honor').addClass('animate'); 1010 } 1011 } 1012} 1013 1014jQuery(document).on('click', '.js-videoPoster, .play-video', function (ev) { 1015 console.log("Clicked: js-videoPoster"); 1016 ev.preventDefault(); 1017 var $poster = jQuery(this); 1018 var $wrapper = $poster.closest('.js-videoWrapper'); 1019 if (!$wrapper.hasClass('videoWrapperActive')) 1020 { 1021 console.log("Playing!"); 1022 videoPlay($wrapper); 1023 } else { 1024 console.log("Stopping!"); 1025 videoStop($wrapper); 1026 }; 1027}); 1028 1029// play the targeted video (and hide the poster frame) 1030function videoPlay($wrapper) { 1031 var $iframe = $wrapper.find('.js-videoIframe'); 1032 var src = $iframe.data('src'); 1033 // hide poster 1034 $wrapper.addClass('videoWrapperActive'); 1035 // add iframe src in, starting the video 1036 $iframe.attr('src', src); 1037} 1038 1039// stop the targeted/all videos (and re-instate the poster frames) 1040function videoStop($wrapper) { 1041 // if we're stopping all videos on page 1042 if (!$wrapper) { 1043 var $wrapper = $('.js-videoWrapper'); 1044 var $iframe = $('.js-videoIframe'); 1045 // if we're stopping a particular video 1046 } else { 1047 var $iframe = $wrapper.find('.js-videoIframe'); 1048 } 1049 // reveal poster 1050 $wrapper.removeClass('videoWrapperActive'); 1051 // remove youtube link, stopping the video from playing in the background 1052 $iframe.attr('src', ''); 1053} 1054 1055/* 1056BoxFit v1.2.4 - jQuery Plugin 1057(c) 2012 Michi Kono (michikono.com); https://github.com/michikono/boxfit 1058License: http://www.opensource.org/licenses/mit-license.php 1059To use: $('#target-div').boxFit() 1060Will make the *text* content inside the div (or whatever tag) scale to fit that tag 1061*/ 1062 1063 1064(function (root, factory) { 1065 'use strict'; 1066 if (typeof define === 'function' && define.amd) { 1067 // AMD 1068 define(['jquery'], function ($) { return factory(root, $); }); 1069 } else if (typeof exports === 'object') { 1070 // CommonJS 1071 module.exports = factory(root, require('jquery')); 1072 } else { 1073 // Browser globals 1074 factory(root, jQuery); 1075 } 1076}(this, function (window, $) { 1077 'use strict'; 1078 var boxfit = function ($nodes, options) { 1079 return $nodes.each(function () { 1080 var current_step, inner_span, next_font_size, original_height, original_text, original_width, settings, span; 1081 settings = { 1082 // manually set a width/height if you haven't set one explicitly via CSS 1083 width: null, 1084 height: null, 1085 // the amount to change each time - bigger numbers are faster but fit less perfectly 1086 step_size: 1, 1087 // the number of font size iterations we should step through until we give up 1088 step_limit: 200, 1089 // set to false to NOT align middle (vertically) 1090 align_middle: true, 1091 // set to false this to NOT center the text (horizontally) 1092 align_center: true, 1093 // set to false to allow the big text to wrap (useful for when you want text to fill a big vertical area) 1094 multiline: false, 1095 // minimum font size (changing this may cause some 'shrink' scenarios to overflow instead) 1096 minimum_font_size: 5, 1097 // set to a number to limit the maximum font size allowed 1098 maximum_font_size: null, 1099 // set desired line-height 1100 line_height: '100%' 1101 }; 1102 $.extend(settings, options); 1103 1104 // take measurements 1105 if (settings.width) { 1106 original_width = settings.width; 1107 $(this).width(original_width + 'px'); 1108 } else { 1109 original_width = $(this).width(); 1110 } 1111 if (settings.height) { 1112 original_height = settings.height; 1113 $(this).height(original_height + 'px'); 1114 } else { 1115 original_height = $(this).height(); 1116 } 1117 1118 if (!original_width || !original_height) { 1119 if (window.console !== null) { 1120 return console.info('Set static height/width on target DIV before using boxfit! Detected width: ' + original_width + ' height: ' + original_height); 1121 } 1122 } else { 1123 if (!settings.multiline) { 1124 $(this).css('white-space', 'nowrap'); 1125 } 1126 original_text = $(this).html(); 1127 if ($('<div>' + original_text + '</div>').find('span.boxfitted').length === 0) { 1128 span = $($('<span></span>').addClass('boxfitted').html(original_text)); 1129 $(this).html(span); 1130 } else { 1131 span = $($(this).find('span.boxfitted')[0]); 1132 } 1133 current_step = 0; 1134 inner_span = span; 1135 $(this).css('display', 'table'); 1136 inner_span.css('display', 'table-cell'); 1137 if (settings.align_middle) { 1138 inner_span.css('vertical-align', 'middle'); 1139 } 1140 if (settings.align_center) { 1141 $(this).css('text-align', 'center'); 1142 inner_span.css('text-align', 'center'); 1143 } 1144 // fixing issue where custom line-heights would break wrapped text 1145 inner_span.css('line-height', settings.line_height); 1146 1147 // keep growing the target so long as we haven't exceeded the width or height 1148 inner_span.css('font-size', settings.minimum_font_size); 1149 while ($(this).width() <= original_width && $(this).height() <= original_height) { 1150 if (current_step++ > settings.step_limit) { 1151 break; 1152 } 1153 next_font_size = parseInt(inner_span.css('font-size'), 10); 1154 if (settings.maximum_font_size && next_font_size > settings.maximum_font_size) { 1155 break; 1156 } 1157 inner_span.css('font-size', next_font_size + settings.step_size); 1158 } 1159 1160 // go back one step 1161 inner_span.css('font-size', parseInt(inner_span.css('font-size'), 10) - settings.step_size); 1162 return $(this); 1163 } 1164 }); 1165 }; 1166 $.fn.boxfit = function (options) { return boxfit(this, options); }; 1167 return boxfit; 1168}));
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.