1"use strict"; 2 3function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 4 5(function ($) { 6 var _$$slick; 7 8 $(window).resize(function () { 9 // Close Menu 10 $(".page-header__menu").removeClass("page-header__menu--open"); 11 $(".icon-menu-container").find(".icon-menu").removeClass("cross"); // Resize front page sliders 12 13 $(".l-latest-event").slick("resize"); 14 $(".featured-pages").slick("resize"); 15 $(".promotions").slick("resize"); 16 17 if (!$(".jobs").hasClass("slick-initialized")) { 18 $(".jobs").slick(jobsSlickSettings); 19 } else { 20 $(".jobs").slick("resize"); 21 } 22 23 if (window.innerWidth < 1024) { 24 $(".event-dots").hide(); 25 } else { 26 $(".jobs__categories").removeClass("jobs-menu-open"); 27 $(".jobs__categories").css({ 28 width: "100%" 29 }); 30 } 31 32 scrollHandling(); 33 }); 34 var resizeId; 35 $(window).resize(function () { 36 if (window.innerWidth < 1650) { 37 $(".page-header__menu").addClass("u-no-transition"); 38 clearTimeout(resizeId); 39 resizeId = setTimeout(function () { 40 // Done Resizing 41 $(".page-header__menu").removeClass("u-no-transition"); 42 }, 500); 43 } 44 }); 45 $(window).on("scroll", function () { 46 scrollHandling(); 47 }); 48 $(document).ready(function () { 49 scrollHandling(); 50 }); 51 /** 52 * Menu icon Animation 53 * Based on: https://codepen.io/Zaku/pen/vcaFr 54 */ 55 56 $(".js-menu-toggle").click(function () { 57 $(".page-header__menu").toggleClass("page-header__menu--open"); 58 $(".icon-menu-container").find(".icon-menu").toggleClass("cross"); 59 }); 60 /** 61 * Scroll Arrow Handler 62 */ 63 64 var btn = $(".js-scrollToBottom"); 65 var btnContainer = $(".hero-home__scroll"); 66 btn.on("click", function (e) { 67 e.preventDefault(); // Remove white space on iPhone X for example. 68 69 $(".heading").css({ 70 "min-height": "auto" 71 }); 72 $("html,body").animate({ 73 scrollTop: $(".hero-home__title").offset().top - 70 74 }, 500); 75 }); 76 77 function scrollHandling() { 78 if (window.innerWidth < 1024) { 79 var st = $(window).scrollTop(); 80 81 if (st > 100) { 82 // Removes white space after 100vh 83 $(".heading").css({ 84 "min-height": "auto" 85 }); // Moves button out of view 86 87 btnContainer.css({ 88 transform: "translate(0,10rem)" 89 }).animate({ 90 transform: "translate(0,10rem)" 91 }, 200); 92 } 93 94 if (st < 100) { 95 // When reaching top, show button 96 $(".heading").css({ 97 "min-height": "100vh" 98 }); 99 btnContainer.css({ 100 transform: "translate(0,0)" 101 }).animate({ 102 transform: "translate(0,0)" 103 }, 200); 104 setTimeout(function () { 105 btnContainer.css({ 106 display: "block" 107 }), 250; 108 }); 109 } 110 111 st = 100; 112 } 113 } 114 /** 115 * Parallax Scrolling Effect. 116 * @@ https://codepen.io/RenanB/pen/GZeBNg 117 * @@ 118 */ 119 120 121 var index = 0; 122 $("#js-parallax").each(function () { 123 var img = $(this); 124 125 function parallaxImg() { 126 var speed = 4; 127 var winY = $(document).scrollTop(); 128 129 if (winY < img.height()) { 130 var imgPercent = speed * (winY / 100); 131 img.css({ 132 top: imgPercent + "%", 133 transform: "translate(-50%, " + imgPercent + "%)" 134 }); 135 } 136 } 137 138 $(document).on({ 139 scroll: function scroll() { 140 parallaxImg(); 141 }, 142 ready: function ready() { 143 parallaxImg(); 144 } 145 }); 146 }); 147 /** 148 * Replace Slick default arrows with SVG 149 */ 150 151 var arrowPrev = '<button class="slick-prev slick-arrow" aria-label="Previous" type="button" style="display: block;" aria-disabled="false"> <div class = "arrow-container" > <svg xmlns = "http://www.w3.org/2000/svg"version = "1.1"viewBox = "0 0 31.5 63" ><polyline points="31.5 0 31.5 12.19 12.19 31.5 31.5 50.81 31.5 63 0 31.5 31.5 0"/> </svg></div> </button>'; 152 var arrowNext = '<button class="slick-next slick-arrow" aria-label="Next" type="button" style="display: block;" aria-disabled="false"> <div class = "arrow-container" ><svg xmlns = "http://www.w3.org/2000/svg"version = "1.1"viewBox = "0 0 31.5 63" > <polyline points="31.5 0 31.5 12.19 12.19 31.5 31.5 50.81 31.5 63 0 31.5 31.5 0"/> </svg></div> </button>'; 153 /** 154 * 155 * Slick JS on Latest Events 156 * 157 */ 158 159 $(".l-latest-events").slick({ 160 infinite: false, 161 arrows: true, 162 slidesToShow: 1, 163 slidesToScroll: 1, 164 mobileFirst: true, 165 prevArrow: arrowPrev, 166 nextArrow: arrowNext, 167 responsive: [{ 168 breakpoint: 768, 169 settings: { 170 slidesToShow: 2 171 } 172 }, {
173 breakpoint: 1200, 174 settings: { 175 slidesToShow: 3 176 } 177 }] 178 }); 179 /** 180 * 181 * Slick JS on Features Pages 182 * 183 */ 184 185 $(".featured-pages").slick({ 186 infinite: false, 187 arrows: true, 188 slidesToShow: 1, 189 slidesToScroll: 1, 190 prevArrow: arrowPrev, 191 nextArrow: arrowNext, 192 mobileFirst: true, 193 responsive: [{ 194 breakpoint: 768, 195 settings: { 196 slidesToShow: 2 197 } 198 }, { 199 breakpoint: 1300, 200 settings: { 201 slidesToShow: 3 202 } 203 }, { 204 breakpoint: 1750, 205 settings: { 206 slidesToShow: 4 207 } 208 }] 209 }); 210 /** 211 * 212 * Slick JS on Promotions 213 * 214 */ 215 216 $(".promotions").slick({ 217 infinite: true, 218 fade: true, 219 slidesToScroll: 1, 220 slidesToShow: 1, 221 speed: 1000, 222 autoplay: true, 223 autoplaySpeed: 6000, 224 arrows: false, 225 dots: true, 226 pauseOnHover: false 227 }); 228 /** 229 * 230 * Slick JS on Specials 231 * 232 */ 233 234 $(".specials").slick((_$$slick = { 235 infinite: true, 236 arrows: true, 237 dots: true 238 }, _defineProperty(_$$slick, "infinite", true), _defineProperty(_$$slick, "fade", true), _defineProperty(_$$slick, "cssEase", "linear"), _defineProperty(_$$slick, "appendDots", $(".special")), _defineProperty(_$$slick, "slidesToShow", 1), _defineProperty(_$$slick, "slidesToScroll", 1), _defineProperty(_$$slick, "prevArrow", arrowPrev), _defineProperty(_$$slick, "nextArrow", arrowNext), _$$slick)); 239 /** 240 * 241 * Slick JS on Jobs Archive 242 * 243 */ 244 245 var jobsArrowPrev = '<button class="slick-prev slick-arrow" aria-label="Previous" type="button" style="display: block;" aria-disabled="false"> <div class = "arrow-container" ><i class="arrow-icon"></i></div> </button>'; 246 var jobsArrowNext = '<button class="slick-next slick-arrow" aria-label="Next" type="button" style="display: block;" aria-disabled="false"> <div class = "arrow-container" ><i class="arrow-icon"></i></div> </button>'; 247 var jobsSlickSettings = { 248 arrows: true, 249 infinite: false, 250 mobileFirst: true, 251 prevArrow: jobsArrowPrev, 252 nextArrow: jobsArrowNext, 253 vertical: true, 254 verticalSwiping: true, 255 rows: 2, 256 slidesToShow: 1, 257 slidesToScroll: 1, 258 slidesPerRow: 1, 259 responsive: [{ 260 breakpoint: 450, 261 settings: { 262 slidesPerRow: 2 263 } 264 }, { 265 breakpoint: 600, 266 settings: { 267 slidesPerRow: 1 268 } 269 }, { 270 breakpoint: 630, 271 settings: { 272 slidesPerRow: 2 273 } 274 }, { 275 breakpoint: 900, 276 settings: { 277 slidesPerRow: 3 278 } 279 }, { 280 breakpoint: 1050, 281 settings: "unslick" 282 }] 283 }; 284 $(".jobs").slick(jobsSlickSettings); // Calculate the heighest slide and set a top/bottom margin for other children. 285 // As variableHeight is not supported yet: https://github.com/kenwheeler/slick/issues/1803 286 287 function verticalSlidesSpacing() { 288 if ($(".jobs").length) { 289 var maxHeight = -1; 290 $(".slick-slide").each(function () { 291 if ($(this).height() > maxHeight) { 292 maxHeight = $(this).height(); 293 } 294 }); 295 $(".slick-slide").each(function () { 296 if ($(this).height() < maxHeight) { 297 $(this).css("margin", Math.ceil((maxHeight - $(this).height()) / 2) + "px 0"); 298 } 299 }); 300 } 301 } 302 303 $(".slick-arrow").click(function () { 304 verticalSlidesSpacing(); 305 }); 306 $(window).resize(function () { 307 if (window.innerWidth < 1024) { 308 verticalSlidesSpacing(); 309 } 310 }); // Handle specials dots inside slides. 311 312 if ($(".specials").length) { 313 var activeClass = "slick-active", 314 ariaAttribute = "aria-hidden"; 315 $(".specials").on("init", function () { 316 $(".slick-dots li:first-of-type").addClass(activeClass).attr(ariaAttribute, false); 317 }).on("afterChange", function (event, slick, currentSlide) { 318 var $dots = $(".slick-dots"); 319 $("li", $dots).removeClass(activeClass).attr(ariaAttribute, true); 320 $dots.each(function () { 321 $("li", $(this)).eq(currentSlide).addClass(activeClass).attr(ariaAttribute, false); 322 }); 323 }); 324 } 325 326 var isLoading = false; 327 /** 328 * Jobs Archive Handler 329 */
330 //Check if Jobs section is anywhere on page 331 332 if ($(".jobs").length) { 333 $(document).ready(function () { 334 var categoryLink = $(".jobs__categories a"); //Handle Click on Category Link 335 336 categoryLink.click(function () { 337 // //Disable Clicking when Jobs are loaded. 338 categoryLink.css({ 339 pointerEvents: "none" 340 }); // Change text 341 342 $(".jobs__title").text("Loading..."); // Remove active class from previous category 343 344 categoryLink.removeClass("job--active"); // Add active to clicked category 345 346 $(this).addClass("job--active"); // Request data 347 348 requestJobsFromCategory($(this).data(), $(this).text()); // Fix Slick 349 350 if ($(".jobs").hasClass("slick-initialized")) { 351 setTimeout(function () { 352 // Destroy slick slider 353 $(".jobs").slick("unslick"); 354 }, 500); 355 } 356 }); 357 /** 358 * Jobs Category Mobile Menu Handler 359 */ 360 361 var jobsCategories = $(".jobs__categories"); 362 var jobsBtn = $(".jobs__button"); 363 364 if (jobsBtn.length) { 365 var hideMenu = function hideMenu() { 366 jobsCategories.removeClass("slide-in"); // Remove class after transition finishes 367 368 setTimeout(function () { 369 jobsCategories.removeClass("jobs-menu-open"); 370 }, 500); 371 setTimeout(function () { 372 verticalSlidesSpacing(); 373 }, 1500); 374 }; 375 376 jobsBtn.click(function () { 377 // Check if has class leftover 378 if (jobsCategories.hasClass("jobs-menu-open") || jobsCategories.hasClass("slide-in")) { 379 // Remove Classes 380 jobsCategories.removeClass("jobs-menu-open").removeClass("slide-in"); 381 } // Toggle 382 383 384 jobsCategories.toggleClass("jobs-menu-open").toggleClass("slide-in"); 385 }); 386 $(".jobs__categories a").click(function () { 387 hideMenu(); 388 }); 389 $(".jobs__close").click(function () { 390 hideMenu(); 391 }); 392 } 393 }); 394 } 395 396 function requestJobsFromCategory(data, title) { 397 var category = data.category; 398 $.ajax({ 399 method: "POST", 400 url: ajax_object.ajax_url, 401 type: "JSON", 402 data: { 403 type: "jobs", 404 category: category, 405 action: "load_more_posts" 406 }, 407 success: function success(res) { 408 if (res.posts === null) { 409 $(".jobs__content .job").remove(); 410 $(".jobs__title").text("No jobs in this category."); 411 $(".jobs__categories a").css({ 412 pointerEvents: "visible" 413 }); 414 return false; 415 } else { 416 $(".jobs__content .job").remove(); 417 $(".jobs__title").text(title); 418 $(".jobs__categories a").css({ 419 pointerEvents: "visible" 420 }); 421 renderArchivePosts(res); 422 } 423 /* Enables category links after all the data is processed 424 * This is not an ideal solution, something like Promise should be used, but IE... 425 */ 426 427 428 setTimeout(function () { 429 $(".job__categories a").css({ 430 pointerEvents: "visible" 431 }); 432 }, res.posts.length * 500); 433 } 434 }); 435 } 436 /* 437 Renders each Promotion / Event / Job into DOM 438 */ 439 440 441 function renderArchivePosts(data) { 442 // Get last promotion container 443 var archiveBtn = $("#archive-loader"); // Get type of archive 444 445 var type = data.type; // Check if data is correct 446 447 if (data === null || !data || data.post === null) { 448 return; 449 } 450 451 switch (type) { 452 case "events": 453 var timeline = $(".events-timeline"); 454 $(".single-event").last().removeClass("last-event"); 455 data.posts.forEach(function (post, index) { 456 // setTimeout(function () { 457 var startTime = function startTime() { 458 //Check if end time is present 459 if (post.end_time) { 460 return "<span class=\"single-event__time\">".concat(post.start_time, " — ").concat(post.end_time, "</span>"); 461 } else { 462 return "<span class=\"single-event__time\">
462".concat(post.start_time, "</span>"); 463 } 464 }; // Construct Event that will be displayed. 465 466 467 var singleEventContainer = "\n <div class=\"single-event\">\n <a href=\"".concat(post.url, "\" title=\"").concat(post.title, "\">\n <div class=\"single-event__view\">\n <span>view</span>\n <span>event</span>\n </div>\n <div class=\"single-event__content\">\n <div class=\"single-event__header\">\n <h3 class=\"single-event__title\">").concat(post.title, ": </h3> ").concat(startTime(), "</div>\n <img src=\"").concat(post.imageUrl, "\" alt=\"").concat(post.title, " image\">\n </div> <div class=\"single-event__date\">\n <span class=\"single-event__date-day\">").concat(post.date.day, "</span>\n <span class=\"single-event__date-month\">").concat(post.date.month, "</span>\n <span class=\"single-event__date-year\">
467").concat(post.date.year, "</span> </div> </a> </div>"); 468 timeline.prepend(singleEventContainer); 469 470 if (window.innerWidth > 1024) { 471 $(".events-dots").show(); 472 } // Remove Class from last Event if it exists so timeline continues 473 474 475 $(".single-event").last().addClass("last-event"); 476 }); // Remove After element form last child 477 478 break; 479 480 case "promotions": 481 data.posts.forEach(function (post) { 482 var singlePromotionContainer = "<div class=\"panel-container\" data-title=\"".concat(post.title, "\">\n\t\t\t\t\t<div class=\"panel-container__image\">\n\t\t\t\t\t<img src=\"").concat(post.imageUrl, "\" alt=\"").concat(post.title, " Image\" class=\"u-image-width\"> </div>\n\t\t\t\t\t<div class=\"panel-container__content\">\n <div class=\"panel-container__wrapper\">\n <h2>").concat(post.title, "</h2>").concat(post.content, "</div> </div></div>"); // Add new promotion HTML object after last promotion on page 483 484 archiveBtn.before(singlePromotionContainer); // css for removing display inline style added by fadeIn 485 }); 486 return true; 487 488 case "jobs": 489 // Index for setTimeout 490 var jobs = $(".jobs"); 491 data.posts.forEach(function (post) { 492 var isHiring = function isHiring() { 493 if (post.hiring) { 494 return "<div class=\"job__hiring\">Now Hiring</div>"; 495 } else { 496 return "<div class=\"job__filled\">Currently Filled</div>"; 497 } 498 }; 499 500 var singleJobContainer = " <li class=\"job\"> <a href=\"".concat(post.url, "\" title=\"").concat(post.title, " Details\"> <h4 class=\"job__title\">").concat(post.title, "\n </h4> ").concat(isHiring(), "\n\t\t\t<div class=\"job__details\">See Details</div> </a> </li>"); // Iterate over each post returned, and inject it's data to HTML DOM object. 501
502 jobs.append(singleJobContainer); 503 }); // Init slick after data is Injected 504 505 jobs.slick(jobsSlickSettings); 506 setTimeout(function () { 507 jobs.slick("resize"); 508 }, 1000); 509 return; 510 } 511 } 512 513 function requestArchivePost(type) { 514 $("#archive-loader").text("Loading..."); // Check if is already loading 515 516 isLoading ? false : isLoading = true; 517 var $offset = $("#archive-loader").data("offset"); 518 $("#archive-loader").addClass("more-archive--disabled"); 519 $.ajax({ 520 method: "POST", 521 url: ajax_object.ajax_url, 522 type: "JSON", 523 data: { 524 offset: $offset, 525 type: type, 526 action: "load_more_posts" 527 }, 528 success: function success(res) { 529 if (res.posts === null) { 530 // Remove scroll more button 531 $("#archive-loader").text("NO MORE " + type.toUpperCase()); 532 533 if ($(".events-dots").length) { 534 $(".events-dots").hide(); 535 $(".last-event").addClass("last-event-no-more").removeClass("last-event"); 536 } 537 538 return false; 539 } else { 540 // Update offset(posts per page) 541 $("#archive-loader").data("offset", parseInt(res.offset)); // Render data into DOM 542 543 renderArchivePosts(res); 544 /* 545 * Enables category links after all the data is processed 546 * This is not an ideal solution, something like Promise should be used but IE exists :( 547 */ 548 549 setTimeout(function () { 550 $("#archive-loader").text("scroll to view more events").removeClass("more-archive--disabled"); 551 isLoading = false; 552 }, 500); 553 } 554 } 555 }); 556 } // Check if archive post loader button exists, so posts are loaded on promotions page 557 558 559 if ($("#archive-loader").length && $(document).ready) { 560 // Add last-event class to Last Event. 561 if ($(".events-timeline").length) { 562 $(".single-event").last().addClass("last-event"); 563 } // Load Archive on click. 564 565 566 $("#archive-loader").click(function () { 567 requestArchivePost($("#archive-loader").data("type")); 568 }); // Load Archive on Scroll to Bottom. 569 570 $(document).on("scroll", function () { 571 var footerHeight = $(".site-footer").height(); 572 573 if ($(window).scrollTop() - footerHeight == $(document).height() - $(window).height() - footerHeight) { 574 return requestArchivePost($("#archive-loader").data("type")); 575 } 576 }); 577 } 578 /** 579 * Google Maps 580 */ 581 582 /* 583 * new_map 584 * 585 * This function will render a Google Map onto the selected jQuery element 586 */ 587 588 589 function new_map($el) { 590 // var 591 var $markers = $el.find(".marker"); // vars 592 593 var args = { 594 zoom: 16, 595 center: new google.maps.LatLng(0, 0), 596 mapTypeId: google.maps.MapTypeId.ROADMAP 597 }; // create map 598 599 var map = new google.maps.Map($el[0], args); // add a markers reference 600 601 map.markers = []; // add markers 602 603 $markers.each(function () { 604 add_marker($(this), map); 605 }); // center map 606 607 center_map(map); // return 608 609 return map; 610 } 611 612 function add_marker($marker, map) { 613 // var 614 var latlng = new google.maps.LatLng($marker.attr("data-lat"), $marker.attr("data-lng")); // create marker 615 616 var marker = new google.maps.Marker({ 617 position: latlng, 618 map: map 619 }); // add to array 620 621 map.markers.push(marker); // if marker contains HTML, add it to an infoWindow 622 623 if ($marker.html()) { 624 // create info window 625 var infowindow = new google.maps.InfoWindow({ 626 content: $marker.html() 627 }); // show info window when marker is clicked 628 629 google.maps.event.addListener(marker, "click", function () { 630 infowindow.open(map, marker); 631 }); 632 } 633 } 634 /* 635 * center_map 636 * 637 * This function will center the map, showing all markers attached to this map 638 */ 639 640 641 function center_map(map) { 642 // vars 643 var bounds = new google.maps.LatLngBounds(); // loop through all markers and create bounds 644 645 $.each(map.markers, function (i, marker) { 646 var latlng = new google.maps.LatLng(marker.position.lat(), marker.position.lng()); 647 bounds.extend(latlng); 648 }); // only 1 marker? 649 650 if (map.markers.length == 1) { 651 // set center of map 652 map.setCenter(bounds.getCenter()); 653 map.setZoom(16); 654 } else {
655 // fit to bounds 656 map.fitBounds(bounds); 657 } 658 } 659 /* 660 * document ready 661 * 662 * This function will render each map when the document is ready (page has loaded) 663 */ 664 665 666 var map = null; 667 $(document).ready(function () { 668 if ($(".map").length) { 669 var _map = $(".map"); 670 671 _map = new_map(_map); 672 } 673 }); 674 /** 675 * Opens all external links in new tab. 676 */ 677 678 $("a").each(function () { 679 var a = new RegExp("/" + window.location.host + "/"); 680 681 if (!a.test(this.href)) { 682 $(this).click(function (event) { 683 event.preventDef(); 684 event.stopPropagation(); 685 window.open(this.href, "_blank"); 686 }); 687 } 688 }); 689 /** 690 * Analytics Event Tracking 691 * 692 */ 693 694 $(document).on("nfFormReady", function () { 695 var submitButton = $("#nf-form-8-cont").find(".btn-dark"); 696 submitButton.on("click", function () { 697 fbq("track", "Lead"); 698 gtag("event", "click", { 699 event_category: "Form", 700 event_action: "Submission" 701 }); 702 }); 703 }); 704 /** 705 * Move checkout fields 706 */ 707 708 $(document).ready(function () { 709 if ($("body").hasClass("woocommerce-checkout")) { 710 var form = $("form.checkout"); 711 var formCol2 = form.find(".col-2"); 712 var orderReviewHeading = form.find("#order_review_heading"); 713 var orderReview = form.find("#order_review"); 714 var payment = form.find("#payment"); 715 orderReviewHeading.prependTo(formCol2); 716 orderReview.prependTo(formCol2); 717 payment.appendTo(form); 718 } 719 }); 720})(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.