1var $j = jQuery.noConflict(); 2 windowHeight = $j(window).height(), 3 adminOffset = $j('body').hasClass('admin-bar') ? 32 : 0, 4 navOffset = $j('#logo').outerHeight(), 5 bannerType = $j('.top-banner').attr('id'), 6 scroll = $j(window).scrollTop(), 7 navHeight = $j("#main-nav").height(), 8 finalOffset = navOffset + adminOffset, 9 scrollOffest = 0, 10 scrollItems = new Array(), 11 lastId = "", 12 headerBreakPoint = 0, 13 14 headerContentWidth = 0, 15 mobileBreakPoint = 780, 16 masonry = $j('.masonry').length, 17 parallaxSkroll = false, 18 breakpoints = { 19 "Large": [9999, 3], // *3* columns for all larger screens 20 "Medium":[800, 2], // For *Medium* screens of *1100 to 700*, set Isotope to *2* columns 21 "Small": [500, 1] // For *Small* screens below *700*, set Isotope to *1* column 22 }; 23 24 25/** 26* Mobile Detection 27*/ 28 29var isMobile = { 30 Android: function() { 31 return navigator.userAgent.match(/Android/i); 32 }, 33 BlackBerry: function() { 34 return navigator.userAgent.match(/BlackBerry/i); 35 }, 36 iOS: function() { 37 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 38 }, 39 Opera: function() { 40 return navigator.userAgent.match(/Opera Mini/i); 41 }, 42 Windows: function() { 43 return navigator.userAgent.match(/IEMobile/i); 44 }, 45 any: function() { 46 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 47 } 48}; 49 50/** 51* Check if browser is IE 52*/ 53function isIE(){ 54 var ua = window.navigator.userAgent; 55 var msie = ua.indexOf("MSIE "); 56 57 if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number 58 { 59 ie = true; 60 } 61 else // If another browser, return 0 62 { 63 ie = false;
64 } 65 66 return ie; 67} 68 69/** 70* Check if browser is Edge 71*/ 72 73function isEdge(){ 74 75 if (document.documentMode || /Edge/.test(navigator.userAgent)) { 76 $j('body').addClass('ie'); 77 return true; 78 } 79} 80 81 82/** 83* Header Setup 84*/ 85function menuSetup(){ 86 // Misc. 87 // -- Hover menus 88 $j('ul.sf-menu').superfish({ 89 cssArrows: false, 90 }); 91} 92 93 94/** 95 * Masonry Blog Initialization 96 * 97 * Check to see if the layout mode is set to masonry, and 98 * defaults to fitRows if the .masonry class is not found. 99 * Initializes Isotope on the $gridContainer var 100 */ 101 102function initMasonryBlog() { 103 var gridContainer = $j('.blog .masonry'); 104 if(gridContainer.length){ 105 gridContainer.each(function(){ 106 var $this = $j(this); 107 $this.waitForImages(function(){ 108 109 $this.isotope({ 110 itemSelector: '.post.small', 111 resizable: true, 112 masonry: { 113 columnWidth: '' 114 } 115 }); 116 $j('.post.small').addClass('show'); 117 }); 118 }); 119 } 120} 121 122 123 124/** 125 * Filter Navigation 126 * 127 * Binds the Isotope filtering function to clicks on the 128 * portfolio filter links using the data-filter attribute 129 */ 130 131function filterInit() { 132 var $filterNavA = $j( '#filter-nav a' ); 133 $filterNavA.click( function(){ 134 var selector = $j(this).attr( 'data-filter' ); 135 $j(this).parents( '.projects' ).find('.thumbs').isotope({filter: selector}); 136 if ( ! $j(this).hasClass( 'selected' ) ) { 137 $j(this).parents( '#filter-nav' ).find( '.selected' ).removeClass( 'selected' ); 138 $j(this).addClass( 'selected' ); 139 } 140 return false; 141 }); 142} 143 144/** 145 * Portfolio Initialization 146 * 147 * Check to see if the layout mode is set to masonry, and 148 * defaults to fitRows if the .masonry class is not found. 149 * Initializes Isotope on the $gridContainer var 150 */ 151 152function initPortfolio() { 153 var gridContainer = $j('.projects .thumbs'); 154 if(gridContainer.length){ 155 156 masonryProjectResize(); 157 158 gridContainer.each(function(){ 159 var $this = $j(this); 160 161 162 $this.isotope({ 163 itemSelector: '.project.small', 164 resizable: false, 165 masonry: { 166 columnWidth: '.grid-sizer' 167 } 168 }); 169 $j('.projects .thumbs .project.small').addClass('show'); 170 if ($j(".effect-4").length > 0) { 171 $j('.projects .thumbs .project.small.effect-4').hover3d({ 172 selector: ".inside" 173 }); 174 } 175 $this.imagesLoaded().progress( function() { 176 $this.isotope('layout'); 177 }); 178 }); 179 } 180} 181 182/** 183 * Resize Masonry Grid Items 184 * 185 */ 186 187function masonryProjectResize() { 188 if($j('.masonry-with-gutter').length || $j('.masonry-without-gutter').length){ 189 var defaultSize = $j('.projects .grid-sizer').width(); 190 var projectDefault = $j('.projects .project.small'); 191 var projectMasonryDefault = $j('.projects .masonry-default'); 192 var projectMasonryWide = $j('.projects .masonry-wide'); 193 var projectMasonryTall = $j('.projects .masonry-tall'); 194 var projectMasonryWideTall = $j('.projects .masonry-wide_tall'); 195 196 projectDefault.css('height', defaultSize); 197 projectMasonryDefault.css('height', defaultSize); 198 projectMasonryWide.css('height', defaultSize); 199 projectMasonryTall.css('height', defaultSize*2); 200 projectMasonryWideTall.css('height', defaultSize*2); 201 projectMasonryWideTall.css('width', defaultSize*2); 202 } 203} 204 205 206/* 207 ** Load More Projects 208 */ 209 210function loadMoreProjects(){ 211 if($j('.projects .load-more-button').length){ 212 213 var i = 1; 214 215 $j('.load-more-button a').on('click', function(e) { 216 e.preventDefault(); 217 218 var gridContainer = $j('.projects .thumbs'); 219 var link = $j(this).attr('href'); 220 var $content = '.projects .thumbs'; 221 var $anchor = '.projects .load-more-button a'; 222 var $next_href = $j($anchor).attr('href'); // Get URL for the next set of projects 223 var loadMoreButton = $j('.projects .load-more-holder .load-more-button'); 224 var loading = $j('.projects .load-more-holder .loading'); 225 226 loadMoreButton.addClass('hidden'); 227 loading.removeClass('hidden'); 228 229 $j.get(link+'', function(data){ 230 231 232 var $new_content = $j($content, data).wrapInner('').html(); // Load only the projects 233 $next_href = $j($anchor, data).attr('href'); // Get the new href 234 235 $j($content, data).waitForImages(function() { 236 237 $j('.projects .thumbs .project.small:last').after($new_content); // Append the new projects 238 239 masonryProjectResize(); 240 gridContainer.isotope( 'on', 'layoutComplete', 241 function( laidOutItems ) { 242 $j('.project.small:not(.show)').addClass('show'); 243 } 244 ); 245 246 if ($j(".effect-4").length > 0) { 247 $j('.projects .thumbs .project.small.effect-4').hover3d({ 248 selector: ".inside" 249 }); 250 } 251 setTimeout(function(){ 252 gridContainer.isotope('reloadItems').isotope(); 253 },200); 254 255 if($j('.load-more-button').data('rel') > i) { 256 $j('.load-more-button a').attr('href', $next_href); // Change the next URL 257 } else { 258 $j('.load-more-button').remove(); 259 } 260 initLightbox(); 261
262 loadMoreButton.removeClass('hidden'); 263 loading.addClass('hidden'); 264 }); 265 }); 266 i++; 267 }); 268 } 269} 270 271 272 273/** 274* Slide Nav Setup 275*/ 276 277function initSlideMenu(){ 278 var siteContainer = $j('#site-wrap'); 279 slideMenu = $j('#slide-panel'); 280 slideMenuWidth = slideMenu.outerWidth(); 281 $j('.menu-toggle.open').on('click', function () { 282 slideMenu.css('transform', 'translateX(0)'); 283 }); 284 $j('#menu-toggle-close').on('click', function () { 285 slideMenu.css('transform', 'translateX(' + slideMenuWidth + 'px)'); 286 }); 287 var browserWidth = $j(window).width(); 288 if(isMobile.any() && browserWidth < 768) { 289 var browserWidth = $j(window).width(); 290 slideMenuWidth = browserWidth; 291 slideMenu.css('width', browserWidth + 'px'); 292 } 293 slideMenu.css('transform', 'translateX(' + slideMenuWidth + 'px)'); 294 slideMenu.css('visibility', 'visible'); 295} 296 297/** 298 * Mobile Menu Submenus 299 * Set collapsable submenus. 300 */ 301// Toggle sub menus 302function initMobileSubMenus(){ 303 jQuery( "#slide-panel nav" ).find( "li.menu-item-has-children" ).click( function(){ 304 jQuery( "#slide-panel nav" ).not( this ).find( "ul" ).next().slideToggle( 100 ); 305 jQuery( this ).find( "> ul" ).stop( true, true ).slideToggle( 100 ); 306 jQuery( this ).toggleClass( "active-sub-menu" ); 307 return false; 308 }); 309 310 // Don't fire sub menu toggle if a user is trying to click the link 311 jQuery( ".menu-item-has-children a" ).click( function(e) { 312 e.stopPropagation(); 313 return true; 314 }); 315} 316 317 318 319/** 320* Header Search Setup 321*/ 322 323function initHeaderSearch(){ 324 var headerSearchBar = $j('.header-search'); 325 $j('.search-toggle.open').on('click', function () { 326 headerSearchBar.addClass('open'); 327 $j(this).closest('header').find('#s').focus(); 328 }); 329 $j('.search-toggle.close').on('click', function () { 330 headerSearchBar.removeClass('open'); 331 }); 332} 333 334/** 335* Single Page Nav Links 336*/ 337 338function initSinglePageNav(){ 339 340 lastId = ""; 341 topMenu = $j('.top-header #site-header .main-nav'); 342 headerHeight = $j('.top-header #site-header').height(); 343 adminBarHeight = $j('body').hasClass('admin-bar') ? 32 : 0; 344 var browserWidth = $j(window).width(); 345 if(isMobile.any() && browserWidth < 768) { 346 scrollOffest = 0; 347 }else{ 348 scrollOffest = adminBarHeight + headerHeight - 10; 349 } 350 351 // All list items 352 menuItems = topMenu.find("a"); 353 // Anchors corresponding to menu items 354 scrollItems = menuItems.map(function(){ 355 var target = this.hash.replace(/^.*#/, ''); 356 var item = $j('div[data-row-id="'+target+'"]'); 357 if (item.length) { return item; } 358 }); 359 360 361 $j('.main-nav a[href^="#"], #slide-mobile-menu a[href^="#"]').click(function(e) { 362 e.preventDefault(); 363 var target = this.hash.replace(/^.*#/, ''); 364 var targetElement = $j('div[data-row-id="'+target+'"]'); 365 if(targetElement.length) { 366 // Shut the slide panel if it is open 367 slideMenu.css('transform', 'translateX(' + slideMenuWidth + 'px)'); 368 } 369 $j(window).scrollTo(targetElement, {duration:500, interrupt:false, offset: -(scrollOffest-15) }); 370 }); 371} 372 373function singlePageNavScroll(){ 374 // Get container scroll position 375 376 var fromTop = $j(this).scrollTop()+scrollOffest+140; 377 378 // Get id of current scroll item 379 var cur = scrollItems.map(function(){ 380 if ($j(this).offset().top <= fromTop) 381 return this; 382 }); 383 // Get the id of the current element 384 cur = cur[cur.length-1]; 385 386 387 var id = cur && cur.length ? cur.data("rowId") : ""; 388 389 if (lastId !== id) { 390 //alert(cur.data("rowId")); 391 lastId = id; 392 // Set/remove active class 393 menuItems 394 .parent().removeClass("active") 395 .end().filter("[href=\\#"+id+"]").parent().addClass("active"); 396 } 397} 398 399/** 400* Init lightbox links 401*/ 402 403function initLightbox(){ 404 $j("a[data-rel^='prettyPhoto']").prettyPhoto({ 405 hook: 'data-rel', 406 social_tools:'', 407 autoplay: false, 408 show_title: false, 409 deeplinking: false, 410 overlay_gallery: false, 411 markup: '<div class="pp_pic_holder"> \ 412 <div class="ppt"> </div> \ 413 <div class="pp_top"> \ 414 <div class="pp_left"></div> \ 415 <div class="pp_middle"></div> \ 416 <div class="pp_right"></div> \ 417 </div> \ 418 <div class="pp_content_container"> \ 419 <div class="pp_left"> \ 420 <div class="pp_right"> \ 421 <div class="pp_content"> \ 422 <div class="pp_loaderIcon"></div> \ 423 <div class="pp_fade"> \ 424 <a href="#" class="pp_expand" title="Expand the image">Expand</a> \ 425 <div class="pp_hoverContainer"> \ 426 <a class="pp_next" href="#"></a> \ 427 <a class="pp_previous" href="#"></a> \ 428 </div> \ 429 <div id="pp_full_res"></div> \ 430 <div class="pp_details"> \ 431 <p class="currentTextHolder">0/0</p> \ 432 <a class="pp_close" href="#"></a> \ 433 </div> \ 434 </div> \ 435 </div> \ 436 </div> \ 437 </div> \ 438 </div> \ 439 <div class="pp_bottom"> \ 440 <div class="pp_left"></div> \ 441 <div class="pp_middle"></div> \ 442 <div class="pp_right"></div> \ 443 </div> \ 444 </div> \ 445 <div class="pp_overlay"></div>', 446 }); 447} 448 449/** 450* Parallax 451*/ 452 453function initParallax(){ 454 455 if(isEdge()){ 456 return false;
457 } 458 459 $j( '.parallax-inner' ).remove(); 460 $j( '.parallax-section' ).each( function () { 461 var skrollrSpeed, 462 skrollrSize, 463 skrollrStart, 464 skrollrEnd, 465 parallaxSectionId, 466 $parallaxElement, 467 parallaxSectionHeight, 468 parallaxImage; 469 parallaxSectionId = $j( this ).data( 'parallaxId' ); 470 parallaxSection = $j( this ); 471 var pOffset = parallaxSection.offset(); //Get the offset of the parallax section 472 var pOffsetTop = pOffset.top; 473 $parallaxElement = $j( '<div />' ).addClass( 'parallax-inner' ).appendTo( $j( this ) ); 474 475 if(pOffsetTop<100){ 476 parallaxSection.addClass('top'); 477 } 478 $parallaxElement.attr('data-parallax', '{"y": 530, "distance": 2000, "smoothness": 0}'); 479 480 parallaxImage = $j( this ).data( 'parallaxImage' ); 481 if ( parallaxImage !== undefined ) { 482 //$parallaxElement.backstretch(parallaxImage); 483 $parallaxElement.css( 'background-image', 'url(' + parallaxImage + ')' ); 484 } 485 486 if ( !isMobile.any()) { 487 488 } 489 }); 490 491} 492 493 494function ieParallax(){ 495 $j( '.parallax-section' ).each( function () { 496 var parallaxSection = $j(this); 497 parallaxSection.css({'background-attachemnt' : 'fixed'}); 498 }); 499} 500 501function parallaxRefresh() { 502 if(parallaxSkroll){ 503 parallaxSkroll.refresh(); 504 } 505} 506 507function parallaxRefreshDelayed() { 508 setTimeout(parallaxRefresh, 400); 509} 510 511 512/** 513* Sticky Header 514*/ 515 516function initStickyHeader(){ 517 if ($j("body").hasClass("sticky-header") && !isMobile.any() ) { 518 $j("#main-container").before($j("#site-header").clone().addClass("sticky").removeClass("stacked").removeClass("main").removeClass("transparent")); 519 } 520} 521 522function stickyHeader(){ 523 var fromTop = $j(document).scrollTop(); 524 $j('body').toggleClass("down", (fromTop > 200)); 525} 526 527/** 528* Transparent Header 529*/ 530 531function transparentHeader(){ 532 var transparentHeader = $j('#site-header.transparent'); 533 transparentHeader.waitForImages(function() { 534 var headerHeight = transparentHeader.height(); 535 $j('body header.entry-header.main .title').css('margin-top', headerHeight); 536 }); 537} 538 539/** 540* Megamenu width 541*/ 542 543function megamenuWidth(){ 544 var headerWidth = $j('#site-header .logo-and-nav').outerWidth(); 545 $j('.mega-menu.full-width ul').css('width', headerWidth+'px'); 546} 547 548 549/** 550* Equal Height Page Builder Columns 551*/ 552function equalizePageBuilderColumnHeights(){ 553 if($j(window).width() > mobileBreakPoint){ 554 555 var tallestColumnHeight = 0; 556 var currentColumnHeight = 0; 557 var currentColumn; 558 var columns = []; 559 var lastRow = ""; 560 $j(".panel-grid .equal-column-height .panel-grid-cell:not(.panel-grid-cell .panel-grid-cell)").each(function(intIndex) { 561 562 currentColumn = $j('.so-panel.widget:first', this); 563 var currentRow = currentColumn.closest(".panel-grid").attr("id"); 564 565 if(currentRow != lastRow) { 566 lastRow = currentRow; 567 tallestColumnHeight = 0; 568 currentColumnHeight = 0; 569 columns = []; 570 } 571 572 currentColumn.find('div:first').css('min-height', '0'); 573 currentColumnHeight = currentColumn.height(); 574 575 if(currentColumnHeight >= tallestColumnHeight){ 576 tallestColumnHeight = currentColumnHeight; 577 578 } 579 columns.push(currentColumn); 580 $j.each(columns, function() { 581 $j(this).find('div:first').css('min-height', tallestColumnHeight); 582 }); 583 584 }); 585 } 586 587 if(isIE()){ 588 $j(".v-center").each(function() { 589 var outerHeight = $j(this).height(); 590 var inner = $j(this).find("div:first"); 591 var innerHeight = inner.height(); 592 var topOffset = (outerHeight/2) - (innerHeight/2); 593 inner.css('margin-top', topOffset); 594 }); 595 }; 596} 597 598 599/** 600* Scroll to top button 601*/ 602 603function initScrollToTopButton(){ 604 if($j('#scroll-to-top')){ 605 $j('#scroll-to-top').click(function(e) { 606 $j(window).scrollTo(0, {duration:500, interrupt:false }); 607 }) 608 } 609} 610 611function scrollToTopButton(){ 612 if($j('#scroll-to-top')){ 613 var fromTop = $j(document).scrollTop(); 614 $j('#scroll-to-top').toggleClass("active", (fromTop > 200)); 615 } 616} 617 618 619/** 620* Set poster image for background videos in Slider Revolution 621*/ 622function revSliderMobilePoster() { 623 var mobile = 'ontouchend' in window; 624 $j('.tp-videolayer').each(function() { 625 var $this = $j(this); 626 if(!mobile) { 627 // to keep the video poster for desktop, comment out or remove the line below 628 $this.attr('data-videoposter', ''); 629 return; 630 } 631 $this.removeClass('fullscreenvideo tp-videolayer').addClass('mobile-video-fallback-image').css( 632 'background-image', 'url(' + $this.attr('data-videoposter') + ')' 633 ); 634 }); 635} 636 637/** 638* Fix mouse wheel zoom on Google Maps 639*/ 640function fixGoogleMapMouseWheelZoom() { 641 $j('.sow-google-map-canvas').addClass('scroll-off'); // set the pointer events to none on doc ready 642 $j('.widget_sow-google-map').on('click', function () { 643 $j('.sow-google-map-canvas').removeClass('scroll-off'); // set the pointer events true on click 644 }); 645 // disable pointer events when the mouse leave the canvas area; 646 $j(".widget_sow-google-map").mouseleave(function () { 647 $j('.sow-google-map-canvas').addClass('scroll-off'); // set the pointer events to none when mouse leaves the map area 648 }); 649} 650 651 652/** 653* Fade out preloader 654*/ 655$j(window).load(function(){ 656 $j('body').addClass('loaded'); 657 $j('#loader-container').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) { 658 $j('#loader-container').addClass('finished'); 659 }); 660}) 661 662 663/** 664* Fix mouswheel scroll in IE for fixed backgrounds 665*/ 666 667if(navigator.userAgent.match(/Trident\/7\./)) { // if IE 668 /* 669 $j('body').on("mousewheel", function () { 670 // remove default behavior 671 event.preventDefault(); 672 673 //scroll without smoothing 674 var wheelDelta = event.wheelDelta; 675 var currentScrollPosition = window.pageYOffset; 676 window.scrollTo(0, currentScrollPosition - wheelDelta); 677 }); 678 */ 679} 680 681 682/** 683* Initialize Everything 684*/ 685 686$j(document).ready(function(){ 687 isEdge(); 688 initStickyHeader(); 689 initSlideMenu(); 690 transparentHeader(); 691 $j(".content-area").fitVids(); 692 menuSetup(); 693 filterInit(); 694 loadMoreProjects(); 695 initSinglePageNav(); 696 initLightbox(); 697 initHeaderSearch(); 698 megamenuWidth(); 699 initMobileSubMenus(); 700 revSliderMobilePoster(); 701 initScrollToTopButton(); 702 fixGoogleMapMouseWheelZoom(); 703 704 //Scroll events 705 $j(window).scroll(function() { 706 if(!isMobile.any()){ 707 stickyHeader(); 708 } 709 singlePageNavScroll(); 710 scrollToTopButton(); 711 }); 712 713 714 $j(window).bind('resize', function(e) 715 { 716 window.resizeEvt; 717 $j(window).resize(function() 718 { 719 clearTimeout(window.resizeEvt); 720 window.resizeEvt = setTimeout(function() 721 { 722 initPortfolio(); 723 equalizePageBuilderColumnHeights(); 724 megamenuWidth(); 725 if(!isMobile.any() && parallaxSkroll){ 726 parallaxSkroll.refresh(); 727 } 728 729 }, 250); 730 }); 731 }); 732 733}); 734 735$j(window).load(function(){ 736 initMasonryBlog(); 737 initPortfolio();
738 equalizePageBuilderColumnHeights(); 739 if(!isMobile.any() && !isIE()){ 740 initParallax(); 741 } 742 if(isIE() || isEdge()){ 743 ieParallax(); 744 } 745 singlePageNavScroll(); 746 parallaxRefreshDelayed(); 747})
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.