1jQuery( function ( $ ) { 2 3 if ( $('div.overlay-container').length ) { 4 5 // Find all iframes inside the overlays 6 var $doviframes = $( "#sidebar-overlay .overlay iframe" ); 7 8 setTimeout( function() { 9 10 $doviframes.each( function() { 11 12 var iframeHeight = this.height; 13 14 if ( iframeHeight == '' ) { 15 16 iframeHeight = $( this ).height(); 17 } 18 19 iframeWidth = this.width; 20 21 if ( iframeWidth == '' ) { 22 23 iframeWidth = $( this ).width(); 24 } 25 26 iframeHeight = parseInt( iframeHeight ); 27 iframeWidth = parseInt( iframeWidth ); 28 29 var ratio = iframeHeight / iframeWidth; 30 31 $( this ).attr( "data-ratio", ratio ) 32 // Remove the hardcoded width & height attributes 33 .removeAttr( "width" ) 34 .removeAttr( "height" ); 35 36 // Get the parent container's width 37 var width = $( this ).parent().width(); 38 39 $( this ).width( width ).height( width * ratio ); 40 }); 41 42 }, 200); 43 44 // Resize the iframes when the window is resized 45 $( window ).resize( function () { 46 $doviframes.each( function() { 47 // Get the parent container's width 48 var width = $( this ).parent().width(); 49 $( this ).width( width ) 50 .height( width * $( this ).data( "ratio" ) ); 51 }); 52 }); 53 54 // Divi Cascade Fix 55 if ( $('#et-builder-module-design-cached-inline-styles').length && !$('#cloned-et-builder-module-design-cached-inline-styles').length ) { 56 57 // Divi Cached Inline Styles 58 var divicachedcss = $( '#et-builder-module-design-cached-inline-styles' ); 59 var divicachedcsscontent = divicachedcss.html(); 60 61 // Remove #page-container from Divi Cached Inline Styles tag and cloning it to prevent issues 62 divicachedcsscontent = divicachedcsscontent.replace(/\#page-container/g, ' '); 63 64 $( divicachedcss ).after( '<style id="cloned-et-builder-module-design-cached-inline-styles">' + divicachedcsscontent + '</style>' ); 65 } 66 67 $(document).keyup(function(e) { 68 69 if (e.keyCode == 27) { 70 71 closeActiveOverlay(); 72 } 73 }); 74 75 $(window).load(function() { 76 77 if ( window.location.hash ) { 78 79 var hash = window.location.hash.substring( 1 );
80 var idx_overlay = hash.indexOf('overlay'); 81 82 if ( idx_overlay !== -1 ) { 83 84 var idx_overlayArr = hash.split('-'); 85 86 if ( idx_overlayArr.length > 1 ) { 87 88 var overlay_id = idx_overlayArr[1]; 89 90 showOverlay( overlay_id ); 91 } 92 } 93 } 94 }); 95 96 var overlay_container = $( 'div.overlay-container' ); 97 var container = $( 'div#page-container' ); 98 99 // Remove any duplicated overlay 100 $( overlay_container ).each(function () { 101 $('[id="' + this.id + '"]:gt(0)').remove(); 102 }); 103 104 $('body [id^="overlay_"]').on('click touch tap', function (e) { 105 106 var overlayArr = $(this).attr('id').split('_') 107 , overlay_id = overlayArr[3] 108 , cookieName = 'divioverlay' + overlay_id; 109 110 doEraseCookie( cookieName ); 111 112 showOverlay( overlay_id ); 113 114 e.preventDefault(); 115 }); 116 117 $('body [rel^="unique_overlay_"]').on('click touch tap', function (e) { 118 119 var overlayArr = $(this).attr('rel').split('_') 120 , overlay_id = overlayArr[4] 121 , cookieName = 'divioverlay' + overlay_id; 122 123 doEraseCookie( cookieName ); 124 125 showOverlay( overlay_id ); 126 127 e.preventDefault(); 128 }); 129 130 $('body [class*="divioverlay-"], body [class*="overlay-"]').on('click touch tap', function () { 131 132 var overlayArr = $(this).attr('class').split(' '); 133 134 $( overlayArr ).each(function( index,value ) { 135
136 idx_overlay = value.indexOf('overlay'); 137 138 if ( idx_overlay !== -1 ) { 139 140 var idx_overlayArr = value.split('-'); 141 142 if ( idx_overlayArr.length > 1 ) { 143 144 var overlay_id = idx_overlayArr[1] 145 , cookieName = 'divioverlay' + overlay_id; 146 147 doEraseCookie( cookieName ); 148 149 showOverlay( overlay_id ); 150 } 151 } 152 }); 153 }); 154 155 if (typeof overlays_with_css_trigger !== 'undefined') { 156 157 if ( $( overlays_with_css_trigger ).length > 0 ) { 158 159 $.each( overlays_with_css_trigger, function( overlay_id, selector ) { 160 161 $( selector ).on('click touch tap', function () { 162 163 var cookieName = 'divioverlay' + overlay_id; 164 165 doEraseCookie( cookieName ); 166 167 showOverlay( overlay_id ); 168 }); 169 }); 170 } 171 } 172 173 if (typeof overlays_with_automatic_trigger !== 'undefined') { 174 175 if ( $( overlays_with_automatic_trigger ).length > 0 ) { 176 177 $.each( overlays_with_automatic_trigger, function( overlay_id, at_settings ) { 178 179 var at_settings_parsed = jQuery.parseJSON( at_settings ); 180 var at_type_value = at_settings_parsed.at_type; 181 var at_onceperload = at_settings_parsed.at_onceperload; 182 183 if ( at_onceperload == 1 ) { 184 185 showOverlayOnce( overlay_id ); 186 } 187 188 if ( at_type_value == 'overlay-timed' ) { 189 190 var time_delayed = at_settings_parsed.at_value * 1000; 191 192 setTimeout( function() { 193 194 showOverlay( overlay_id ); 195 196 }, time_delayed); 197 } 198 199 200 if ( at_type_value == 'overlay-scroll' ) { 201 202 var overlayScroll = at_settings_parsed.at_value, refScroll; 203 204 if ( overlayScroll.indexOf('%') || overlayScroll.indexOf('px') ) { 205 206 if ( overlayScroll.indexOf('%') ) { 207 208 overlayScroll = overlayScroll.replace(/%/g, ''); 209 refScroll = '%'; 210 } 211 212 if ( overlayScroll.indexOf('px') ) { 213 214 overlayScroll = overlayScroll.replace(/px/g, ''); 215 refScroll = 'px'; 216 } 217 218 overlayScroll = overlayScroll.split(':'); 219 var overlayScrollFrom = overlayScroll[0]; 220 var overlayScrollTo = overlayScroll[1]; 221 222 $(window).scroll(function(e) { 223 224 var s = getScrollTop(), 225 d = $(document).height(), 226 c = $(window).height(); 227 228 if ( refScroll == '%' ) { 229 230 wScroll = (s / (d-c)) * 100; 231 232 } else if ( refScroll == 'px' ) { 233 234 wScroll = s; 235 236 } else { 237 238 return; 239 } 240 241 if ( overlayScrollFrom > 0 && overlayScrollTo > 0 ) { 242 243 if ( overlayScrollFrom <= wScroll && overlayScrollTo >= wScroll ) { 244 245 if ( !isActiveOverlay( overlay_id ) ) { 246 247 showOverlay( overlay_id ); 248 } 249 } 250 else if ( isActiveOverlay( overlay_id ) ) { 251 252 closeActiveOverlay( overlay_id ); 253 } 254 } 255 256 if ( overlayScrollFrom > 0 && overlayScrollTo == '' ) { 257 258 if ( overlayScrollFrom <= wScroll ) { 259 260 if ( !isActiveOverlay( overlay_id ) ) { 261 262 showOverlay( overlay_id ); 263 } 264 } 265 else if ( isActiveOverlay( overlay_id ) ) { 266 267 closeActiveOverlay( overlay_id ); 268 } 269 } 270 271 if ( overlayScrollFrom == '' && overlayScrollTo > 0 ) { 272 273 if ( overlayScrollTo >= wScroll ) { 274 275 if ( !isActiveOverlay( overlay_id ) ) { 276 277 showOverlay( overlay_id ); 278 } 279 } 280 else if ( isActiveOverlay( overlay_id ) ) { 281 282 closeActiveOverlay( overlay_id ); 283 } 284 } 285 }); 286 } 287 } 288 289 290 if ( at_type_value == 'overlay-exit' ) { 291 292 $.exitIntent('enable', { 'sensitivity': 100 }); 293 294 $(document).bind('exitintent', 295 function() { 296
297 if ( !isActiveOverlay( overlay_id ) ) { 298 299 showOverlay( overlay_id ); 300 } 301 }); 302 } 303 }); 304 } 305 } 306 307 308 $('.nav a, .mobile_nav a').each(function( index,value ) { 309 310 href = $( value ).attr('href'); 311 312 if ( href !== undefined ) { 313 314 idx_overlay = href.indexOf('overlay'); 315 316 if ( idx_overlay !== -1 ) { 317 318 var idx_overlayArr = href.split('-'); 319 320 if ( idx_overlayArr.length > 1 ) { 321 322 var overlay_id = idx_overlayArr[1]; 323 324 $(this).attr('data-overlayid', overlay_id); 325 326 $(this).on('click touch tap', function () { 327 328 overlay_id = $(this).data('overlayid'); 329 330 showOverlay( overlay_id ); 331 }); 332 } 333 } 334 } 335 }); 336 337 transEndEventNames = { 338 'WebkitTransition': 'webkitTransitionEnd', 339 'MozTransition': 'transitionend', 340 'OTransition': 'oTransitionEnd', 341 'msTransition': 'MSTransitionEnd', 342 'transition': 'transitionend' 343 }, 344 transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ], 345 support = { transitions : Modernizr.csstransitions }; 346 347 function shuffle(array) { 348 var currentIndex = array.length 349 , temporaryValue 350 , randomIndex 351 ; 352 353 // While there remain elements to shuffle... 354 while (0 !== currentIndex) { 355 // Pick a remaining element... 356 randomIndex = Math.floor(Math.random() * currentIndex); 357 currentIndex -= 1; 358 // And swap it with the current element. 359 temporaryValue = array[currentIndex]; 360 array[currentIndex] = array[randomIndex]; 361 array[randomIndex] = temporaryValue; 362 } 363 return array; 364 } 365 366 function toggleOverlay( overlay_id ) { 367 368 var overlay_selector = '#overlay-' + overlay_id; 369 var overlay_cache_selector = '#overlay-' + overlay_id; 370 var overlay_container = '#divi-overlay-container-' + overlay_id; 371 var overlay = $('body').find( overlay_cache_selector ); 372 var oid = overlay.attr('id'); 373 var prevent_mainpage_scroll = overlay.data('preventscroll'); 374 var displayonceperload = overlay.data('displayonceperload'); 375 var overlay_active_selector = 'div.overlay-container div.overlay-body'; 376 var preventOpen = overlay.attr('data-preventopen'); 377 378 var cookieName = 'divioverlay' + overlay_id 379 , cookieDays = overlay.data('cookie'); 380 381 if ( doReadCookie( cookieName ) ) { 382 383 return; 384 } 385 386 if ( $( overlay_cache_selector ).hasClass("overlay-cornershape") ) { 387 388 var s = Snap( document.querySelector( overlay_cache_selector ).querySelector( 'svg' ) ); 389 var original_s = Snap( document.querySelector( overlay_selector ).querySelector( 'svg' ) ); 390 391 var path = s.select( 'path' ); 392 var original_path = original_s.select( 'path' ); 393 394 var pathConfig = { 395 from : original_path.attr( 'd' ), 396 to : document.querySelector( overlay_cache_selector ).getAttribute( 'data-path-to' ) 397 }; 398 } 399 400 if ( $( overlay_cache_selector ).hasClass("overlay-boxes") ) { 401 402 paths = [].slice.call( document.querySelector( overlay_cache_selector ).querySelectorAll( 'svg > path' ) ), 403 pathsTotal = paths.length; 404 } 405 406 if ( $( overlay_cache_selector ).hasClass("overlay-genie") ) { 407 408 var s1 = Snap( document.querySelector( overlay_cache_selector ).querySelector( 'svg' ) ), 409 path1 = s1.select( 'path' ), 410 steps = document.querySelector( overlay_cache_selector ).getAttribute( 'data-steps' ).split(';'), 411 stepsTotal = steps.length; 412 } 413 414 if ( $( overlay_cache_selector ).hasClass('overlay-boxes') ) { 415 416 var cnt = 0; 417 418 shuffle( paths ); 419 } 420 421 if ( $( overlay ).hasClass('open') ) { 422 423 if ( cookieDays > 0 ) { 424 425 doCreateCookie( cookieName, 'true', cookieDays ); 426 } 427 428 $( overlay ).removeClass('open'); 429 $( overlay ).addClass('close'); 430 431 if ( $( overlay_cache_selector ).hasClass('overlay-hugeinc') 432 || $( overlay_cache_selector ).hasClass('overlay-corner') 433 || $( overlay_cache_selector ).hasClass('overlay-scale') ) { 434 435 $( overlay_cache_selector ).css('opacity',0); 436 } 437 438 if ( $( overlay_cache_selector ).hasClass('overlay-contentpush') ) { 439 440 $( container ).removeClass('overlay-contentpush-open'); 441 442 setTimeout( function() { 443 444 $( container ).removeClass( 'container2' ); 445 $("html,body").removeAttr('style'); 446 447 }, 1000); 448 } 449 450 if ( $( overlay_cache_selector).hasClass('overlay-contentscale') ) { 451 452 $( container ).removeClass('overlay-contentscale-open'); 453 454 setTimeout( function() { 455 456 $( container ).removeClass( 'container3' ); 457 458 }, 1000); 459 } 460 461 if ( $( overlay_cache_selector ).hasClass('overlay-cornershape') ) { 462 463 var onEndTransitionFn = function( ev ) { 464 465 $( overlay ).removeClass( 'close' ); 466 }; 467 path.animate( { 'path' : pathConfig.from }, 400, mina.linear, onEndTransitionFn ); 468 } 469 else if ( $( overlay_cache_selector ).hasClass('overlay-boxes') ) { 470 471 paths.forEach( function( p, i ) { 472 setTimeout( function() { 473 ++cnt; 474 p.style.display = 'none'; 475 if( cnt === pathsTotal ) { 476 477 $( overlay ).removeClass( 'close' ); 478 } 479 }, i * 30 ); 480 });
481 } 482 else if ( $( overlay_cache_selector ).hasClass('overlay-genie') ) { 483 484 var pos = stepsTotal-1; 485 var onEndTransitionFn = function( ev ) { 486 487 $( overlay ).removeClass( 'close' ); 488 }, 489 nextStep = function( pos ) { 490 pos--; 491 if( pos < 0 ) return; 492 path1.animate( { 'path' : steps[pos] }, 60, mina.linear, function() { 493 if( pos === 0 ) { 494 onEndTransitionFn(); 495 } 496 nextStep( pos ); 497 } ); 498 }; 499 500 nextStep( pos ); 501 } 502 else { 503 504 overlay = document.querySelector( overlay_cache_selector ); 505 506 var onEndTransitionFn = function( ev ) { 507 if( support.transitions ) { 508 if( ev.propertyName !== 'visibility' ) return; 509 this.removeEventListener( transEndEventName, onEndTransitionFn ); 510 } 511 512 $( overlay ).removeClass( 'close' ); 513 }; 514 515 if ( support.transitions ) { 516 517 overlay.addEventListener( transEndEventName, onEndTransitionFn ); 518 } 519 else { 520 521 onEndTransitionFn(); 522 } 523 } 524 525 if ( prevent_mainpage_scroll ) { 526 527 $( 'html,body' ).removeClass('prevent_mainpage_scroll'); 528 $( 'body' ).removeClass('prevent_mainpage_scroll_mobile'); 529 $( '#page-container' ).removeClass('prevent_content_scroll'); 530 $('html, body').scrollTop( $( overlay ).attr('data-scrolltop') ); 531 $( overlay ).attr('data-scrolltop', '' ); 532 } 533 534 setTimeout( function() { 535 536 $( overlay_cache_selector ).removeAttr('style'); 537 $( overlay_cache_selector + ' path' ).removeAttr('style'); 538 539 if ( !isActiveOverlay() ) { 540 541 $( "#page-container .container" ).css('z-index','1'); 542 $( "#page-container #main-header" ).css('z-index','99989'); 543 $( "#sidebar-overlay" ).css('z-index','-15'); 544 } 545 546 if ( displayonceperload ) { 547 548 $( overlay_container ).remove(); 549 } 550 else { 551 552 togglePlayableTags( '#overlay-' + overlay_id ); 553 } 554 555 }, 500); 556 } 557 else if( !$( overlay ).hasClass('close') && !preventOpen ) { 558 559 if ( displayonceperload ) { 560 561 overlay.attr('data-preventopen', 1); 562 } 563 564 overlay.attr('data-scrolltop', getScrollTop() ); 565 566 $( "#page-container .container" ).css('z-index','0'); 567 $( "#page-container #main-header" ).css('z-index','-1'); 568 $( "#sidebar-overlay" ).css('z-index','16777271'); 569 570 setTimeout( function() { 571 572 $( overlay ).addClass('open'); 573 574 if ( overlay.attr('data-bgcolor') != "") { 575 $( overlay_cache_selector ).css( { 'background-color': overlay.attr('data-bgcolor') } ); 576 } 577 578 if ( overlay.attr('data-fontcolor') != "") { 579 $( overlay_cache_selector ).css( 'color', overlay.attr('data-fontcolor') ); 580 } 581 582 if ( $( overlay_cache_selector ).hasClass('overlay-contentpush') ) { 583 584 $( "html,body" ).css('overflow-x','hidden'); 585 586 $( overlay_cache_selector ).css('opacity',1); 587 588 container.attr('class', 'container2'); 589 590 $( container ).addClass( 'overlay-contentpush-open' ); 591 } 592 593 if ( $( overlay_cache_selector ).hasClass('overlay-contentscale')) { 594 595 container.attr('class', 'container3'); 596 597 $( container ).addClass('overlay-contentscale-open'); 598 } 599 600 if ( $( overlay_cache_selector ).hasClass('overlay-cornershape')) { 601 602 $( overlay_cache_selector ).css({"background":"transparent none repeat scroll 0 0"}); 603 604 path.animate( { 'path' : pathConfig.to }, 400, mina.linear ); 605 $( overlay_cache_selector + ' .overlay-path' ).css({"fill": overlay.attr('data-bgcolor')}); 606 } 607 608 if ( $( overlay_cache_selector ).hasClass('overlay-boxes') ) { 609 610 $( overlay_cache_selector ).css({"background":"transparent none repeat scroll 0 0"}); 611 paths.forEach( function( p, i ) { 612 setTimeout( function() { 613 p.style.display = 'block'; 614 p.style.fill = overlay.attr('data-bgcolor'); 615 }, i * 30 ); 616 });
617 } 618 619 if ( $( overlay_cache_selector ).hasClass('overlay-genie') ) { 620 621 $( overlay_cache_selector ).css({"background":"transparent none repeat scroll 0 0"}); 622 623 var pos = 0; 624 625 $( overlay ).addClass( 'open' ); 626 627 var nextStep = function( pos ) { 628 pos++; 629 if( pos > stepsTotal - 1 ) return; 630 path1.animate( { 'path' : steps[pos] }, 60, mina.linear, function() { nextStep(pos); } ); 631 632 $( overlay_cache_selector + ' .overlay-path' ).css({"fill": overlay.attr('data-bgcolor')}); 633 }; 634 635 nextStep(pos); 636 } 637 638 if ( prevent_mainpage_scroll ) { 639 640 $( 'html,body' ).addClass('prevent_mainpage_scroll'); 641 $( 'body' ).addClass('prevent_mainpage_scroll_mobile'); 642 $( '#page-container' ).addClass('prevent_content_scroll'); 643 } 644 645 }, 200); 646 } 647 } 648 649 650 function getScrollTop() { 651 652 if ( typeof pageYOffset!= 'undefined' ) { 653 654 // most browsers except IE before #9 655 return pageYOffset; 656 } 657 else { 658 659 var B = document.body; // IE 'quirks' 660 var D = document.documentElement; // IE with doctype 661 D = ( D.clientHeight ) ? D: B; 662 663 return D.scrollTop; 664 } 665 } 666 667 668 function showOverlay( overlay_id ) { 669 670 if ( !DovisInt( overlay_id ) ) 671 return; 672 673 var data = { 674 action: 'divioverlay_content', 675 overlay_id: overlay_id 676 }; 677 678 divi_overlay_container_selector = '#divi-overlay-container-' + overlay_id; 679 680 if ( $( divi_overlay_container_selector ).length ) { 681 682 overlay_body = $( divi_overlay_container_selector ).find( '.overlay' ); 683 684 toggleSrcInPlayableTags( overlay_body ); 685 686 toggleOverlay( overlay_id ); 687 } 688 } 689 690 function showOverlayOnce( overlay_id ) { 691 692 if ( !DovisInt( overlay_id ) ) 693 return; 694 695 overlay = '#overlay-' + overlay_id; 696 697 $( overlay ).attr( 'data-displayonceperload', 1 ); 698 } 699 700 function toggleSrcInPlayableTags( str ) { 701 702 str.find("iframe").each(function() { 703 var src = $(this).data('src'); 704 $(this).attr('src', src); 705 }); 706 707 return str; 708 } 709 710 $('body').on('click', '.overlay.open, .overlay-close, .overlay-close span, .close-divi-overlay', function(e) { 711 712 if ( e.target !== e.currentTarget ) return; 713 714 closeActiveOverlay(); 715 }); 716 717 function closeActiveOverlay( overlay_id ) { 718 719 // find active overlay 720 var overlay = $( 'body' ).find( '.overlay.open' ); 721 var displayonceperload = overlay.data('displayonceperload'); 722 723 if ( overlay.length ) { 724 725 if ( overlay_id == null ) { 726 727 var overlayArr = overlay.attr('id').split('-'); 728 overlay_id = overlayArr[1]; 729 } 730 731 showOverlay( overlay_id ); 732 } 733 } 734 735 function getActiveOverlay( onlyNumber ) { 736 737 // find active overlay 738 overlay = $( 'body' ).find( '.overlay.active' ); 739 overlay_id = null; 740 741 if ( overlay.length ) { 742 743 var overlayArr = overlay.attr('id').split('-'); 744 var overlay_id = overlayArr[1]; 745 } 746 747 return overlay_id; 748 } 749 750 function isOpeningOverlay( overlay_id ) { 751
752 if ( !overlay_id ) { 753 754 return null; 755 } 756 757 var overlay = $( '#overlay-' + overlay_id ); 758 759 if ( $( overlay ).css('opacity') < 1 ) { 760 761 return true; 762 } 763 764 return false; 765 } 766 767 function isClosingOverlay( overlay_id ) { 768 769 if ( !overlay_id ) { 770 771 return null; 772 } 773 774 var overlay = $( '#overlay-' + overlay_id ); 775 776 if ( $( overlay ).hasClass('close') ) { 777 778 return false; 779 } 780 781 return true; 782 } 783 784 function isActiveOverlay( overlay_id ) { 785 786 if ( !overlay_id ) { 787 788 var overlay = $( '.overlay.open' ); 789 } 790 else { 791 792 var overlay = $( '#overlay-' + overlay_id ); 793 } 794 795 if ( $( overlay ).hasClass('open') ) { 796 797 return true; 798 } 799 800 return false; 801 } 802 803 function doCreateCookie( name,value,days ) { 804 805 var expires = ""; 806 807 if ( days ) { 808 809 var date = new Date(); 810 811 date.setTime(date.getTime() + ( days * 24 * 60 * 60 * 1000)); 812 813 expires = "; expires=" + date.toUTCString(); 814 } 815 816 document.cookie = name + "=" + value + expires + "; path=/"; 817 } 818 819 function doReadCookie( name ) { 820 821 var nameEQ = name + "="; 822 var ca = document.cookie.split(';'); 823 824 for(var i=0;i < ca.length;i++) { 825 826 var c = ca[i]; 827 828 while (c.charAt(0)==' ') c = c.substring(1,c.length); 829 830 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 831 } 832 833 return null; 834 } 835 836 function doEraseCookie( name ) { 837 doCreateCookie( name, '', -1 ); 838 } 839 } 840}); 841 842 843function DovisInt(value) { 844 var x; 845 return isNaN(value) ? !1 : (x = parseFloat(value), (0 | x) === x); 846}
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.