1var wpAjaxUrl = 'https://www.excellencemanagement.com/wp-admin/admin-ajax.php';var flBuilderUrl = 'https://www.excellencemanagement.com/wp-content/plugins/bb-plugin/';var FLBuilderLayoutConfig = { 2 anchorLinkAnimations : { 3 duration : 1000, 4 easing : 'swing', 5 offset : 100 6 }, 7 paths : { 8 pluginUrl : 'https://www.excellencemanagement.com/wp-content/plugins/bb-plugin/', 9 wpAjaxUrl : 'https://www.excellencemanagement.com/wp-admin/admin-ajax.php' 10 }, 11 breakpoints : { 12 small : 768, 13 medium : 992 }, 14 waypoint: { 15 offset: 80 16 } 17}; 18(function($){ 19 20 if(typeof FLBuilderLayout != 'undefined') { 21 return; 22 } 23 24 /** 25 * Helper class with generic logic for a builder layout. 26 * 27 * @class FLBuilderLayout 28 * @since 1.0 29 */ 30 FLBuilderLayout = { 31 32 /** 33 * Initializes a builder layout. 34 * 35 * @since 1.0 36 * @method init 37 */ 38 init: function() 39 { 40 // Destroy existing layout events. 41 FLBuilderLayout._destroy(); 42 43 // Init CSS classes. 44 FLBuilderLayout._initClasses(); 45 46 // Init backgrounds. 47 FLBuilderLayout._initBackgroun
47ds(); 48 49 // Only init if the builder isn't active. 50 if ( 0 === $('.fl-builder-edit').length ) { 51 52 // Init module animations. 53 FLBuilderLayout._initModuleAnimations(); 54 55 // Init anchor links. 56 FLBuilderLayout._initAnchorLinks(); 57 58 // Init the browser hash. 59 FLBuilderLayout._initHash(); 60 61 // Init forms. 62 FLBuilderLayout._initForms(); 63 } 64 }, 65 66 /** 67 * Public method for refreshing Wookmark or MosaicFlow galleries 68 * within an element. 69 * 70 * @since 1.7.4 71 * @method refreshGalleries 72 */ 73 refreshGalleries: function( element ) 74 { 75 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 76 mfContent = $element.find( '.fl-mosaicflow-content' ), 77 wmContent = $element.find( '.fl-gallery' ), 78 mfObject = null; 79 80 if ( mfContent ) { 81 82 mfObject = mfContent.data( 'mosaicflow' ); 83 84 if ( mfObject ) { 85 mfObject.columns = $( [] ); 86 mfObject.columnsHeights = []; 87 mfContent.data( 'mosaicflow', mfObject ); 88 mfContent.mosaicflow( 'refill' ); 89 } 90 } 91 if ( wmContent ) { 92 wmContent.trigger( 'refreshWookmark' ); 93 } 94 }, 95 96 /** 97 * Public method for refreshing Masonry within an element 98 * 99 * @since 1.8.1 100 * @method refreshGridLayout 101 */ 102 refreshGridLayout: function( element ) 103 { 104 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 105 msnryContent = $element.find('.masonry'); 106 107 if ( msnryContent.length ) { 108 msnryContent.masonry('layout'); 109 } 110 }, 111 112 /** 113 * Public method for reloading BxSlider within an element 114 * 115 * @since 1.8.1 116 * @method reloadSlider 117 */ 118 reloadSlider: function( element ) 119 { 120 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 121 bxContent = $element.find('.bx-viewport > div').eq(0), 122 bxObject = null; 123 124 if ( bxContent.length ) { 125 bxObject = bxContent.data( 'bxSlider'); 126 if ( bxObject ) { 127 bxObject.reloadSlider(); 128 } 129 } 130 }, 131 132 /** 133 * Public method for resizing WP audio player 134 * 135 * @since 1.8.2 136 * @method resizeAudio 137 */ 138 resizeAudio: function( element ) 139 { 140 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 141 audioPlayers = $element.find('.wp-audio-shortcode.mejs-audio'), 142 player = null, 143 mejsPlayer = null, 144 rail = null, 145 railWidth = 400; 146 147 if ( audioPlayers.length && typeof mejs !== 'undefined' ) { 148 audioPlayers.each(function(){ 149 player = $(this); 150 mejsPlayer = mejs.players[player.attr('id')]; 151 rail = player.find('.mejs-controls .mejs-time-rail'); 152 var innerMejs = player.find('.mejs-inner'), 153 total = player.find('.mejs-controls .mejs-time-total'); 154 155 if ( typeof mejsPlayer !== 'undefined' ) { 156 railWidth = Math.ceil(player.width() * 0.8); 157 158 if ( innerMejs.length ) { 159 160 rail.css('width', railWidth +'px!important'); 161 //total.width(rail.width() - 10); 162 163 mejsPlayer.options.autosizeProgress = true; 164 165 // webkit has trouble doing this without a delay 166 setTimeout(function () { 167 mejsPlayer.setControlsSize(); 168 }, 50); 169 170 player.find('.mejs-inner').css({ 171 visibility: 'visible', 172 height: 'inherit' 173 }); 174 } 175 } 176 }); 177 } 178 }, 179 180 /** 181 * Public method for preloading WP audio player when it's inside the hidden element 182 * 183 * @since 1.8.2 184 * @method preloadAudio 185 */ 186 preloadAudio: function(element) 187 { 188 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ), 189 contentWrap = $element.closest('.fl-accordion-item'), 190 audioPlayers = $element.find('.wp-audio-shortcode.mejs-audio'); 191 192 if ( ! contentWrap.hasClass('fl-accordion-item-active') && audioPlayers.find('.mejs-inner').length ) { 193 audioPlayers.find('.mejs-inner').css({ 194 visibility : 'hidden', 195 height: 0 196 }); 197 } 198 }, 199 200 /** 201 * Public method for resizing slideshow momdule within the tab 202 * 203 * @since 1.10.5 204 * @method resizeSlideshow 205 */ 206 resizeSlideshow: function(){ 207 if(typeof YUI !== 'undefined') { 208 YUI().use('node-event-simulate', function(Y) { 209 Y.one(window).simulate("resize"); 210 }); 211 } 212 }, 213 214 /** 215 * Public method for reloading an embedded Google Map within the tabs or hidden element. 216 * 217 * @since 2.2 218 * @method reloadGoogleMap 219 */ 220 reloadGoogleMap: function(element){ 221 var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ),
222 googleMap = $element.find( 'iframe[src*="google.com/maps"]' ); 223 224 if ( googleMap.length ) { 225 googleMap.attr( 'src', function(i, val) { 226 return val; 227 }); 228 } 229 }, 230 231 /** 232 * Unbinds builder layout events. 233 * 234 * @since 1.0 235 * @access private 236 * @method _destroy 237 */ 238 _destroy: function() 239 { 240 var win = $(window); 241 242 win.off('scroll.fl-bg-parallax'); 243 win.off('resize.fl-bg-video'); 244 }, 245 246 /** 247 * Checks to see if the current device has touch enabled. 248 * 249 * @since 1.0 250 * @access private 251 * @method _isTouch 252 * @return {Boolean} 253 */ 254 _isTouch: function() 255 { 256 if(('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)) { 257 return true; 258 } 259 260 return false; 261 }, 262 263 /** 264 * Checks to see if the current device is mobile. 265 * 266 * @since 1.7 267 * @access private 268 * @method _isMobile 269 * @return {Boolean} 270 */ 271 _isMobile: function() 272 { 273 return /Mobile|Android|Silk\/|Kindle|BlackBerry|Opera Mini|Opera Mobi|webOS/i.test( navigator.userAgent ); 274 }, 275 276 /** 277 * Initializes builder body classes. 278 * 279 * @since 1.0 280 * @access private 281 * @method _initClasses 282 */ 283 _initClasses: function() 284 { 285 var body = $( 'body' ), 286 ua = navigator.userAgent; 287 288 // Add the builder body class. 289 if ( ! body.hasClass( 'archive' ) && $( '.fl-builder-content-primary' ).length > 0 ) { 290 body.addClass('fl-builder'); 291 } 292 293 // Add the builder touch body class. 294 if(FLBuilderLayout._isTouch()) { 295 body.addClass('fl-builder-touch'); 296 } 297 298 // Add the builder mobile body class. 299 if(FLBuilderLayout._isMobile()) { 300 body.addClass('fl-builder-mobile'); 301 } 302 303 // IE11 body class. 304 if ( ua.indexOf( 'Trident/7.0' ) > -1 && ua.indexOf( 'rv:11.0' ) > -1 ) { 305 body.addClass( 'fl-builder-ie-11' ); 306 } 307 }, 308 309 /** 310 * Initializes builder node backgrounds that require 311 * additional JavaScript logic such as parallax. 312 * 313 * @since 1.1.4 314 * @access private
315 * @method _initBackgrounds 316 */ 317 _initBackgrounds: function() 318 { 319 var win = $(window); 320 321 // Init parallax backgrounds. 322 if($('.fl-row-bg-parallax').length > 0 && !FLBuilderLayout._isMobile()) { 323 FLBuilderLayout._scrollParallaxBackgrounds(); 324 FLBuilderLayout._initParallaxBackgrounds(); 325 win.on('scroll.fl-bg-parallax', FLBuilderLayout._scrollParallaxBackgrounds); 326 } 327 328 // Init video backgrounds. 329 if($('.fl-bg-video').length > 0) { 330 FLBuilderLayout._initBgVideos(); 331 FLBuilderLayout._resizeBgVideos(); 332 win.on('resize.fl-bg-video', FLBuilderLayout._resizeBgVideos); 333 } 334 }, 335 336 /** 337 * Initializes all parallax backgrounds in a layout. 338 * 339 * @since 1.1.4 340 * @access private 341 * @method _initParallaxBackgrounds 342 */ 343 _initParallaxBackgrounds: function() 344 { 345 $('.fl-row-bg-parallax').each(FLBuilderLayout._initParallaxBackground); 346 }, 347 348 /** 349 * Initializes a single parallax background. 350 * 351 * @since 1.1.4 352 * @access private 353 * @method _initParallaxBackgrounds 354 */ 355 _initParallaxBackground: function() 356 { 357 var row = $(this), 358 content = row.find('> .fl-row-content-wrap'), 359 src = row.data('parallax-image'), 360 loaded = row.data('parallax-loaded'), 361 img = new Image(); 362 363 if(loaded) { 364 return; 365 } 366 else if(typeof src != 'undefined') { 367 368 $(img).on('load', function() { 369 content.css('background-image', 'url(' + src + ')'); 370 row.data('parallax-loaded', true); 371 }); 372 373 img.src = src; 374 } 375 }, 376 377 /** 378 * Fires when the window is scrolled to adjust 379 * parallax backgrounds. 380 * 381 * @since 1.1.4 382 * @access private 383 * @method _scrollParallaxBackgrounds 384 */ 385 _scrollParallaxBackgrounds: function() 386 { 387 $('.fl-row-bg-parallax').each(FLBuilderLayout._scrollParallaxBackground); 388 }, 389 390 /** 391 * Fires when the window is scrolled to adjust 392 * a single parallax background. 393 * 394 * @since 1.1.4 395 * @access private 396 * @method _scrollParallaxBackground 397 */ 398 _scrollParallaxBackground: function() 399 { 400 var win = $(window), 401 row = $(this), 402 content = row.find('> .fl-row-content-wrap'), 403 speed = row.data('parallax-speed'), 404 offset = content.offset(), 405 yPos = -((win.scrollTop() - offset.top) / speed); 406 407 content.css('background-position', 'center ' + yPos + 'px'); 408 }, 409 410 /** 411 * Initializes all video backgrounds. 412 * 413 * @since 1.6.3.3 414 * @access private 415 * @method _initBgVideos 416 */ 417 _initBgVideos: function() 418 { 419 $('.fl-bg-video').each(FLBuilderLayout._initBgVideo); 420 }, 421 422 /** 423 * Initializes a video background. 424 * 425 * @since 1.6.3.3 426 * @access private 427 * @method _initBgVideo 428 */ 429 _initBgVideo: function() 430 { 431 var wrap = $( this ), 432 width = wrap.data( 'width' ), 433 height = wrap.data( 'height' ), 434 mp4 = wrap.data( 'mp4' ), 435 youtube = wrap.data( 'youtube'), 436 vimeo = wrap.data( 'vimeo'), 437 mp4Type = wrap.data( 'mp4-type' ), 438 webm = wrap.data( 'webm' ), 439 webmType = wrap.data( 'webm-type' ), 440 fallback = wrap.data( 'fallback' ), 441 loaded = wrap.data( 'loaded' ), 442 fallbackTag = '', 443 videoTag = null, 444 mp4Tag = null, 445 webmTag = null; 446 447 // Return if the video has been loaded for this row. 448 if ( loaded ) { 449 return; 450 } 451 452 videoTag = $( '<video autoplay loop muted playsinline></video>' ); 453 454 /** 455 * Add poster image (fallback image) 456 */ 457 if( 'undefined' != typeof fallback && '' != fallback ) { 458 videoTag.attr( 'poster', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' ) 459 videoTag.css( 'background', 'transparent url("' + fallback + '") no-repeat center center' ) 460 videoTag.css( 'background-size', 'cover' ) 461 videoTag.css( 'height', '100%' ) 462 } 463 464 // MP4 Source Tag 465 if ( 'undefined' != typeof mp4 && '' != mp4 ) { 466 467 mp4Tag = $( '<source />' ); 468 mp4Tag.attr( 'src', mp4 ); 469 mp4Tag.attr( 'type', mp4Type ); 470 471 videoTag.append( mp4Tag ); 472 } 473 // WebM Source Tag 474 if ( 'undefined' != typeof webm && '' != webm ) { 475 476 webmTag = $( '<source />' ); 477 webmTag.attr( 'src', webm ); 478 webmTag.attr( 'type', webmType ); 479 480 videoTag.append( webmTag ); 481 } 482 483 // Check what video player we are going to load in a row 484 if ( 'undefined' != typeof youtube && ! FLBuilderLayout._isMobile() ) { 485 FLBuilderLayout._initYoutubeBgVideo.apply( this ); 486 } 487 else if ( 'undefined' != typeof vimeo && ! FLBuilderLayout._isMobile() ) { 488 FLBuilderLayout._initVimeoBgVideo.apply( this ); 489 } 490 else { 491 wrap.append( videoTag ); 492 } 493 494 // Mark this video as loaded. 495 wrap.data('loaded', true); 496 }, 497 498 /** 499 * Initializes Youtube video background 500 * 501 * @since 1.9 502 * @access private 503 * @method _initYoutubeBgVideo 504 */ 505 _initYoutubeBgVideo: function() 506 { 507 var playerWrap = $(this), 508 videoId = playerWrap.data('video-id'), 509 videoPlayer = playerWrap.find('.fl-bg-video-player'), 510 enableAudio = playerWrap.data('enable-audio'), 511 audioButton = playerWrap.find('.fl-bg-video-audio'), 512 startTime = 'undefined' !== typeof playerWrap.data('start') ? playerWrap.data('start')
512: 0, 513 endTime = 'undefined' !== typeof playerWrap.data('end') ? playerWrap.data('end') : 0, 514 loop = 'undefined' !== typeof playerWrap.data('loop') ? playerWrap.data('loop') : 1, 515 vidPlayed = false, 516 didUnmute = false, 517 stateCount = 0, 518 player; 519 520 if ( videoId ) { 521 FLBuilderLayout._onYoutubeApiReady( function( YT ) { 522 setTimeout( function() { 523 524 player = new YT.Player( videoPlayer[0], { 525 videoId: videoId, 526 events: { 527 onReady: function(event) { 528 if ( "no" === enableAudio ) { 529 event.target.mute(); 530 } 531 else if ("yes" === enableAudio && event.target.isMuted ) { 532 event.target.unMute(); 533 } 534 535 // Store an instance to a parent 536 playerWrap.data('YTPlayer', player); 537 FLBuilderLayout._resizeYoutubeBgVideo.apply(playerWrap); 538 539 // Queue the video. 540 event.target.playVideo(); 541 542 if ( audioButton.length > 0 ) { 543 audioButton.on( 'click', {button: audioButton, player: player}, FLBuilderLayout._toggleBgVideoAudio ); 544 } 545 }, 546 onStateChange: function( event ) { 547 // Manual check if video is not playable in some browsers. 548 // StateChange order: [-1, 3, -1] 549 if ( stateCount < 4 ) { 550 stateCount++; 551 } 552 553 // Comply with the audio policy in some browsers like Chrome and Safari. 554 if ( stateCount > 1 && -1 === event.data && "yes" === enableAudio ) { 555 player.mute(); 556 player.playVideo(); 557 audioButton.show(); 558 } 559 560 if ( event.data === YT.PlayerState.ENDED && 1 === loop ) { 561 if ( startTime > 0 ) { 562 player.seekTo( startTime ); 563 } 564 else { 565 player.playVideo(); 566 } 567 } 568 }, 569 onError: function(event) { 570 console.info('YT Error: ' + event.data) 571 FLBuilderLayout._onErrorYoutubeVimeo(playerWrap) 572 } 573 }, 574 playerVars: { 575 controls: 0, 576 showinfo: 0, 577 rel : 0, 578 start: startTime, 579 end: endTime, 580 } 581 } ); 582 }, 1 ); 583 } ); 584 } 585 }, 586 587 /** 588 * On youtube or vimeo error show the fallback image if available. 589 * @since 2.0.7 590 */ 591 _onErrorYoutubeVimeo: function(playerWrap) { 592 593 fallback = playerWrap.data('fallback') || false 594 if( ! fallback ) { 595 return false; 596 } 597 playerWrap.find('iframe').remove() 598 fallbackTag = $( '<div></div>' ); 599 fallbackTag.addClass( 'fl-bg-video-fallback' ); 600 fallbackTag.css( 'background-image', 'url(' + playerWrap.data('fallback') + ')' ); 601 playerWrap.append( fallbackTag ); 602 }, 603 604 /** 605 * Check if Youtube API has been downloaded 606 * 607 * @since 1.9 608 * @access private 609 * @method _onYoutubeApiReady 610 * @param {Function} callback Method to call when YT API has been loaded 611 */ 612 _onYoutubeApiReady: function( callback ) { 613 if ( window.YT && YT.loaded ) { 614 callback( YT ); 615 } else { 616 // If not ready check again by timeout.. 617 setTimeout( function() { 618 FLBuilderLayout._onYoutubeApiReady( callback ); 619 }, 350 ); 620 } 621 }, 622 623 /** 624 * Initializes Vimeo video background 625 * 626 * @since 1.9 627 * @access private 628 * @method _initVimeoBgVideo 629 */ 630 _initVimeoBgVideo: function() 631 { 632 var playerWrap = $(this), 633 videoId = playerWrap.data('video-id'), 634 videoPlayer = playerWrap.find('.fl-bg-video-player'), 635 enableAudio = playerWrap.data('enable-audio'), 636 audioButton = playerWrap.find('.fl-bg-video-audio'), 637 player, 638 width = playerWrap.outerWidth(); 639 640 if ( typeof Vimeo !== 'undefined' && videoId ) { 641 player = new Vimeo.Player(videoPlayer[0], { 642 id : videoId, 643 loop : true, 644 title : false, 645 portrait : false, 646 background : true, 647 autopause : false, 648 muted : true 649 }); 650 651 playerWrap.data('VMPlayer', player); 652 if ( "no" === enableAudio ) { 653 player.setVolume(0); 654 } 655 else if ("yes" === enableAudio ) { 656 // Chrome and Safari have audio policy restrictions for autoplay videos. 657 if ( $.browser.safari || $.browser.chrome ) { 658 player.setVolume(0); 659 audioButton.show(); 660 } 661 else { 662 player.setVolume(1); 663 } 664 } 665 666 player.play().catch(function(error) { 667 FLBuilderLayout._onErrorYoutubeVimeo(playerWrap) 668 }); 669 670 if ( audioButton.length > 0 ) {
671 audioButton.on( 'click', {button: audioButton, player: player}, FLBuilderLayout._toggleBgVideoAudio ); 672 } 673 } 674 }, 675 676 /** 677 * Mute / unmute audio on row's video background. 678 * It works for both Youtube and Vimeo. 679 * 680 * @since 2.1.3 681 * @access private 682 * @method _toggleBgVideoAudio 683 * @param {Object} e Method arguments 684 */ 685 _toggleBgVideoAudio: function( e ) { 686 var player = e.data.player, 687 control = e.data.button.find('.fl-audio-control'); 688 689 if ( control.hasClass( 'fa-volume-off' ) ) { 690 // Unmute 691 control 692 .removeClass( 'fa-volume-off' ) 693 .addClass( 'fa-volume-up' ); 694 e.data.button.find( '.fa-times' ).hide(); 695 696 if ( 'function' === typeof player.unMute ) { 697 player.unMute(); 698 } 699 else { 700 player.setVolume( 1 ); 701 } 702 } 703 else { 704 // Mute 705 control 706 .removeClass( 'fa-volume-up' ) 707 .addClass( 'fa-volume-off' ); 708 e.data.button.find( '.fa-times' ).show(); 709 710 if ( 'function' === typeof player.unMute ) { 711 player.mute(); 712 } 713 else { 714 player.setVolume( 0 ); 715 } 716 } 717 }, 718 719 /** 720 * Fires when there is an error loading a video 721 * background source and shows the fallback. 722 * 723 * @since 1.6.3.3 724 * @access private 725 * @method _videoBgSourceError 726 * @param {Object} e An event object 727 * @deprecated 2.0.3 728 */ 729 _videoBgSourceError: function( e ) 730 { 731 var source = $( e.target ), 732 wrap = source.closest( '.fl-bg-video' ), 733 vid = wrap.find( 'video' ), 734 fallback = wrap.data( 'fallback' ), 735 fallbackTag = ''; 736 source.remove(); 737 738 if ( vid.find( 'source' ).length ) { 739 // Don't show the fallback if we still have other sources to check. 740 return; 741 } else if ( '' !== fallback ) { 742 fallbackTag = $( '<div></div>' ); 743 fallbackTag.addClass( 'fl-bg-video-fallback' ); 744 fallbackTag.css( 'background-image', 'url(' + fallback + ')' ); 745 wrap.append( fallbackTag ); 746 vid.remove(); 747 } 748 }, 749 750 /** 751 * Fires when the window is resized to resize 752 * all video backgrounds. 753 * 754 * @since 1.1.4 755 * @access private 756 * @method _resizeBgVideos 757 */ 758 _resizeBgVideos: function() 759 { 760 $('.fl-bg-video').each( function() { 761 762 FLBuilderLayout._resizeBgVideo.apply( this ); 763 764 if ( $( this ).parent().find( 'img' ).length > 0 ) { 765 $( this ).parent().imagesLoaded( $.proxy( FLBuilderLayout._resizeBgVideo, this ) ); 766 } 767 } ); 768 }, 769 770 /** 771 * Fires when the window is resized to resize 772 * a single video background. 773 * 774 * @since 1.1.4 775 * @access private 776 * @method _resizeBgVideo 777 */ 778 _resizeBgVideo: function() 779 { 780 if ( 0 === $( this ).find( 'video' ).length && 0 === $( this ).find( 'iframe' ).length ) { 781 return; 782 } 783 784 var wrap = $(this), 785 wrapHeight = wrap.outerHeight(), 786 wrapWidth = wrap.outerWidth(), 787 vid = wrap.find('video'), 788 vidHeight = wrap.data('height'), 789 vidWidth = wrap.data('width'), 790 newWidth = wrapWidth, 791 newHeight = Math.round(vidHeight * wrapWidth/vidWidth), 792 newLeft = 0, 793 newTop = 0, 794 iframe = wrap.find('iframe'); 795 796 if ( vid.length ) { 797 if(vidHeight === '' || typeof vidHeight === 'undefined' || vidWidth === '' || typeof vidWidth === 'undefined') { 798 vid.css({ 799 'left' : '0px', 800 'top' : '0px', 801 'width' : newWidth + 'px' 802 }); 803 804 // Try to set the actual video dimension on 'loadedmetadata' when using URL as video source 805 vid.on('loadedmetadata', FLBuilderLayout._resizeOnLoadedMeta); 806 807 } 808 else { 809 810 if(newHeight < wrapHeight) { 811 newHeight = wrapHeight; 812 newWidth = Math.round(vidWidth * wrapHeight/vidHeight); 813 newLeft = -((newWidth - wrapWidth)/2); 814 } 815 else { 816 newTop = -((newHeight - wrapHeight)/2); 817 } 818 819 vid.css({ 820 'left' : newLeft + 'px', 821 'top' : newTop + 'px', 822 'height' : newHeight + 'px', 823 'width' : newWidth + 'px' 824 }); 825 } 826 } 827 else if ( iframe.length ) { 828 829 // Resize Youtube video player within iframe tag 830 if ( typeof wrap.data('youtube') !== 'undefined' ) { 831 FLBuilderLayout._resizeYoutubeBgVideo.apply(this); 832 } 833 } 834 }, 835 836 /** 837 * Fires when video meta has been loaded. 838 * This will be Triggered when width/height attributes were not specified during video background resizing. 839 * 840 * @since 1.8.5 841 * @access private 842 * @method _resizeOnLoadedMeta 843 */ 844 _resizeOnLoadedMeta: function(){ 845 var video = $(this), 846 wrapHeight = video.parent().outerHeight(), 847 wrapWidth = video.parent().outerWidth(), 848 vidWidth = video[0].videoWidth, 849 vidHeight = video[0].videoHeight, 850 newHeight = Math.round(vidHeight * wrapWidth/vidWidth), 851 newWidth = wrapWidth, 852 newLeft = 0, 853 newTop = 0; 854 855 if(newHeight < wrapHeight) { 856 newHeight = wrapHeight; 857 newWidth = Math.round(vidWidth * wrapHeight/vidHeight); 858 newLeft = -((newWidth - wrapWidth)/2); 859 } 860 else { 861 newTop = -((newHeight - wrapHeight)/2); 862 } 863 864 video.parent().data('width', vidWidth); 865 video.parent().data('height', vidHeight); 866 867 video.css({ 868 'left' : newLeft + 'px', 869 'top' : newTop + 'px', 870 'width' : newWidth + 'px', 871 'height' : newHeight + 'px' 872 }); 873 }, 874 875 /** 876 * Fires when the window is resized to resize 877 * a single Youtube video background. 878 * 879 * @since 1.9 880 * @access private 881 * @method _resizeYoutubeBgVideo 882 */ 883 _resizeYoutubeBgVideo: function() 884 { 885 var wrap = $(this), 886 wrapWidth = wrap.outerWidth(), 887 wrapHeight = wrap.outerHeight(), 888 player = wrap.data('YTPlayer'), 889 video = player ? player.getIframe() : null, 890 aspectRatioSetting = '16:9', // Medium 891 aspectRatioArray = aspectRatioSetting.split( ':' ),
892 aspectRatio = aspectRatioArray[0] / aspectRatioArray[1], 893 ratioWidth = wrapWidth / aspectRatio, 894 ratioHeight = wrapHeight * aspectRatio, 895 isWidthFixed = wrapWidth / wrapHeight > aspectRatio, 896 width = isWidthFixed ? wrapWidth : ratioHeight, 897 height = isWidthFixed ? ratioWidth : wrapHeight; 898 899 if ( video ) { 900 $(video).width( width ).height( height ); 901 } 902 }, 903 904 /** 905 * Initializes module animations. 906 * 907 * @since 1.1.9 908 * @access private 909 * @method _initModuleAnimations 910 */ 911 _initModuleAnimations: function() 912 { 913 if(typeof jQuery.fn.waypoint !== 'undefined') { 914 $('.fl-animation').each( function() { 915 var node = $( this ), 916 nodeTop = node.offset().top, 917 winHeight = $( window ).height(), 918 bodyHeight = $( 'body' ).height(), 919 waypoint = FLBuilderLayoutConfig.waypoint, 920 offset = '80%'; 921 922 if ( typeof waypoint.offset !== undefined ) { 923 offset = FLBuilderLayoutConfig.waypoint.offset + '%'; 924 } 925 926 if ( bodyHeight - nodeTop < winHeight * 0.2 ) { 927 offset = '100%'; 928 } 929 930 node.waypoint({ 931 offset: offset, 932 handler: FLBuilderLayout._doModuleAnimation 933 }); 934 } ); 935 } 936 }, 937 938 /** 939 * Runs a module animation. 940 * 941 * @since 1.1.9 942 * @access private 943 * @method _doModuleAnimation 944 */ 945 _doModuleAnimation: function() 946 { 947 var module = 'undefined' == typeof this.element ? $(this) : $(this.element), 948 delay = parseFloat(module.data('animation-delay')), 949 duration = parseFloat(module.data('animation-duration')); 950 951 if ( ! isNaN( duration ) ) { 952 module.css( 'animation-duration', duration + 's' ); 953 } 954 955 if(!isNaN(delay) && delay > 0) { 956 setTimeout(function(){ 957 module.addClass('fl-animated'); 958 }, delay * 1000); 959 } else { 960 setTimeout(function(){ 961 module.addClass('fl-animated'); 962 }, 1); 963 } 964 }, 965 966 /** 967 * Opens a tab or accordion item if the browser hash is set 968 * to the ID of one on the page. 969 * 970 * @since 1.6.0 971 * @access private 972 * @method _initHash 973 */ 974 _initHash: function() 975 { 976 var hash = window.location.hash.replace( '#', '' ).split( '/' ).shift(), 977 element = null, 978 tabs = null, 979 responsiveLabel = null, 980 tabIndex = null, 981 label = null; 982 983 if ( '' !== hash ) { 984 985 try { 986 987 element = $( '#' + hash ); 988 989 if ( element.length > 0 ) { 990 991 if ( element.hasClass( 'fl-accordion-item' ) ) { 992 setTimeout( function() { 993 element.find( '.fl-accordion-button' ).trigger( 'click' ); 994 }, 100 ); 995 } 996 if ( element.hasClass( 'fl-tabs-panel' ) ) { 997 998 setTimeout( function() { 999 1000 tabs = element.closest( '.fl-tabs' ); 1001 responsiveLabel = element.find( '.fl-tabs-panel-label' ); 1002 tabIndex = responsiveLabel.data( 'index' ); 1003 label = tabs.find( '.fl-tabs-labels .fl-tabs-label[data-index=' + tabIndex + ']' ); 1004 1005 if ( responsiveLabel.is( ':visible' ) ) { 1006 responsiveLabel.trigger( 'click' ); 1007 } 1008 else { 1009 label[0].click(); 1010 FLBuilderLayout._scrollToElement( element ); 1011 } 1012 1013 }, 100 ); 1014 } 1015 } 1016 } 1017 catch( e ) {} 1018 } 1019 }, 1020 1021 /** 1022 * Initializes all anchor links on the page for smooth scrolling. 1023 * 1024 * @since 1.4.9 1025 * @access private 1026 * @method _initAnchorLinks 1027 */ 1028 _initAnchorLinks: function() 1029 { 1030 $( 'a' ).each( FLBuilderLayout._initAnchorLink ); 1031 }, 1032 1033 /** 1034 * Initializes a single anchor link for smooth scrolling. 1035 * 1036 * @since 1.4.9 1037 * @access private 1038 * @method _initAnchorLink 1039 */ 1040 _initAnchorLink: function() 1041 { 1042 var link = $( this ), 1043 href = link.attr( 'href' ), 1044 loc = window.location, 1045 id = null, 1046 element = null; 1047 if ( 'undefined' != typeof href && href.indexOf( '#' ) > -1 && link.closest('svg').length < 1 ) { 1048 1049 if ( loc.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && loc.hostname == this.hostname ) { 1050 1051 try { 1052 1053 id = href.split( '#' ).pop(); 1054 // If there is no ID then we have nowhere to look 1055 // Fixes a quirk in jQuery and FireFox 1056 if( ! id ) { 1057 return; 1058 } 1059 element = $( '#' + id ); 1060 1061 if ( element.length > 0 ) { 1062 if ( link.hasClass( 'fl-scroll-link' ) || element.hasClass( 'fl-row' ) || element.hasClass( 'fl-col' ) || element.hasClass( 'fl-module' ) ) { 1063 $( link ).on( 'click', FLBuilderLayout._scrollToElementOnLinkClick ); 1064 } 1065 if ( element.hasClass( 'fl-accordion-item' ) ) { 1066 $( link ).on( 'click', FLBuilderLayout._scrollToAccordionOnLinkClick ); 1067 } 1068 if ( element.hasClass( 'fl-tabs-panel' ) ) { 1069 $( link ).on( 'click', FLBuilderLayout._scrollToTabOnLinkClick ); 1070 } 1071 } 1072 } 1073 catch( e ) {} 1074 } 1075 } 1076 }, 1077 1078 /** 1079 * Scrolls to an element when an anchor link is clicked. 1080 * 1081 * @since 1.4.9 1082 * @access private 1083 * @method _scrollToElementOnLinkClick 1084 * @param {Object} e An event object. 1085 * @param {Function} callback A function to call when the scroll is complete. 1086 */ 1087 _scrollToElementOnLinkClick: function( e, callback ) 1088 { 1089 var element = $( '#' + $( this ).attr( 'href' ).split( '#' ).pop() ); 1090 1091 FLBuilderLayout._scrollToElement( element, callback ); 1092 1093 e.preventDefault(); 1094 }, 1095 1096 /** 1097 * Scrolls to an element. 1098 * 1099 * @since 1.6.4.5 1100 * @access private 1101 * @method _scrollToElement 1102 * @param {Object} element The element to scroll to. 1103 * @param {Function} callback A function to call when the scroll is complete. 1104 */ 1105 _scrollToElement: function( element, callback ) 1106 { 1107 var config = FLBuilderLayoutConfig.anchorLinkAnimations, 1108 dest = 0, 1109 win = $( window ), 1110 doc = $( document ); 1111 1112 if ( element.length > 0 ) { 1113 1114 if ( element.offset().top > doc.height() - win.height() ) { 1115 dest = doc.height() - win.height(); 1116 } 1117 else { 1118 dest = element.offset().top - config.offset; 1119 } 1120 1121 $( 'html, body' ).animate( { scrollTop: dest }, config.duration, config.easing, function() { 1122 1123 if ( 'undefined' != typeof callback ) { 1124 callback(); 1125 } 1126 1127 if ( undefined != element.attr( 'id' ) ) { 1128 1129 if ( history.pushState ) { 1130 history.pushState( null, null, '#' + element.attr( 'id' ) ); 1131 } 1132 else { 1133 window.location.hash = element.attr( 'id' ); 1134 } 1135 } 1136 } ); 1137 } 1138 }, 1139 1140 /** 1141 * Scrolls to an accordion item when a link is clicked. 1142 * 1143 * @since 1.5.9 1144 * @access private 1145 * @method _scrollToAccordionOnLinkClick 1146 * @param {Object} e An event object. 1147 */ 1148 _scrollToAccordionOnLinkClick: function( e ) 1149 { 1150 var element = $( '#' + $( this ).attr( 'href' ).split( '#' ).pop() ); 1151 1152 if ( element.length > 0 ) { 1153 1154 var callback = function() { 1155 if ( element ) { 1156 element.find( '.fl-accordion-button' ).trigger( 'click' ); 1157 element = false;
1158 } 1159 }; 1160 1161 FLBuilderLayout._scrollToElementOnLinkClick.call( this, e, callback ); 1162 } 1163 }, 1164 1165 /** 1166 * Scrolls to a tab panel when a link is clicked. 1167 * 1168 * @since 1.5.9 1169 * @access private 1170 * @method _scrollToTabOnLinkClick 1171 * @param {Object} e An event object. 1172 */ 1173 _scrollToTabOnLinkClick: function( e ) 1174 { 1175 var element = $( '#' + $( this ).attr( 'href' ).split( '#' ).pop() ), 1176 tabs = null, 1177 label = null, 1178 responsiveLabel = null; 1179 1180 if ( element.length > 0 ) { 1181 1182 tabs = element.closest( '.fl-tabs' ); 1183 responsiveLabel = element.find( '.fl-tabs-panel-label' ); 1184 tabIndex = responsiveLabel.data( 'index' ); 1185 label = tabs.find( '.fl-tabs-labels .fl-tabs-label[data-index=' + tabIndex + ']' ); 1186 1187 if ( responsiveLabel.is( ':visible' ) ) { 1188 1189 var callback = function() { 1190 if ( element ) { 1191 responsiveLabel.trigger( 'click' ); 1192 element = false; 1193 } 1194 }; 1195 1196 FLBuilderLayout._scrollToElementOnLinkClick.call( this, e, callback ); 1197 } 1198 else { 1199 label[0].click(); 1200 FLBuilderLayout._scrollToElement( element ); 1201 } 1202 1203 e.preventDefault(); 1204 } 1205 }, 1206 1207 /** 1208 * Initializes all builder forms on a page. 1209 * 1210 * @since 1.5.4 1211 * @access private 1212 * @method _initForms 1213 */ 1214 _initForms: function() 1215 { 1216 if ( ! FLBuilderLayout._hasPlaceholderSupport ) { 1217 $( '.fl-form-field input' ).each( FLBuilderLayout._initFormFieldPlaceholderFallback ); 1218 } 1219 1220 $( '.fl-form-field input' ).on( 'focus', FLBuilderLayout._clearFormFieldError ); 1221 }, 1222 1223 /** 1224 * Checks to see if the current device has HTML5 1225 * placeholder support. 1226 * 1227 * @since 1.5.4 1228 * @access private 1229 * @method _hasPlaceholderSupport 1230 * @return {Boolean} 1231 */ 1232 _hasPlaceholderSupport: function() 1233 { 1234 var input = document.createElement( 'input' ); 1235 1236 return 'undefined' != input.placeholder; 1237 }, 1238 1239 /** 1240 * Initializes the fallback for when placeholders aren't supported. 1241 * 1242 * @since 1.5.4 1243 * @access private 1244 * @method _initFormFieldPlaceholderFallback 1245 */ 1246 _initFormFieldPlaceholderFallback: function() 1247 { 1248 var field = $( this ), 1249 val = field.val(), 1250 placeholder = field.attr( 'placeholder' ); 1251 1252 if ( 'undefined' != placeholder && '' === val ) { 1253 field.val( placeholder ); 1254 field.on( 'focus', FLBuilderLayout._hideFormFieldPlaceholderFallback ); 1255 field.on( 'blur', FLBuilderLayout._showFormFieldPlaceholderFallback ); 1256 } 1257 }, 1258 1259 /** 1260 * Hides a fallback placeholder on focus. 1261 * 1262 * @since 1.5.4 1263 * @access private 1264 * @method _hideFormFieldPlaceholderFallback 1265 */ 1266 _hideFormFieldPlaceholderFallback: function() 1267 { 1268 var field = $( this ), 1269 val = field.val(), 1270 placeholder = field.attr( 'placeholder' ); 1271 1272 if ( val == placeholder ) { 1273 field.val( '' ); 1274 } 1275 }, 1276 1277 /** 1278 * Shows a fallback placeholder on blur. 1279 * 1280 * @since 1.5.4 1281 * @access private 1282 * @method _showFormFieldPlaceholderFallback 1283 */ 1284 _showFormFieldPlaceholderFallback: function() 1285 { 1286 var field = $( this ), 1287 val = field.val(), 1288 placeholder = field.attr( 'placeholder' ); 1289 1290 if ( '' === val ) { 1291 field.val( placeholder ); 1292 } 1293 }, 1294 1295 /** 1296 * Clears a form field error message. 1297 * 1298 * @since 1.5.4 1299 * @access private 1300 * @method _clearFormFieldError 1301 */ 1302 _clearFormFieldError: function() 1303 { 1304 var field = $( this ); 1305 1306 field.removeClass( 'fl-form-error' ); 1307 field.siblings( '.fl-form-error-message' ).hide(); 1308 } 1309 }; 1310 1311 /* Initializes the builder layout. */ 1312 $(function(){ 1313 FLBuilderLayout.init(); 1314 }); 1315 1316})(jQuery); 1317jQuery(function($) { 1318 1319 $(function() { 1320 $( '.fl-node-57f56886ae7bc .fl-photo-img' ) 1321 .on( 'mouseenter', function( e ) { 1322 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1323 } ) 1324 .on( 'mouseleave', function( e ){ 1325 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1326 } ); 1327 }); 1328}); 1329jQuery(function($) { 1330 1331 $(function() { 1332 $( '.fl-node-58827d6a7bc53 .fl-photo-img' ) 1333 .on( 'mouseenter', function( e ) { 1334 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1335 } ) 1336 .on( 'mouseleave', function( e ){ 1337 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1338 } ); 1339 }); 1340}); 1341jQuery(function($) { 1342 1343 $(function() { 1344 $( '.fl-node-58827b170ec4b .fl-photo-img' ) 1345 .on( 'mouseenter', function( e ) { 1346 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1347 } ) 1348 .on( 'mouseleave', function( e ){ 1349 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1350 } ); 1351 }); 1352}); 1353jQuery(function($) { 1354 1355 $(function() { 1356 $( '.fl-node-58827d8fe46de .fl-photo-img' ) 1357 .on( 'mouseenter', function( e ) { 1358 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1359 } ) 1360 .on( 'mouseleave', function( e ){ 1361 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1362 } ); 1363 }); 1364}); 1365jQuery(function($) { 1366 1367 $(function() { 1368 $( '.fl-node-58827db6e5b83 .fl-photo-img' ) 1369 .on( 'mouseenter', function( e ) { 1370 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1371 } ) 1372 .on( 'mouseleave', function( e ){ 1373 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1374 } ); 1375 }); 1376}); 1377jQuery(function($) { 1378 1379 $(function() { 1380 $( '.fl-node-58827dcb954d2 .fl-photo-img' ) 1381 .on( 'mouseenter', function( e ) { 1382 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1383 } ) 1384 .on( 'mouseleave', function( e ){ 1385 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1386 } ); 1387 }); 1388}); 1389jQuery(function($) { 1390 1391 $(function() { 1392 $( '.fl-node-58827de090c02 .fl-photo-img' ) 1393 .on( 'mouseenter', function( e ) { 1394 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1395 } ) 1396 .on( 'mouseleave', function( e ){ 1397 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1398 } ); 1399 }); 1400}); 1401jQuery(function($) { 1402 1403 $(function() { 1404 $( '.fl-node-58827e15092bf .fl-photo-img' ) 1405 .on( 'mouseenter', function( e ) { 1406 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1407 } ) 1408 .on( 'mouseleave', function( e ){ 1409 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1410 } ); 1411 }); 1412}); 1413jQuery(function($) { 1414 1415 $(function() { 1416 $( '.fl-node-58827e296ff0c .fl-photo-img' ) 1417 .on( 'mouseenter', function( e ) { 1418 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1419 } ) 1420 .on( 'mouseleave', function( e ){ 1421 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1422 } ); 1423 }); 1424}); 1425jQuery(function($) { 1426 1427 $(function() { 1428 $( '.fl-node-58827e40dce7a .fl-photo-img' ) 1429 .on( 'mouseenter', function( e ) { 1430 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1431 } ) 1432 .on( 'mouseleave', function( e ){ 1433 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1434 } ); 1435 }); 1436}); 1437jQuery(function($) { 1438 1439 $(function() { 1440 $( '.fl-node-58827e67059aa .fl-photo-img' ) 1441 .on( 'mouseenter', function( e ) { 1442 $( this ).data( 'title', $( this ).attr( 'title' ) ).removeAttr( 'title' ); 1443 } ) 1444 .on( 'mouseleave', function( e ){ 1445 $( this ).attr( 'title', $( this ).data( 'title' ) ).data( 'title', null ); 1446 } ); 1447 }); 1448});
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.