1/* 2 * To change this license header, choose License Headers in Project Properties. 3 * To change this template file, choose Tools | Templates 4 * and open the template in the editor. 5 */ 6 7var note_email_id; 8var message_flag = true; 9jQuery(window).on('load',function() { 10 setTimeout(function(){ 11 if ( jQuery('body.blog').length > 0 ) { 12 var cat = window.location.href.split("cat=")[1]; 13 var search = window.location.href.split("search=")[1]; 14 if ( cat !== undefined && cat !== '' ) { 15 jQuery(document).find('.blog_cat_selection a[href="'+cat+'"]').click(); 16 } 17 if ( search !== undefined && search !== '' ) { 18 search = decodeURI(search); 19 jQuery(document).find('.search-box input').val(search); 20 jQuery(document).find('.search-box').submit(); 21 } 22 var newURL = location.href.split("?")[0]; 23 window.history.pushState('object', document.title, newURL); 24 } 25 var urlHash = window.location.href.split("#")[1]; 26 if (urlHash && jQuery('#' + urlHash).length > 0 ){ 27 jQuery('html,body').animate({ 28 scrollTop: jQuery('#' + urlHash).offset().top - jQuery(document).find('header').height() 29 }, 700); 30 var newURL = location.href.split("#")[0]; 31 window.history.pushState('object', document.title, newURL); 32 } 33 }, 500); 34 35 jQuery('.sunday_header_section .cotm_login_form input.login_send_otp').insertAfter('.sunday_header_section .cotm_login_form #login_phone'); 36 jQuery('.sunday_header_section .cotm_login_form input.login_send_otp, .sunday_header_section .cotm_login_form #login_phone').wrapAll('<div class="cover-box"></div>'); 37 jQuery('.cotm_account_info .cotm_payment_methods, .cotm_account_info .cotm_giving_schedules').wrapAll('<div class="payment-cover-box"></div>'); 38 39 /*jQuery('.single-resource .sub_nav_subpage_link').append('<span id="select">Select</span>'); 40 jQuery('#select').insertBefore('.single-resource .sub_nav_subpage_link ul');*/ 41 42 jQuery(document).find('.sm-group-banner').each(function(){ 43 var desktop_img = jQuery(this).css('background-image'); 44 var mobile_img = jQuery(this).attr('data-mobile'); 45 if ( mobile_img !== '' ) { 46 if (jQuery(window).width() <= 767) { 47 jQuery(this).css('background-image', "url(" + mobile_img + ")"); 48 } else { 49 jQuery(this).css('background-image', desktop_img); 50 } 51 } 52 }); 53 jQuery(window).resize(function () { 54 jQuery(document).find('.sm-group-banner').each(function(){ 55 var desktop_img = jQuery(this).css('background-image'); 56 var mobile_img = jQuery(this).attr('data-mobile'); 57 if ( mobile_img !== '' ) { 58 if (jQuery(window).width() <= 767) { 59 jQuery(this).css('background-image', "url(" + mobile_img + ")"); 60 } else { 61 jQuery(this).css('background-image', desktop_img); 62 } 63 } 64 }); 65 }); 66 67}); 68jQuery.fn.isInViewport = function() { 69 var elementTop = jQuery(this).offset().top; 70 var elementBottom = elementTop + jQuery(this).outerHeight(); 71 72 var viewportTop = jQuery(window).scrollTop(); 73 var viewportBottom = viewportTop + jQuery(window).height(); 74 75 return elementBottom > viewportTop && elementTop < viewportBottom; 76}; 77jQuery( document ).ready( function($) { 78 79 80 81 if (window.matchMedia("(min-width: 981px)").matches) { 82 setTimeout(function(){ 83 var navOffset = jQuery('.atss').offset().top-150; 84 jQuery(window).scroll(function(){ 85 var scrollPos = jQuery(window).scrollTop(); 86 if (scrollPos >= navOffset) { 87 jQuery('.atss').addClass('sticky'); 88 } else { 89 jQuery('.atss').removeClass('sticky'); 90 } 91 }); 92 }, 3000); 93 } 94 95 96 jQuery(".top-series-video").click(function () { 97 jQuery(".video-block").css("display","block"); 98 jQuery(".top-series-video").css("display","none"); 99 // $("#").show(); 100 }); 101 102 jQuery(".single_choice_checkbox input:checkbox").click(function(){ 103 jQuery(".single_choice_checkbox input:checkbox").not(this).attr('checked', false); 104 }); 105 106 jQuery('.single-resource .sub_nav_subpage_link #select').click(function(){ 107 jQuery(this).toggleClass('show'); 108 jQuery('.single-resource .sub_nav_subpage_link ul').slideToggle(); 109 110 }); 111 jQuery('.single-resource .sub_nav_subpage_link ul li a').click(function(e){ 112 console.log('atagclick'); 113 jQuery('#select').text(jQuery(this).text()); 114 jQuery('.single-resource .sub_nav_subpage_link ul').hide(); 115 jQuery(this).addClass('current'); 116 e.preventDefault(); 117 }); 118 119 if ( jQuery(document).find('body.page-template-sunday_info-template').length > 0 ) { 120 jQuery(document).find('#country').val('United States').trigger('change'); 121 jQuery(document).find('#state').val('OK').trigger('change'); 122 } 123 124 if (window.matchMedia("(max-width: 767px)").matches) { 125 jQuery('.sm-gp-jesus-section .title h3 br').remove(); 126 jQuery(".right.row_pro_grey").insertAfter(".banner_her-site"); 127 jQuery('.rec_giving').slick({ 128 infinite: true, 129 centerMode: true, 130 slidesToShow: 1, 131 slidesToScroll: 1,
132 arrows: false 133 }); 134 } 135 136 jQuery(document).on('click','.skip_to_msg',function(){ 137 var skip_time = jQuery(this).data('url'); 138 if ( skip_time !== '' ) { 139 jQuery(this).parent('.series-video-popup').find('iframe').attr('src',skip_time); 140 jQuery(this).remove(); 141 } 142 }); 143// const player = new Plyr('#player'); 144 if ( jQuery(document).find('.messages_wrapper').length > 0 ) { 145 var test = new LazyLoad({ 146 elements_selector: ".lazy" 147 }); 148 jQuery('[data-fancybox]').fancybox({ 149 beforeShow: function( instance, current ) { 150// var src = current.src; 151// var player_id = src.split("-")[1]; 152// const player = new Plyr('#player'+player_id); 153 } 154 }); 155 156 jQuery(window).on('scroll', function() { 157 if ( message_flag ) { 158 if (jQuery('.instagram_wrapper').isInViewport()) { 159 message_flag = false; 160 var page_number = jQuery(document).find('.messages_wrapper').attr('data-page'); 161 console.log(jQuery('body.page-template-message-template').length); 162 if ( page_number > 0 && jQuery('body.page-template-message-template').length > 0 ) { 163 jQuery.ajax({ 164 url: CHURCHPUBLIC.ajax_url, 165 method : 'post', 166 data : { 167 action : 'messages_video_append', 168 page_number : page_number 169 }, 170 beforeSend: function () { 171 message_flag = false; 172 jQuery(document).find('.messages_wrapper').after('<img class="loader" src="'+CHURCHPUBLIC.site_url+'/wp-content/themes/church/images/loader.gif" />'); 173 }, 174 success: function (data) { 175 if ( data ) { 176 jQuery(document).find('.loader').remove(); 177 jQuery(document).find('.messages_wrapper').append(data); 178 jQuery(document).find('.messages_wrapper').attr('data-page',(page_number-1)); 179 } 180 message_flag = true; 181 } 182 }); 183 } 184 } 185 } 186 }); 187 } 188 189 jQuery('select').on('change', function() { 190 jQuery(this).addClass('black-color'); 191 }); 192 jQuery(document).on('submit','#gform_2',function(){ 193 note_email_id = jQuery(this).find('#input_2_1').val(); 194 }) 195 jQuery(document).on('gform_confirmation_loaded', function(event, formId){ 196 if ( formId == '2' ) { 197 var obj = []; 198 jQuery(document).find('.latest_message_columns').each(function(k){ 199 var note_text = jQuery(this).find('textarea').val(); 200 var note_title = jQuery(this).find('h3').text(); 201 if ( note_text !== '' ) { 202 obj.push({ 203 title : note_title, 204 note : note_text, 205 }) 206 } 207 }); 208 jQuery.ajax({ 209 url: CHURCHPUBLIC.ajax_url, 210 method : 'post', 211 data : { 212 action : 'note_email_sending', 213 notes_content : obj, 214 email : note_email_id 215 }, 216 success: function (data) { 217 if ( data ) { 218 console.log(data); 219 } 220 } 221 }); 222 } 223 }); 224 jQuery(document).on('click','.notes_text',function(){ 225 jQuery(this).siblings('textarea').slideToggle(); 226 }); 227 //read more js 228 jQuery(".read-more-collapser .readmore").click(function(){ 229 jQuery(".read-more-collapser").addClass("open"); 230 }); 231 232// jQuery(document).on('click','.signup_btn',function(){ 233// jQuery(this).removeClass('signup_btn'); 234// jQuery(this).addClass('login_anchor'); 235// jQuery(this).html('Login'); 236// jQuery('.all_forms').hide(); 237// jQuery('.register_form_giving').show(); 238// }); 239// jQuery(document).on('click','.login_anchor',function(){ 240// jQuery(this).removeClass('login_anchor'); 241// jQuery(this).addClass('signup_btn'); 242// jQuery(this).html('Sign Up'); 243// jQuery('.all_forms').hide(); 244// jQuery('.login_form_giving').show(); 245// }); 246// jQuery(document).on('click','.forgot_anchor',function(){ 247// jQuery('.all_forms').hide(); 248// jQuery('.reset_pw_giving').show(); 249// }); 250// jQuery(document).on('click','.guest_anchor',function(){ 251// jQuery('.all_forms').hide(); 252// jQuery('.giving_form').show(); 253// }); 254 jQuery(document).on('click','.register_link',function(){ 255 jQuery('.login_form').hide(); 256 jQuery('.register_form').slideToggle(); 257 }); 258 jQuery(document).on('click','.left_link',function(){ 259 jQuery('.register_form').hide(); 260 jQuery('.login_form').slideToggle(); 261 }); 262 263 jQuery('a[href*="#"]:not([href="#"])').on('click',function(e){ 264 var attr = jQuery(this).attr('data-fancybox'); 265 if ( typeof attr === typeof undefined ) { 266 console.log("in2"); 267 var urlHash = jQuery(this).attr('href').split("#")[1]; 268 var urlHash0 = jQuery(this).attr('href').split("#")[0]; 269 var url = window.location.href; 270 if ( (urlHash0 == url || urlHash0 == '') && urlHash !== '' ) { 271 e.preventDefault(); 272 $('html,body').animate({ 273 scrollTop: $("#"+urlHash).offset().top - 0 274 }, 1500); 275 return false;
276 } 277 } 278 }); 279 280 $('.mainmenu li:has(ul)').addClass('parent'); 281 282 $('a.menulinks').click(function() { 283 $(this).next('ul').slideToggle(250); 284 $('body').toggleClass('mobile-open'); 285 $('.mainmenu li.parent ul').slideUp(250); 286 $('a.child-triggerm').removeClass('child-open'); 287 return false; 288 }); 289 290 $('.mainmenu li.parent > a').after('<a class="child-triggerm"><span></span></a>'); 291 292 $('.mainmenu a.child-triggerm').click(function() { 293 $(this).parent().siblings('li').find('a.child-triggerm').removeClass('child-open'); 294 $(this).parent().siblings('li').find('ul').slideUp(250); 295 $(this).next('ul').slideToggle(250); 296 $(this).toggleClass('child-open'); 297 return false; 298 }); 299 300 301 $('a.menulinks-1').click(function() { 302 $(this).next('ul.mainmenu-1').slideToggle(250); 303 $('body').toggleClass('mobile-open-1'); 304 $('.mainmenu-1 li.parent ul').slideUp(250); 305 return false; 306 }); 307 308 $('.select-sec ul.list-unstyled li').on('click', function() { 309 var a = $(this).text(); 310 $('.select-sec label').text(a); 311 jQuery(document).find('.banner-caption h1 span').html(a); 312 var loc_url = jQuery(this).data('link'); 313 if ( loc_url !== '' ) { 314 window.location.href = loc_url; 315 } 316 $(this).parent('ul').slideToggle(); 317 }); 318 jQuery(document).on('click','.select-sec label',function(){ 319 jQuery(document).find('.select-sec ul').slideToggle(); 320 }); 321 322 jQuery(".et_search_icon").click(function(){ 323 jQuery(".top-search").slideToggle(); 324 }); 325 326 if (jQuery(window).width() > 200) { 327 jQuery(".search-results-open-menu").appendTo(".header-blog .menu > ul"); 328 329 } 330 if (jQuery(window).width() > 200) { 331 jQuery(".header-blog").appendTo(".blog-header"); 332 333 } 334 335 var $grid = $('.grid').isotope({ 336 itemSelector: '.grid-item', 337 }); 338 339 // filter items on button click 340 var filters = {}; 341 342 $('.filter-button-group').on('click', 'li', function(event) { 343 $('.filter-button-group li').removeClass('active'); 344 $(this).addClass('active'); 345 var $button = $( event.currentTarget ); 346 var $buttonGroup = $button.parents('.filter-button-group'); 347 var filterGroup = $buttonGroup.attr('data-filter-group'); 348 filters[ filterGroup ] = $button.attr('data-filter'); 349 var filterValue = concatValues( filters ); 350 $grid.isotope({ filter: filterValue }); 351 }); 352 353 $('.filter-button-group ul li').on('click', function() { 354 var a = $(this).text(); 355 jQuery(this).parents('.filter-button-group').find('label').text(a); 356 jQuery(this).parents('.filter-button-group').find("ul").slideToggle(); 357 358 }); 359 $('.filter-button-group label').on('click', function() { 360 jQuery(this).parents('.filter-button-group').find("ul").slideToggle(); 361 362 }); 363 364 jQuery(document).on('click','.single .blog_cat_selection li a',function(e){ 365 e.preventDefault(); 366 window.location = CHURCHPUBLIC.blog_page_link+"?cat="+jQuery(this).attr('href'); 367 }); 368 jQuery(document).on('submit','.single .search-box',function(e){ 369 e.preventDefault(); 370 var search_val = jQuery('.search-box input[type="text"]').val(); 371 window.location = CHURCHPUBLIC.blog_page_link+"?search="+search_val; 372 }); 373 374 jQuery(document).on('click','.blog .blog_cat_selection li a',function(e){ 375 e.preventDefault(); 376 if(jQuery(document).find('.blog_cat_selection li a').hasClass('active')){ 377 jQuery(document).find('.blog_cat_selection li a').removeClass('active'); 378 } 379 jQuery(this).toggleClass('active'); 380 var cat_id = []; 381 var search_val = jQuery('.search-box input[type="text"]').val(); 382 jQuery(document).find('.blog_cat_selection .active').each(function(){ 383 cat_id.push(jQuery(this).attr('href')); 384 }); 385 if ( cat_id.length !== 0 || search_val !== '' ){ 386 jQuery(document).find('.blog_header_section').hide(); 387 } else { 388 jQuery(document).find('.blog_header_section').show(); 389 } 390 jQuery.ajax({ 391 url: CHURCHPUBLIC.ajax_url, 392 method : 'post', 393 data : { 394 action : 'blog_listing', 395 category : cat_id, 396 search : search_val, 397 }, 398 beforeSend: function() { 399 jQuery(document).find('.blog_home_content_section').css('opacity','0.1'); 400 }, 401 success: function (data) { 402 if ( data ) { 403 jQuery(document).find('.blog_home_content_section').css('opacity','1'); 404 jQuery(document).find('.blog_home_content_section .blog_list_wrapper_div').html(data); 405 } 406 } 407 }); 408 }); 409 // jQuery(document).on('submit','.blog .search-box',function(e){ 410 // e.preventDefault(); 411 // var cat_id = []; 412 // var search_val = jQuery('.search-box input[type="text"]').val(); 413 // jQuery(document).find('.blog_cat_selection .active').each(function(){ 414 // cat_id.push(jQuery(this).attr('href')); 415 // }); 416 // if ( cat_id.length !== 0 || search_val !== '' ){ 417 // jQuery(document).find('.blog_header_section').hide(); 418 // } else { 419 // jQuery(document).find('.blog_header_section').show(); 420 // } 421 // jQuery.ajax({ 422 // url: CHURCHPUBLIC.ajax_url, 423 // method : 'post', 424 // data : { 425 // action : 'blog_listing', 426 // category : cat_id, 427 // search : search_val, 428 // }, 429 // beforeSend: function() { 430 // jQuery(document).find('.blog_home_content_section').css('opacity','0.1'); 431 // }, 432 // success: function (data) { 433 // if ( data ) { 434 // jQuery(document).find('.blog_home_content_section').css('opacity','1'); 435 // jQuery(document).find('.blog_home_content_section .blog_list_wrapper_div').html(data); 436 // } 437 // } 438 // }); 439 // }); 440 441 $(".set > a").on("click", function() { 442 var $this = jQuery(this).parents('.set'); 443 444 if ($(this).hasClass("active")) { 445 $(this).removeClass("active"); 446 $(this) 447 .siblings(".content") 448 .slideUp(1000); 449 $(".set > a i") 450 .removeClass("fa-minus") 451 .addClass("fa-plus"); 452 } else { 453 $(".set > a i") 454 .removeClass("fa-minus") 455 .addClass("fa-plus"); 456 $(this) 457 .find("i") 458 .removeClass("fa-plus") 459 .addClass("fa-minus"); 460 $(".set > a").removeClass("active"); 461 $(this).addClass("active"); 462 $(".content").slideUp(700); 463 $(this) 464 .siblings(".content") 465 .slideDown(700); 466 setTimeout(function(){ 467 468 jQuery('html,body').animate({ 469 scrollTop: $this.offset().top 470 }, 200); 471 },700); 472 } 473 }); 474 475 var buttonFilters = {}; 476 var buttonFilter; 477 // quick search regex 478 var qsRegex; 479 480 // init Isotope 481 var $groups = $('.groups').isotope({ 482 itemSelector: '.color-shape', 483 filter: function() { 484 var $this = $(this); 485 var searchResult = qsRegex ? $this.text().match( qsRegex ) : true; 486 var buttonResult = buttonFilter ? $this.is( buttonFilter ) : true; 487 return searchResult && buttonResult; 488 }, 489 }); 490 jQuery(document).on('change','select[name="emphasis"]',function(){ 491 var selected_emphasis = jQuery(this).val(); 492 selected_emphasis = selected_emphasis.replace(".", ""); 493 jQuery(document).find(".emphasis_filters select").val('').change(); 494 jQuery(document).find(".emphasis_filters").hide(); 495 if ( selected_emphasis !== '' ) { 496 jQuery(document).find(".emphasis_filters."+selected_emphasis).show(); 497 } 498 }); 499 500 $('.filters').on( 'change', 'select', function() { 501 var $this = $(this); 502 // get group key 503 var $buttonGroup = $this.parents('.button-group'); 504 var filterGroup = $buttonGroup.attr('data-filter-group'); 505 // set filter for group 506 buttonFilters[ filterGroup ] = $this.val();
507 // combine filters 508 buttonFilter = concatValues( buttonFilters ); 509 // Isotope arrange 510 $groups.isotope(); 511// setTimeout(function(){ 512 $groups.isotope( 'layout', noResultsCheck($groups) ); 513// },1000); 514 }); 515 516 // use value of search field to filter 517 var $quicksearch = $('.quicksearch').keyup( debounce( function() { 518 qsRegex = new RegExp( $quicksearch.val(), 'gi' ); 519 $groups.isotope(); 520 $groups.isotope( 'layout', noResultsCheck($groups) ); 521 }) ); 522 523 // change is-checked class on buttons 524 $('.button-group').each( function( i, buttonGroup ) { 525 var $buttonGroup = $( buttonGroup ); 526 $buttonGroup.on( 'click', 'button', function() { 527 $buttonGroup.find('.is-checked').removeClass('is-checked'); 528 $( this ).addClass('is-checked'); 529 }); 530 }); 531 532 // flatten object by concatting values 533// function concatValues( obj ) { 534// var value = ''; 535// for ( var prop in obj ) { 536// value += obj[ prop ]; 537// } 538// return value; 539// } 540 541 // debounce so filtering doesn't happen every millisecond 542 function debounce( fn, threshold ) { 543 var timeout; 544 threshold = threshold || 100; 545 return function debounced() { 546 clearTimeout( timeout ); 547 var args = arguments; 548 var _this = this; 549 function delayed() { 550 fn.apply( _this, args ); 551 } 552 timeout = setTimeout( delayed, threshold ); 553 }; 554 } 555 556 557 jQuery(document).on('click','.group_title_name',function(e){ 558 e.preventDefault(); 559 jQuery(document).find('.panel-group').not(jQuery(this).siblings('.panel-group')).hide(); 560 jQuery(document).find('.color-shape').not(jQuery(this).parents('.color-shape')).removeClass('active'); 561 jQuery(document).find('.group_leader_form').hide(); 562 jQuery(this).siblings('.panel-group').toggle(); 563 jQuery(this).parents('.color-shape').toggleClass('active'); 564 $groups.isotope('layout'); 565 }); 566 jQuery(document).on('click','.contact_leader_btn',function(e){ 567 e.preventDefault(); 568 jQuery(this).parents('.panel-footer').find('.group_leader_form').toggle(); 569// setTimeout(function(){ 570 $groups.isotope('layout'); 571// },1000); 572 }); 573 jQuery(document).on('click','#no_item_found a',function(e){ 574 e.preventDefault(); 575 jQuery(this).parent('#no_item_found').hide(); 576 buttonFilters = {}; 577// $groups.isotope({ filter: '*' }); 578 jQuery(document).find('.quicksearch').val(''); 579 jQuery(document).find('.quicksearch').trigger('keyup'); 580 jQuery(document).find('.ui-group select').val('').change(); 581 $groups.isotope('layout'); 582 }); 583 jQuery(document).on('submit','.group_leader_form',function(e){ 584 e.preventDefault(); 585 var $this = jQuery(this); 586 var validation = validate_form($this); 587 if ( validation ) { 588 var group_id = jQuery(this).data('form_id'); 589 var spouse = jQuery(this).data('spouse'); 590 var fomdata = jQuery(this).serializeArray(); 591 jQuery.ajax({ 592 url: CHURCHPUBLIC.ajax_url, 593 method : 'post', 594 data : { 595 action : 'cotm_small_group_registration', 596 group_id : group_id, 597 spouse : spouse, 598 fomdata : fomdata 599 }, 600 beforeSend: function () { 601 // jQuery(document).find('body').addClass('is_loading'); 602 }, 603 success: function (data) { 604 if ( data == 'success' ) { 605 $this.parents('.panel-footer').find('.response_box').html('YOUR SUBMISSION HAS BEEN SENT!'); 606 $this.parents('.panel-footer').find('.response_box').show(); 607 $this.remove(); 608 setTimeout(function(){ 609 $groups.isotope('layout'); 610 },200); 611 } else { 612 alert(data); 613 } 614 } 615 }); 616 } 617 }); 618 619 /**16-10-2020**/ 620 jQuery(".pro_btn").click(function(){ 621 jQuery(".show_pro").toggleClass('active'); 622 jQuery(".pro_btn").toggleClass('uparrow'); 623 jQuery(".progress_sticky").toggleClass('sticky_none'); 624 }); 625 jQuery('.rec_giving .box_hover:first').addClass('home'); 626 jQuery(".box_hover").hover( 627 function () { 628 jQuery('.box_hover.home').removeClass("result_hover"); 629 jQuery(this).addClass("result_hover"); 630 }, 631 function () { 632 jQuery(this).removeClass("result_hover"); 633 } 634 ); 635 jQuery('.box_hover').mouseleave( function () { 636 jQuery(this).removeClass("result_hover"); 637 jQuery('.box_hover.home').addClass("result_hover"); 638 }); 639 if ( jQuery(document).find('.page-template-landing-template').length > 0 ) { 640 jQuery('.menulinks').on('click', function () { 641// jQuery(document).find('.mainmenu').slideDown();
642 jQuery(document).find('.show_pro.progress_con').slideUp(); 643 jQuery(document).find('.show_pro').css('display','none'); 644 }); 645 jQuery('.pro_btn').on('click', function () { 646 jQuery(document).find('.mainmenu').slideUp(); 647 jQuery(document).find('.show_pro.progress_con').slideDown(); 648 jQuery('body').removeClass('mobile-open'); 649 650 }); 651 } 652 jQuery(document).find('.right.row_pro_grey .show_pro').css('display','block'); 653// if( jQuery(document).find('herder_rw').hasClass('sticky')){ 654// console.log('in'); 655//// jQuery(document).find('.show_pro.progress_con').slideUp(); 656// jQuery(document).find('.right.row_pro_grey .show_pro').css('display','none'); 657// } 658 659 // $(".box_hover").hover( 660 // function(){ 661 // $(this).animate({ "width" : "70%", "height" : window.innerHeight + "px" }); 662 // }, 663 // function(){ 664 // $(this).animate({ "width" : "50%", "height" : "" }); 665 // } 666 // ); 667 668 jQuery(document).on('keyup focus change','.group_leader_form input,.group_leader_form select,.group_leader_form textarea',function(e){ 669 var $this = jQuery(this); 670 validate_single_field($this); 671 }); 672 equalheight('.watch_info_wrapper_div h2'); 673}); 674function isValidEmailAddress(emailAddress) { 675 var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); 676 return pattern.test(emailAddress); 677} 678function isValidPhoneNumber(PhoneNumber) { 679 var pattern = new RegExp(/\(?([0-9]{3})\)?([ .-]?)([0-9]{3})\2([0-9]{4})/); 680 return pattern.test(PhoneNumber); 681} 682function validate_single_field($this){ 683 if ( $this.val() == '' ) { 684 $this.addClass('haserror'); 685 } else { 686 $this.removeClass('haserror'); 687 } 688 if ( $this.val() !== '' ) { 689 if( $this.attr('type') == 'email') { 690 if ( isValidEmailAddress($this.val()) ) { 691 $this.removeClass('haserror'); 692 } else { 693 $this.addClass('haserror'); 694 } 695 var match_id = $this.data('match'); 696 var email_value = $this.val(); 697 var email2_value = $this.parents('.group_leader_form').find('input[data-match="'+match_id+'"]').val(); 698 if ( email_value == email2_value ) { 699 $this.removeClass('haserror'); 700 $this.parents('.group_leader_form').find('input[data-match="'+match_id+'"]').removeClass('haserror'); 701 } else { 702 $this.addClass('haserror'); 703 $this.parents('.group_leader_form').find('input[data-match="'+match_id+'"]').addClass('haserror'); 704 705 } 706 } 707 if( $this.attr('type') == 'tel') { 708 if ( isValidPhoneNumber($this.val()) ) { 709 $this.removeClass('haserror'); 710 } else { 711 $this.addClass('haserror'); 712 } 713 } 714 } 715 716 setTimeout(function(){ 717 jQuery('.groups').isotope('layout'); 718 },200); 719} 720function validate_form($this){ 721 722 $this.find('input').each(function(){ 723 if ( jQuery(this).val() == '' ) { 724 jQuery(this).addClass('haserror'); 725 } else { 726 jQuery(this).removeClass('haserror'); 727 } 728 }); 729 $this.find('select').each(function(){ 730 if ( jQuery(this).val() == '' ) { 731 jQuery(this).addClass('haserror'); 732 } else { 733 jQuery(this).removeClass('haserror'); 734 } 735 }); 736 $this.find('textarea').each(function(){ 737 if ( jQuery(this).val() == '' ) { 738 jQuery(this).addClass('haserror'); 739 } else { 740 jQuery(this).removeClass('haserror'); 741 } 742 }); 743 $this.find('input[type="email"]').each(function() { 744 if ( jQuery(this).val() !== '' ) { 745 if ( !isValidEmailAddress(jQuery(this).val()) ) { 746 jQuery(this).addClass('haserror'); 747 } else { 748 jQuery(this).removeClass('haserror'); 749 } 750 } 751 var match_id = jQuery(this).data('match'); 752 var email_value = jQuery(this).val(); 753 var email2_value = $this.find('input[data-match="'+match_id+'"]').val(); 754 if ( email_value == email2_value && email_value !== '') { 755 jQuery(this).removeClass('haserror'); 756 $this.find('input[data-match="'+match_id+'"]').removeClass('haserror'); 757 } else { 758 jQuery(this).addClass('haserror'); 759 $this.find('input[data-match="'+match_id+'"]').addClass('haserror'); 760 761 } 762 }); 763 $this.find('input[type="tel"]').each(function() { 764 if ( jQuery(this).val() !== '' ) { 765 if ( !isValidPhoneNumber(jQuery(this).val()) ) { 766 jQuery(this).addClass('haserror'); 767 } else { 768 jQuery(this).removeClass('haserror'); 769 } 770 } 771 }); 772 if ( jQuery($this).find('.haserror').length > 0 ) { 773 return false;
774 } else { 775 return true; 776 } 777 setTimeout(function(){ 778 jQuery('.groups').isotope('layout'); 779 },200); 780} 781function concatValues( obj ) { 782 var value = ''; 783 for ( var prop in obj ) { 784 value += obj[ prop ]; 785 } 786 return value; 787} 788 789 790 791 792equalheight = function(container){ 793 794var currentTallest = 0, 795 currentRowStart = 0, 796 rowDivs = new Array(), 797 $el, 798 topPosition = 0; 799 jQuery(container).each(function() { 800 801 $el = jQuery(this); 802 jQuery($el).height('auto') 803 topPostion = $el.position().top; 804 805 if (currentRowStart != topPostion) { 806 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 807 rowDivs[currentDiv].height(currentTallest); 808 } 809 rowDivs.length = 0; // empty the array 810 currentRowStart = topPostion; 811 currentTallest = $el.height(); 812 rowDivs.push($el); 813 } else { 814 rowDivs.push($el); 815 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 816 } 817 for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) { 818 rowDivs[currentDiv].height(currentTallest); 819 } 820 }); 821} 822 823jQuery(window).load(function() { 824 equalheight('.messages_wrapper .single_message_wrap a'); 825}); 826 827 828jQuery(window).resize(function(){ 829 equalheight('.messages_wrapper .single_message_wrap a'); 830}); 831 832 833function noResultsCheck($grid) { 834 if ( $grid.data('isotope').filteredItems.length == 0) { 835 jQuery('#no_item_found').show(); 836 } else { 837 jQuery('#no_item_found').hide(); 838 } 839} 840 jQuery('.back_to_top a').click(function(){ 841 jQuery("html, body").animate({ scrollTop: 0 }, 900); 842 return false; 843 }); 844 845jQuery('.image-carousel').each(function(){ 846 jQuery(this).slick({ 847 dots: false, 848 infinite: true, 849 speed: 300, 850 slidesToShow: 1, 851 variableWidth: true, 852 centerMode: true, 853 autoplay: true, 854 autoplaySpeed: 3000, 855 pauseOnHover: false, 856 prevArrow: '<div class="image-carousel__arrow image-carousel__prev"><i class="fa fa-chevron-left"></i></div>', 857 nextArrow: '<div class="image-carousel__arrow image-carousel__next"><i class="fa fa-chevron-right"></i></div>' 858 }); 859}); 860 861jQuery(window).on('scroll', function(){ 862 863 //** STICKY OR FIXED JS 864 if (jQuery(this).scrollTop() > 250){ 865 jQuery('.herder_rw').addClass("sticky"); 866 jQuery(document).find('.right.row_pro_grey .show_pro').css('display','none'); 867 } 868 else{ 869 jQuery('.herder_rw').removeClass("sticky"); 870 jQuery(document).find('.right.row_pro_grey .show_pro').css('display','block'); 871 } 872 873 if (window.matchMedia("(max-width: 767px)").matches) { 874 //** STICKY OR FIXED JS 875 jQuery(document).find('.show_pro.active').removeClass('active'); 876 jQuery(document).find('.progress_sticky.sticky_none').show(); 877 jQuery(".pro_btn").removeClass('uparrow'); 878 if (jQuery(this).scrollTop() > 250){ 879 jQuery('.right.row_pro_grey').addClass("sticky"); 880 } 881 else{ 882 jQuery('.right.row_pro_grey').removeClass("sticky"); 883 } 884 } 885 886 887 888 889 890 891}); // END SCROLL 892
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.