1var THEMEVISION = THEMEVISION || {}; 2 3(function($){ 4 5 "use strict"; 6 7 THEMEVISION.initialize = { 8 9 init: function(){ 10 11 THEMEVISION.initialize.responsiveClasses(); 12 THEMEVISION.initialize.slider(); 13 THEMEVISION.initialize.categoryChildren(); 14 THEMEVISION.initialize.goToTop(); 15 THEMEVISION.initialize.verticalMiddle(); 16 THEMEVISION.initialize.lightbox(); 17 THEMEVISION.initialize.resizeVideos(); 18 THEMEVISION.initialize.imageFade(); 19 /*THEMEVISION.initialize.pageTransition();*/ 20 21 }, 22 23 responsiveClasses: function(){ 24 var jRes = jRespond([ 25 { 26 label: 'smallest', 27 enter: 0, 28 exit: 479 29 },{ 30 label: 'handheld', 31 enter: 480, 32 exit: 767 33 },{ 34 label: 'tablet', 35 enter: 768, 36 exit: 991 37 },{ 38 label: 'laptop', 39 enter: 992, 40 exit: 1199 41 },{ 42 label: 'desktop', 43 enter: 1200, 44 exit: 10000 45 } 46 ]); 47 jRes.addFunc([ 48 { 49 breakpoint: 'desktop', 50 enter: function() { $body.addClass('device-lg'); }, 51 exit: function() { $body.removeClass('device-lg'); } 52 },{ 53 breakpoint: 'laptop', 54 enter: function() { $body.addClass('device-md'); }, 55 exit: function() { $body.removeClass('device-md'); } 56 },{ 57 breakpoint: 'tablet', 58 enter: function() { $body.addClass('device-sm'); }, 59 exit: function() { $body.removeClass('device-sm'); } 60 },{ 61 breakpoint: 'handheld', 62 enter: function() { $body.addClass('device-xs'); }, 63 exit: function() { $body.removeClass('device-xs'); } 64 },{ 65 breakpoint: 'smallest', 66 enter: function() { $body.addClass('device-xxs'); }, 67 exit: function() { $body.removeClass('device-xxs'); } 68 } 69 ]); 70 }, 71 72 width: function() { 73 return $window.width(); 74 }, 75 76 height: function() { 77 return $window.height(); 78 }, 79 80 slider: function() { 81 if( agama_pro.slider !== '' && agama_pro.slider_img_1 !== '' ) { 82 83 var $height = agama_pro.slider_height + "%"; 84 85 if( $slider.hasClass('camera_wrap') ) { 86 $slider.camera({ 87 time: agama_pro.slider_time, 88 height: $height, 89 minHeight: '300px', 90 barPosition: 'top', 91 loader: agama_pro.slider_loader, 92 loaderColor: agama_pro.primary_color, 93 overlay: false, 94 fx: 'simpleFade', 95 pagination: false, 96 thumbnails: false, 97 transPeriod: 1000, 98 overlayer: false, 99 playPause: false, 100 hover: false, 101 }); 102 } 103 } 104 }, 105 106 categoryChildren: function() { 107 $(".cat-item").has("ul").addClass("cat-has-children"); 108 $(".children .cat-item").has("ul").addClass("subcat-has-children"); 109 110 var children = $(".cat-item .children"); 111 112 children.prev('a').click(function(event) { 113 event.preventDefault(); 114 $(this).next('.children').slideToggle(); 115 } 116 ); 117 118 $('.cat-has-children a').click(function (event) { 119 if ($(this).parent('li').hasClass('cat-open')) { 120 $(this).parent('li').removeClass('cat-open'); 121 } else { 122 $(this).parent('li').addClass('cat-open'); 123 } 124 }); 125 126 $('.subcat-has-children a').click(function (event) { 127 if ($(this).parent('li').hasClass('subcat-open')) { 128 $(this).parent('li').removeClass('subcat-open'); 129 } else { 130 $(this).parent('li').addClass('subcat-open'); 131 } 132 }); 133 134 $('.subcat-has-children').click(function (event) {}); 135 }, 136 137 goToTop: function(){ 138 $goToTopEl.click(function() { 139 $('body,html').stop(true).animate({scrollTop:0},400); 140 return false; 141 }); 142 }, 143 144 goToTopScroll: function(){ 145 if( $body.hasClass('device-lg') || $body.hasClass('device-md') || $body.hasClass('device-sm') ) { 146 if($window.scrollTop() > 450) { 147 $goToTopEl.fadeIn(); 148 } else { 149 $goToTopEl.fadeOut(); 150 } 151 } 152 }, 153 154 testimonialsGrid: function(){ 155 if( $testimonialsGridEl.length > 0 ) { 156 157 var attrs = { }; 158 159 $.each($(".testimonial-item")[0].attributes, function(idx, attr) { 160 attrs[attr.nodeName] = attr.nodeValue; 161 }); 162 163 $(".testimonial-item").replaceWith(function () { 164 return $("<li />", attrs).append($(this).contents()); 165 }); 166 167 if( $body.hasClass('device-sm') || $body.hasClass('device-md') || $body.hasClass('device-lg') ) { 168 var maxHeight = 0; 169 $testimonialsGridEl.each( function(){ 170 $(this).find("li > .testimonial").each(function(){ 171 if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } 172 }); 173 $(this).find("li").height(maxHeight); 174 maxHeight = 0; 175 }); 176 } else { 177 $testimonialsGridEl.find("li").css({ 'height': 'auto' }); 178 } 179 } 180 }, 181 182 verticalMiddle: function(){ 183 if( $verticalMiddleEl.length > 0 ) { 184 $verticalMiddleEl.each( function(){ 185 var element = $(this), 186 verticalMiddleH = element.outerHeight(), 187 headerHeight = $header.outerHeight(); 188 189 if( element.parents('#slider').length > 0 && !element.hasClass('ignore-header') ) { 190 if( $header.hasClass('transparent-header') && ( $body.hasClass('device-lg') || $body.hasClass('device-md') ) ) { 191 verticalMiddleH = verticalMiddleH - 70; 192 if( $slider.next('#header').length > 0 ) { verticalMiddleH = verticalMiddleH + headerHeight; } 193 } 194 } 195 196 if( $body.hasClass('device-xs') || $body.hasClass('device-xxs') ) { 197 if( element.parents('.full-screen').length && !element.parents('.force-full-screen').length ){ 198 element.css({ position: 'relative', top: '0', width: 'auto', marginTop: '0', padding: '60px 0' }).addClass('clearfix'); 199 } else { 200 element.css({ position: 'absolute', top: '50%', width: '100%', marginTop: -(verticalMiddleH/2)+'px' }); 201 } 202 } else { 203 element.css({ position: 'absolute', top: '50%', width: '100%', marginTop: -(verticalMiddleH/2)+'px' }); 204 } 205 }); 206 } 207 }, 208 209 lightbox: function(){ 210 var $lightboxImageEl = $('[data-lightbox="image"]'), 211 $lightboxGalleryEl = $('[data-lightbox="gallery"]'), 212 $lightboxIframeEl = $('[data-lightbox="iframe"]'); 213 214 if( $lightboxImageEl.length > 0 ) { 215 $lightboxImageEl.magnificPopup({ 216 type: 'image', 217 closeOnContentClick: true, 218 closeBtnInside: false, 219 fixedContentPos: true, 220 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 221 image: { 222 verticalFit: true 223 } 224 }); 225 } 226 227 if( $lightboxGalleryEl.length > 0 ) { 228 $lightboxGalleryEl.each(function() { 229 var element = $(this); 230 231 if( element.find('a[data-lightbox="gallery-item"]').parent('.clone').hasClass('clone') ) { 232 element.find('a[data-lightbox="gallery-item"]').parent('.clone').find('a[data-lightbox="gallery-item"]').attr('data-lightbox',''); 233 } 234 235 element.magnificPopup({ 236 delegate: 'a[data-lightbox="gallery-item"]', 237 type: 'image', 238 closeOnContentClick: true, 239 closeBtnInside: false, 240 fixedContentPos: true, 241 mainClass: 'mfp-no-margins mfp-fade', // class to remove default margin from left and right side 242 image: { 243 verticalFit: true 244 }, 245 gallery: { 246 enabled: true, 247 navigateByImgClick: true, 248 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 249 } 250 }); 251 }); 252 } 253 254 if( $lightboxIframeEl.length > 0 ) { 255 $lightboxIframeEl.magnificPopup({ 256 disableOn: 600, 257 type: 'iframe', 258 removalDelay: 160, 259 preloader: false,
260 fixedContentPos: false 261 }); 262 } 263 }, 264 265 resizeVideos: function(){ 266 if ( $().fitVids ) { 267 $("#content,#footer,#slider:not(.revslider-wrap),.landing-offer-media,.portfolio-ajax-modal").fitVids({ 268 customSelector: "iframe[src^='http://www.dailymotion.com/embed']", 269 ignore: '.no-fv' 270 }); 271 } 272 }, 273 274 imageFade: function(){ 275 $('.image_fade').hover( function(){ 276 $(this).filter(':not(:animated)').animate({opacity: 0.8}, 400); 277 }, function() { 278 $(this).animate({opacity: 1}, 400); 279 }); 280 }, 281 282 /* 283 pageTransition: function(){ 284 if( !$body.hasClass('no-transition') ){ 285 var animationIn = $body.attr('data-animation-in'), 286 animationOut = $body.attr('data-animation-out'), 287 durationIn = $body.attr('data-speed-in'), 288 durationOut = $body.attr('data-speed-out'), 289 loaderStyle = $body.attr('data-loader'), 290 loaderStyleHtml = '<div class="css3-spinner-bounce1"></div><div class="css3-spinner-bounce2"></div><div class="css3-spinner-bounce3"></div>'; 291 292 if( !animationIn ) { animationIn = 'fadeIn'; } 293 if( !animationOut ) { animationOut = 'fadeOut'; } 294 if( !durationIn ) { durationIn = 1500; } 295 if( !durationOut ) { durationOut = 800; } 296 297 if( loaderStyle == '2' ) { 298 loaderStyleHtml = '<div class="css3-spinner-flipper"></div>'; 299 } else if( loaderStyle == '3' ) { 300 loaderStyleHtml = '<div class="css3-spinner-double-bounce1"></div><div class="css3-spinner-double-bounce2"></div>'; 301 } else if( loaderStyle == '4' ) { 302 loaderStyleHtml = '<div class="css3-spinner-rect1"></div><div class="css3-spinner-rect2"></div><div class="css3-spinner-rect3"></div><div class="css3-spinner-rect4"></div><div class="css3-spinner-rect5"></div>'; 303 } else if( loaderStyle == '5' ) { 304 loaderStyleHtml = '<div class="css3-spinner-cube1"></div><div class="css3-spinner-cube2"></div>'; 305 } else if( loaderStyle == '6' ) { 306 loaderStyleHtml = '<div class="css3-spinner-scaler"></div>'; 307 } 308 309 $wrapper.animsition({ 310 inClass : animationIn, 311 outClass : animationOut, 312 inDuration : Number(durationIn), 313 outDuration : Number(durationOut), 314 linkElement : '#primary-menu ul li a:not([target="_blank"]):not([href^=#])', 315 loading : true, 316 loadingParentElement : 'body', 317 loadingClass : 'css3-spinner', 318 loadingHtml : loaderStyleHtml, 319 unSupportCss : [ 320 'animation-duration', 321 '-webkit-animation-duration', 322 '-o-animation-duration' 323 ], 324 overlay : false, 325 overlayClass : 'animsition-overlay-slide', 326 overlayParentElement : 'body' 327 }); 328 } 329 },*/ 330 331 defineColumns: function( element ){ 332 var column = 4; 333 334 if( element.hasClass('portfolio-full') ) { 335 if( element.hasClass('portfolio-3') ) column = 3; 336 else if( element.hasClass('portfolio-5') ) column = 5; 337 else if( element.hasClass('portfolio-6') ) column = 6; 338 else column = 4; 339 340 if( $body.hasClass('device-sm') && ( column == 4 || column == 5 || column == 6 ) ) { 341 column = 3; 342 } else if( $body.hasClass('device-xs') && ( column == 3 || column == 4 || column == 5 || column == 6 ) ) { 343 column = 2; 344 } else if( $body.hasClass('device-xxs') ) { 345 column = 1; 346 } 347 } else if( element.hasClass('masonry-thumbs') ) { 348 if( element.hasClass('col-2') ) column = 2; 349 else if( element.hasClass('col-3') ) column = 3; 350 else if( element.hasClass('col-5') ) column = 5; 351 else if( element.hasClass('col-6') ) column = 6; 352 else column = 4; 353 } 354 355 return column; 356 }, 357 358 setFullColumnWidth: function( element ){ 359 360 if( element.hasClass('portfolio-full') ) { 361 var columns = THEMEVISION.initialize.defineColumns( element ); 362 var containerWidth = element.width(); 363 if( containerWidth == ( Math.floor(containerWidth/columns) * columns ) ) { containerWidth = containerWidth - 1; } 364 var postWidth = Math.floor(containerWidth/columns); 365 if( $body.hasClass('device-xxs') ) { var deviceSmallest = 1; } else { var deviceSmallest = 0; } 366 element.find(".portfolio-item").each(function(index){ 367 if( deviceSmallest == 0 && $(this).hasClass('wide') ) { var elementSize = ( postWidth*2 ); } else { var elementSize = postWidth; } 368 $(this).css({"width":elementSize+"px"}); 369 }); 370 } else if( element.hasClass('masonry-thumbs') ) { 371 var columns = THEMEVISION.initialize.defineColumns( element ), 372 containerWidth = element.innerWidth(), 373 windowWidth = $window.width(); 374 if( containerWidth == windowWidth ){ 375 containerWidth = windowWidth*1.004; 376 element.css({ 'width': containerWidth+'px' }); 377 } 378 var postWidth = (containerWidth/columns); 379 380 postWidth = Math.floor(postWidth); 381 382 if( ( postWidth * columns ) >= containerWidth ) { element.css({ 'margin-right': '-1px' }); } 383 384 element.children('a').css({"width":postWidth+"px"}); 385 386 var firstElementWidth = element.find('a:eq(0)').outerWidth(); 387 388 element.isotope({ 389 masonry: { 390 columnWidth: firstElementWidth 391 } 392 }); 393 394 var bigImageNumbers = element.attr('data-big'); 395 if( bigImageNumbers ) { 396 bigImageNumbers = bigImageNumbers.split(","); 397 var bigImageNumber = '', 398 bigi = ''; 399 for( bigi = 0; bigi < bigImageNumbers.length; bigi++ ){ 400 bigImageNumber = Number(bigImageNumbers[bigi]) - 1; 401 element.find('a:eq('+bigImageNumber+')').css({ width: firstElementWidth*2 + 'px' }); 402 } 403 var t = setTimeout( function(){ 404 element.isotope('layout'); 405 }, 1000 ); 406 } 407 } 408 409 }, 410 }; 411 412 THEMEVISION.header = { 413 414 init: function(){ 415
416 THEMEVISION.header.transparent(); 417 THEMEVISION.header.sticky(); 418 THEMEVISION.header.superfish(); 419 THEMEVISION.header.topSearch(); 420 THEMEVISION.header.mobilemenu(); 421 422 }, 423 424 transparent: function() { 425 if( agama_pro.header_transparent == true ) { 426 if( agama_pro.header_image !== true && ! $slider.hasClass('camera_wrap') && ! $('img').hasClass('header-image') ) { 427 $header_v2.css('position', 'relative'); 428 $window.on('scroll', function() { 429 if( jQuery(this).scrollTop() > 1 ) { 430 $header_v2.css('position', 'fixed'); 431 } 432 else if( jQuery(this).scrollTop() < 1 ) { 433 $header_v2.css('position', 'relative'); 434 } 435 }); 436 } 437 } 438 }, 439 440 sticky: function( headerOffset ){ 441 442 if ($window.scrollTop() > headerOffset) { 443 $stickyheader.addClass("sticky-header-shrink"); 444 if( agama_pro.header_style == 'v3' ) { 445 $body.addClass('top-bar-out'); 446 $topbar.hide(); 447 } 448 } else { 449 $stickyheader.removeClass("sticky-header-shrink"); 450 if( agama_pro.header_style == 'v3' ) { 451 $body.removeClass('top-bar-out'); 452 $topbar.show(); 453 } 454 } 455 456 }, 457 458 superfish: function(){ 459 460 if( $().superfish ){ 461 $('nav[role="navigation"] ul').superfish(); 462 $('nav[role="navigation"] ul.sticky-nav').superfish(); 463 } 464 465 }, 466 467 topsocial: function(){ 468 if( $topSocialEl.length > 0 ){ 469 if( $body.hasClass('device-md') || $body.hasClass('device-lg') ) { 470 $topSocialEl.show(); 471 $topSocialEl.find('a').css({width: 40}); 472 473 $topSocialEl.find('.tv-text').each( function(){ 474 var $clone = $(this).clone().css({'visibility': 'hidden', 'display': 'inline-block', 'font-size': '13px', 'font-weight':'bold'}).appendTo($body), 475 cloneWidth = $clone.innerWidth() + 52; 476 $(this).parent('a').attr('data-hover-width',cloneWidth); 477 $clone.remove(); 478 }); 479 480 $topSocialEl.find('a').hover(function() { 481 if( $(this).find('.tv-text').length > 0 ) { 482 $(this).css({width: $(this).attr('data-hover-width')}); 483 } 484 }, function() { 485 $(this).css({width: 40}); 486 }); 487 } else { 488 $topSocialEl.show(); 489 $topSocialEl.find('a').css({width: 40}); 490 491 $topSocialEl.find('a').each(function() { 492 var topIconTitle = $(this).find('.tv-text').text(); 493 $(this).attr('title', topIconTitle); 494 }); 495 496 $topSocialEl.find('a').hover(function() { 497 $(this).css({width: 40}); 498 }, function() { 499 $(this).css({width: 40}); 500 }); 501 502 if( $body.hasClass('device-xxs') ) { 503 $topSocialEl.hide(); 504 $topSocialEl.slice(0, 8).show(); 505 } 506 } 507 } 508 }, 509 510 topSearch: function() { 511 512 $('#top-search-trigger .fa-search').click(function(){ 513 var $wrapper_width = $('.sticky-header-inner').width(); 514 var $logo_width = $('.sticky-header-inner .pull-left').width(); 515 var $search_width = $wrapper_width - $logo_width - 50; 516 517 if( agama_pro.header_style == 'v2' || agama_pro.header_style == 'v3' ) { 518 $('.sticky-header-inner .pull-right').css('width', $search_width); 519 } 520 521 $('body').addClass('top-search-open'); 522 $('.sticky-nav').css('display', 'none'); 523 }); 524 $('#top-search-trigger .fa-close').click(function(){ 525 526 if( agama_pro.header_style == 'v2' || agama_pro.header_style == 'v3' ) { 527 $('.sticky-header-inner .pull-right').css('width', 'auto'); 528 } 529 530 $('body').removeClass('top-search-open'); 531 $('.sticky-nav').css('display', 'block'); 532 }); 533 534 }, 535 536 mobilemenu: function(){ 537 $(".mobile-menu ul.menu > li.menu-item-has-children").each(function(index) { 538 var menuItemId = "mobile-menu-submenu-item-" + index; 539 $('.mobile-menu ul.sub-menu').id = index; 540 $('<button class="dropdown-toggle collapsed" data-toggle="collapse" data-target="#' + menuItemId + '"></button>').insertAfter($(this).children("a")); 541 542 $(this).children("ul").prop("id", menuItemId); 543 $(this).children("ul").addClass("collapse"); 544 545 $("#" + menuItemId).on("show.bs.collapse", function() { 546 $(this).parent().addClass("open"); 547 }); 548 $("#" + menuItemId).on("hidden.bs.collapse", function() { 549 $(this).parent().removeClass("open"); 550 }); 551 }); 552 $('.mobile-menu-toggle.collapsed').click(function() { 553 554 if( agama_pro.header_style == 'v2' && agama_pro.header_transparent !== '' ) { 555 var $top = $('.sticky-header-inner').height() + 'px'; 556 $('.mobile-menu').css({ 557 'position': 'absolute', 558 'top': $top, 559 'z-index': '1', 560 'width': '100%' 561 }); 562 } 563 564 $('#masthead .sticky-header').css('box-shadow', 'none'); 565 $('nav.mobile-menu').slideToggle(); 566 }); 567 $window.on('resize', function(){ 568 if( $window.width() > 992 ) { 569 $('#masthead .sticky-header').css('box-shadow', ''); 570 $('nav.mobile-menu').hide(); 571 } 572 }); 573 } 574 }; 575 576 THEMEVISION.portfolio = { 577 578 init: function() { 579 580 581 582 }, 583 584 portfolioDescMargin: function(){ 585 var $portfolioOverlayEl = $('.portfolio-overlay'); 586 if( $portfolioOverlayEl.length > 0 ){ 587 $portfolioOverlayEl.each(function() { 588 var element = $(this); 589 if( element.find('.portfolio-desc').length > 0 ) { 590 var portfolioOverlayHeight = element.outerHeight(); 591 var portfolioOverlayDescHeight = element.find('.portfolio-desc').outerHeight(); 592 if( element.find('a.left-icon').length > 0 || element.find('a.right-icon').length > 0 || element.find('a.center-icon').length > 0 ) { 593 var portfolioOverlayIconHeight = 40 + 20; 594 } else { 595 var portfolioOverlayIconHeight = 0; 596 } 597 var portfolioOverlayMiddleAlign = ( portfolioOverlayHeight - portfolioOverlayDescHeight - portfolioOverlayIconHeight ) / 2 598 element.find('.portfolio-desc').css({ 'margin-top': portfolioOverlayMiddleAlign }); 599 } 600 }); 601 } 602 }, 603 604 arrange: function(){ 605 THEMEVISION.initialize.setFullColumnWidth( $portfolio ); 606 $('#portfolio.portfolio-full').isotope('layout'); 607 }, 608 609 610 }; 611 612 THEMEVISION.widgets = { 613 614 init: function(){ 615 616 THEMEVISION.widgets.animations(); 617 THEMEVISION.widgets.youtubeBgVideo(); 618 THEMEVISION.widgets.tabs(); 619 THEMEVISION.widgets.toggles(); 620 THEMEVISION.widgets.accordions(); 621 THEMEVISION.widgets.counter(); 622 THEMEVISION.widgets.progress(); 623 THEMEVISION.widgets.extras(); 624 THEMEVISION.widgets.contact7form(); 625 626 }, 627 628 parallax: function(){ 629 if( !THEMEVISION.isMobile.any() ){ 630 $.stellar({ 631 horizontalScrolling: false, 632 verticalOffset: 150, 633 responsive: true 634 }); 635 } else { 636 $parallaxEl.addClass('mobile-parallax'); 637 $parallaxPageTitleEl.addClass('mobile-parallax'); 638 } 639 }, 640 641 animations: function(){ 642 var $dataAnimateEl = $('[data-animate]'); 643 if( $dataAnimateEl.length > 0 ){ 644 if( $body.hasClass('device-lg') || $body.hasClass('device-md') || $body.hasClass('device-sm') ){ 645 $dataAnimateEl.each(function(){ 646 var element = $(this), 647 animationDelay = element.attr('data-delay'), 648 animationDelayTime = 0; 649 650 if( animationDelay ) { animationDelayTime = Number( animationDelay ) + 500; } else { animationDelayTime = 500; } 651 652 if( !element.hasClass('animated') ) { 653 element.addClass('not-animated'); 654 var elementAnimation = element.attr('data-animate'); 655 element.appear(function () { 656 setTimeout(function() { 657 element.removeClass('not-animated').addClass( elementAnimation + ' animated'); 658 }, animationDelayTime); 659 }
659,{accX: 0, accY: -120},'easeInCubic'); 660 } 661 }); 662 } 663 } 664 }, 665 666 loadFlexSlider: function(){ 667 var $flexSliderEl = $('.fslider').find('.flexslider'); 668 if( $flexSliderEl.length > 0 ){ 669 $flexSliderEl.each(function() { 670 var $flexsSlider = $(this), 671 flexsAnimation = $flexsSlider.parent('.fslider').attr('data-animation'), 672 flexsEasing = $flexsSlider.parent('.fslider').attr('data-easing'), 673 flexsDirection = $flexsSlider.parent('.fslider').attr('data-direction'), 674 flexsSlideshow = $flexsSlider.parent('.fslider').attr('data-slideshow'), 675 flexsPause = $flexsSlider.parent('.fslider').attr('data-pause'), 676 flexsSpeed = $flexsSlider.parent('.fslider').attr('data-speed'), 677 flexsVideo = $flexsSlider.parent('.fslider').attr('data-video'), 678 flexsPagi = $flexsSlider.parent('.fslider').attr('data-pagi'), 679 flexsArrows = $flexsSlider.parent('.fslider').attr('data-arrows'), 680 flexsThumbs = $flexsSlider.parent('.fslider').attr('data-thumbs'), 681 flexsHover = $flexsSlider.parent('.fslider').attr('data-hover'), 682 flexsSheight = true, 683 flexsUseCSS = false; 684 685 if( !flexsAnimation ) { flexsAnimation = 'slide'; } 686 if( !flexsEasing || flexsEasing == 'swing' ) { 687 flexsEasing = 'swing'; 688 flexsUseCSS = true; 689 } 690 if( !flexsDirection ) { flexsDirection = 'horizontal'; } 691 if( !flexsSlideshow ) { flexsSlideshow = true; } else { flexsSlideshow = false; } 692 if( !flexsPause ) { flexsPause = 5000; } 693 if( !flexsSpeed ) { flexsSpeed = 600; } 694 if( !flexsVideo ) { flexsVideo = false; } 695 if( flexsDirection == 'vertical' ) { flexsSheight = false; } 696 if( flexsPagi == 'false' ) { flexsPagi = false; } else { flexsPagi = true; } 697 if( flexsThumbs == 'true' ) { flexsPagi = 'thumbnails'; } else { flexsPagi = flexsPagi; } 698 if( flexsArrows == 'false' ) { flexsArrows = false; } else { flexsArrows = true; } 699 if( flexsHover == 'false' ) { flexsHover = false; } else { flexsHover = true; } 700 701 $('.testimonial-item').addClass('slide'); 702 $('.slide .testimonial').removeClass('testimonial'); 703 704 $flexsSlider.flexslider({ 705 selector: ".slider-wrap > .slide", 706 animation: flexsAnimation, 707 easing: flexsEasing, 708 direction: flexsDirection, 709 slideshow: flexsSlideshow, 710 slideshowSpeed: Number(flexsPause), 711 animationSpeed: Number(flexsSpeed), 712 pauseOnHover: flexsHover, 713 video: flexsVideo, 714 controlNav: flexsPagi, 715 directionNav: flexsArrows, 716 smoothHeight: flexsSheight, 717 useCSS: flexsUseCSS, 718 start: function(slider){ 719 THEMEVISION.widgets.animations(); 720 THEMEVISION.initialize.verticalMiddle(); 721 slider.parent().removeClass('preloader2'); 722 var t = setTimeout( function(){ $('#portfolio.portfolio-masonry,#portfolio.portfolio-full,#posts.post-masonry').isotope('layout'); }, 1200 ); 723 THEMEVISION.initialize.lightbox(); 724 $('.flex-prev').html('<i class="fa fa-angle-left"></i>'); 725 $('.flex-next').html('<i class="fa fa-angle-right"></i>'); 726 THEMEVISION.portfolio.portfolioDescMargin(); 727 }, 728 after: function(){ 729 if( $portfolio.has('portfolio-full') ) { 730 $('#portfolio.portfolio-full').isotope('layout'); 731 THEMEVISION.portfolio.portfolioDescMargin(); 732 } 733 } 734 }); 735 }); 736 } 737 }, 738 739 html5Video: function(){ 740 var videoEl = $('.video-wrap:has(video)'); 741 if( videoEl.length > 0 ) { 742 videoEl.each(function(){ 743 var element = $(this), 744 elementVideo = element.find('video'), 745 outerContainerWidth = element.outerWidth(), 746 outerContainerHeight = element.outerHeight(), 747 innerVideoWidth = elementVideo.outerWidth(), 748 innerVideoHeight = elementVideo.outerHeight(); 749 750 if( innerVideoHeight < outerContainerHeight ) { 751 var videoAspectRatio = innerVideoWidth/innerVideoHeight, 752 newVideoWidth = outerContainerHeight * videoAspectRatio, 753 innerVideoPosition = (newVideoWidth - outerContainerWidth) / 2; 754 elementVideo.css({ 'width': newVideoWidth+'px', 'height': outerContainerHeight+'px', 'left': -innerVideoPosition+'px' }); 755 } else { 756 var innerVideoPosition = (innerVideoHeight - outerContainerHeight) / 2; 757 elementVideo.css({ 'width': innerVideoWidth+'px', 'height': innerVideoHeight+'px', 'top': -innerVideoPosition+'px' }); 758 } 759 760 if( SEMICOLON.isMobile.any() ) { 761 var placeholderImg = elementVideo.attr('poster'); 762 763 if( placeholderImg != '' ) { 764 element.append('<div class="video-placeholder" style="background-image: url('+ placeholderImg +');"></div>') 765 } 766 } 767 }); 768 } 769 }, 770 771 youtubeBgVideo: function(){ 772 if( $youtubeBgPlayerEl.length > 0 ){ 773 $youtubeBgPlayerEl.each( function(){ 774 var element = $(this), 775 ytbgVideo = element.attr('data-video'), 776 ytbgMute = element.attr('data-mute'), 777 ytbgRatio = element.attr('data-ratio'), 778 ytbgQuality = element.attr('data-quality'), 779 ytbgOpacity = element.attr('data-opacity'), 780 ytbgContainer = element.attr('data-container'), 781 ytbgOptimize = element.attr('data-optimize'), 782 ytbgLoop = element.attr('data-loop'), 783 ytbgVolume = element.attr('data-volume'), 784 ytbgStart = element.attr('data-start'), 785 ytbgStop = element.attr('data-stop'), 786 ytbgAutoPlay = element.attr('data-autoplay'), 787 ytbgFullScreen = element.attr('data-fullscreen'); 788 789 if( ytbgMute == 'false' ) { ytbgMute = false; } else { ytbgMute = true; } 790 if( !ytbgRatio ) { ytbgRatio = '16/9'; } 791 if( !ytbgQuality ) { ytbgQuality = 'hd720'; } 792 if( !ytbgOpacity ) { ytbgOpacity = 1; } 793 if( !ytbgContainer ) { ytbgContainer = 'self'; } 794 if( ytbgOptimize == 'false' ) { ytbgOptimize = false; } else { ytbgOptimize = true; } 795 if( ytbgLoop == 'false' ) { ytbgLoop = false; } else { ytbgLoop = true; } 796 if( !ytbgVolume ) { ytbgVolume = 1; } 797 if( !ytbgStart ) { ytbgStart = 0; } 798 if( !ytbgStop ) { ytbgStop = 0; } 799 if( ytbgAutoPlay == 'false' ) { ytbgAutoPlay = false; } else { ytbgAutoPlay = true; } 800 if( ytbgFullScreen == 'true' ) { ytbgFullScreen = true; } else { ytbgFullScreen = false; } 801 802 element.mb_YTPlayer({ 803 videoURL: ytbgVideo, 804 mute: ytbgMute, 805 ratio: ytbgRatio, 806 quality: ytbgQuality, 807 opacity: ytbgOpacity, 808 containment: ytbgContainer, 809 optimizeDisplay: ytbgOptimize, 810 loop: ytbgLoop, 811 vol: ytbgVolume, 812 startAt: ytbgStart, 813 stopAt: ytbgStop, 814 autoplay: ytbgAutoPlay, 815 realfullscreen: ytbgFullScreen, 816 showYTLogo: false, 817 showControls: false 818 }); 819 }); 820 } 821 }, 822 823 tabs: function(){ 824 825 $('#tabs a:first').tab('show'); 826 $('#tabs a').click(function (e) { 827 e.preventDefault() 828 $(this).tab('show'); 829 }); 830 831 }, 832 833 toggles: function(){ 834 var $toggle = $('.toggle'); 835 if( $toggle.length > 0 ) { 836 $toggle.each( function(){ 837 var element = $(this), 838 elementState = element.attr('data-state'); 839 840 if( elementState != 'open' ){ 841 element.find('.togglec').hide(); 842 } else { 843 element.find('.togglet').addClass("toggleta"); 844 } 845 846 element.find('.togglet').click(function(){ 847 $(this).toggleClass('toggleta').next('.togglec').slideToggle(300); 848 return true; 849 }); 850 }); 851 } 852 }, 853 854 accordions: function(){ 855 var $accordionEl = $('.accordion'); 856 if( $accordionEl.length > 0 ){ 857 $accordionEl.each( function(){ 858 var element = $(this), 859 elementState = element.attr('data-state'), 860 accordionActive = element.attr('data-active'); 861 862 if( !accordionActive ) { accordionActive = 0; } else { accordionActive = accordionActive - 1; } 863 864 element.find('.acc_content').hide(); 865 866 if( elementState != 'closed' ) { 867 element.find('.acctitle:eq('+ Number(accordionActive) +')').addClass('acctitlec').next().show(); 868 } 869 870 element.find('.acctitle').click(function(){ 871 if( $(this).next().is(':hidden') ) { 872 element.find('.acctitle').removeClass('acctitlec').next().slideUp("normal"); 873 $(this).toggleClass('acctitlec').next().slideDown("normal"); 874 } 875 return false;
876 }); 877 }); 878 } 879 }, 880 881 counter: function(){ 882 var $counterEl = $('.counter:not(.counter-instant)'); 883 if( $counterEl.length > 0 ){ 884 $counterEl.each(function(){ 885 var element = $(this); 886 var counterElementComma = $(this).find('span').attr('data-comma'); 887 if( !counterElementComma ) { counterElementComma = false; } else { counterElementComma = true; } 888 if( $body.hasClass('device-lg') || $body.hasClass('device-md') ){ 889 element.appear( function(){ 890 THEMEVISION.widgets.runCounter( element, counterElementComma ); 891 },{accX: 0, accY: -120},'easeInCubic'); 892 } else { 893 THEMEVISION.widgets.runCounter( element, counterElementComma ); 894 } 895 }); 896 } 897 }, 898 899 runCounter: function( counterElement,counterElementComma ){ 900 if( counterElementComma == true ) { 901 counterElement.find('span').countTo({ 902 formatter: function (value, options) { 903 value = value.toFixed(options.decimals); 904 value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ','); 905 return value; 906 } 907 }); 908 } else { 909 counterElement.find('span').countTo(); 910 } 911 }, 912 913 progress: function(){ 914 var $progressEl = $('.progress'); 915 if( $progressEl.length > 0 ){ 916 $progressEl.each(function(){ 917 var element = $(this), 918 skillsBar = element.parent('li'), 919 skillValue = skillsBar.attr('data-percent'); 920 921 if( $body.hasClass('device-lg') || $body.hasClass('device-md') ){ 922 element.appear( function(){ 923 if (!skillsBar.hasClass('skills-animated')) { 924 element.find('.counter-instant span').countTo(); 925 skillsBar.find('.progress').css({width: skillValue + "%"}).addClass('skills-animated'); 926 } 927 },{accX: 0, accY: -120},'easeInCubic'); 928 } else { 929 element.find('.counter-instant span').countTo(); 930 skillsBar.find('.progress').css({width: skillValue + "%"}); 931 } 932 }); 933 } 934 }, 935 936 notifications: function( element ){ 937 toastr.clear(); 938 var notifyElement = $(element), 939 notifyPosition = notifyElement.attr('data-notify-position'), 940 notifyType = notifyElement.attr('data-notify-type'), 941 notifyMsg = notifyElement.attr('data-notify-msg'), 942 notifyCloseButton = notifyElement.attr('data-notify-close'); 943 944 if( !notifyPosition ) { notifyPosition = 'toast-top-right'; } else { notifyPosition = 'toast-' + notifyElement.attr('data-notify-position'); } 945 if( !notifyMsg ) { notifyMsg = 'Please set a message!'; } 946 if( notifyCloseButton == 'true' ) { notifyCloseButton = true; } else { notifyCloseButton = false; } 947 948 toastr.options.positionClass = notifyPosition; 949 toastr.options.closeButton = notifyCloseButton; 950 toastr.options.closeHtml = '<button><i class="icon-remove"></i></button>'; 951 952 if( notifyType == 'warning' ) { 953 toastr.warning(notifyMsg); 954 } else if( notifyType == 'error' ) { 955 toastr.error(notifyMsg); 956 } else if( notifyType == 'success' ) { 957 toastr.success(notifyMsg); 958 } else { 959 toastr.info(notifyMsg); 960 } 961 962 return false; 963 }, 964 965 extras: function(){ 966 967 // Tooltips init 968 $('[data-toggle="tooltip"]').tooltip(); 969 970 // Add reply icon to reply link - comments area 971 $('a.comment-reply-link').append('<i class="fa fa-reply"></i>'); 972 973 if( THEMEVISION.isMobile.any() ){ 974 $body.addClass('device-touch'); 975 } 976 977 // Contact Form 7 Form Submit Button 978 $('.ccf-form .form-submit input[type=submit]').addClass('button button-3d'); 979 980 // Contact Form Plugin 981 if( $('div').hasClass('cntctfrm_submit_wrap') ) { 982 $('.cntctfrm_submit_wrap input[type=submit]').addClass('button button-3d'); 983 } 984 985 // If WooCommerce not active, reduce search icon area width from 100px to 50px 986 if( $('div').hasClass('cart_count') ) { 987 988 } else { 989 $('.sticky-header .navigation-icons').css('width', '50'); 990 } 991 }, 992 993 contact7form: function() { 994 995 $('.wpcf7-form-control').css('width', 'auto'); 996 $('.wpcf7-form-control').addClass('sm-form-control'); 997 $('.wpcf7-submit').removeClass('sm-form-control'); 998 999 } 1000 1001 }; 1002 1003 THEMEVISION.isMobile = { 1004 Android: function() { 1005 return navigator.userAgent.match(/Android/i); 1006 }, 1007 BlackBerry: function() { 1008 return navigator.userAgent.match(/BlackBerry/i); 1009 }, 1010 iOS: function() { 1011 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 1012 }, 1013 Opera: function() { 1014 return navigator.userAgent.match(/Opera Mini/i); 1015 }, 1016 Windows: function() { 1017 return navigator.userAgent.match(/IEMobile/i); 1018 }, 1019 any: function() { 1020 return (THEMEVISION.isMobile.Android() || THEMEVISION.isMobile.BlackBerry() || THEMEVISION.isMobile.iOS() || THEMEVISION.isMobile.Opera() || THEMEVISION.isMobile.Windows()); 1021 } 1022 }; 1023 1024 THEMEVISION.woocommerce = { 1025 1026 init: function(){ 1027 1028 THEMEVISION.woocommerce.quantity(); 1029 1030 }, 1031 1032 quantity: function(){ 1033 1034 $('.quantity input[type="number"]').prop('type', 'text'); 1035 $('.quantity').prepend('<input type="button" value="-" class="minus">'); 1036 $('.quantity').append('<input type="button" value="+" class="plus">'); 1037 1038 $( document ).on('click', '.plus, .minus', function() { 1039 // Get values 1040 var $qty = $( this ).closest( '.quantity' ).find( '.qty' ), 1041 currentVal = parseFloat( $qty.val() ), 1042 max = parseFloat( $qty.attr( 'max' ) ), 1043 min = parseFloat( $qty.attr( 'min' ) ), 1044 step = $qty.attr( 'step' ); 1045 1046 // Format values 1047 if ( !currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0; 1048 if ( max === '' || max === 'NaN' ) max = ''; 1049 if ( min === '' || min === 'NaN' ) min = 0; 1050 if ( step === 'any' || step === '' || step === undefined || parseFloat( step )
1050=== 'NaN' ) step = 1; 1051 1052 // Change the value 1053 if ( $( this ).is( '.plus' ) ) { 1054 1055 if ( max && ( max == currentVal || currentVal > max ) ) { 1056 $qty.val( max ); 1057 } else { 1058 $qty.val( currentVal + parseFloat( step ) ); 1059 } 1060 1061 } else { 1062 1063 if ( min && ( min == currentVal || currentVal < min ) ) { 1064 $qty.val( min ); 1065 } else if ( currentVal > 0 ) { 1066 $qty.val( currentVal - parseFloat( step ) ); 1067 } 1068 1069 } 1070 1071 // Trigger change event 1072 $qty.trigger( 'change' ); 1073 }); 1074 } 1075 1076 }; 1077 1078 THEMEVISION.slider = { 1079 1080 init: function() { 1081 1082 1083 1084 }, 1085 1086 owlCaptionInit: function(){ 1087 if( $owlCarouselEl.length > 0 ){ 1088 $owlCarouselEl.each( function(){ 1089 var element = $(this); 1090 if( element.find('.owl-dot').length > 0 ) { 1091 element.find('.owl-controls').addClass('with-carousel-dots'); 1092 } 1093 }); 1094 } 1095 } 1096 1097 }; 1098 1099 THEMEVISION.documentOnResize = { 1100 1101 init: function(){ 1102 1103 var t = setTimeout( function(){ 1104 THEMEVISION.header.topsocial(); 1105 THEMEVISION.initialize.verticalMiddle(); 1106 THEMEVISION.initialize.testimonialsGrid(); 1107 THEMEVISION.widgets.html5Video(); 1108 THEMEVISION.portfolio.arrange(); 1109 }, 500 ); 1110 1111 } 1112 1113 }; 1114 1115 THEMEVISION.documentOnReady = { 1116 1117 init: function(){ 1118 1119 THEMEVISION.initialize.init(); 1120 THEMEVISION.header.init(); 1121 if( $portfolio.length > 0 ) { THEMEVISION.portfolio.init(); } 1122 THEMEVISION.widgets.init(); 1123 THEMEVISION.woocommerce.init(); 1124 THEMEVISION.documentOnReady.windowscroll(); 1125 1126 }, 1127 1128 windowscroll: function(){ 1129 1130 var headerOffset = $header.offset().top; 1131 var headerWrapOffset = $headerWrap.offset().top; 1132 1133 var headerDefinedOffset = $header.attr('data-sticky-offset'); 1134 if( typeof headerDefinedOffset !== 'undefined' ) { 1135 if( headerDefinedOffset == 'full' ) { 1136 headerWrapOffset = $window.height(); 1137 var headerOffsetNegative = $header.attr('data-sticky-offset-negative'); 1138 if( typeof headerOffsetNegative !== 'undefined' ) { headerWrapOffset = headerWrapOffset - headerOffsetNegative - 1; } 1139 } else { 1140 headerWrapOffset = Number(headerDefinedOffset); 1141 } 1142 } 1143 1144 $window.on( 'scroll', function(){ 1145 1146 THEMEVISION.initialize.goToTopScroll(); 1147 THEMEVISION.header.sticky( headerWrapOffset ); 1148 1149 }); 1150 1151 } 1152 1153 }; 1154 1155 THEMEVISION.documentOnLoad = { 1156 1157 init: function(){ 1158 1159 THEMEVISION.initialize.testimonialsGrid(); 1160 THEMEVISION.portfolio.portfolioDescMargin(); 1161 THEMEVISION.initialize.verticalMiddle(); 1162 THEMEVISION.portfolio.arrange(); 1163 THEMEVISION.widgets.parallax(); 1164 THEMEVISION.widgets.loadFlexSlider(); 1165 THEMEVISION.widgets.html5Video(); 1166 THEMEVISION.header.topsocial(); 1167 THEMEVISION.slider.owlCaptionInit(); 1168 1169 } 1170 1171 }; 1172 1173 var $window = $(window), 1174 $body = $('body'), 1175 $wrapper = $('#main-wrapper'), 1176 $header = $('#masthead'), 1177 $header_v2 = $('.header_v2 .sticky-header'), 1178 $topbar = $('#top-bar'), 1179 $stickyheader = $('.sticky-header'), 1180 $headerWrap = $('#masthead, .sticky-header'), 1181 $topSocialEl = $('#top-social').find('li'), 1182 $slider = $('#agama_slider'), 1183 $portfolio = $('#portfolio'), 1184 $goToTopEl = $('#toTop'), 1185 $testimonialsGridEl = $('.testimonials-grid'), 1186 $verticalMiddleEl = $('.vertical-middle'), 1187 $owlCarouselEl = $('.owl-carousel'), 1188 $parallaxEl = $('.parallax'), 1189 $youtubeBgPlayerEl = $('.yt-bg-player'), 1190 $parallaxPageTitleEl = $('.page-title-parallax'), 1191 $portfolio = $('#portfolio'), 1192 $portfolioItems = $('.portfolio-ajax').find('.portfolio-item'); 1193 1194 $(document).ready( THEMEVISION.documentOnReady.init ); 1195 $window.load( THEMEVISION.documentOnLoad.init ); 1196 $window.on( 'resize', THEMEVISION.documentOnResize.init ); 1197 1198})(jQuery);
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.