1document.documentElement.className += ' js_active '; 2document.documentElement.className += 'ontouchstart' in document.documentElement ? ' vc_mobile ' : ' vc_desktop '; 3(function () { 4 var prefix = [ 5 '-webkit-', 6 '-moz-', 7 '-ms-', 8 '-o-', 9 '' 10 ]; 11 for ( var i = 0; 12 i < prefix.length; 13 i ++ ) { 14 if ( prefix[ i ] + 'transform' in document.documentElement.style ) { 15 document.documentElement.className += " vc_transform "; 16 } 17 } 18})(); 19/* 20 On document ready jQuery will fire set of functions. 21 If you want to override function behavior then copy it to your theme js file 22 with the same name. 23 */ 24 25jQuery( window ).load( function () { 26 27} ); 28function vc_js() { 29 vc_twitterBehaviour(); 30 vc_toggleBehaviour(); 31 vc_tabsBehaviour(); 32 vc_accordionBehaviour(); 33 vc_teaserGrid(); 34 vc_carouselBehaviour(); 35 vc_slidersBehaviour(); 36 vc_prettyPhoto(); 37 vc_googleplus(); 38 vc_pinterest(); 39 vc_progress_bar(); 40 vc_plugin_flexslider(); 41 vc_google_fonts(); 42 vc_gridBehaviour(); 43 vc_rowBehaviour(); 44 vc_ttaActivation(); // @since 4.5 45 jQuery( document ).trigger( 'vc_js' ); 46 window.setTimeout( vc_waypoints, 500 ); 47} 48jQuery( document ).ready( function ( $ ) { 49 window.vc_js(); 50} ); 51 52if ( 'function' !== typeof(window[ 'vc_plugin_flexslider' ]) ) { 53 window.vc_plugin_flexslider = function ( $parent ) { 54 var $slider = $parent ? $parent.find( '.wpb_flexslider' ) : jQuery( '.wpb_flexslider' ); 55 $slider.each( function () { 56 var this_element = jQuery( this ); 57 var sliderSpeed = 800, 58 sliderTimeout = parseInt( this_element.attr( 'data-interval' ) ) * 1000, 59 sliderFx = this_element.attr( 'data-flex_fx' ), 60 slideshow = true; 61 if ( 0 === sliderTimeout ) { 62 slideshow = false; 63 } 64 65 this_element.is( ':visible' ) && this_element.flexslider( { 66 animation: sliderFx, 67 slideshow: slideshow, 68 slideshowSpeed: sliderTimeout, 69 sliderSpeed: sliderSpeed, 70 smoothHeight: true 71 } ); 72 } ); 73 }; 74} 75 76/* Twitter 77 ---------------------------------------------------------- */ 78if ( 'function' !== typeof(window[ 'vc_twitterBehaviour' ]) ) { 79 window.vc_twitterBehaviour = function () { 80 jQuery( '.wpb_twitter_widget .tweets' ).each( function ( index ) { 81 var this_element = jQuery( this ), 82 tw_name = this_element.attr( 'data-tw_name' ), 83 tw_count = this_element.attr( 'data-tw_count' ); 84 85 this_element.tweet( { 86 username: tw_name, 87 join_text: "auto", 88 avatar_size: 0, 89 count: tw_count, 90 template: "{avatar}{join}{text}{time}", 91 auto_join_text_default: "", 92 auto_join_text_ed: "", 93 auto_join_text_ing: "", 94 auto_join_text_reply: "", 95 auto_join_text_url: "", 96 loading_text: '<span class="loading_tweets">loading tweets...</span>' 97 } ); 98 } ); 99 }; 100} 101 102/* Google plus 103 ---------------------------------------------------------- */ 104if ( 'function' !== typeof(window[ 'vc_googleplus' ]) ) { 105 window.vc_googleplus = function () { 106 if ( 0 < jQuery( '.wpb_googleplus' ).length ) { 107 (function () { 108 var po = document.createElement( 'script' ); 109 po.type = 'text/javascript'; 110 po.async = true; 111 po.src = 'https://apis.google.com/js/plusone.js'; 112 var s = document.getElementsByTagName( 'script' )[ 0 ]; 113 s.parentNode.insertBefore( po, s ); 114 })(); 115 } 116 } 117} 118 119/* Pinterest 120 ---------------------------------------------------------- */ 121if ( 'function' !== typeof(window[ 'vc_pinterest' ]) ) { 122 window.vc_pinterest = function () { 123 if ( 0 < jQuery( '.wpb_pinterest' ).length ) { 124 (function () { 125 var po = document.createElement( 'script' ); 126 po.type = 'text/javascript'; 127 po.async = true; 128 po.src = 'http://assets.pinterest.com/js/pinit.js'; 129 var s = document.getElementsByTagName( 'script' )[ 0 ]; 130 s.parentNode.insertBefore( po, s ); 131 })(); 132 } 133 } 134} 135 136/* Progress bar 137 ---------------------------------------------------------- */ 138if ( 'function' !== typeof(window[ 'vc_progress_bar' ] ) ) { 139 window.vc_progress_bar = function () { 140 if ( 'undefined' !== typeof(jQuery.fn.waypoint) ) { 141 142 jQuery( '.vc_progress_bar' ).waypoint( function () { 143 jQuery( this ).find( '.vc_single_bar' ).each( function ( index ) { 144 var $this = jQuery( this ), 145 bar = $this.find( '.vc_bar' ), 146 val = bar.data( 'percentage-value' ); 147 148 setTimeout( function () { 149 bar.css( { "width": val + '%' } ); 150 }, index * 200 ); 151 } ); 152 }, { offset: '85%' } ); 153 } 154 } 155} 156 157/* Waypoints magic 158 ---------------------------------------------------------- */ 159if ( 'function' !== typeof(window[ 'vc_waypoints' ] ) ) { 160 window.vc_waypoints = function () { 161 if ( 'undefined' !== typeof(jQuery.fn.waypoint ) ) { 162 jQuery( '.wpb_animate_when_almost_visible:not(.wpb_start_animation)' ).waypoint( function () { 163 jQuery( this ).addClass( 'wpb_start_animation' ); 164 }, { offset: '85%' } ); 165 } 166 } 167} 168 169/* Toggle/FAQ 170 ---------------------------------------------------------- */ 171if ( 'function' !== typeof(window[ 'vc_toggleBehaviour' ] ) ) { 172 window.vc_toggleBehaviour = function ( $el ) { 173 function event( e ) { 174 e && e.preventDefault && e.preventDefault(); 175 var title = jQuery( this ); 176 var element = title.closest( '.vc_toggle' ); 177 var content = element.find( '.vc_toggle_content' ); 178 if ( element.hasClass( 'vc_toggle_active' ) ) { 179 content.slideUp( { 180 duration: 300, 181 complete: function () { 182 element.removeClass( 'vc_toggle_active' ); 183 } 184 } ); 185 } else { 186 content.slideDown( { 187 duration: 300, 188 complete: function () { 189 element.addClass( 'vc_toggle_active' ); 190 } 191 } ); 192 } 193 } 194 195 if ( $el ) { 196 if ( $el.hasClass( 'vc_toggle_title' ) ) { 197 $el.unbind( 'click' ).click( event ); 198 } else { 199 $el.find( ".vc_toggle_title" ).unbind( 'click' ).click( event ); 200 } 201 } else { 202 jQuery( ".vc_toggle_title" ).unbind( 'click' ).on( 'click', event ); 203 } 204 } 205} 206 207/* Tabs + Tours 208 ---------------------------------------------------------- */ 209if ( 'function' !== typeof(window[ 'vc_tabsBehaviour' ] ) ) { 210 window.vc_tabsBehaviour = function ( $tab ) { 211 if ( jQuery.ui ) { 212 var $call = $tab || jQuery( '.wpb_tabs, .wpb_tour' ), 213 ver = jQuery.ui && jQuery.ui.version ? jQuery.ui.version.split( '.' ) : '1.10', 214 old_version = 1 === parseInt( ver[ 0 ] ) && 9 > parseInt( ver[ 1 ] ); 215 $call.each( function ( index ) { 216 var $tabs, 217 interval = jQuery( this ).attr( "data-interval" ), 218 tabs_array = []; 219 // 220 $tabs = jQuery( this ).find( '.wpb_tour_tabs_wrapper' ).tabs( { 221 show: function ( event, ui ) { 222 wpb_prepare_tab_content( event, ui ); 223 }, 224 beforeActivate: function ( event, ui ) { 225 1 !== ui.newPanel.index() && ui.newPanel.find( '.vc_pie_chart:not(.vc_ready)' ); 226 }, 227 activate: function ( event, ui ) { 228 wpb_prepare_tab_content( event, ui ); 229 } 230 } ); 231 if ( interval && 0 < interval ) { 232 try { 233 $tabs.tabs( 'rotate', interval * 1000 ); 234 } catch ( e ) { 235 // nothing. 236 window.console && window.console.log && console.log( e ); 237 } 238 } 239 240 jQuery( this ).find( '.wpb_tab' ).each( function () { 241 tabs_array.push( this.id ); 242 } ); 243 244 jQuery( this ).find( '.wpb_tabs_nav li' ).click( function ( e ) { 245 e.preventDefault(); 246 if ( old_version ) { 247 $tabs.tabs( "select", jQuery( 'a', this ).attr( 'href' ) ); 248 } else { 249 $tabs.tabs( "option", "active", jQuery( this ).index() ); 250 } 251 return false;
252 } ); 253 254 jQuery( this ).find( '.wpb_prev_slide a, .wpb_next_slide a' ).click( function ( e ) { 255 e.preventDefault(); 256 if ( old_version ) { 257 var index = $tabs.tabs( 'option', 'selected' ); 258 if ( jQuery( this ).parent().hasClass( 'wpb_next_slide' ) ) { 259 index ++; 260 } 261 else { 262 index --; 263 } 264 if ( 0 > index ) { 265 index = $tabs.tabs( "length" ) - 1; 266 } 267 else if ( index >= $tabs.tabs( "length" ) ) { 268 index = 0; 269 } 270 $tabs.tabs( "select", index ); 271 } else { 272 var index = $tabs.tabs( "option", "active" ), 273 length = $tabs.find( '.wpb_tab' ).length; 274 275 if ( jQuery( this ).parent().hasClass( 'wpb_next_slide' ) ) { 276 index = (index + 1) >= length ? 0 : index + 1; 277 } else { 278 index = 0 > index - 1 ? length - 1 : index - 1; 279 } 280 281 $tabs.tabs( "option", "active", index ); 282 } 283 284 } ); 285 286 } ); 287 } 288 } 289} 290 291/* Tabs + Tours 292 ---------------------------------------------------------- */ 293if ( 'function' !== typeof(window[ 'vc_accordionBehaviour' ]) ) { 294 window.vc_accordionBehaviour = function () { 295 jQuery( '.wpb_accordion' ).each( function ( index ) { 296 var $this = jQuery( this ); 297 var $tabs, 298 interval = $this.attr( "data-interval" ), 299 active_tab = ! isNaN( jQuery( this ).data( 'active-tab' ) ) && 0 < parseInt( $this.data( 'active-tab' ) ) ? parseInt( $this.data( 'active-tab' ) ) - 1 : false, 300 collapsible = false === active_tab || 'yes' === $this.data( 'collapsible' ); 301 $tabs = $this.find( '.wpb_accordion_wrapper' ).accordion( { 302 header: "> div > h3", 303 autoHeight: false, 304 heightStyle: "content", 305 active: active_tab, 306 collapsible: collapsible, 307 navigation: true, 308 309 activate: vc_accordionActivate, 310 change: function ( event, ui ) { 311 if ( 'undefined' !== typeof(jQuery.fn.isotope) ) { 312 ui.newContent.find( '.isotope' ).isotope( "layout" ); 313 } 314 vc_carouselBehaviour( ui.newPanel ); 315 } 316 } ); 317 if ( true === $this.data( 'vcDisableKeydown' ) ) { 318 $tabs.data( 'uiAccordion' )._keydown = function () { 319 }; 320 } 321 } ); 322 } 323} 324 325/* Teaser grid: isotope 326 ---------------------------------------------------------- */ 327if ( 'function' !== typeof(window[ 'vc_teaserGrid' ]) ) { 328 window.vc_teaserGrid = function () { 329 var layout_modes = { 330 fitrows: 'fitRows', 331 masonry: 'masonry' 332 }; 333 jQuery( '.wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)' ).each( function () { 334 var $container = jQuery( this ); 335 var $thumbs = $container.find( '.wpb_thumbnails' ); 336 var layout_mode = $thumbs.attr( 'data-layout-mode' ); 337 $thumbs.isotope( { 338 // options 339 itemSelector: '.isotope-item', 340 layoutMode: ('undefined' === typeof(layout_modes[ layout_mode ]) ? 'fitRows' : layout_modes[ layout_mode ]) 341 } ); 342 $container.find( '.categories_filter a' ).data( 'isotope', $thumbs ).click( function ( e ) { 343 e.preventDefault(); 344 var $thumbs = jQuery( this ).data( 'isotope' ); 345 jQuery( this ).parent().parent().find( '.active' ).removeClass( 'active' ); 346 jQuery( this ).parent().addClass( 'active' ); 347 $thumbs.isotope( { filter: jQuery( this ).attr( 'data-filter' ) } ); 348 } ); 349 jQuery( window ).bind( 'load resize', function () { 350 $thumbs.isotope( "layout" ); 351 } ); 352 } ); 353 } 354} 355 356if ( 'function' !== typeof(window[ 'vc_carouselBehaviour' ]) ) { 357 window.vc_carouselBehaviour = function ( $parent ) { 358 var $carousel = $parent ? $parent.find( ".wpb_carousel" ) : jQuery( ".wpb_carousel" ); 359 $carousel.each( function () { 360 var $this = jQuery( this ); 361 if ( true !== $this.data( 'carousel_enabled' ) && $this.is( ':visible' ) ) { 362 $this.data( 'carousel_enabled', true ); 363 var visible_count = getColumnsCount( jQuery( this ) ), 364 carousel_speed = 500; 365 if ( jQuery( this ).hasClass( 'columns_count_1' ) ) { 366 carousel_speed = 900; 367 } 368 /* Get margin-left value from the css grid and apply it to the carousele li items (margin-right), before carousele initialization */ 369 var carousele_li = jQuery( this ).find( '.wpb_thumbnails-fluid li' ); 370 carousele_li.css( { "margin-right": carousele_li.css( "margin-left" ), "margin-left": 0 } ); 371 372 jQuery( this ).find( '.wpb_wrapper:eq(0)' ).jCarouselLite( { 373 btnNext: jQuery( this ).find( '.next' ), 374 btnPrev: jQuery( this ).find( '.prev' ), 375 visible: visible_count, 376 speed: carousel_speed 377 } ) 378 .width( '100%' ); 379 380 var fluid_ul = jQuery( this ).find( 'ul.wpb_thumbnails-fluid' ); 381 fluid_ul.width( fluid_ul.width() + 300 ); 382 383 jQuery( window ).resize( function () { 384 var before_resize = screen_size; 385 screen_size = getSizeName(); 386 if ( before_resize != screen_size ) { 387 window.setTimeout( 'location.reload()', 20 ); 388 } 389 } ); 390 } 391 392 } ); 393 } 394} 395 396if ( 'function' !== typeof(window[ 'vc_slidersBehaviour' ]) ) { 397 window.vc_slidersBehaviour = function () { 398 jQuery( '.wpb_gallery_slides' ).each( function ( index ) { 399 var this_element = jQuery( this ); 400 var $imagesGrid; 401 402 if ( this_element.hasClass( 'wpb_slider_nivo' ) ) { 403 var sliderSpeed = 800, 404 sliderTimeout = this_element.attr( 'data-interval' ) * 1000; 405 406 if ( 0 === sliderTimeout ) { 407 sliderTimeout = 9999999999; 408 } 409 410 this_element.find( '.nivoSlider' ).nivoSlider( {
411 effect: 'boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse', // Specify sets like: 'fold,fade,sliceDown' 412 slices: 15, // For slice animations 413 boxCols: 8, // For box animations 414 boxRows: 4, // For box animations 415 animSpeed: sliderSpeed, // Slide transition speed 416 pauseTime: sliderTimeout, // How long each slide will show 417 startSlide: 0, // Set starting Slide (0 index) 418 directionNav: true, // Next & Prev navigation 419 directionNavHide: true, // Only show on hover 420 controlNav: true, // 1,2,3... navigation 421 keyboardNav: false, // Use left & right arrows 422 pauseOnHover: true, // Stop animation while hovering 423 manualAdvance: false, // Force manual transitions 424 prevText: 'Prev', // Prev directionNav text 425 nextText: 'Next' // Next directionNav text 426 } ); 427 } 428 else if ( this_element.hasClass( 'wpb_image_grid' ) ) { 429 if ( jQuery.fn.imagesLoaded ) { 430 $imagesGrid = this_element.find( '.wpb_image_grid_ul' ).imagesLoaded( function () { 431 $imagesGrid.isotope( { 432 // options 433 itemSelector: '.isotope-item', 434 layoutMode: 'fitRows' 435 } ); 436 } ); 437 } else { 438 this_element.find( '.wpb_image_grid_ul' ).isotope( { 439 // options 440 itemSelector: '.isotope-item', 441 layoutMode: 'fitRows' 442 } ); 443 } 444 } 445 } ); 446 } 447} 448 449if ( 'function' !== typeof(window[ 'vc_prettyPhoto' ]) ) { 450 window.vc_prettyPhoto = function () { 451 try { 452 // just in case. maybe prettyphoto isn't loaded on this site 453 if ( jQuery && jQuery.fn && jQuery.fn.prettyPhoto ) { 454 jQuery( 'a.prettyphoto, .gallery-icon a[href*=".jpg"]' ).prettyPhoto( { 455 animationSpeed: 'normal', /* fast/slow/normal */ 456 padding: 15, /* padding for each side of the picture */ 457 opacity: 0.7, /* Value betwee 0 and 1 */ 458 showTitle: true, /* true/false */ 459 allowresize: true, /* true/false */ 460 counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ 461 //theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */ 462 hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ 463 deeplinking: false, /* Allow prettyPhoto to update the url to enable deeplinking. */ 464 modal: false, /* If set to true, only the close button will close the window */ 465 callback: function () { 466 var url = location.href; 467 var hashtag = (url.indexOf( '#!prettyPhoto' )) ? true : false; 468 if ( hashtag ) { 469 location.hash = "!"; 470 } 471 } /* Called when prettyPhoto is closed */, 472 social_tools: '' 473 } ); 474 } 475 } catch ( err ) { 476 window.console && window.console.log && console.log( err ); 477 } 478 } 479} 480 481if ( 'function' !== typeof(window[ 'vc_google_fonts' ]) ) { 482 window.vc_google_fonts = function () { 483 return false; // TODO: check this for what this is needed 484 } 485} 486window.vcParallaxSkroll = false; 487if ( 'function' !== typeof(window[ 'vc_rowBehaviour' ]) ) { 488 window.vc_rowBehaviour = function () { 489 var $ = window.jQuery; 490 491 function localFunction() { 492 var $elements = $( '[data-vc-full-width="true"]' ); 493 $.each( $elements, function ( key, item ) { 494 var $el = $( this ); 495 $el.addClass( 'vc_hidden' ); 496 497 var $el_full = $el.next( '.vc_row-full-width' ); 498 var el_margin_left = parseInt( $el.css( 'margin-left' ), 10 ); 499 var el_margin_right = parseInt( $el.css( 'margin-right' ), 10 ); 500 var offset = 0 - $el_full.offset().left - el_margin_left; 501 var width = $( window ).width(); 502 $el.css( { 503 'position': 'relative', 504 'left': offset, 505 'box-sizing': 'border-box', 506 'width': $( window ).width() 507 } ); 508 if ( ! $el.data( 'vcStretchContent' ) ) { 509 var padding = (- 1 * offset); 510 if ( 0 > padding ) { 511 padding = 0; 512 } 513 var paddingRight = width - padding - $el_full.width() + el_margin_left + el_margin_right; 514 if ( 0 > paddingRight ) { 515 paddingRight = 0; 516 } 517 $el.css( { 'padding-left': padding + 'px', 'padding-right': paddingRight + 'px' } ); 518 } 519 $el.attr( "data-vc-full-width-init", "true" ); 520 $el.removeClass( 'vc_hidden' ); 521 } ); 522 } 523 524 /** 525 * @todo refactor as plugin. 526 * @returns {*} 527 */
528 function parallaxRow() { 529 var vcSkrollrOptions, vcParallaxSkroll, 530 callSkrollInit = false; 531 if ( vcParallaxSkroll ) { 532 vcParallaxSkroll.destroy(); 533 } 534 $( '.vc_parallax-inner' ).remove(); 535 $( '[data-5p-top-bottom]' ).removeAttr( 'data-5p-top-bottom data-30p-top-bottom' ); 536 $( '[data-vc-parallax]' ).each( function () { 537 var skrollrSpeed, 538 skrollrSize, 539 skrollrStart, 540 skrollrEnd, 541 $parallaxElement, 542 parallaxImage, 543 youtubeId; 544 callSkrollInit = true; // Enable skrollinit; 545 if ( 'on' === $( this ).data( 'vcParallaxOFade' ) ) { 546 $( this ).children().attr( 'data-5p-top-bottom', 'opacity:0;' ).attr( 'data-30p-top-bottom', 547 'opacity:1;' ); 548 } 549 550 skrollrSize = $( this ).data( 'vcParallax' ) * 100; 551 $parallaxElement = $( '<div />' ).addClass( 'vc_parallax-inner' ).appendTo( $( this ) ); 552 $parallaxElement.height( skrollrSize + '%' ); 553 554 parallaxImage = $( this ).data( 'vcParallaxImage' ); 555 556 youtubeId = vcExtractYoutubeId( parallaxImage ); 557 558 if ( youtubeId ) { 559 insertYoutubeVideoAsBackground( $parallaxElement, youtubeId ); 560 } else if ( 'undefined' !== typeof(parallaxImage) ) { 561 $parallaxElement.css( 'background-image', 'url(' + parallaxImage + ')' ); 562 } 563 564 skrollrSpeed = skrollrSize - 100; 565 skrollrStart = - skrollrSpeed; 566 skrollrEnd = 0; 567 568 $parallaxElement.attr( 'data-bottom-top', 'top: ' + skrollrStart + '%;' ).attr( 'data-top-bottom', 569 'top: ' + skrollrEnd + '%;' ); 570 } ); 571 572 if ( callSkrollInit && window.skrollr ) { 573 vcSkrollrOptions = { 574 forceHeight: false, 575 smoothScrolling: false, 576 mobileCheck: function () { 577 return false; 578 } 579 }; 580 vcParallaxSkroll = skrollr.init( vcSkrollrOptions ); 581 return vcParallaxSkroll; 582 } 583 return false; 584 } 585 586 /** 587 * @todo refactor as plugin. 588 * @returns {*} 589 */ 590 function fullHeightRow() { 591 $( '.vc_row-o-full-height:first' ).each( function () { 592 var $window, 593 windowHeight, 594 offsetTop, 595 fullHeight; 596 $window = $( window ); 597 windowHeight = $window.height(); 598 offsetTop = $( this ).offset().top; 599 if ( offsetTop < windowHeight ) { 600 fullHeight = 100 - offsetTop / (windowHeight / 100); 601 $( this ).css( 'min-height', fullHeight + 'vh' ); 602 } 603 } ); 604 605 $( '.vc_row-o-full-height.vc_row-o-content-middle' ).each( function () { 606 var elHeight = $( this ).height(); 607 $( '<div><!-- IE flexbox min height vertical align fixer --></div>' ) 608 .addClass( 'vc_row-full-height-fixer' ) 609 .height( elHeight ) 610 .prependTo( $( this ) ); 611 } ); 612 } 613 614 $( window ).unbind( 'resize.vcRowBehaviour' ).bind( 'resize.vcRowBehaviour', localFunction ); 615 $( window ).bind( 'resize.vcRowBehaviour', fullHeightRow ); 616 localFunction(); 617 fullHeightRow(); 618 initVideoBackgrounds(); // must be called before parallax 619 parallaxRow(); 620 } 621} 622 623if ( 'function' !== typeof(window[ 'vc_gridBehaviour' ]) ) { 624 window.vc_gridBehaviour = function () { 625 jQuery.fn.vcGrid && jQuery( '[data-vc-grid]' ).vcGrid(); 626 } 627} 628/* Helper 629 ---------------------------------------------------------- */ 630if ( 'function' !== typeof(window[ 'getColumnsCount' ]) ) { 631 window.getColumnsCount = function ( el ) { 632 var find = false, 633 i = 1; 634 635 while ( false === find ) { 636 if ( el.hasClass( 'columns_count_' + i ) ) { 637 find = true; 638 return i; 639 } 640 i ++; 641 } 642 } 643} 644 645var screen_size = getSizeName(); 646function getSizeName() { 647 var screen_w = jQuery( window ).width(); 648 649 if ( 1170 < screen_w ) { 650 return 'desktop_wide'; 651 } 652 653 if ( 960 < screen_w && 1169 > screen_w ) { 654 return 'desktop'; 655 } 656 657 if ( 768 < screen_w && 959 > screen_w ) { 658 return 'tablet'; 659 } 660 661 if ( 300 < screen_w && 767 > screen_w ) { 662 return 'mobile'; 663 } 664 665 if ( 300 > screen_w ) { 666 return 'mobile_portrait'; 667 } 668 669 return ''; 670} 671 672function loadScript( url, $obj, callback ) { 673 674 var script = document.createElement( "script" ); 675 script.type = "text/javascript"; 676 677 if ( script.readyState ) { //IE 678 script.onreadystatechange = function () { 679 if ( "loaded" === script.readyState || 680 "complete" === script.readyState ) { 681 script.onreadystatechange = null; 682 callback(); 683 } 684 }; 685 } else { 686 //Others 687 } 688 689 script.src = url; 690 $obj.get( 0 ).appendChild( script ); 691} 692 693if ( 'function' !== typeof(window[ 'wpb_prepare_tab_content' ]) ) { 694 /** 695 * Prepare html to correctly display inside tab container 696 * 697 * @param event - ui tab event 'show' 698 * @param ui - jquery ui tabs object 699 */ 700 window.wpb_prepare_tab_content = function ( event, ui ) { 701 var panel = ui.panel || ui.newPanel, 702 $pie_charts = panel.find( '.vc_pie_chart:not(.vc_ready)' ), 703 $round_charts = panel.find( '.vc_round-chart' ), 704 $line_charts = panel.find( '.vc_line-chart' ), 705 $carousel = panel.find( '[data-ride="vc_carousel"]' ), 706 $ui_panel, $google_maps; 707 vc_carouselBehaviour(); 708 vc_plugin_flexslider( panel ); 709 if ( ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) { 710 ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () { 711 var grid = jQuery( this ).data( 'vcGrid' ); 712 grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry(); 713 } ); 714 } 715 if ( panel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) { 716 panel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () { 717 var grid = jQuery( this ).data( 'vcGrid' ); 718 grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry(); 719 } ); 720 } 721 $pie_charts.length && jQuery.fn.vcChat && $pie_charts.vcChat(); 722 $round_charts.length && jQuery.fn.vcRoundChart && $round_charts.vcRoundChart( { reload: false } ); 723 $line_charts.length && jQuery.fn.vcLineChart && $line_charts.vcLineChart( { reload: false } ); 724 $carousel.length && jQuery.fn.carousel && $carousel.carousel( 'resizeAction' ); 725 $ui_panel = panel.find( '.isotope, .wpb_image_grid_ul' ); // why var name '$ui_panel'? 726 $google_maps = panel.find( '.wpb_gmaps_widget' ); 727 if ( 0 < $ui_panel.length ) { 728 $ui_panel.isotope( "layout" ); 729 } 730 if ( $google_maps.length && ! $google_maps.is( '.map_ready' ) ) { 731 var $frame = $google_maps.find( 'iframe' ); 732 $frame.attr( 'src', $frame.attr( 'src' ) ); 733 $google_maps.addClass( 'map_ready' ); 734 } 735 if ( panel.parents( '.isotope' ).length ) { 736 panel.parents( '.isotope' ).each( function () { 737 jQuery( this ).isotope( "layout" ); 738 } ); 739 } 740 } 741} 742function vc_ttaActivation() { 743 jQuery( '[data-vc-accordion]' ).on( 'show.vc.accordion', function ( e ) { 744 var $ = window.jQuery, ui = {}; 745 ui.newPanel = $( this ).data( 'vc.accordion' ).getTarget(); 746 window.wpb_prepare_tab_content( e, ui ); 747 } ); 748} 749 750function vc_accordionActivate( event, ui ) { 751 if ( ui.newPanel.length && ui.newHeader.length ) { 752 var $pie_charts = ui.newPanel.find( '.vc_pie_chart:not(.vc_ready)' ), 753 $round_charts = ui.newPanel.find( '.vc_round-chart' ), 754 $line_charts = ui.newPanel.find( '.vc_line-chart' ), 755 $carousel = ui.newPanel.find( '[data-ride="vc_carousel"]' ); 756 if ( 'undefined' !== typeof(jQuery.fn.isotope) ) { 757 ui.newPanel.find( '.isotope, .wpb_image_grid_ul' ).isotope( "layout" ); 758 } 759 if ( ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) { 760 ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () { 761 var grid = jQuery( this ).data( 'vcGrid' ); 762 grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry(); 763 } ); 764 } 765 vc_carouselBehaviour( ui.newPanel ); 766 vc_plugin_flexslider( ui.newPanel ); 767 $pie_charts.length && jQuery.fn.vcChat && $pie_charts.vcChat(); 768 $round_charts.length && jQuery.fn.vcRoundChart && $round_charts.vcRoundChart( { reload: false } ); 769 $line_charts.length && jQuery.fn.vcLineChart && $line_charts.vcLineChart( { reload: false } ); 770 $carousel.length && jQuery.fn.carousel && $carousel.carousel( 'resizeAction' ); 771 if ( ui.newPanel.parents( '.isotope' ).length ) { 772 ui.newPanel.parents( '.isotope' ).each( function () { 773 jQuery( this ).isotope( "layout" ); 774 } ); 775 } 776 } 777} 778 779/** 780 * Reinitialize all video backgrounds 781 */
782function initVideoBackgrounds() { 783 jQuery( '.vc_row' ).each( function () { 784 var $row = jQuery( this ), 785 youtubeUrl, 786 youtubeId; 787 788 if ( $row.data( 'vcVideoBg' ) ) { 789 youtubeUrl = $row.data( 'vcVideoBg' ); 790 youtubeId = vcExtractYoutubeId( youtubeUrl ); 791 792 if ( youtubeId ) { 793 $row.find( '.vc_video-bg' ).remove(); 794 insertYoutubeVideoAsBackground( $row, youtubeId ); 795 } 796 797 jQuery( window ).on( 'grid:items:added', function ( event, $grid ) { 798 if ( ! $row.has( $grid ).length ) { 799 return; 800 } 801 802 vcResizeVideoBackground( $row ); 803 } ); 804 } else { 805 $row.find( '.vc_video-bg' ).remove(); 806 } 807 } ); 808} 809 810/** 811 * Insert youtube video into element. 812 * 813 * Video will be w/o controls, muted, autoplaying and looping. 814 */ 815function insertYoutubeVideoAsBackground( $element, youtubeId, counter ) { 816 if ( 'undefined' === typeof( YT.Player ) ) { 817 // wait for youtube iframe api to load. try for 10sec, then abort 818 counter = 'undefined' === typeof( counter ) ? 0 : counter; 819 if ( 100 < counter ) { 820 console.warn( 'Too many attempts to load YouTube api' ); 821 return; 822 } 823 824 setTimeout( function () { 825 insertYoutubeVideoAsBackground( $element, youtubeId, counter ++ ); 826 }, 100 ); 827 828 return; 829 } 830 831 var $container = $element.prepend( '<div class="vc_video-bg"><div class="inner"></div></div>' ).find( '.inner' ); 832 833 new YT.Player( $container[ 0 ], { 834 width: '100%', 835 height: '100%', 836 videoId: youtubeId, 837 playerVars: { 838 playlist: youtubeId, 839 iv_load_policy: 3, // hide annotations 840 enablejsapi: 1, 841 disablekb: 1, 842 autoplay: 1, 843 controls: 0, 844 showinfo: 0, 845 rel: 0, 846 loop: 1 847 }, 848 events: { 849 onReady: function ( event ) { 850 event.target.mute().setLoop( true ); 851 } 852 } 853 } ); 854 855 vcResizeVideoBackground( $element ); 856 857 jQuery( window ).bind( 'resize', function () { 858 vcResizeVideoBackground( $element ); 859 } ); 860} 861 862/** 863 * Resize background video iframe so that video content covers whole area 864 */ 865function vcResizeVideoBackground( $element ) { 866 var iframeW, 867 iframeH, 868 marginLeft, 869 marginTop, 870 containerW = $element.innerWidth(), 871 containerH = $element.innerHeight(), 872 ratio1 = 16, 873 ratio2 = 9; 874 875 if ( ( containerW / containerH ) < ( ratio1 / ratio2 ) ) { 876 iframeW = containerH * (ratio1 / ratio2); 877 iframeH = containerH; 878 879 marginLeft = - Math.round( ( iframeW - containerW ) / 2 ) + 'px'; 880 marginTop = - Math.round( ( iframeH - containerH ) / 2 ) + 'px'; 881 882 iframeW += 'px'; 883 iframeH += 'px'; 884 } else { 885 iframeW = containerW; 886 iframeH = containerW * (ratio2 / ratio1); 887 888 marginTop = - Math.round( ( iframeH - containerH ) / 2 ) + 'px'; 889 marginLeft = - Math.round( ( iframeW - containerW ) / 2 ) + 'px'; 890 891 iframeW += 'px'; 892 iframeH += 'px'; 893 } 894 895 $element.find( '.vc_video-bg iframe' ).css( { 896 maxWidth: '1000%', 897 marginLeft: marginLeft, 898 marginTop: marginTop, 899 width: iframeW, 900 height: iframeH 901 } ); 902} 903 904/** 905 * Extract video ID from youtube url 906 */ 907function vcExtractYoutubeId( url ) { 908 if ( 'undefined' === typeof(url) ) { 909 return false; 910 } 911 912 var id = url.match( /(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/ ); 913 914 if ( null !== id ) { 915 return id[ 1 ]; 916 } 917 918 return false; 919}
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.