1////////////////////// 2// Global Functions // 3////////////////////// 4 5// Loader for Buttons 6$(window).bind('pageshow', function() { 7 if ($('.btn-loader').length) { 8 $('.btn-loader').on('click', function(e){ 9 if (e.ctrlKey || e.metaKey) { 10 // Don't Show Loader 11 } else { 12 // Show Loader 13 let loadingText = $(this).data('btn-loader-loading-text'); 14 $(this).addClass('loading').text(loadingText); 15 } 16 }); 17 // Reset Button Loader 18 function btnLoaderReset(btnLoader) { 19 let loaderText = btnLoader.data('btn-loader-text'); 20 btnLoader.removeClass('loading').text(loaderText); 21 } 22 $('.btn-loader').each(function(){ 23 btnLoaderReset($(this)); 24 }); 25 } 26}); 27 28//////////////////// 29// Document Ready // 30//////////////////// 31$(document).ready(function(){ 32 // Header Height - Measures the headers height, used by CSS for height calculations under the header 33 headerElement = $('.i-header')[0]; 34 headerBarElement = $('.i-header-bar')[0]; 35 qsElement = $('.hero-quick-search-wrap')[0]; 36 homeContent1Element = $('.home-content-section-1')[0]; 37 const resizeObserver = new ResizeObserver(() => { 38 let headerHeight = $('.i-header').outerHeight(); 39 document.documentElement.style.setProperty('--headerHeight', headerHeight + 'px'); 40 var headerBarHeight = $('.i-header-bar').outerHeight(); 41 document.documentElement.style.setProperty('--headerBarHeight', headerBarHeight + 'px'); 42 if ( $('.hero-quick-search-wrap').length ) { 43 var qsHeight = $('.hero-quick-search-wrap').outerHeight(); 44 document.documentElement.style.setProperty('--qsHeight', qsHeight + 'px'); 45 } 46 if ( $('.home-content-section-1').length ) { 47 var homeContent1Height = $('.home-content-section-1').outerHeight(); 48 document.documentElement.style.setProperty('--homeContent1Height', homeContent1Height + 'px'); 49 } 50 }); 51 resizeObserver.observe(headerElement); 52 resizeObserver.observe(headerBarElement); 53 if ( $('.hero-quick-search-wrap').length ) { 54 resizeObserver.observe(qsElement); 55 } 56 if ( $('.home-content-section-1').length ) { 57 resizeObserver.observe(homeContent1Element); 58 } 59 60 // Hide Header on on scroll down 61 var didScroll; 62 var lastScrollTop = 0; 63 var scrollHeader = $('.i-header').outerHeight(); 64 65 $(window).scroll(function(event){ 66 didScroll = true; 67 }); 68 69 setInterval(function() { 70 if (didScroll) { 71 hasScrolled(); 72 didScroll = false; 73 } 74 }, 250); 75 76 function hasScrolled() { 77 var myScrollTop = $(this).scrollTop(); 78 if (myScrollTop > lastScrollTop && myScrollTop > scrollHeader){ 79 // Scroll Down 80 $('.i-header').addClass('scroll-down').removeClass('scroll-up'); 81 } else { 82 // Scroll Up 83 if(myScrollTop + $(window).height() < $(document).height()) { 84 $('.i-header').removeClass('scroll-down').addClass('scroll-up'); 85 } 86 } 87 lastScrollTop = myScrollTop; 88 } 89 90 $(window).on('resize',function(){ 91 if ($(window).outerWidth() >= 1025) { 92 $('#headerPropertySelectWrap').appendTo('#headerPropertySelectContainer'); 93 } else { 94 $('#headerPropertySelectWrap').appendTo('#propertySelectNavItem'); 95 } 96 }).resize(); 97 98 99 // Main Navigation Toggle Mobile 100 $('.i-header-navigation-toggle').on('click', function () { 101 $('.i-header-navigation-container').toggleClass('open toggled'); 102 $('html').toggleClass('i-header-navigation-container-open'); 103 }); 104 $('.i-header-navigation-close').on('click', function () { 105 $('.i-header-navigation-container').toggleClass('open toggled'); 106 $('html').removeClass('i-header-navigation-container-open'); 107 }); 108 /* Task ID: 280476 */ 109 $(window).on('resize',function(){ 110 if ($(window).outerWidth() >= 1025) { 111 const megaMenu = $('.i-header-navigation-container'); 112 const navItem = $('.i-header-navigation-inline-item'); 113 navItem.mouseenter(function() { 114 if (!megaMenu.hasClass('toggled')) { 115 megaMenu.addClass('open'); 116 $('html').addClass('i-header-navigation-container-open'); 117 } 118 }); 119 navItem.mouseleave(function() { 120 if (!megaMenu.hasClass('toggled') && $('.i-header-navigation-container:hover').length == 0) { 121 megaMenu.removeClass('open'); 122 $('html').removeClass('i-header-navigation-container-open'); 123 } 124 }); 125 megaMenu.mouseleave(function() { 126 console.log('mouseleave') 127 if (!megaMenu.hasClass('toggled') && $('.i-header-navigation-toggle:hover').length == 0) { 128 megaMenu.removeClass('open'); 129 $('html').removeClass('i-header-navigation-container-open'); 130 } 131 }); 132 } 133 }).resize(); 134 $('.i-header-navigation-sub-toggle').on('click', function () { 135 let subNav = $(this).next('.i-header-navigation-sub'); 136 let subHeight = subNav[0].scrollHeight; 137 let subParent = $(this).closest('.i-header-navigation-sub'); 138 if (!$(this).hasClass('toggled')) { 139 // Open Sub Nav 140 $(this).addClass('toggled'); 141 $(this).next('.i-header-navigation-sub').addClass('open'); 142 subNav.css({ 'max-height': subHeight + 'px' }); 143 if (subParent.length == 1) { 144 subParent.css({ 'max-height': 'none' }); 145 setTimeout(function () { 146 let subParentHeight = subParent[0].scrollHeight; 147 subParent.css({ 'max-height': subParentHeight + 'px' }); 148 }, 450); // 50 milliseconds after the 400ms (0.4s) CSS transition animation 149 } 150 } else { 151 // Close Sub Nav 152 $(this).removeClass('toggled'); 153 $(this).next('.i-header-navigation-sub').removeClass('open'); 154 subNav.css({ 'max-height': '0' }); 155 if (subParent.length == 1) { 156 let subParentHeight = subParent[0].scrollHeight; 157 subParent.css({ 'max-height': subParentHeight + 'px' }); 158 } 159 } 160 }); 161 162 // Add class to last child of Nav 163 $(window).on('resize',function(){ 164 if ($(window).outerWidth() >= 1025) { 165 $('.i-header-navigation-item:last-child:has(.i-header-navigation-sub)').addClass('i-header-navigation-item-end'); 166 } 167 }).resize(); 168 169 // BE - Header Action Toggles 170 $('.i-header-actions-toggle').on('click', function () { 171 $(this).tooltip('hide'); 172 if (!$(this).hasClass('active')) { 173 $('.i-header-actions-toggle').not(this).removeClass('active'); 174 $('.i-header-actions-toggled').not(this).removeClass('open'); 175 $(this).addClass('active'); 176 $(this).parent().find('.i-header-actions-toggled').addClass('open'); 177 } else { 178 $(this).removeClass('active'); 179 $(this).parent().find('.i-header-actions-toggled').removeClass('open'); 180 } 181 // Recently Viewed - Overflow management for desktop and mobile 182 if ($(this).hasClass('i-header-recently-viewed-be-toggle')) { 183 if ($('html').hasClass('recently-viewed-toggled')) { 184 $('html').removeClass('recently-viewed-toggled'); 185 } else { 186 $('html').addClass('recently-viewed-toggled'); 187 } 188 $('html').removeClass('srp-map-open'); 189 $('html').removeClass('favorites-toggled'); 190 } 191 if ($(this).hasClass('i-header-recently-viewed-mls-toggle')) { 192 if ($('html').hasClass('recently-viewed-toggled')) { 193 $('html').removeClass('recently-viewed-toggled'); 194 } else { 195 $('html').addClass('recently-viewed-toggled'); 196 } 197 $('html').removeClass('srp-map-open'); 198 $('html').removeClass('favorites-toggled'); 199 } 200 // Favorites - Overflow management for desktop and mobile 201 if ($(this).hasClass('i-header-favorites-be-toggle')) { 202 if ($('html').hasClass('favorites-toggled')) { 203 $('html').removeClass('favorites-toggled'); 204 } else { 205 $('html').addClass('favorites-toggled'); 206 } 207 $('html').removeClass('srp-map-open'); 208 $('html').removeClass('recently-viewed-toggled'); 209 } 210 if ($(this).hasClass('i-header-favorites-mls-toggle')) { 211 if ($('html').hasClass('favorites-toggled')) { 212 $('html').removeClass('favorites-toggled'); 213 } else { 214 $('html').addClass('favorites-toggled'); 215 } 216 $('html').removeClass('srp-map-open'); 217 $('html').removeClass('recently-viewed-toggled'); 218 } 219 }); 220 221 // BE - Header Action Close 222 $('.i-header-action-dropdown-close').on('click', function () { 223 $('html').removeClass('favorites-toggled'); 224 $('html').removeClass('srp-map-open'); 225 $('html').removeClass('recently-viewed-toggled'); 226 $(this).closest('.i-header-actions-toggled').prev('.i-header-actions-toggle').removeClass('active'); 227 $(this).closest('.i-header-actions-toggled').toggleClass('open'); 228 }); 229 230 // BE - Favorites Dropdown Container 231 let favoritesDropdownContainer = $('.i-header-favorites .i-header-action-dropdown-main-container'); 232 233 // BE - Favorites Header Toggle - Click and load favorites if they aren't already shown 234 $('.i-header-favorites-be-toggle').on('click',function(){ 235 if ( !favoritesDropdownContainer.find('.be-header-dropdown-list').length ) { 236 $.ajax({ 237 type: 'GET', 238 url: siteFolder + 'ajax/favorites' + siteURLEnding, 239 cache: false, 240 success: function(data) { 241 favoritesDropdownContainer.html(data); 242 } 243 }); 244 } 245 }); 246 $('.i-header-favorites-mls-toggle').on('click',function(){ 247 if ( !favoritesDropdownContainer.find('.mls-header-dropdown-list').length ) { 248 $.ajax({ 249 type: 'GET', 250 url: siteFolder + 'ajax/mls/favorites' + siteURLEnding, 251 cache: false, 252 success: function(data) { 253 favoritesDropdownContainer.html(data); 254 } 255 }); 256 } 257 }); 258 259 // BE - Update Favorites List Function - saveFavorites 260 function updateFavoritesList(thisElement, propDataHolder, action) { 261 // Get Property Data 262 let property = thisElement.closest(propDataHolder); 263 let propertyID = property.data('unitcode'); 264 let propWidget = $('[data-unitcode='+ propertyID +']'); 265 let propTitle = propWidget.data('unitshortname') || property.find('.i-header-dropdown-list-item-title').text(); 266 let propWidgetFavorite = propWidget.find('.be-property-widget-img-area-favorite'); 267 if (action == 'add') { 268 let favAction = 1; 269 } 270 if (action == 'remove') { 271 let favAction = 0; 272 // Remove from Favorites 273 propWidgetFavorite.removeClass('favorite'); 274 // Toast Notification 275 $.fn.beToast({ 276 icon: 'heart-regular', 277 iconColor: 'body-font-color', 278 title: 'Removed from Favorites', 279 body: propTitle 280 }); 281 } 282 // Save Favorites 283 $.ajax({ 284 type: 'GET', 285 url: siteFolder + 'ajax/saveFavorites' + siteURLEnding + '?propertyID='+propertyID+'&favAdded='+favAction, 286 success: function(data) { 287 //console.log(data); 288 // If Zero Favories are saved then hide the badge 289 if (data == -1) { 290 openModal('favorites-requires-login'); 291 } else if (data == 0) { 292 $('.i-header-favorites-toggle .badge').addClass('d-none'); 293 } else { 294 if (action == 'add') { 295 // Add to Favorites 296 propWidgetFavorite.addClass('favorite'); 297 // Toast Notification 298 $.fn.beToast({ 299 icon: 'heart-solid', 300 iconColor: 'true-red', 301 title: 'Added to Favorites', 302 body: propTitle 303 }); 304 } 305 // Update the number count on the fly in the header if more than 0 306 $('.i-header-favorites-toggle .badge').html(data).removeClass('d-none'); 307 } 308 // Now load the data into the top right view via ajax 309 $.ajax({ 310 type: 'GET', 311 url: siteFolder + 'ajax/favorites' + siteURLEnding, 312 cache: false, 313 success: function(data) { 314 // Load Returned Data 315 favoritesDropdownContainer.html(data); 316 } 317 }); 318 } 319 }); 320 } 321 322 // MLS - Update Favorites List Function - saveFavorites 323 function updateMLSFavoritesList(thisElement, propDataHolder, action) { 324 // Get Property Data 325 let property = thisElement.closest(propDataHolder); 326 let propertyID = property.data('unitcode'); 327 let propWidget = $('[data-unitcode='+ propertyID +']'); 328 let propTitle = propWidget.data('unitshortname') || property.find('.i-header-dropdown-list-item-title').text(); 329 let propWidgetFavorite = propWidget.find('.mls-property-widget-img-area-favorite'); 330 if (action == 'add') { 331 let favAction = 1; 332 } 333 if (action == 'remove') { 334 let favAction = 0; 335 // Remove from Favorites 336 propWidgetFavorite.removeClass('favorite'); 337 // Toast Notification 338 $.fn.beToast({ 339 icon: 'heart-regular', 340 iconColor: 'body-font-color', 341 title: 'Removed from Favorites', 342 body: propTitle 343 }); 344 } 345 // Save Favorites 346 $.ajax({ 347 type: 'GET', 348 url: siteFolder + 'ajax/mls/saveFavorites' + siteURLEnding + '?mlsPropertyID='+propertyID+'&favAdded='+favAction, 349 success: function(data) { 350 // If Zero Favories are saved then hide the badge 351 if (data == -1) { 352 openModal('mls-favorites-requires-login'); 353 } else if (data == 0) { 354 $('.i-header-favorites-toggle .badge').addClass('d-none'); 355 // Update the Compare Favorites Number on the Compare Favorites Page 356 if ($('#favTotal').length) { 357 $('#favTotal').html(0); 358 $('.compare-wrap .container') 359 .html('<h1 class="site-color-1">Compare Your Favorites</h1>') 360 .append(alertMessage('alert-warning','You do not have any Favorites now!')); 361 } 362 $('.mls-header-bar-sub-send-and-print button').prop('disabled',true); 363 } else { 364 if (action == 'add') { 365 // Add to Favorites 366 propWidgetFavorite.addClass('favorite'); 367 // Toast Notification 368 $.fn.beToast({ 369 icon: 'heart-solid', 370 iconColor: 'true-red', 371 title: 'Added to Favorites', 372 body: propTitle 373 }); 374 } 375 // Update the number count on the fly in the header if more than 0 376 $('.i-header-favorites-toggle .badge').html(data).removeClass('d-none'); 377 // Update the Compare Favorites Number on the Compare Favorites Page 378 if ($('#favTotal').length) { 379 $('#favTotal').html(data); 380 } 381 } 382 // Now load the data into the top right view via ajax 383 $.ajax({ 384 type: 'GET', 385 url: siteFolder + 'ajax/mls/favorites' + siteURLEnding, 386 cache: false, 387 success: function(data) { 388 // Load Returned Data 389 favoritesDropdownContainer.html(data); 390 } 391 }); 392 } 393 }); 394 } 395 396 // BE - Property Widget - Favorites Heart Click - Shows a Toast and adds it to Favorites list 397 $(document).on('click', '.be-property-widget-img-area-favorite', function () { 398 if (!$(this).hasClass('favorite')) { 399 // Add to Favorites List 400 updateFavoritesList($(this), '.be-property-widget', 'add'); 401 } else { 402 // Remove from Favorites List 403 updateFavoritesList($(this), '.be-property-widget', 'remove'); 404 } 405 }); 406 $(document).on('click', '.mls-property-widget-img-area-favorite', function () { 407 if (!$(this).hasClass('favorite')) { 408 // Add to Favorites List 409 updateMLSFavoritesList($(this), '.mls-property-widget', 'add'); 410 } else { 411 // Remove from Favorites List 412 updateMLSFavoritesList($(this), '.mls-property-widget', 'remove'); 413 } 414 }); 415 416 // BE - Remove From Favorites List 417 $(document).on('click', '.be-header-dropdown-list-remove-from-favs', function(){ 418 // Remove from Favorites List 419 updateFavoritesList($(this), '.be-header-dropdown-list-item', 'remove'); 420 }); 421 $(document).on('click', '.mls-header-dropdown-list-remove-from-favs', function(){ 422 // Remove from Favorites List 423 updateMLSFavoritesList($(this), '.mls-header-dropdown-list-item', 'remove'); 424 }); 425 426 // BE - Recently Viewed List Dropdown 427 $(document).on('click','.i-header-recently-viewed-toggle',function(){ 428 if ( !$('.i-header-recently-viewed .i-header-action-dropdown-main-container').find('.i-header-dropdown-list').length ) { 429 // Load the recently viewed data 430 $.ajax({ 431 type: 'GET', 432 url: siteFolder + 'ajax/recentlyViewed' + siteURLEnding, 433 cache: false, 434 success: function(data) { 435 $('.i-header-recently-viewed .i-header-action-dropdown-main-container').html(data); 436 } 437 }); 438 } 439 }); 440 $(document).on('click','.i-header-recently-viewed-mls-toggle',function(){ 441 if ( !$('.i-header-recently-viewed .i-header-action-dropdown-main-container').find('.i-header-dropdown-list').length ) { 442 // Load the recently viewed data 443 $.ajax({ 444 type: 'GET', 445 url: siteFolder + 'ajax/mls/recentlyViewed' + siteURLEnding, 446 cache: false, 447 success: function(data)
447{ 448 $('.i-header-recently-viewed .i-header-action-dropdown-main-container').html(data); 449 } 450 }); 451 } 452 }); 453 454 // Reset Button Loader 455 function btnLoaderReset(btnLoader) { 456 let loaderText = btnLoader.data('btn-loader-text'); 457 btnLoader.removeClass('loading').text(loaderText); 458 } 459 460 // Selectpicker 461 if ($('.selectpicker').length) { 462 $('.selectpicker').selectpicker(); 463 464 $('.selectpicker').on('change', function () { 465 $(this).next('.error').hide(); 466 }); 467 } 468 469 // SRP - Property Select - Jump to PDP 470 $('.header-property-select, .footer-property-select').change(function () { 471 var tabName = $(this).find('option:selected').text(); 472 var redirectWindow = window.open( this.options[ this.selectedIndex ].value, tabName); 473 redirectWindow.location; 474 }); 475 476 // Lazy Load 477 if ($('.lazy').length) { 478 $('.lazy').lazy({ 479 effect: 'fadeIn', 480 effectTime: 1000, 481 threshold: 0, 482 afterLoad: function(element) { 483 let lazyElement = element.get(0); 484 // Add a Class to set the placeholder background to transparent 485 $(lazyElement).addClass('loaded'); 486 } 487 }); 488 } 489 490 // Swiper 491 if ($('.swiper-container').length) { 492 // ADA Compliance for Swiper Carousels 493 setTimeout(function(){ 494 if ($('.swiper-pagination').length) { 495 if (!$('.swiper-pagination-bullet .hidden').length) { 496 $('.swiper-pagination-bullet').append('<div class="hidden">Slide Dot</div>'); 497 } 498 } 499 if ($('.swiper-button-prev').length) { 500 if (!$('.swiper-button-prev .hidden').length) { 501 $('.swiper-button-prev').append('<div class="hidden">Prev</div>'); 502 } 503 } 504 if ($('.swiper-button-next').length) { 505 if (!$('.swiper-button-next .hidden').length) { 506 $('.swiper-button-next').append('<div class="hidden">Next</div>'); 507 } 508 } 509 }, 500); 510 } 511 512 // Fancybox 513 if ($('[data-fancybox]').length) { 514 if ( $('.swiper-container').length ) { 515 $('.swiper-slide:not(.swiper-slide-duplicate) [data-fancybox]').fancybox({ 516 infobar: true, 517 arrows: true, 518 protect: true, 519 backFocus: true, 520 thumbs: { 521 autoStart: true, 522 }, 523 mobile: { 524 thumbs: { 525 autoStart: false 526 } 527 }, 528 idleTime: false, 529 toolbar: true, 530 buttons: [ 531 'zoom', 532 'thumbs', 533 'slideShow', 534 'close' 535 ] 536 }); 537 } else { 538 $('[data-fancybox]').fancybox({ 539 infobar: true, 540 arrows: true, 541 protect: true, 542 thumbs: { 543 autoStart: true, 544 }, 545 mobile: { 546 thumbs: { 547 autoStart: false 548 } 549 }, 550 idleTime: false, 551 toolbar: true, 552 buttons: [ 553 'zoom', 554 'thumbs', 555 'slideShow', 556 'close' 557 ] 558 }); 559 } 560 } 561 562 // Tooltips 563 if ($('[data-toggle="tooltip"]').length) { 564 $('[data-toggle="tooltip"]').tooltip(); 565 } 566 567 // Slide Up Alert 568 if ($('[data-toggle="slideUp"]').length) { 569 // Timeout to add class active 570 setTimeout(function(){ 571 $('[data-toggle="slideUp"]').addClass('active'); 572 }, 750); 573 574 $(window).on('resize', function(){ 575 // Identify the Alert 576 let slideUp = $('[data-toggle="slideUp"]'); 577 // Find the Alert Height 578 let slideUpHeight = slideUp.outerHeight(); 579 //console.log(slideUpHeight); 580 // If there are sibling alerts, take the height and push it above the one before it 581 $(slideUp).next().css('bottom', slideUpHeight); 582 // Button to remove class active - If there are sibling alerts, reset the Alert positioning 583 $('[data-dismiss="slideUp"]').on('click', function(){ 584 $(this).parent(slideUp).removeClass('active'); 585 $(slideUp).next().css('bottom', 'auto'); 586 }) 587 }).resize(); 588 } 589 590 // Return to Top 591 if ($('#returnToTop').length) { 592 $('#returnToTop').on('click', function(){ 593 $('html, body').animate({scrollTop : 0},300); 594 return false; 595 }); 596 } 597 598 // DataTables - All Properties Page 599 if ($('#aZPropertiesTable').length) { 600 $('#aZPropertiesTable').DataTable({ 601 paging: false, 602 "oLanguage": { 603 "sSearch": "Search By Name:", 604 "searching": true, 605 } 606 }); 607 } 608 609 // Form Reset/Clear button 610 if ($('[type=reset]').length) { 611 $('[type=reset]').on('click', function(){ 612 $('input.required').removeClass('error'); 613 $('label.error').remove(); 614 grecaptcha.reset(); 615 }); 616 } 617 618 // Recaptcha - Time to wait to check if it's valid 619 setInterval(function() { 620 verifyGoogleRecaptcha(); 621 }, 3000); 622 623 // Recaptcha - Verify Google Recaptcha Function 624 function verifyGoogleRecaptcha() { 625 if ($('#g-recaptcha-response').length) { 626 let isVerified = grecaptcha.getResponse(); 627 if(!isVerified.length == 0){ 628 $('.g-recaptcha-error').html(''); 629 } 630 } 631 } 632 633 // Validation - Contact page 634 if ($('form#contactform').length) { 635 $('form#contactform').validate({ 636 invalidHandler: function(event, validator) { 637 let errors = validator.numberOfInvalids(); 638 if (errors) { 639 btnLoaderReset($('form#contactform .btn-loader')); 640 } 641 }, 642 submitHandler: function(form){ 643 $.ajax({ 644 type: "POST", 645 url: siteFolder + 'ajax/contactUs' + siteURLEnding, 646 data: $('form#contactform').serialize(), 647 dataType: "text", 648 success: function (response) { 649 response = $.trim(response); 650 if(response === "success") { 651 $('form#contactform').hide(); 652 $('#contactformMSG').html(`<div class="alert alert-success mb-3">Thanks! Your email has been sent!</div>`); 653 trackGoogleSubmit(); 654 } else if(response === "captcha fail") { 655 btnLoaderReset($('form#contactform .btn-loader')); 656 $("form#contactform div.g-recaptcha-error").html(`<div class="alert alert-danger mb-3">You must complete the reCAPTCHA</div>`); 657 } else{ 658 btnLoaderReset($('form#contactform .btn-loader')); 659 $("form#contactform div.g-recaptcha-error").html(`<div class="alert alert-danger mb-3">There was an error processing your request</div>`); 660 } 661 } 662 }); 663 return false;
664 } 665 }); 666 } 667 668 // Validation - Footer form 669 if ($('form#footerform').length) { 670 $('form#footerform').validate({ 671 invalidHandler: function(event, validator) { 672 let errors = validator.numberOfInvalids(); 673 if (errors) { 674 btnLoaderReset($('form#footerform .btn-loader')); 675 } 676 }, 677 submitHandler: function(form){ 678 let arrName = $("#fn-name").val().split(' '); 679 if(arrName.length == 2){ 680 $("#firstName").val(arrName[0]); 681 $("#lastName").val(arrName[1]); 682 } 683 if(arrName.length == 1){ 684 $("#firstName").val($("#fn-name").val()); 685 } 686 $.ajax({ 687 type: "POST", 688 url: siteFolder + 'ajax/footerSignup' + siteURLEnding, 689 data: $('form#footerform').serialize(), 690 dataType: "text", 691 success: function (response) { 692 response = $.trim(response); 693 if(response === "success") { 694 $('form#footerform').hide(); 695 $('#footerformMSG').html(`<div class="alert alert-success mb-3">Thanks! Your email has been sent!</div>`); 696 } else if(response === "captcha fail") { 697 btnLoaderReset($('form#footerform .btn-loader')); 698 $("form#footerform div.g-recaptcha-error").html(`<div class="alert alert-danger mb-3">You must complete the reCAPTCHA</div>`); 699 } else { 700 btnLoaderReset($('form#footerform .btn-loader')); 701 $("form#footerform div.g-recaptcha-error").html(`<div class="alert alert-danger mb-3">There was an error processing your request</div>`); 702 } 703 } 704 }); 705 return false; 706 } 707 }); 708 } 709 710 // Fix for SEO Lighthouse Audit & ADA 711 setTimeout(function () { 712 // Datepicker 713 $('.ui-datepicker-prev').attr('title', 'Prev Calendar').attr('href', '#'); 714 $('.ui-datepicker-next').attr('title', 'Next Calendar').attr('href', '#'); 715 $(document).on('click','.ui-datepicker-prev, .ui-datepicker-next', function(e) { 716 e.stopPropagation(); 717 return false; 718 }); 719 // Selectpicker 720 $('.dropdown-toggle').attr('role', ''); 721 }, 500); 722 723});
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.