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 var $elcss = { 503 'position': 'relative', 504 'box-sizing': 'border-box', 505 'width': $( window ).width() 506 }; 507 if( $( 'body' ).hasClass( 'rtl' ) ) 508 { 509 $elcss[ 'right' ] = offset; 510 } 511 else 512 { 513 $elcss[ 'left' ] = offset; 514 } 515 $el.css( $elcss ); 516 if ( ! $el.data( 'vcStretchContent' ) ) { 517 var padding = (- 1 * offset); 518 if ( 0 > padding ) { 519 padding = 0; 520 } 521 var paddingRight = width - padding - $el_full.width() + el_margin_left + el_margin_right; 522 if ( 0 > paddingRight ) { 523 paddingRight = 0; 524 } 525 $el.css( { 'padding-left': padding + 'px', 'padding-right': paddingRight + 'px' } ); 526 } 527 $el.attr( "data-vc-full-width-init", "true" ); 528 $el.removeClass( 'vc_hidden' ); 529 } ); 530 } 531 532 /** 533 * @todo refactor as plugin. 534 * @returns {*} 535 */
536 function parallaxRow() { 537 var vcSkrollrOptions, vcParallaxSkroll, 538 callSkrollInit = false; 539 if ( vcParallaxSkroll ) { 540 vcParallaxSkroll.destroy(); 541 } 542 $( '.vc_parallax-inner' ).remove(); 543 $( '[data-5p-top-bottom]' ).removeAttr( 'data-5p-top-bottom data-30p-top-bottom' ); 544 $( '[data-vc-parallax]' ).each( function () { 545 var skrollrSpeed, 546 skrollrSize, 547 skrollrStart, 548 skrollrEnd, 549 $parallaxElement, 550 parallaxImage, 551 youtubeId; 552 callSkrollInit = true; // Enable skrollinit; 553 if ( 'on' === $( this ).data( 'vcParallaxOFade' ) ) { 554 $( this ).children().attr( 'data-5p-top-bottom', 'opacity:0;' ).attr( 'data-30p-top-bottom', 555 'opacity:1;' ); 556 } 557 558 skrollrSize = $( this ).data( 'vcParallax' ) * 100; 559 $parallaxElement = $( '<div />' ).addClass( 'vc_parallax-inner' ).appendTo( $( this ) ); 560 $parallaxElement.height( skrollrSize + '%' ); 561 562 parallaxImage = $( this ).data( 'vcParallaxImage' ); 563 564 youtubeId = vcExtractYoutubeId( parallaxImage ); 565 566 if ( youtubeId ) { 567 insertYoutubeVideoAsBackground( $parallaxElement, youtubeId ); 568 } else if ( 'undefined' !== typeof(parallaxImage) ) { 569 $parallaxElement.css( 'background-image', 'url(' + parallaxImage + ')' ); 570 } 571 572 skrollrSpeed = skrollrSize - 100; 573 skrollrStart = - skrollrSpeed; 574 skrollrEnd = 0; 575 576 $parallaxElement.attr( 'data-bottom-top', 'top: ' + skrollrStart + '%;' ).attr( 'data-top-bottom', 577 'top: ' + skrollrEnd + '%;' ); 578 } ); 579 580 if ( callSkrollInit && window.skrollr ) { 581 vcSkrollrOptions = { 582 forceHeight: false, 583 smoothScrolling: false, 584 mobileCheck: function () { 585 return false; 586 } 587 }; 588 vcParallaxSkroll = skrollr.init( vcSkrollrOptions ); 589 return vcParallaxSkroll; 590 } 591 return false; 592 } 593 594 /** 595 * @todo refactor as plugin. 596 * @returns {*} 597 */ 598 function fullHeightRow() { 599 $( '.vc_row-o-full-height:first' ).each( function () { 600 var $window, 601 windowHeight, 602 offsetTop, 603 fullHeight; 604 $window = $( window ); 605 windowHeight = $window.height(); 606 offsetTop = $( this ).offset().top; 607 if ( offsetTop < windowHeight ) { 608 fullHeight = 100 - offsetTop / (windowHeight / 100); 609 $( this ).css( 'min-height', fullHeight + 'vh' ); 610 } 611 } ); 612 613 $( '.vc_row-o-full-height.vc_row-o-content-middle' ).each( function () { 614 var elHeight = $( this ).height(); 615 $( '<div><!-- IE flexbox min height vertical align fixer --></div>' ) 616 .addClass( 'vc_row-full-height-fixer' ) 617 .height( elHeight ) 618 .prependTo( $( this ) ); 619 } ); 620 } 621 622 $( window ).unbind( 'resize.vcRowBehaviour' ).bind( 'resize.vcRowBehaviour', localFunction ); 623 $( window ).bind( 'resize.vcRowBehaviour', fullHeightRow ); 624 localFunction(); 625 fullHeightRow(); 626 initVideoBackgrounds(); // must be called before parallax 627 parallaxRow(); 628 } 629} 630 631if ( 'function' !== typeof(window[ 'vc_gridBehaviour' ]) ) { 632 window.vc_gridBehaviour = function () { 633 jQuery.fn.vcGrid && jQuery( '[data-vc-grid]' ).vcGrid(); 634 } 635} 636/* Helper 637 ---------------------------------------------------------- */ 638if ( 'function' !== typeof(window[ 'getColumnsCount' ]) ) { 639 window.getColumnsCount = function ( el ) { 640 var find = false, 641 i = 1; 642 643 while ( false === find ) { 644 if ( el.hasClass( 'columns_count_' + i ) ) { 645 find = true; 646 return i; 647 } 648 i ++; 649 } 650 } 651} 652 653var screen_size = getSizeName(); 654function getSizeName() { 655 var screen_w = jQuery( window ).width(); 656 657 if ( 1170 < screen_w ) { 658 return 'desktop_wide'; 659 } 660 661 if ( 960 < screen_w && 1169 > screen_w ) { 662 return 'desktop'; 663 } 664 665 if ( 768 < screen_w && 959 > screen_w ) { 666 return 'tablet'; 667 } 668 669 if ( 300 < screen_w && 767 > screen_w ) { 670 return 'mobile'; 671 } 672 673 if ( 300 > screen_w ) { 674 return 'mobile_portrait'; 675 } 676 677 return ''; 678} 679 680function loadScript( url, $obj, callback ) { 681 682 var script = document.createElement( "script" ); 683 script.type = "text/javascript"; 684 685 if ( script.readyState ) { //IE 686 script.onreadystatechange = function () { 687 if ( "loaded" === script.readyState || 688 "complete" === script.readyState ) { 689 script.onreadystatechange = null; 690 callback(); 691 } 692 }; 693 } else { 694 //Others 695 } 696 697 script.src = url; 698 $obj.get( 0 ).appendChild( script ); 699} 700 701if ( 'function' !== typeof(window[ 'wpb_prepare_tab_content' ]) ) { 702 /** 703 * Prepare html to correctly display inside tab container 704 * 705 * @param event - ui tab event 'show' 706 * @param ui - jquery ui tabs object 707 */ 708 window.wpb_prepare_tab_content = function ( event, ui ) { 709 var panel = ui.panel || ui.newPanel, 710 $pie_charts = panel.find( '.vc_pie_chart:not(.vc_ready)' ), 711 $round_charts = panel.find( '.vc_round-chart' ), 712 $line_charts = panel.find( '.vc_line-chart' ), 713 $carousel = panel.find( '[data-ride="vc_carousel"]' ), 714 $ui_panel, $google_maps; 715 vc_carouselBehaviour(); 716 vc_plugin_flexslider( panel ); 717 if ( ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) { 718 ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () { 719 var grid = jQuery( this ).data( 'vcGrid' ); 720 grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry(); 721 } ); 722 } 723 if ( panel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) { 724 panel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () { 725 var grid = jQuery( this ).data( 'vcGrid' ); 726 grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry(); 727 } ); 728 } 729 $pie_charts.length && jQuery.fn.vcChat && $pie_charts.vcChat(); 730 $round_charts.length && jQuery.fn.vcRoundChart && $round_charts.vcRoundChart( { reload: false } ); 731 $line_charts.length && jQuery.fn.vcLineChart && $line_charts.vcLineChart( { reload: false } ); 732 $carousel.length && jQuery.fn.carousel && $carousel.carousel( 'resizeAction' ); 733 $ui_panel = panel.find( '.isotope, .wpb_image_grid_ul' ); // why var name '$ui_panel'? 734 $google_maps = panel.find( '.wpb_gmaps_widget' ); 735 if ( 0 < $ui_panel.length ) { 736 $ui_panel.isotope( "layout" ); 737 } 738 if ( $google_maps.length && ! $google_maps.is( '.map_ready' ) ) { 739 var $frame = $google_maps.find( 'iframe' ); 740 $frame.attr( 'src', $frame.attr( 'src' ) ); 741 $google_maps.addClass( 'map_ready' ); 742 } 743 if ( panel.parents( '.isotope' ).length ) { 744 panel.parents( '.isotope' ).each( function () { 745 jQuery( this ).isotope( "layout" ); 746 } ); 747 } 748 } 749} 750function vc_ttaActivation() { 751 jQuery( '[data-vc-accordion]' ).on( 'show.vc.accordion', function ( e ) { 752 var $ = window.jQuery, ui = {}; 753 ui.newPanel = $( this ).data( 'vc.accordion' ).getTarget(); 754 window.wpb_prepare_tab_content( e, ui ); 755 } ); 756} 757 758function vc_accordionActivate( event, ui ) { 759 if ( ui.newPanel.length && ui.newHeader.length ) { 760 var $pie_charts = ui.newPanel.find( '.vc_pie_chart:not(.vc_ready)' ), 761 $round_charts = ui.newPanel.find( '.vc_round-chart' ), 762 $line_charts = ui.newPanel.find( '.vc_line-chart' ), 763 $carousel = ui.newPanel.find( '[data-ride="vc_carousel"]' ); 764 if ( 'undefined' !== typeof(jQuery.fn.isotope) ) { 765 ui.newPanel.find( '.isotope, .wpb_image_grid_ul' ).isotope( "layout" ); 766 } 767 if ( ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).length ) { 768 ui.newPanel.find( '.vc_masonry_media_grid, .vc_masonry_grid' ).each( function () { 769 var grid = jQuery( this ).data( 'vcGrid' ); 770 grid && grid.gridBuilder && grid.gridBuilder.setMasonry && grid.gridBuilder.setMasonry(); 771 } ); 772 } 773 vc_carouselBehaviour( ui.newPanel ); 774 vc_plugin_flexslider( ui.newPanel ); 775 $pie_charts.length && jQuery.fn.vcChat && $pie_charts.vcChat(); 776 $round_charts.length && jQuery.fn.vcRoundChart && $round_charts.vcRoundChart( { reload: false } ); 777 $line_charts.length && jQuery.fn.vcLineChart && $line_charts.vcLineChart( { reload: false } ); 778 $carousel.length && jQuery.fn.carousel && $carousel.carousel( 'resizeAction' ); 779 if ( ui.newPanel.parents( '.isotope' ).length ) { 780 ui.newPanel.parents( '.isotope' ).each( function () { 781 jQuery( this ).isotope( "layout" ); 782 } ); 783 } 784 } 785} 786 787/** 788 * Reinitialize all video backgrounds 789 */
790function initVideoBackgrounds() { 791 jQuery( '.vc_row' ).each( function () { 792 var $row = jQuery( this ), 793 youtubeUrl, 794 youtubeId; 795 796 if ( $row.data( 'vcVideoBg' ) ) { 797 youtubeUrl = $row.data( 'vcVideoBg' ); 798 youtubeId = vcExtractYoutubeId( youtubeUrl ); 799 800 if ( youtubeId ) { 801 $row.find( '.vc_video-bg' ).remove(); 802 insertYoutubeVideoAsBackground( $row, youtubeId ); 803 } 804 805 jQuery( window ).on( 'grid:items:added', function ( event, $grid ) { 806 if ( ! $row.has( $grid ).length ) { 807 return; 808 } 809 810 vcResizeVideoBackground( $row ); 811 } ); 812 } else { 813 $row.find( '.vc_video-bg' ).remove(); 814 } 815 } ); 816} 817 818/** 819 * Insert youtube video into element. 820 * 821 * Video will be w/o controls, muted, autoplaying and looping. 822 */ 823function insertYoutubeVideoAsBackground( $element, youtubeId, counter ) { 824 if ( 'undefined' === typeof( YT.Player ) ) { 825 // wait for youtube iframe api to load. try for 10sec, then abort 826 counter = 'undefined' === typeof( counter ) ? 0 : counter; 827 if ( 100 < counter ) { 828 console.warn( 'Too many attempts to load YouTube api' ); 829 return; 830 } 831 832 setTimeout( function () { 833 insertYoutubeVideoAsBackground( $element, youtubeId, counter ++ ); 834 }, 100 ); 835 836 return; 837 } 838 839 var $container = $element.prepend( '<div class="vc_video-bg"><div class="inner"></div></div>' ).find( '.inner' ); 840 841 new YT.Player( $container[ 0 ], { 842 width: '100%', 843 height: '100%', 844 videoId: youtubeId, 845 playerVars: { 846 playlist: youtubeId, 847 iv_load_policy: 3, // hide annotations 848 enablejsapi: 1, 849 disablekb: 1, 850 autoplay: 1, 851 controls: 0, 852 showinfo: 0, 853 rel: 0, 854 loop: 1 855 }, 856 events: { 857 onReady: function ( event ) { 858 event.target.mute().setLoop( true ); 859 } 860 } 861 } ); 862 863 vcResizeVideoBackground( $element ); 864 865 jQuery( window ).bind( 'resize', function () { 866 vcResizeVideoBackground( $element ); 867 } ); 868} 869 870/** 871 * Resize background video iframe so that video content covers whole area 872 */ 873function vcResizeVideoBackground( $element ) { 874 var iframeW, 875 iframeH, 876 marginLeft, 877 marginTop, 878 containerW = $element.innerWidth(), 879 containerH = $element.innerHeight(), 880 ratio1 = 16, 881 ratio2 = 9; 882 883 if ( ( containerW / containerH ) < ( ratio1 / ratio2 ) ) { 884 iframeW = containerH * (ratio1 / ratio2); 885 iframeH = containerH; 886 887 marginLeft = - Math.round( ( iframeW - containerW ) / 2 ) + 'px'; 888 marginTop = - Math.round( ( iframeH - containerH ) / 2 ) + 'px'; 889 890 iframeW += 'px'; 891 iframeH += 'px'; 892 } else { 893 iframeW = containerW; 894 iframeH = containerW * (ratio2 / ratio1); 895 896 marginTop = - Math.round( ( iframeH - containerH ) / 2 ) + 'px'; 897 marginLeft = - Math.round( ( iframeW - containerW ) / 2 ) + 'px'; 898 899 iframeW += 'px'; 900 iframeH += 'px'; 901 } 902 903 $element.find( '.vc_video-bg iframe' ).css( { 904 maxWidth: '1000%', 905 marginLeft: marginLeft, 906 marginTop: marginTop, 907 width: iframeW, 908 height: iframeH 909 } ); 910} 911 912/** 913 * Extract video ID from youtube url 914 */ 915function vcExtractYoutubeId( url ) { 916 if ( 'undefined' === typeof(url) ) { 917 return false; 918 } 919 920 var id = url.match( /(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/ ); 921 922 if ( null !== id ) { 923 return id[ 1 ]; 924 } 925 926 return false; 927}
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.