1/** 2* @package: CloudFw / Envision 3* @access: Envision 4*/ 5 6/* ======================================== 7 ACCORDIONS (includes.shortcodes.shortcode.accordions) 8========================================*/ 9jQuery(document).ready(function(){ 10 "use strict"; 11 12 jQuery.fn.extend({ 13 14 CloudFwAccordions: function() { 15 var in_progress = false, 16 accordion_wrap = this, 17 accordion_items = accordion_wrap.children().not('.ui--accordion-state-static'); 18 19 accordion_items.find('> a').click(function( e ) { 20 e.preventDefault(); 21 22 if ( in_progress === true ) { 23 return false; 24 } 25 26 in_progress = true; 27 28 var that = jQuery(this), 29 item = that.parents('.ui--accordion-item').first(); 30 31 item.addClass('not'); 32 accordion_items.not('.not').removeClass('ui--accordion-state-opened').addClass('ui--accordion-state-closed'); 33 34 if (item.hasClass('ui--accordion-state-opened')) { 35 item.removeClass('ui--accordion-state-opened').removeClass('not').addClass('ui--accordion-state-closed'); 36 in_progress = false; 37 38 } else { 39 item.removeClass('ui--accordion-state-closed').removeClass('not').addClass('ui--accordion-state-opened'); 40 in_progress = false; 41 42 } 43 44 jQuery(window).trigger('scroll'); 45 jQuery(window).trigger('make@2x'); 46 jQuery(window).trigger('resize'); 47 48 }); 49 50 } 51 52 }); 53 54 /** Init Toggles */ 55 jQuery('.ui--accordion').each(function () { 56 jQuery(this).CloudFwAccordions(); 57 }); 58 59}); 60 61/* ======================================== 62 CAROUSEL (includes.shortcodes.shortcode.carousel) 63========================================*/ 64var boxGalleryInit; 65 66jQuery(document).ready(function(){ 67 "use strict"; 68 69 if ( jQuery.isFunction( jQuery.fn.flexslider ) ) { 70 71 var carouselInit = function( parent ){ 72 if ( typeof parent == 'undefined' || !parent.jquery ) 73 parent = jQuery( '.ui--carousel' ); 74 75 parent.each(function(){ 76 var that = jQuery(this); 77 var fullwidth = ! that.parents('.ui-row').length; 78 var pass = that.parents('.ui--pass'); 79 var wrapper = pass.length ? pass : that; 80 81 var title_bordered = that.prev('.ui--title-bordered').length ? that.prev('.ui--title-bordered') : wrapper.prev('.ui--title-bordered'); 82 var title_widget = wrapper.prev('.ui--widget-title'); 83 var slider_data = that.data('flexslider'); 84 85 86 if ( ! slider_data ) { 87 88 var options = CloudFwParseAttribute(that.attr('data-options')); 89 var slides = that.find('.slides'); 90 91 if ( options.disable_on_mobile == '1' && detectDeviceViaPageWidth() == 'phone' ) { 92 var items = slides.children(); 93 items.show(); 94 return false; 95 } 96 97 if ( slides.length > 1 ) { 98 slides.last().unwrap(); 99 } 100 101 if ( fullwidth ) { 102 that.addClass( 'fullwidth-content' ); 103 var children = slides.first().children(); 104 105 children.each(function(){ 106 var child = jQuery(this); 107 108 if ( child.hasClass('.ui-row') ) { 109 child.wrap('<div class="ui--carousel-content clearfix" />').wrap('<div class="container" />'); 110 } else { 111 child.wrap('<div class="ui--carousel-content clearfix" />').wrap('<div class="container" />').wrap('<div class="ui-row" />'); 112 } 113 114 }); 115 116 prepareResponsiveFullwidthContainerPage( that ); 117 } else { 118 slides.first().children('.ui-row').wrap('<div class="ui--carousel-content clearfix" />'); 119 } 120 121 var items = slides.children(); 122 if ( !( items.length > 1 ) ) { 123 items.show(); 124 return false; 125 } 126 127 128 //console.log(options); 129 130 if ( options.auto_rotate == '1' ) { 131 options.auto_rotate = true; 132 } else { 133 options.auto_rotate = false; 134 } 135 136 if ( options.animation_loop == '1' ) { 137 options.animation_loop = true; 138 } else { 139 options.animation_loop = false; 140 } 141 142 if ( typeof options.animate == 'undefined' || options.animate == '1' ) { 143 options.animate = 600; 144 } else { 145 options.animate = 1; 146 } 147 148 var that = that.flexslider({ 149 namespace: "ui--carousel-", 150 selector: ".slides > div", 151 animation: options.effect || "slide", 152 slideshow: options.auto_rotate, 153 //slideshow: false, 154 slideshowSpeed: options.rotate_time || 7000, 155 smoothHeight: true, 156 animationLoop: options.animation_loop || false, 157 controlNav: false, 158 directionNav: false, 159 pauseOnHover: true, 160 animationSpeed: 1000, 161 itemMargin: 30, 162 start: function( obj ) { 163 if ( typeof boxGalleryInit != 'undefined' ) { 164 boxGalleryInit( that ); 165 } 166 } 167 168 }); 169 170 var slider_data = that.data('flexslider'); 171 172 if ( options.arrows == '1' ) { 173 174 var to_prev = function(){ that.flexslider('prev'); jQuery(window).scroll(); } 175 var to_next = function(){ that.flexslider('next'); jQuery(window).scroll(); } 176 177 if ( title_bordered.length ) { 178 title_bordered.addClass('with-navigation'); 179 title_bordered.find('.ui--title-navigation').remove(); 180 title_bordered.append( jQuery('<div/>').addClass('ui--title-navigation') ); 181 title_bordered.find('.ui--title-navigation').html('<span class=\"arr arr-small arr-plain arr-left ui--carosuel-prev\"><span></span><i class=\"fontawesome-angle-left px18\"></i></span> <span class=\"arr arr-small arr-plain ui--carosuel-next\"><span></span><i class=\"fontawesome-angle-right px18\"></i></span>'); 182 title_bordered.find('.ui--title-navigation > .ui--carosuel-prev').click( to_prev ); 183 title_bordered.find('.ui--title-navigation > .ui--carosuel-next').click( to_next ); 184 } else if ( title_widget.length ) { 185 title_widget.addClass('with-navigation'); 186 title_widget.find('.ui--title-navigation').remove(); 187 title_widget.append( jQuery('<div/>').addClass('ui--title-navigation') ); 188 title_widget.find('.ui--title-navigation').html('<span class=\"arr arr-plain arr-left ui--carosuel-prev\"><span></span><i class=\"fontawesome-angle-left px18\"></i></span> <span class=\"arr arr-plain ui--carosuel-next\"><span></span><i class=\"fontawesome-angle-right px18\"></i></span>'); 189 title_widget.find('.ui--title-navigation > .ui--carosuel-prev').click( to_prev ); 190 title_widget.find('.ui--title-navigation > .ui--carosuel-next').click( to_next ); 191 } else { 192 that.find('.ui--carousel-navigation').remove(); 193 that.append( jQuery('<div/>').addClass('ui--carousel-navigation clearfix') ); 194 that.find('.ui--carousel-navigation').html('<span class=\"arr arr-normal arr-left ui--carosuel-prev\"><span></span><i class=\"fontawesome-chevron-left px18\"></i></span> <span class=\"arr arr-normal ui--carosuel-next\"><span></span><i class=\"fontawesome-chevron-right px18\"></i></span>'); 195 that.find('.ui--carousel-navigation > .ui--carosuel-prev').click( to_prev ); 196 that.find('.ui--carousel-navigation > .ui--carosuel-next').click( to_next ); 197 } 198 199 } 200 201 } 202 203 }); 204 205 } 206 207 /*var timeout = setTimeout( function(){ 208 carouselInit(); 209 clearTimeout( timeout ); 210 }, 500); 211 */ 212 jQuery( '.ui--carousel' ).each(function(){ 213 var that = jQuery(this); 214 that.find('.slides > div:first').find('img:first').imagesLoaded(function(){ 215 var timeout = setTimeout( function(){ 216 carouselInit( that ); 217 clearTimeout( timeout ); 218 }, 300); 219 220 }); 221 }); 222 jQuery(window).load(carouselInit); 223 224 225 226 227 boxGalleryInit = function( parent ){ 228 229 parent.find( '.ui--content-box-gallery' ).each(function(){ 230 var that = jQuery(this); 231 var slider_data = that.data('flexslider'); 232 233 234 if ( !slider_data ) { 235 236 jQuery(window).load(function(){ boxGalleryInit( parent ); }); 237 var options = CloudFwParseAttribute(that.attr('data-options')); 238 options.auto_rotate = (options.auto_rotate == '1') ? true : false;
239 240 that.flexslider({ 241 namespace: "ui--content-box-gallery-", 242 selector: ".mini-slides > div", 243 animation: options.effect || "slide", 244 slideshow: options.auto_rotate || false, 245 slideshowSpeed: 7000, 246 smoothHeight: true, 247 controlNav: false, 248 directionNav: false, 249 keyboard: false 250 }); 251 252 var slider_data = that.data('flexslider'); 253 254 var to_prev = function(){ that.flexslider("prev"); } 255 var to_next = function(){ that.flexslider("next"); } 256 257 that.find('.ui--content-box-gallery-navigation').remove(); 258 that.append( jQuery('<div/>').addClass('ui--content-box-gallery-navigation') ); 259 that.find('.ui--content-box-gallery-navigation').html('<span class=\"arr arr-normal arr-left ui--carosuel-prev\"><span></span><i class=\"fontawesome-chevron-left px18\"></i></span> <span class=\"arr arr-normal ui--carosuel-next\"><span></span><i class=\"fontawesome-chevron-right px18\"></i></span>'); 260 that.find('.ui--content-box-gallery-navigation > .ui--carosuel-prev').click( to_prev ); 261 that.find('.ui--content-box-gallery-navigation > .ui--carosuel-next').click( to_next ); 262 263 264 } 265 266 }); 267 268 } 269 270 jQuery('.ui--content-box').each(function(){ 271 var that = jQuery(this), 272 parents = that.parents(); 273 274 if ( !parents.filter('.ui--carousel').length && !parents.filter('.ui--masonry').length ) { 275 boxGalleryInit( that ); 276 jQuery(window).load(function(){ boxGalleryInit( that ); }); 277 } 278 279 280 }); 281 282 283 284 285 } 286 287}); 288 289/* ======================================== 290 GALLERY (includes.shortcodes.shortcode.gallery) 291========================================*/ 292(function( jQuery ){ 293 "use strict"; 294 295 jQuery(document).ready(function(){ 296 297 if ( !CloudFwOp.gallery_overlay_opacity ) { 298 CloudFwOp.gallery_overlay_opacity = 90; 299 } 300 301 jQuery('.ui--gallery-item a').hover(function(){ 302 var that = jQuery(this), 303 overlay = that.find('.ui--gallery-overlay'); 304 305 overlay.stop(1).fadeTo(500, CloudFwOp.gallery_overlay_opacity / 100); 306 307 },function(){ 308 var that = jQuery(this), 309 overlay = that.find('.ui--gallery-overlay'); 310 311 overlay.stop(1).fadeTo(500,0); 312 313 }); 314 315 }); 316 317})(jQuery); 318 319/* ======================================== 320 GMAP (includes.shortcodes.shortcode.gmap) 321========================================*/ 322jQuery(document).ready(function(){ 323 "use strict"; 324 325 jQuery(".gmap").each(function(){ 326 var that = jQuery(this), 327 gmap = '', 328 api = '', 329 data = that.attr('data-gmap-options') || '', 330 defaults = {}; 331 332 try { 333 334 if ( typeof data != 'object' ) { 335 var gmap_metadata = jQuery.parseJSON( data ); 336 } else { 337 var gmap_metadata = data; 338 } 339 340 } catch (e) { 341 var gmap_metadata = {}; 342 } 343 344 var defaults = { 345 zoom : 12, 346 latitude : 0, 347 longitude : 0, 348 maptype : "ROADMAP", 349 doubleclickzoom : 1, 350 scrollwheel : 1, 351 controls : false 352 }; 353 354 355 var gmap_options = jQuery.extend( {}, defaults, gmap_metadata ); 356 jQuery( gmap_options.markers ).each(function( index, value ) { 357 gmap_options.markers[ index ].html = jQuery('<div />').html( gmap_options.markers[ index ].html ).text().replace(/\n/g,'<br/>'); 358 }); 359 360 that.unbind('gMapReady').bind('gMapReady',function(){ 361 gmap = that.gMap( gmap_options ); 362 api = that.data('gMap.reference'); 363 that.data( "gMapReady", true ); 364 365 var styles = gmap_options.stylers || {}; 366 367 if ( styles ) { 368 api.setOptions({styles: styles}); 369 } 370 371 }).data("gMapReady", false); 372 373 var init_now = true; 374 375 if ( init_now ) { 376 that.trigger( 'gMapReady' ); 377 } 378 379 var device_callback = function(){ 380 var device = detectDeviceViaPageWidth(); 381 382 if ( device == 'phone' ) { 383 that.trigger('gMapReady'); 384 } 385 } 386 387 device_callback(); 388 //jQuery(window).bind('CloudFwDetectDevice', device_callback ); 389 390 }); 391 392}); 393 394/* ======================================== 395 MASONRY (includes.shortcodes.shortcode.masonry) 396========================================*/ 397jQuery(document).ready(function(){ 398 "use strict"; 399 400 //return true; 401 402 if ( jQuery.isFunction( jQuery.fn.CloudFwisotope ) ) { 403 404 // code found on this page: http://isotope.metafizzy.co/custom-layout-modes/masonry-gutters.html 405 406 // modified Isotope methods for gutters in masonry 407 jQuery.CloudFwisotope.prototype._getMasonryGutterColumns = function() { 408 var gutter = this.options.masonry && this.options.masonry.gutterWidth || 0; 409 var containerWidth = this.element.width(); 410 411 this.masonry.columnWidth = this.options.masonry && this.options.masonry.columnWidth || 412 // or use the size of the first item 413 this.$filteredAtoms.outerWidth(true) || 414 containerWidth; 415 416 this.masonry.columnWidth += gutter; 417 418 this.masonry.cols = Math.floor((containerWidth + gutter) / this.masonry.columnWidth); 419 this.masonry.cols = Math.max(this.masonry.cols, 1); 420 } 421 422 jQuery.CloudFwisotope.prototype._masonryReset = function() { 423 // layout-specific props 424 this.masonry = {}; 425 this._getMasonryGutterColumns(); 426 var i = this.masonry.cols; 427 this.masonry.colYs = []; 428 while (i--) { 429 this.masonry.colYs.push(0); 430 } 431 } 432 433 jQuery.CloudFwisotope.prototype._masonryResizeChanged = function() { 434 var prevSegments = this.masonry.cols; 435 // update cols/rows 436 this._getMasonryGutterColumns(); 437 // return if updated cols/rows is not equal to previous 438 return (this.masonry.cols !== prevSegments); 439 } 440 441 var masonryInit = function(){ 442 443 jQuery( '.ui--masonry' ).each(function(){ 444 var that = jQuery(this); 445 var title_bordered = that.prev('.ui--title-bordered'); 446 var title_widget = that.prev('.ui--widget-title'); 447 var masonry_data = that.data('masonry'); 448 var init = new Object(); 449 var is_fluid = false;
450 451 if ( that.hasClass('row-fluid') || that.parents('.ui-row').length ) { 452 is_fluid = true; 453 } 454 455 if ( ! masonry_data ) { 456 457 CloudFwLoaded( that ); 458 459 var items = that.find('.ui--content-item'); 460 items.each(function(){ 461 if( !jQuery(this).parent().hasClass('ui-column') ) { 462 jQuery(this).wrap('<div class="ui-column span12"/>'); 463 } 464 }); 465 466 var pass = that.children('.ui--pass'); 467 if ( pass.length ) { 468 pass.find('.ui-row > .ui-column').addClass('ui--isotope-item'); 469 } else { 470 that.find('> .ui-row > .ui-column').addClass('ui--isotope-item'); 471 } 472 473 //that.imagesLoaded(masonryInit); 474 } 475 476 if ( masonry_data == true && !is_fluid ) { 477 that.CloudFwisotope( 'reLayout' ); 478 return false; 479 } 480 481 /** Init Object */ 482 init.resizable = false; 483 init.itemSelector = '.ui--isotope-item'; 484 init.onLayout = function(){ 485 that.show(); 486 if ( typeof boxGalleryInit != 'undefined' ) 487 boxGalleryInit( that ); 488 }; 489 init.layoutMode = 'masonry'; 490 491 if ( is_fluid ) { 492 var containerWidth = that.width(); 493 494 var column = that.children().first().attr('data-columns'); 495 496 if ( ! column ) { 497 var column = CloudFwGetColumByClassname( that.find('.ui--isotope-item') ); 498 } 499 500 var gutter = (containerWidth * column) / 100, 501 gutterWidth = gutter * (column - 1), 502 columnWidth = Math.floor(((containerWidth - gutterWidth) / column)); 503 504 init.masonry = { 505 columnWidth: columnWidth, 506 gutterWidth: gutter 507 }; 508 } 509 510 that.data('masonry',true); 511 that.css("visibility", "visible").css("overflow", "visible").CloudFwisotope(init); 512 that.addClass('ui--done'); 513 514 }); 515 516 } 517 518 if ( BrowserDetect.browser == 'IE' ) { 519 jQuery(window).load(masonryInit); 520 } else { 521 masonryInit(); 522 } 523 524 jQuery(window).smartresize(masonryInit, 5000); 525 jQuery(document).ajaxSuccess(masonryInit); 526 527 } 528 529}); 530 531/* ======================================== 532 TABLE (includes.shortcodes.shortcode.pricing_table) 533========================================*/ 534jQuery(document).ready(function(){ 535 "use strict"; 536 537 var pricingTableInit = function(){ 538 539 jQuery('.ui--pricing-table').each(function(){ 540 var that = jQuery(this), 541 before_htmls = that.find( '.ui--pricing-table-before-html' ), 542 features = that.find( '.ui--pricing-table-features' ); 543 544 before_htmls.css({'min-height': ''}).css({'min-height': Math.max.apply(null, before_htmls.map(function(){return jQuery(this).height();}).get())}); 545 546 features.first().children('.ui--pricing-table-feature').each(function(){ 547 var group = jQuery(this).attr('data-group'), 548 items = that.find( '.' + group ); 549 550 items.css({'min-height': ''}).css({'min-height': Math.max.apply(null, items.map(function(){return jQuery(this).height();}).get())}); 551 552 }); 553 554 }); 555 556 } 557 558 pricingTableInit(); 559 jQuery(window).load( pricingTableInit ); 560 jQuery(window).smartresize( pricingTableInit ); 561 562}); 563 564/* ======================================== 565 PROGRESS BAR (includes.shortcodes.shortcode.progress_bar) 566========================================*/ 567jQuery(document).ready(function(){ 568 "use strict"; 569 570 if ( ! jQuery.isFunction( jQuery.inviewport ) ) 571 return false; 572 573 var progressBarInit = function(){ 574 575 jQuery('.ui--progress:in-viewport').each(function(){ 576 var that = jQuery(this); 577 578 if( ! that.hasClass('animated') ) { 579 var percent = that.find('.ui--progress-percent'); 580 var callback = function(){ 581 582 } 583 584 percent.css({'visibility': 'visible'}); 585 if ( animation_type == 'css' ) { 586 587 that.addClass('lock'); 588 that.addClass('animated'); 589 590 var delay = setInterval(function(){ 591 that.removeClass('lock'); 592 clearInterval(delay); 593 }, 500); 594 595 that.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", callback); 596 597 } else { 598 599 that.addClass('animated'); 600 var width = percent.attr('data-value'); 601 percent.width('0').animate({'width': width}, 600, callback); 602 603 } 604 605 606 } 607 }); 608 609 } 610 611 if ( jQuery('.ui--progress').length ) { 612 var animation_type = jQuery('html').hasClass('cssanimations') ? 'css' : 'javascript'; 613 614 if ( animation_type == 'css' ) { 615 progressBarInit(); 616 jQuery(window).load( progressBarInit ); 617 jQuery(window).scroll( jQuery.throttle( 250, progressBarInit ) ); 618 } 619 620 } 621}); 622 623/* ========================================
624 PROGRESS CIRCLE (includes.shortcodes.shortcode.progress_circle) 625========================================*/ 626jQuery(document).ready(function(){ 627 "use strict"; 628 629 if ( ! jQuery.isFunction( jQuery.inviewport ) || ! jQuery.isFunction( jQuery.easyPieChart ) ) { 630 return false; 631 } 632 633 var initPieChart = function() { 634 jQuery('.ui--progress-circle').each(function(){ 635 var that = jQuery(this), 636 wrapper = that.parent(), 637 wrapper_width = wrapper.width(), 638 percent_text = wrapper.find('.ui--progress-circle-percent'), 639 percent = parseInt(that.attr('data-percent-update'), 10), 640 width = parseInt(that.attr('data-width'), 10); 641 642 if ( !width || width > wrapper_width ) { 643 width = wrapper_width; 644 } 645 646 that.easyPieChart({ 647 animate: 1000, 648 trackColor: '#f1f1f1', 649 barColor: '#169FE5', 650 scaleColor: false, 651 lineCap: 'butt', 652 rotate: -90, 653 lineWidth: 15, 654 size: width, 655 onStep: function(value) { percent_text.text(~~value); }, 656 onStop: function(value) { percent_text.text(percent); } 657 }); 658 659 that.find('.ui--center-vertical').uiVerticalCenter(); 660 661 662 }); 663 664 initPieChartUpdate(); 665 666 }; 667 668 var initPieChartResize = function() { 669 670 jQuery('.ui--progress-circle').each(function(){ 671 var that = jQuery(this); 672 673 that.removeData( 'easyPieChart' ); 674 that.removeData( 'inViewport' ); 675 that.css({ 676 'width' : '', 677 'height' : '', 678 'line-height' : '' 679 }); 680 that.find('canvas').remove(); 681 682 }); 683 684 initPieChart(); 685 686 }; 687 688 var initPieChartUpdate = function() { 689 jQuery('.ui--progress-circle:in-viewport').each(function(){ 690 var that = jQuery(this); 691 692 if ( ! that.is(':visible') ) { 693 return true; 694 } 695 696 if ( that.data('inViewport') ) { 697 return true; 698 } 699 700 that.data('inViewport', true); 701 702 var percent = parseInt(that.attr('data-percent-update'), 10); 703 that.data('easyPieChart').update( percent ); 704 }); 705 }; 706 707 708 if ( jQuery('.ui--progress-circle').length ) { 709 var animation_type = jQuery('html').hasClass('cssanimations') ? 'css' : 'javascript'; 710 711 if ( animation_type == 'css' ) { 712 initPieChart(); 713 jQuery(window).load( initPieChartUpdate ); 714 jQuery(window).scroll( jQuery.throttle( 250, initPieChartUpdate ) ); 715 jQuery(window).smartresize( initPieChartResize, 5000 ); 716 } 717 }; 718 719}); 720 721/* ======================================== 722 TABS (includes.shortcodes.shortcode.tabs) 723========================================*/ 724jQuery(document).ready(function(){ 725 "use strict"; 726 727 jQuery.fn.extend({ 728 /** 729 * CloudFw Tabs 730 * 731 * @since 1.0 732 */ 733 CloudFwTabs: function() { 734 var in_proccess = false, 735 tabs = this, 736 titles = tabs.find('.ui--tabs-header .ui--tabs-titles').children('li'), 737 border_before = tabs.find('.ui--tabs-header .ui--tabs-border-before'), 738 border_after = tabs.find('.ui--tabs-header .ui--tabs-border-after'), 739 border_top = tabs.find('.ui--tabs-header .ui--tabs-border-top'), 740 border_bottom = tabs.find('.ui--tabs-header .ui--tabs-border-bottom'), 741 contents = tabs.children('.ui--tabs-contents').children('li'); 742 743 titles.first().addClass('first-item'); 744 titles.last().addClass('last-item'); 745 746 contents.first().show().removeClass('hidden').addClass('active').addClass('first-item'); 747 contents.last().addClass('last-item'); 748 749 titles.find('a').click(function(e) { 750 e.preventDefault(); 751 752 var that = jQuery(this), 753 li = that.parents('li').first(), 754 width = li.width(), 755 height = li.height(), 756 pos = li.position(), 757 index = li.index(); 758 759 760 if (in_proccess === true ) { 761 return false; 762 } 763 764 in_proccess = true; 765 766 if ( ! li.hasClass('active') ) { 767 contents.filter('.active').removeClass('active').addClass('hidden'); 768 var current_item = contents.eq(index); 769 770 current_item.removeClass('hidden').addClass('active'); 771 772 titles.filter('.active').removeClass('active'); 773 li.addClass('active'); 774 775 /*if ( ! current_item.is(':in-viewport' ) ) { 776 var pos = parseInt(current_item.offset().top, 10); 777 778 if ( pos > 100 ) { 779 pos = pos - 200; 780 } 781 782 jQuery("html, body").scrollTop( pos ); 783 }*/ 784 785 } 786 787 border_after.css( { left: (pos.left + width) } ); 788 border_before.css( { left: -(border_before.width() - pos.left) } ); 789 790 border_top.css( { top: -(border_top.height() - pos.top) } ); 791 border_bottom.css( { top: (pos.top + height) } ); 792 793 tabs.addClass('ui--done'); 794 795 in_proccess = false;
796 jQuery(window).trigger('scroll'); 797 jQuery(window).trigger('make@2x'); 798 799 800 }); 801 802 titles.first().find('a').click(); 803 804 var refresh_titles = function(){ 805 titles.filter('.active').find('a').click(); 806 }; 807 808 jQuery(window).smartresize(refresh_titles, 20); 809 jQuery(document).ready(refresh_titles); 810 jQuery(window).load(refresh_titles); 811 812 } 813 814 }); 815 816 /** Prepare Tabs */ 817 jQuery('.ui--tabs').each(function () { 818 jQuery(this).CloudFwTabs(); 819 }); 820 821}); 822 823/* ======================================== 824 TITLES (includes.shortcodes.shortcode.titles) 825========================================*/ 826jQuery(document).ready(function(){ 827 "use strict"; 828 829 var bordered_titles_callback = function(){ 830 jQuery('.ui--title-bordered').each(function(){ 831 var that = jQuery(this), 832 text = that.find('.ui--title-text'), 833 pos = text.position(), 834 width = text.outerWidth(), 835 border_left = that.find('.ui--title-border-left'), 836 border_right = that.find('.ui--title-border-right'); 837 838 839 border_left.show().css({ left: 0 - (border_left.width() - pos.left) }); 840 border_right.show().css( { left: (pos.left + width) } ); 841 842 }); 843 } 844 845 bordered_titles_callback(); 846 jQuery(window).load( bordered_titles_callback ); 847 jQuery(window).smartresize( bordered_titles_callback ); 848 849 850}); 851 852/* ======================================== 853 TOGGLES (includes.shortcodes.shortcode.toggles) 854========================================*/ 855jQuery(document).ready(function(){ 856 "use strict"; 857 858 jQuery.fn.extend({ 859 860 CloudFwToggle: function() { 861 var in_progress = false, 862 toggle = this, 863 title = toggle.children('.ui--toggle-title'), 864 title_link = title.children('a'), 865 content = toggle.children('.ui--toggle-content'); 866 867 title_link.click(function( e ) { 868 e.preventDefault(); 869 870 if (in_progress === true) { 871 return false; 872 } 873 874 in_progress = true; 875 876 var that = jQuery(this), 877 group = toggle.attr("data-group"); 878 879 toggle.addClass('not'); 880 881 if (group && toggle.hasClass('ui--toggle-state-closed')) { 882 jQuery('[data-group="' + group + '"]').not('.not').removeClass('ui--toggle-state-opened').addClass('ui--toggle-state-closed'); 883 } 884 885 if (toggle.hasClass('ui--toggle-state-opened')) { 886 toggle.removeClass('ui--toggle-state-opened').removeClass('not').addClass('ui--toggle-state-closed'); 887 in_progress = false; 888 889 } else { 890 toggle.removeClass('ui--toggle-state-closed').removeClass('not').addClass('ui--toggle-state-opened'); 891 in_progress = false; 892 jQuery(window).trigger('scroll'); 893 jQuery(window).trigger('make@2x'); 894 } 895 896 }); 897 898 899 } 900 901 }); 902 903 /** Init Toggles */ 904 jQuery('.ui--toggle').each(function () { 905 jQuery(this).CloudFwToggle(); 906 }); 907 908}); 909 910/* ======================================== 911 GALLERY (includes.shortcodes.shortcode.ui_box) 912========================================*/ 913jQuery(document).ready(function(){ 914 "use strict"; 915 916 if ( jQuery.isFunction( jQuery.fn.flexslider ) ) { 917 //jQuery( '.ui--carousel' ).imagesLoaded(boxGalleryInit); 918 919 } 920 921 jQuery('.ui--content-box').each(function(){ 922 var that = jQuery(this); 923 var options = CloudFwParseAttribute(that.attr('data-ligthbox')); 924 925 if ( options ) { 926 if ( options.src ) { 927 that.find('.ui--content-box-link').bind('click', function(){ 928 jQuery.CloudFwPrettyPhoto.open(options.src, null, options.desc); 929 return false; 930 }); 931 } 932 } 933 934 935 }); 936 937 938 939}); 940 941/* ======================================== 942 BLOG (includes.modules.module.blog) 943========================================*/ 944jQuery(document).ready(function(){ 945 946 blogGalleryInit = function( parent ){ 947 948 jQuery( '.ui--blog-gallery' ).each(function(){ 949 var that = jQuery(this); 950 var slider_data = that.data('flexslider'); 951 952 953 if ( !slider_data ) { 954 955 var first_item = jQuery('.ui--blog-gallery-item-1 img', that); 956 first_item.imagesLoaded(function(){ 957 958 that.css({height: first_item.height()}); 959 960 jQuery(window).load(function(){ blogGalleryInit( parent ); }); 961 962 var options = CloudFwParseAttribute(that.attr('data-options')); 963 options.auto_rotate = (options.auto_rotate == '1') ? true : false;
964 965 that.flexslider({ 966 namespace: "ui--blog-gallery-", 967 selector: ".slides > div", 968 animation: options.effect || "slide", 969 slideshow: options.auto_rotate || false, 970 slideshowSpeed: options.rotate_time || 7000, 971 smoothHeight: true, 972 controlNav: false, 973 directionNav: false, 974 keyboard: false 975 }); 976 977 var slider_data = that.data('flexslider'); 978 979 var to_prev = function(){ that.flexslider("prev"); } 980 var to_next = function(){ that.flexslider("next"); } 981 982 that.find('.ui--blog-gallery-navigation').remove(); 983 that.append( jQuery('<div/>').addClass('ui--blog-gallery-navigation') ); 984 that.find('.ui--blog-gallery-navigation').html('<span class=\"arr arr-normal arr-left ui--carosuel-prev\"><span></span><i class=\"fontawesome-chevron-left px18\"></i></span> <span class=\"arr arr-normal ui--carosuel-next\"><span></span><i class=\"fontawesome-chevron-right px18\"></i></span>'); 985 that.find('.ui--blog-gallery-navigation > .ui--carosuel-prev').click( to_prev ); 986 that.find('.ui--blog-gallery-navigation > .ui--carosuel-next').click( to_next ); 987 988 }); 989 990 } 991 992 }); 993 994 } 995 996 blogGalleryInit(); 997 jQuery(window).load(function(){ blogGalleryInit(); }); 998 999}); 1000 1001/* ======================================== 1002 EFFECTS (includes.modules.module.effects) 1003========================================*/ 1004jQuery(document).ready(function(){ 1005 'use strict'; 1006 1007 var initEffects = function() { 1008 1009 jQuery('.ui--animation-in:in-viewport').each(function(){ 1010 var parent = jQuery(this); 1011 1012 if ( ! parent.is(':visible') ) { 1013 return true; 1014 } 1015 1016 if ( parent.data('inViewport') ) { 1017 return true; 1018 } 1019 1020 parent.data('inViewport', true); 1021 1022 initEffectsFire( parent ); 1023 1024 }); 1025 1026 }; 1027 1028 var initEffectsFire = function( parent ) { 1029 1030 var animator = parent.hasClass('ui--animation-in') ? parent : parent.parents('.ui--animation-in:first'); 1031 1032 var elements = parent.find('.ui--animation'), 1033 effect = animator.attr('data-fx'), 1034 start_delay = parseInt( parent.attr('data-start-delay'), 10 ) || 0, 1035 delay = parseInt( animator.attr('data-delay'), 10 ) || 150; 1036 1037 var carousel = parent.find('.ui--carousel'); 1038 if ( carousel.length ) { 1039 var active_carousel = carousel.find('.ui--carousel-active-slide'); 1040 1041 if ( active_carousel.length ) { 1042 var passive_elements = elements; 1043 1044 if ( carousel.parents('.ui--animation').length ) { 1045 initEffectsFire( carousel.find('.ui--carousel-active-slide') ); 1046 } else { 1047 elements = carousel.find('.ui--carousel-active-slide').find('.ui--animation'); 1048 } 1049 passive_elements.not( elements ).addClass('ui--animation-fire');/*.removeClass('ui--animation')*/; 1050 } 1051 1052 } 1053 1054 elements = elements.filter(function(index){ 1055 var parent_animations = jQuery(this).parents('.ui--animation'); 1056 1057 parent_animations = parent_animations.filter(function(){ 1058 return jQuery(this).find('.ui--animation-in').length === 0; 1059 }); 1060 1061 return parent_animations.length === 0; 1062 }); 1063 1064 /*elements = elements.filter(function(index){ 1065 var all_parents = jQuery(this).parents(); 1066 var has_ui_animation = false; 1067 1068 all_parents.each(function(){ 1069 var up_element = jQuery(this); 1070 if ( up_element.hasClass( '.ui--animation-in' ) ) { 1071 return false; 1072 } else if ( up_element.hasClass( '.ui--animation' ) ) { 1073 has_ui_animation = true; 1074 return false; 1075 } 1076 }); 1077 1078 return has_ui_animation ? false : true; 1079 });*/ 1080 1081 1082 1083 elements.each(function(i){ 1084 1085 var element = jQuery(this), 1086 element_effect = element.attr('data-fx'), 1087 element_delay = parseInt( element.attr('data-delay'), 10 ) || 0, 1088 current_delay = (start_delay + element_delay) + (i * delay); 1089 1090 //element.attr('data-current-delay', current_delay); 1091 1092 if ( element_effect ) { 1093 element.addClass( element_effect ); 1094 } else if ( effect ) { 1095 element.addClass( effect ); 1096 } 1097 1098 var timeout = setTimeout(function(){ 1099 1100 //element.bind("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd", function(){}); 1101 element.addClass('ui--animation-fire').attr('delay', current_delay); 1102 1103 if ( element.find('.ui--animation') ) { 1104 element.removeClass('ui--animation'); 1105 initEffectsFire( element ); 1106 } 1107 1108 }, (current_delay)); 1109 1110 }); 1111 1112 }; 1113 1114 var animation_type = jQuery('html').hasClass('cssanimations') ? 'css' : 'javascript'; 1115 1116 if ( animation_type == 'css' ) { 1117 //setTimeout( initEffects, 200 ); 1118 jQuery(document).ready( initEffects ); 1119 jQuery(document).ajaxSuccess( initEffects ); 1120 jQuery(window).load( initEffects ); 1121 jQuery(window).focus( initEffects ); 1122 jQuery(window).scroll( jQuery.throttle( 250, initEffects ) ); 1123 } 1124 1125}); 1126 1127/* ======================================== 1128 LIKES (includes.modules.module.likes) 1129========================================*/ 1130jQuery(document).ready(function($){ 1131 1132 jQuery('.ui--likes').on('click', 1133 function() { 1134 var that = jQuery(this); 1135 1136 //if(that.hasClass('active')) 1137 // return false;
1138 1139 var id = that.attr('data-post-id'), 1140 options = CloudFwParseAttribute(that.attr('data-options')); 1141 1142 var options_encoded = {}; 1143 jQuery.each( options, function( k, v ){ 1144 options_encoded[ k ] = encodeURIComponent(v); 1145 }); 1146 1147 jQuery.post(CloudFwOp.ajaxUrl, { 1148 action: 'cloudfw_likes', 1149 likes_id: id, 1150 options: options_encoded 1151 }, function(data){ 1152 that.html(data).addClass('active').attr('title','You already like this'); 1153 }); 1154 1155 return false; 1156 }); 1157 1158}); 1159 1160/* ======================================== 1161 PRIMARY NAVIGATION (includes.modules.module.nav) 1162========================================*/ 1163jQuery(document).ready(function(){ 1164 1165 if ( jQuery.isFunction( jQuery.fn.superfish ) ) { 1166 var navigation = jQuery('#header-navigation'); 1167 1168 navigation.superfish({ 1169 hoverClass: 'hover', 1170 fire_event: CloudFwOp.navigation_event || 'hover', 1171 cssArrows: false, 1172 delay: 10, 1173 speed: 200, 1174 speedOut: 200, 1175 onBeforeShow: function( $sub ){ 1176 1177 var $device = detectDeviceViaPageWidth(); 1178 if ( $device != 'phone' ) { 1179 var $parent = $sub.parent('li').first(); 1180 1181 if ( $parent.hasClass('level-0') ) { 1182 var $height = $parent.height(); 1183 if ( $parent.css('position') != 'relative' ) { 1184 var $pos = $parent.position().top; 1185 } 1186 $sub.css({'top': $height + $pos}); 1187 } 1188 } 1189 navigation.addClass('active'); 1190 1191 }, 1192 onShow: function( $sub ){ 1193 1194 jQuery(window).trigger('scroll'); 1195 jQuery(window).trigger('make@2x'); 1196 }, 1197 onBeforeHide: function( $sub ){ 1198 var $parent = $sub.parent('li').first(); 1199 1200 if ( $parent.hasClass('level-0') ) { 1201 navigation.removeClass('active'); 1202 $sub.css({'top': ''}); 1203 } 1204 1205 } 1206 }); 1207 } 1208 1209 1210 jQuery('#header-navigation-toggle > a').click(function(){ 1211 var that = jQuery(this), 1212 nav = jQuery('#header-navigation'); 1213 1214 if ( nav.is(':visible') ) { 1215 nav.slideUp(); 1216 } else { 1217 nav.slideDown(); 1218 } 1219 1220 }); 1221 1222}); 1223 1224 1225(function(){ 1226 1227 jQuery(document).ready(function(){ 1228 1229 var header_overlapping = function(){ 1230 var win_height = win_height_alias = jQuery(window).height(); 1231 var header = jQuery('#page-header'); 1232 1233 if( header.length ) { 1234 var device = detectDeviceViaPageWidth(); 1235 var header_height = header.height(); 1236 var helper = jQuery('#header-overlapping-helper'); 1237 var header_overlapping_mobile = jQuery('body').hasClass('header-overlapping-mobile'); 1238 1239 if ( helper.length ) { 1240 if ( device == 'widescreen' || header_overlapping_mobile ) { 1241 helper.height( header_height ); 1242 } else { 1243 helper.css('height', '' ); 1244 } 1245 1246 } else { 1247 1248 var titlebar = jQuery('#titlebar'); 1249 if( titlebar.length ) { 1250 1251 if ( device == 'widescreen' || header_overlapping_mobile ) { 1252 titlebar.css('padding-top', header_height ); 1253 } else { 1254 titlebar.css('padding-top', '' ); 1255 } 1256 1257 } 1258 1259 } 1260 1261 jQuery('body').addClass('header-overlapping-ok'); 1262 1263 } 1264 1265 } 1266 1267 if ( jQuery('body').hasClass('header-overlapping') ) { 1268 header_overlapping(); 1269 jQuery(window).load( header_overlapping ); 1270 jQuery(window).smartresize( header_overlapping, 20 ); 1271 } 1272 1273 }); 1274 1275})(jQuery); 1276 1277/* ======================================== 1278 PORTFOLIO (includes.modules.module.portfolio) 1279========================================*/ 1280jQuery(document).ready(function(){ 1281 1282 var filters = []; 1283 var can_multiple = false; 1284 var changePortfolioFilter = function( that ) { 1285 var wrapper = that.parents('.portfolio-container-wrapper').first(), 1286 container = wrapper.find('.portfolio-container'), 1287 layout = wrapper.attr('data-layout'), 1288 columns = parseInt(wrapper.attr('data-columns')), 1289 parent = that.parents('.portfolio-filters').first(), 1290 parent_li = that.parent('li'), 1291 isotope = parent.attr('data-isotope'), 1292 multiple = parent.attr('data-multiple'), 1293 selector = that.attr('data-filter'); 1294 1295 if ( layout == 'masonry' ) { 1296 if ( parent_li.hasClass('active-item') ){ 1297 filters = jQuery.grep(filters, function(value) { 1298 return value != selector; 1299 }); 1300 } else { 1301 filters.push( selector ); 1302 } 1303 1304 if ( multiple != '1' || can_multiple ) { 1305 filters = [ selector ]; 1306 } 1307 1308 if ( selector == '*' ) { 1309 filters = []; 1310 } 1311 1312 parent.children('li.active-item').removeClass('active-item'); 1313 var filterValue = ''; 1314 for ( var prop in filters ) { 1315 if ( ! jQuery.isFunction( filters[ prop ] ) ) { 1316 filterValue += filters[ prop ]; 1317 } 1318 jQuery('[data-filter="'+ filters[ prop ] +'"]', parent).parent().addClass('active-item'); 1319 } 1320 1321 if ( filters.length === 0 ) { 1322 filterValue = '*'; 1323 jQuery('[data-filter="*"]', parent).parent().addClass('active-item'); 1324 } 1325 1326 jQuery(""+isotope+"").find('.ui--masonry').first().CloudFwisotope({ filter: filterValue }); 1327 1328 } else { 1329 1330 var items = container.find('> .ui-row > .ui-column'), 1331 count = items.length, 1332 rows = container.children('.ui-row'); 1333 1334 items.show().removeClass('passive-item').fadeTo(1000,1).not('' + selector).stop(1).addClass('passive-item').fadeTo(1000,.3); 1335 1336 parent.children('li.active-item').removeClass('active-item'); 1337 parent_li.addClass('active-item'); 1338 parent.children('li').not('.active-item'); 1339 } 1340 } 1341 1342 /** Portfolio Filters */ 1343 jQuery('.portfolio-filters > li > a').click(function(e){ 1344 e.preventDefault(); 1345 //changePortfolioFilter( jQuery(this) );
1346 can_multiple = true; 1347 var href = jQuery(this).attr('href'); 1348 if ( href != '#' ) { 1349 history.pushState ? history.pushState(null, null, href) : (location.hash = href); 1350 } else { 1351 changePortfolioFilter( jQuery('a', '.portfolio-filters > li.item-filter-reset') ); 1352 history.pushState ? history.pushState(null, null, '#/') : (location.hash = '#/'); 1353 } 1354 can_multiple = false; 1355 }); 1356 1357 jQuery( document ).on( "filterChange", {}, function( event, target ) { 1358 changePortfolioFilter( jQuery('a[data-filter=".filter-'+ target +'"]', '.portfolio-filters > li') ); 1359 }); 1360 1361}); 1362 1363/* ======================================== 1364 REVSLIDER (includes.modules.module.revslider) 1365========================================*/ 1366jQuery(document).ready(function(){ 1367 "use strict"; 1368 1369 jQuery('.rev_slider_wrapper').bind("revolution.slide.onloaded",function (e) { 1370 var that = jQuery(this); 1371 1372 that.find( '.caption-primary' ).wrapInner('<div />'); 1373 that.find( '.tp-leftarrow.custom' ).html( '<div class="slider-navigation-wrapper"><i class="fontawesome-chevron-left"></i></div>' ); 1374 that.find( '.tp-rightarrow.custom' ).html( '<div class="slider-navigation-wrapper"><i class="fontawesome-chevron-right"></i></div>' ); 1375 that.find( '.tp-bullets.custom > .bullet' ).html( '<div class="ui--bullets"><div class="ui--bullets-color ui--accent-gradient"></div></div>' ); 1376 1377 }); 1378 1379 1380}); 1381 1382 1383 1384/* ======================================== 1385 BROWSER (includes.modules.module.script) 1386========================================*/ 1387var BrowserDetect = 1388{ 1389 init: function () 1390 { 1391 this.browser = this.searchString(this.dataBrowser) || "Other"; 1392 this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown"; 1393 }, 1394 1395 searchString: function (data) 1396 { 1397 for (var i=0 ; i < data.length ; i++) 1398 { 1399 var dataString = data[i].string; 1400 this.versionSearchString = data[i].subString; 1401 1402 if (dataString.indexOf(data[i].subString) != -1) 1403 { 1404 return data[i].identity; 1405 } 1406 } 1407 }, 1408 1409 searchVersion: function (dataString) 1410 { 1411 var index = dataString.indexOf(this.versionSearchString); 1412 if (index == -1) return; 1413 return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); 1414 }, 1415 1416 dataBrowser: 1417 [ 1418 { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, 1419 { string: navigator.userAgent, subString: "MSIE", identity: "IE" }, 1420 { string: navigator.userAgent, subString: "Trident/", identity: "IE" }, 1421 { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, 1422 { string: navigator.userAgent, subString: "Safari", identity: "Safari" }, 1423 { string: navigator.userAgent, subString: "Opera", identity: "Opera" }, 1424 ] 1425 1426}; 1427BrowserDetect.init(); 1428 1429/* ======================================== 1430 HOVER INTENT (includes.modules.module.script) 1431========================================*/ 1432/*! 1433 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ 1434 * http://cherne.net/brian/resources/jquery.hoverIntent.html 1435 * 1436 * You may use hoverIntent under the terms of the MIT license. Basically that 1437 * means you are free to use hoverIntent as long as this header is left intact. 1438 * Copyright 2007, 2013 Brian Cherne 1439 */ 1440 1441/* hoverIntent is similar to jQuery's built-in "hover" method except that 1442 * instead of firing the handlerIn function immediately, hoverIntent checks 1443 * to see if the user's mouse has slowed down (beneath the sensitivity 1444 * threshold) before firing the event. The handlerOut function is only 1445 * called after a matching handlerIn. 1446 * 1447 * // basic usage ... just like .hover() 1448 * .hoverIntent( handlerIn, handlerOut ) 1449 * .hoverIntent( handlerInOut ) 1450 * 1451 * // basic usage ... with event delegation! 1452 * .hoverIntent( handlerIn, handlerOut, selector ) 1453 * .hoverIntent( handlerInOut, selector ) 1454 * 1455 * // using a basic configuration object 1456 * .hoverIntent( config ) 1457 * 1458 * @param handlerIn function OR configuration object 1459 * @param handlerOut function OR selector for delegation OR undefined 1460 * @param selector selector OR undefined 1461 * @author Brian Cherne <brian(at)cherne(dot)net> 1462 */ 1463(function($) { 1464 $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { 1465 1466 // default configuration values 1467 var cfg = { 1468 interval: 100, 1469 sensitivity: 7, 1470 timeout: 0 1471 }; 1472
1473 if ( typeof handlerIn === "object" ) { 1474 cfg = $.extend(cfg, handlerIn ); 1475 } else if ($.isFunction(handlerOut)) { 1476 cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); 1477 } else { 1478 cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); 1479 } 1480 1481 // instantiate variables 1482 // cX, cY = current X and Y position of mouse, updated by mousemove event 1483 // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval 1484 var cX, cY, pX, pY; 1485 1486 // A private function for getting mouse position 1487 var track = function(ev) { 1488 cX = ev.pageX; 1489 cY = ev.pageY; 1490 }; 1491 1492 // A private function for comparing current and previous mouse position 1493 var compare = function(ev,ob) { 1494 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1495 // compare mouse positions to see if they've crossed the threshold 1496 if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { 1497 $(ob).off("mousemove.hoverIntent",track); 1498 // set hoverIntent state to true (so mouseOut can be called) 1499 ob.hoverIntent_s = 1; 1500 return cfg.over.apply(ob,[ev]); 1501 } else { 1502 // set previous coordinates for next time 1503 pX = cX; pY = cY; 1504 // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) 1505 ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); 1506 } 1507 }; 1508 1509 // A private function for delaying the mouseOut function 1510 var delay = function(ev,ob) { 1511 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1512 ob.hoverIntent_s = 0; 1513 return cfg.out.apply(ob,[ev]); 1514 }; 1515 1516 // A private function for handling mouse 'hovering' 1517 var handleHover = function(e) { 1518 // copy objects to be passed into t (required for event object to be passed in IE) 1519 var ev = jQuery.extend({},e); 1520 var ob = this; 1521 1522 // cancel hoverIntent timer if it exists 1523 if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } 1524 1525 // if e.type == "mouseenter" 1526 if (e.type == "mouseenter") { 1527 // set "previous" X and Y position based on initial entry point 1528 pX = ev.pageX; pY = ev.pageY; 1529 // update "current" X and Y position based on mousemove 1530 $(ob).on("mousemove.hoverIntent",track); 1531 // start polling interval (self-calling timeout) to compare mouse coordinates over time 1532 if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} 1533 1534 // else e.type == "mouseleave" 1535 } else { 1536 // unbind expensive mousemove event 1537 $(ob).off("mousemove.hoverIntent",track); 1538 // if hoverIntent state is true, then call the mouseOut function after the specified delay 1539 if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} 1540 } 1541 }; 1542 1543 // listen for mouseenter and mouseleave 1544 return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); 1545 }; 1546})(jQuery); 1547 1548/* ======================================== 1549 SUPERFISH (includes.modules.module.script) 1550========================================*/ 1551/* 1552 * jQuery Superfish Menu Plugin 1553 * Copyright (c) 2013 Joel Birch 1554 * 1555 * Dual licensed under the MIT and GPL licenses: 1556 * http://www.opensource.org/licenses/mit-license.php 1557 * http://www.gnu.org/licenses/gpl.html 1558 */ 1559(function ($) { 1560 "use strict"; 1561 1562 var methods = (function () { 1563 // private properties and methods go here 1564 var c = { 1565 bcClass: 'sf-breadcrumb', 1566 menuClass: 'sf-js-enabled', 1567 anchorClass: 'sf-with-ul', 1568 menuArrowClass: 'sf-arrows' 1569 }, 1570 ios = (function () { 1571 var ios = /iphone|ipad|ipod/i.test(navigator.userAgent.toLowerCase()); 1572 if (ios) { 1573 // iOS clicks only bubble as far as body children 1574 $(window).load(function () { 1575 $('body').children().on('click', $.noop); 1576 }); 1577 } 1578 return ios; 1579 })(), 1580 wp7 = (function () { 1581 var style = document.documentElement.style; 1582 return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent)); 1583 })(), 1584 toggleMenuClasses = function ($menu, o) { 1585 var classes = c.menuClass; 1586 if (o.cssArrows) { 1587 classes += ' ' + c.menuArrowClass; 1588 }
1589 $menu.toggleClass(classes); 1590 }, 1591 setPathToCurrent = function ($menu, o) { 1592 return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels) 1593 .addClass(o.hoverClass + ' ' + c.bcClass) 1594 .filter(function () { 1595 return ($(this).children(o.popUpSelector).hide().show().length); 1596 }).removeClass(o.pathClass); 1597 }, 1598 toggleAnchorClass = function ($li) { 1599 $li.children('a').toggleClass(c.anchorClass); 1600 }, 1601 toggleTouchAction = function ($menu) { 1602 var touchAction = $menu.css('ms-touch-action'); 1603 touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y'; 1604 $menu.css('ms-touch-action', touchAction); 1605 }, 1606 applyHandlers = function ($menu, o) { 1607 var targets = 'li:has(' + o.popUpSelector + ')'; 1608 1609 if ( o.fire_event == 'click' ) { 1610 $menu 1611 .on('click.superfish', targets, over) 1612 .on('mouseleave.superfish', targets, out); 1613 1614 } else if ($.fn.hoverIntent && !o.disableHI) { 1615 $menu.hoverIntent(over, out, targets); 1616 } 1617 else { 1618 $menu 1619 .on('mouseenter.superfish', targets, over) 1620 .on('mouseleave.superfish', targets, out); 1621 } 1622 var touchevent = 'MSPointerDown.superfish'; 1623 if (!ios) { 1624 touchevent += ' touchend.superfish'; 1625 } 1626 if (wp7) { 1627 touchevent += ' mousedown.superfish'; 1628 } 1629 $menu 1630 .on('focusin.superfish', 'li', over) 1631 .on('focusout.superfish', 'li', out) 1632 .on(touchevent, 'a', o, touchHandler); 1633 }, 1634 touchHandler = function (e) { 1635 var $this = $(this), 1636 $ul = $this.siblings(e.data.popUpSelector); 1637 1638 if ($ul.length > 0 && $ul.is(':hidden')) { 1639 $this.one('click.superfish', false); 1640 if (e.type === 'MSPointerDown') { 1641 $this.trigger('focus'); 1642 } else { 1643 $.proxy(over, $this.parent('li'))(); 1644 } 1645 } 1646 }, 1647 over = function () { 1648 var $this = $(this), 1649 o = getOptions($this); 1650 clearTimeout(o.sfTimer); 1651 $this.siblings().superfish('hide').end().superfish('show'); 1652 }, 1653 out = function () { 1654 var $this = $(this), 1655 o = getOptions($this); 1656 if (ios) { 1657 $.proxy(close, $this, o)(); 1658 } 1659 else { 1660 if ( o.sfTimer ) { 1661 clearTimeout(o.sfTimer); 1662 } 1663 o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay); 1664 } 1665 }, 1666 close = function (o) { 1667 o.retainPath = ($.inArray(this[0], o.$path) > -1); 1668 this.superfish('hide'); 1669 1670 if (!this.parents('.' + o.hoverClass).length) { 1671 o.onIdle.call(getMenu(this)); 1672 if (o.$path.length) { 1673 $.proxy(over, o.$path)(); 1674 } 1675 } 1676 }, 1677 getMenu = function ($el) { 1678 return $el.closest('.' + c.menuClass); 1679 }, 1680 getOptions = function ($el) { 1681 return getMenu($el).data('sf-options'); 1682 }; 1683 1684 return { 1685 // public methods 1686 hide: function (instant) { 1687 if (this.length) { 1688 var $this = this, 1689 o = getOptions($this); 1690 if (!o) { 1691 return this; 1692 } 1693 var not = (o.retainPath === true) ? o.$path : '', 1694 $ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector), 1695 speed = o.speedOut; 1696 1697 if (instant) { 1698 $ul.show(); 1699 speed = 0; 1700 } 1701 o.retainPath = false; 1702 o.onBeforeHide.call(this, $ul); 1703 $ul.stop(true, true).animate(o.animationOut, speed, function () { 1704 var $this = $(this); 1705 o.onHide.call($this); 1706 }); 1707 } 1708 return this; 1709 }, 1710 show: function () { 1711 var o = getOptions(this); 1712 if (!o) { 1713 return this; 1714 } 1715 var $this = this.addClass(o.hoverClass), 1716 $ul = $this.children(o.popUpSelector); 1717 1718 o.onBeforeShow.call(this, $ul); 1719 $ul.stop(true, true).animate(o.animation, o.speed, function () { 1720 o.onShow.call(this, $ul); 1721 }); 1722 return this; 1723 }, 1724 destroy: function () { 1725 return this.each(function () { 1726 var $this = $(this), 1727 o = $this.data('sf-options'), 1728 $hasPopUp; 1729 if (!o) { 1730 return false; 1731 } 1732 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 1733 clearTimeout(o.sfTimer); 1734 toggleMenuClasses($this, o); 1735 toggleAnchorClass($hasPopUp); 1736 toggleTouchAction($this); 1737 // remove event handlers 1738 $this.off('.superfish').off('.hoverIntent'); 1739 // clear animation's inline display style 1740 $hasPopUp.children(o.popUpSelector).attr('style', function (i, style) { 1741 return style.replace(/display[^;]+;?/g, ''); 1742 }); 1743 // reset 'current' path classes 1744 o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass); 1745 $this.find('.' + o.hoverClass).removeClass(o.hoverClass); 1746 o.onDestroy.call($this); 1747 $this.removeData('sf-options'); 1748 }); 1749 }, 1750 init: function (op) { 1751 return this.each(function () { 1752 var $this = $(this); 1753 if ($this.data('sf-options')) { 1754 return false;
1755 } 1756 var o = $.extend({}, $.fn.superfish.defaults, op), 1757 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 1758 o.$path = setPathToCurrent($this, o); 1759 1760 $this.data('sf-options', o); 1761 1762 toggleMenuClasses($this, o); 1763 toggleAnchorClass($hasPopUp); 1764 toggleTouchAction($this); 1765 applyHandlers($this, o); 1766 1767 $hasPopUp.not('.' + c.bcClass).superfish('hide', true); 1768 1769 o.onInit.call(this); 1770 1771 var iosnavfix_force = false; 1772 if ( o.fire_event == 'click' ) { 1773 iosnavfix_force = true; 1774 } 1775 1776 $this.iosnavfix(iosnavfix_force); 1777 }); 1778 } 1779 }; 1780 })(); 1781 1782 $.fn.superfish = function (method, args) { 1783 if (methods[method]) { 1784 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 1785 } 1786 else if (typeof method === 'object' || ! method) { 1787 return methods.init.apply(this, arguments); 1788 } 1789 else { 1790 return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish'); 1791 } 1792 }; 1793 1794 $.fn.superfish.defaults = { 1795 popUpSelector: 'ul, .sf-mega', // within menu context 1796 hoverClass: 'sfHover', 1797 pathClass: 'overrideThisToUse', 1798 fire_event: 'hover', 1799 pathLevels: 1, 1800 delay: 800, 1801 animation: {opacity: 'show'}, 1802 animationOut: {opacity: 'hide'}, 1803 speed: 'normal', 1804 speedOut: 'fast', 1805 cssArrows: true, 1806 disableHI: false, 1807 onInit: $.noop, 1808 onBeforeShow: $.noop, 1809 onShow: $.noop, 1810 onBeforeHide: $.noop, 1811 onHide: $.noop, 1812 onIdle: $.noop, 1813 onDestroy: $.noop 1814 }; 1815 1816 // soon to be deprecated 1817 $.fn.extend({ 1818 hideSuperfishUl: methods.hide, 1819 showSuperfishUl: methods.show 1820 }); 1821 1822})(jQuery); 1823 1824 1825/*! 1826 * iOS Nav Fix - Dropdown menu fix for iOS devices 1827 * 1828 * Version: 1.0 1829 * Released: 19-02-2013 1830 * Source: http://github.com/Vheissu/IOSNavFix 1831 * Plugin: Iosnavfix 1832 * Author: Dwayne Charrington ([email protected]) 1833 * Modified: Orkun Gursel ([email protected]) 1834 * License: MIT Licence 1835 * http://www.opensource.org/licenses/mit-license.php 1836 * 1837 * Copyright (c) 2013 Dwayne Charrington. 1838 * 1839 */ 1840;(function(w, $) { 1841 1842 $.fn.iosnavfix = function( force ) { 1843 1844 return this.each(function() { 1845 1846 if ( isMobile() || force ) { 1847 var $this = $(this); 1848 var $list = []; 1849 1850 $("li", $this).each(function() { 1851 var $this = $(this); 1852 var $parentLink = $("> a", $this); 1853 1854 1855 // If we have children 1856 if ($this.children('ul').length || $this.children('ol').length) { 1857 1858 // Set default clicked state 1859 $parentLink.data('clicked', false); 1860 1861 // When the link is clicked 1862 $parentLink.on("click", function(e) { 1863 1864 jQuery.each($list, function(k,v){ 1865 if ( v.jquery && v != $parentLink ) { 1866 v.data('clicked', false); 1867 } 1868 }); 1869 1870 // if we haven't already clicked, false 1871 if ($parentLink.data('clicked') == false) { 1872 // Inform everyone we've now clicked 1873 $parentLink.data('clicked', true); 1874 1875 $list.push( $parentLink ); 1876 1877 // Prevent link being followed into next click 1878 return false; 1879 } else { 1880 // Reset link click state 1881 $parentLink.data('clicked', false); 1882 1883 // Allow link to be followed now 1884 return true; 1885 } 1886 1887 }); 1888 } 1889 }); 1890 } 1891 1892 }); 1893 1894 /** 1895 * If a user is pretending to be an iOS device, too bad for them. 1896 * As if you would imitate an iPad or iPhone for non-testing purposes. 1897 * 1898 * Anyway, this function will detect iOS user agents, simple. 1899 */ 1900 function isMobile() { 1901 if ( (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i) ) || (navigator.userAgent.match(/iPad/i) )|| (navigator.userAgent.toLowerCase().match(/android/i) ) ) { return true; } else { return false; } 1902 } 1903 1904 } 1905 1906})(window, jQuery); 1907 1908/* ======================================== 1909 IMAGELOADED (includes.modules.module.script) 1910========================================*/ 1911/*! 1912 * imagesLoaded PACKAGED v3.0.4 1913 * JavaScript is all like "You images are done yet or what?" 1914 */ 1915 1916(function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}var n=e.prototype;n.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},n.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},n.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},n.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},n.on=n.addListener,n.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},n.once=n.addOnceListener,n.defineEvent=function(e){return this.getListeners(e),this},n.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},n.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},n.off=n.removeListener,n.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},n.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},n.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},n.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},n.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],o=n.listener.apply(this,t||[]),(o===this._getOnceReturnValue()||n.once===!0)&&this.removeListener(e,s[r][i].listener);return this},n.trigger=n.emitEvent,n.emit=function(e){var t=Array.prototype.slice.call(arguments,1
1916);return this.emitEvent(e,t)},n.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},n._getEvents=function(){return this._events||(this._events={})},"function"==typeof define&&define.amd?define(function(){return e}):"undefined"!=typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){"use strict";var t=document.documentElement,n=function(){};t.addEventListener?n=function(e,t,n){e.addEventListener(t,n,!1)}:t.attachEvent&&(n=function(t,n,i){t[n+i]=i.handleEvent?function(){var t=e.event;t.target=t.target||t.srcElement,i.handleEvent.call(i,t)}:function(){var n=e.event;n.target=n.target||n.srcElement,i.call(t,n)},t.attachEvent("on"+n,t[n+i])});var i=function(){};t.removeEventListener?i=function(e,t,n){e.removeEventListener(t,n,!1)}:t.detachEvent&&(i=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var r={bind:n,unbind:i};"function"==typeof define&&define.amd?define(r):e.eventie=r}(this),function(e){"use strict";function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){return"[object Array]"===c.call(e)}function i(e){var t=[];if(n(e))t=e;else if("number"==typeof e.length)for(var i=0,r=e.length;r>i;i++)t.push(e[i]);else t.push(e);return t}function r(e,n){function r(e,n,s){if(!(this instanceof r))return new r(e,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=i(e),this.options=t({},this.options),"function"==typeof n?s=n:t(this.options,n),s&&this.on("always",s),this.getImages(),o&&(this.jqDeferred=new o.Deferred);var a=this;setTimeout(function(){a.check()})}function c(e){this.img=e}r.prototype=new e,r.prototype.options={},r.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},r.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},r.prototype.check=function(){function e(e,r){return t.options.debug&&a&&s.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},r.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify(t,e)})},r.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},o&&(o.fn.imagesLoaded=function(e,t){var n=new r(this,e,t);return n.jqDeferred.promise(o(this))});var f={};return c.prototype=new e,c.prototype.check=function(){var e=f[this.img.src];if(e)return this.useCached(e),void 0;if(f[this.img.src]=this,this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this.proxyImage=new Image;n.bind(t,"load",this),n.bind(t,"error",this),t.src=this.img.src},c.prototype.useCached=function(e){if(e.isConfirmed)this.confirm(e.isLoaded,"cached was confirmed");else{var t=this;e.on("confirm",function(e){return t.confirm(e.isLoaded,"cache emitted confirmed"),!0})}},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindProxyEvents()},c.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindProxyEvents()},c.prototype.unbindProxyEvents=function(){n.unbind(this.proxyImage,"load",this),n.unbind(this.proxyImage,"error",this)},r}var o=e.jQuery,s=e.console,a=s!==void 0,c=Object.prototype.toString;"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],r):e.imagesLoaded=r(e.EventEmitter,e.eventie)}(window); 1917 1918/* ======================================== 1919 UI (includes.modules.module.script) 1920========================================*/ 1921;(function ( $, window, document, undefined ) { 1922 1923 // Create the defaults once 1924 var pluginName = "uiVerticalCenter", 1925 defaults = {}; 1926 1927 // The actual plugin constructor 1928 function Plugin( element, options ) { 1929 this.element = element; 1930 this.options = $.extend( {}, defaults, options ); 1931 1932 this._defaults = defaults; 1933 this._name = pluginName; 1934 1935 this.init(); 1936 } 1937 1938 Plugin.prototype = { 1939 1940 init: function() { 1941 var element = jQuery(this.element); 1942 var images = element.find('img'); 1943 var height = element.outerHeight(); 1944 1945 element.css({'margin-top' : - (height / 2) }).attr('data-height', height ); 1946 if ( images.length ) { 1947 images.imagesLoaded(function(){ 1948 var height = element.outerHeight(); 1949 element.css({'margin-top' : - (height / 2) }); 1950 }); 1951 } 1952 1953 }, 1954 1955 calcHeight: function () { 1956 var that = jQuery(this.element); 1957 1958 var height = 1959 parseInt(that.css('margin-top'), 10) + 1960 parseInt(that.css('padding-top'), 10) + 1961 parseInt(that.css('border-top-width'), 10) + 1962 parseInt(that.height(), 10) + 1963 parseInt(that.css('border-bottom-width'), 10) + 1964 parseInt(that.css('padding-bottom'), 10) + 1965 parseInt(that.css('margin-bottom'), 10); 1966 1967 return height; 1968 } 1969 1970 1971 }; 1972 1973 $.fn[pluginName] = function ( options ) { 1974 return this.each(function () { 1975 if (!$.data(this, "plugin_" + pluginName)) { 1976 $.data(this, "plugin_" + pluginName, new Plugin( this, options )); 1977 } 1978 }); 1979 }; 1980 1981})( jQuery, window, document ); 1982 1983jQuery(document).ready(function(){ 1984 var centerVertical = function(){ 1985 jQuery('.ui--center-vertical').uiVerticalCenter(); 1986 }; 1987 1988 setTimeout(function(){ 1989 centerVertical(); 1990 }, 100 ); 1991 1992 jQuery(window).resize( centerVertical ); 1993 jQuery(window).load( centerVertical ); 1994 1995 1996}); 1997 1998/* ======================================== 1999 BOXED LAYOUT (includes.modules.module.script) 2000========================================*/ 2001jQuery(document).ready(function(){ 2002 2003 if( jQuery('body').hasClass('layout--boxed') ) { 2004 var calc_header_width = function(){ 2005 var page_wrap_width = jQuery('#page-wrap').width(); 2006 var header_container = jQuery('#header-container'); 2007 2008 header_container.width( page_wrap_width ); 2009 2010 } 2011 2012 calc_header_width(); 2013 jQuery(window).smartresize( calc_header_width ); 2014 2015 } 2016 2017}); 2018 2019/* ======================================== 2020 CURRENT MENU (includes.modules.module.script) 2021========================================*/ 2022jQuery(document).ready(function(){ 2023 "use strict"; 2024 2025 jQuery.fn.extend({ 2026 /** 2027 * CloudFw Select Current Menu Item 2028 * 2029 * @since 1.0 2030 */ 2031 selectCurrentMenu : function() { 2032 2033 jQuery.fn.extend({ 2034 2035 /* Match Classes */ 2036 matchClasses : function() { 2037 2038 //this.addClass('passed'); 2039 2040 if ( this.is('.current-menu-item, .current-menu-ancestor, .current-menu-parent, .current_page_parent, .current_page_ancestor, .current_page_item') ) { 2041 if ( this.parents('.depth-0').length ) { 2042 this.parents('.depth-0').last().addClass('current-item-handler'); 2043 } else { 2044 this.addClass('current-item-handler').addClass('current-sub-item'); 2045 } 2046 } 2047 this.removeClass('current-menu-item current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor current_page_item'); 2048 return this; 2049 }, 2050 2051 /* Loop Items */ 2052 loopItems : function() { 2053 2054 if ( this.length ){ 2055 2056 this.each(function(){ 2057 var item = jQuery(this); 2058 item.matchClasses(); 2059 2060 if ( item.children('.sub-menu').length ) { 2061 2062 var children = item.children('.sub-menu').children(); 2063 2064 if ( !children.length ) { 2065 item.find('.ui--caret').remove(); 2066 item.children('.sub-menu').remove(); 2067 } else { 2068 children.loopItems(); 2069 } 2070 } 2071 2072 }); 2073 2074 } 2075 2076 }, 2077 2078 /* Set Final */ 2079 setCurrentItem : function() { 2080 2081 var currentItemClass = 'current-menu-item'; 2082 2083 if ( this.find( '.current-item-handler' ).length ){ 2084 if ( this.find( '.current-item-handler' ).is('.force-for-select') ) 2085 this.find( '.current-item-handler.force-for-select' ).removeClass( 'current-item-handler' ).first().addClass( currentItemClass ); 2086 else 2087 this.find( '.current-item-handler' ).removeClass( 'current-item-handler' ).first().addClass( currentItemClass ); 2088 } 2089 /*else 2090 this.children().first().addClass( currentItemClass );*/ 2091 2092 } 2093 2094 2095 }); 2096 2097 /* Run the Plugin */ 2098 return this.each(function() { 2099 var theMenu = jQuery(this); 2100 var menuItems = theMenu.children(); 2101 2102 menuItems.loopItems(); 2103 theMenu.setCurrentItem(); 2104 }); 2105 }, 2106 2107 /** 2108 * CloudFw Prepare Menus 2109 * 2110 * @since 1.0 2111 */ 2112 prepareMenu: function() { 2113 /* Run the Plugin */ 2114 return this.each(function() { 2115 var theMenu = jQuery(this); 2116 var navMenuItems = theMenu.find('li'); 2117 2118 navMenuItems.each(function(){ 2119 2120 if ( jQuery(this).find('.sub-menu').length ) { 2121 2122 if ( !jQuery(this).hasClass('has-sub-menu') ) 2123 jQuery(this) 2124 .addClass('has-sub-menu') 2125 .find('a') 2126 .first() 2127 .append('<span class="indicator"></span>'); 2128 2129 } 2130 2131 }); 2132 2133 /** Add class to first level navigation menu items */ 2134 var navMenuFirstLevelItems = theMenu.children('ul > li.depth-0'); 2135 var navMenuFirstLevelItemsLenght = navMenuFirstLevelItems.length; 2136 navMenuFirstLevelItems.each(function(itemNumber) { 2137 jQuery(this).addClass('asc-' + itemNumber++ ).addClass('desc-' + parseInt(navMenuFirstLevelItemsLenght - itemNumber, 10)); 2138 }); 2139 2140 }); 2141 2142 } 2143 2144 2145 }); 2146 2147 jQuery('#header-navigation').selectCurrentMenu(); 2148 2149}); 2150 2151/* ======================================== 2152 FILL PARENT (includes.modules.module.script) 2153========================================*/ 2154/* 2155 * jQuery Fill Parent 2156 * 2157 * Author: Orkun Gursel 2158 */ 2159;(function ( $, window, document, undefined ) { 2160 "use strict"; 2161 2162 var pluginName = 'fillParent', 2163 defaults = { 2164 2165 }; 2166 2167 function Plugin( element, options ) { 2168 this.element = element; 2169 this.options = $.extend( {}, defaults, options); 2170 2171 this._defaults = defaults; 2172 this._name = pluginName; 2173 2174 var that = this; 2175 this.init(); 2176 jQuery(window).load(function(){ 2177 that.init(); 2178 }); 2179 jQuery(window).smartresize(function(){ 2180 that.init(); 2181 }); 2182 } 2183 2184 Plugin.prototype = { 2185 init: function () { 2186 2187 var element = jQuery( this.element ), 2188 parent = element.parent(); 2189 2190 var parentWidth = parent.width(); 2191 var parentHeight = parent.height(); 2192 2193 var elementWidth = element.attr('width'); 2194 var elementHeight = element.attr('height'); 2195 2196 if ( ! elementWidth ) { 2197 element.css({ width: '' }); 2198 elementWidth = element.width(); 2199 } 2200 2201 if ( ! elementHeight ) { 2202 element.css({ height: '' }); 2203 elementHeight = element.height(); 2204 } 2205 2206 var newsizes = this.fill( parentWidth, parentHeight, elementWidth, elementHeight ); 2207 2208 element.css( newsizes ).addClass('ui--filled'); 2209 2210 /*console.log( 'parentWidth: ' + parentWidth ); 2211 console.log( 'parentHeight: ' + parentHeight ); 2212 console.log( 'elementWidth: ' + elementWidth ); 2213 console.log( 'elementHeight: ' + elementHeight ); 2214 console.log( newsizes );*/ 2215 }, 2216 2217 fill: function( parentWidth, boxHeight, elementWidth, elementHeight ) { 2218 var out = {}; 2219 var initW = elementWidth; 2220 var initH = elementHeight; 2221 var ratio = initH / initW; 2222 2223 elementWidth = parentWidth; 2224 elementHeight = parentWidth * ratio; 2225 2226 if(elementHeight < boxHeight){ 2227 elementHeight = boxHeight; 2228 elementWidth = elementHeight / ratio; 2229 } 2230 2231 elementWidth = Math.round(elementWidth); 2232 elementHeight = Math.round(elementHeight); 2233 2234 out.width = elementWidth; 2235 out.height = elementHeight; 2236 2237 if( elementWidth > parentWidth ) { 2238 out.marginLeft = Math.round( (parentWidth - elementWidth) / 2 ); 2239 out.marginTop = ''; 2240 } else { 2241 out.marginLeft = ''; 2242 out.marginTop = Math.round( (boxHeight - elementHeight) / 2 ); 2243 } 2244 2245 return out; 2246 } 2247 2248 }; 2249 2250 $.fn[pluginName] = function ( options ) { 2251 return this.each(function () { 2252 if (!$.data(this, 'plugin_' + pluginName)) { 2253 $.data(this, 'plugin_' + pluginName, 2254 new Plugin( this, options )); 2255 } 2256 }); 2257 } 2258 2259})( jQuery, window, document ); 2260 2261/* ======================================== 2262 FULL HEIGHT CONTAINER (includes.modules.module.script) 2263========================================*/ 2264(function(){ 2265 2266 jQuery(document).ready(function(){ 2267 2268 var video_bg_page_height = function(){ 2269 var win_height = win_height_alias = jQuery(window).height(); 2270 var body = jQuery('body'); 2271 var header = jQuery('#page-header'); 2272 var titlebar = jQuery('#titlebar'); 2273 var adminbar = jQuery('#wpadminbar'); 2274 var total_content_height = 0; 2275 2276 var is_overlapping = body.hasClass('header-overlapping'); 2277 2278 if( ! is_overlapping && header.length ) { 2279 var header_height = header.height(); 2280 win_height = win_height - header_height; 2281 total_content_height += header_height; 2282 } 2283 2284 if( titlebar.length ) { 2285 var titlebar_height = titlebar.height(); 2286 win_height = win_height - titlebar_height; 2287 total_content_height += titlebar_height; 2288 } 2289 2290 if( adminbar.length ) { 2291 var adminbar_height = adminbar.height(); 2292 win_height = win_height - adminbar_height; 2293 total_content_height += adminbar_height; 2294 } 2295 2296 jQuery('.ui--section-content-v-center').css({ 2297 'height': win_height > 0 ? win_height : win_height_alias 2298 }); 2299 2300 /** Sticky Footer */ 2301 if ( body.hasClass('sticky-footer') ) { 2302 var footer = jQuery('#page-wrap > footer'), 2303 footer_height = footer.height(), 2304 page_content = jQuery('#page-content'); 2305 2306 page_content.css({'min-height': ''}); 2307 var page_content_height = page_content.outerHeight() - page_content.height() + 1; 2308 2309 if( footer.length ) { 2310 2311 var value = win_height_alias - (total_content_height + footer_height) - page_content_height; 2312 page_content.css({ 2313 'min-height': value > 0 ? value : '' 2314 }); 2315 2316 } 2317 2318 } 2319 2320 } 2321 2322 if ( jQuery('.ui--section-content-v-center').length || jQuery('body').hasClass('sticky-footer') ) { 2323 video_bg_page_height(); 2324 jQuery(window).load( video_bg_page_height ); 2325 jQuery(window).smartresize( video_bg_page_height, 20 ); 2326 } 2327 2328 jQuery('.ui--video-background-video video, .ui--video-background-video iframe').fillParent(); 2329 }); 2330 2331})(jQuery); 2332 2333/* ======================================== 2334 GLOBAL (includes.modules.module.script) 2335========================================*/ 2336jQuery(document).ready(function(){ 2337 2338 jQuery("a[data-rel^='prettyPhoto']").each(function(){ 2339 var that = jQuery(this), 2340 href = that.attr('href'); 2341 2342 var same_hrefs = jQuery('a[href^="'+ href +'"]').not(that); 2343 2344 if( same_hrefs.length ) { 2345 same_hrefs.each(function(){ 2346 if (jQuery(this).attr('data-rel') == that.attr('data-rel')){ 2347 jQuery(this).attr('data-rel', 'prettyPhoto'); 2348 } 2349 }); 2350 } 2351 2352 }); 2353 2354 2355 jQuery("a[data-rel^='prettyPhoto']").CloudFwPrettyPhoto({ 2356 theme: 'pp_envision', 2357 show_title: true, 2358 slideshow: false, 2359 social_tools: false, 2360 deeplinking: false, 2361 modal: false 2362 }); 2363 2364}); 2365 2366/* ======================================== 2367 HASH (includes.modules.module.script) 2368========================================*/ 2369jQuery(function(){ 2370 "use strict"; 2371 2372 var getParam = function (name,url){ 2373 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 2374 var regexS = ""+name+"[\:|\=]([^&#]*)"; 2375 var regex = new RegExp( regexS ); 2376 var results = regex.exec( url ); 2377 return ( results == null ) ? "" : results[1]; 2378 } 2379 2380 var listenHash = function( hash, that ){ 2381 if ( hash == '' || hash == '
2381#' ) { 2382 return true; 2383 } 2384 2385 /** Scroll */ 2386 var to = getParam( 'to', hash ); 2387 if ( typeof to !== undefined && to != '' ) { 2388 2389 var anchor = jQuery('#' + to); 2390 if ( anchor.length === 0 ) { 2391 return true; 2392 } 2393 2394 if ( to == 'top' && anchor.length === 0 ) { 2395 var scrollTo = '0'; 2396 } else { 2397 var scrollTo = anchor.offset().top; 2398 var offset = getParam( 'offset', hash ); 2399 2400 if ( typeof offset !== undefined && offset !== '' ) { 2401 scrollTo = scrollTo + parseInt(offset, 10); 2402 if ( scrollTo < 0 ) { 2403 scrollTo = 0; 2404 } 2405 } 2406 2407 } 2408 2409 jQuery('html, body').stop( true ).animate({scrollTop: scrollTo}, 500, function () {/**window.location.hash = id;*/}); 2410 2411 var update_hash = getParam( 'update', hash ); 2412 if ( typeof update_hash !== undefined && update_hash == 'true' ) { 2413 return true; 2414 } 2415 2416 return false; 2417 2418 } 2419 2420 /** Sidepanel */ 2421 var sidepanel = getParam( 'sidepanel', hash ); 2422 if ( typeof sidepanel !== undefined && sidepanel != '' ) { 2423 jQuery( document ).trigger( "openSidePanel", [ sidepanel ] ); 2424 return false; 2425 } 2426 2427 /** Filter */ 2428 var filter = getParam( 'filter', hash ); 2429 if ( typeof filter !== undefined && filter != '' ) { 2430 jQuery( document ).trigger( "filterChange", [ filter ] ); 2431 return false; 2432 } 2433 2434 return true; 2435 2436 } 2437 2438 jQuery("[href^='#']").click(function() { 2439 var that = jQuery(this), 2440 hash = that.attr('href').replace('#', ''); 2441 2442 return listenHash( hash, that ); 2443 }); 2444 2445 jQuery(window).on('load hashchange',function(){ 2446 var hash = location.hash.replace('#', ''); 2447 listenHash( hash, undefined ); 2448 }); 2449 2450}); 2451 2452/* ======================================== 2453 HASHCHANGE (includes.modules.module.script) 2454========================================*/ 2455/* 2456 * jQuery hashchange event - v1.3 - 7/21/2010 2457 * http://benalman.com/projects/jquery-hashchange-plugin/ 2458 * 2459 * Copyright (c) 2010 "Cowboy" Ben Alman 2460 * Dual licensed under the MIT and GPL licenses. 2461 * http://benalman.com/about/license/ 2462 */ 2463(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$('html').hasClass('ie')&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this); 2464 2465jQuery(function(){ 2466 "use strict"; 2467 2468 jQuery(window).hashchange( function() { 2469 2470 var hash = location.hash.replace('#', ''); 2471 /*if ( hash.match("^to:") ) { 2472 hash = hash.replace('to:', ''); 2473 location.hash = ''; 2474 2475 var toElement = jQuery( '#' + hash ); 2476 if ( toElement.length ) { 2477 jQuery.smoothScroll({ 2478 speed: 500, 2479 scrollTarget: '#' + hash, 2480 afterScroll: function() { location.hash = hash; } 2481 }); 2482 } 2483 2484 } else */if ( hash ) { 2485 jQuery('a[href$="' + hash + '"]').click(); 2486 } 2487 2488 }); 2489 2490 jQuery(window).hashchange(); 2491 2492}); 2493 2494/* ======================================== 2495 LOADING (includes.modules.module.script) 2496========================================*/ 2497var CloudFwLoaded = function( item ){ 2498 if ( typeof item.jquery == 'undefined' ) 2499 return false; 2500 2501 if ( item.hasClass('ui--loading') ) { 2502 item.removeClass('ui--loading'); 2503 item.next('.ui--loading-progress').addClass('loaded'); 2504 2505 //console.log(item.next('.ui--loading-progress')); 2506 } 2507 2508}; 2509 2510/* ======================================== 2511 MIDWAY (includes.modules.module.script) 2512========================================*/ 2513/** 2514 * Midway.js 2515 * Version: 1.0 2516 * Author: Shipp Co. (Brandon Jacoby, Jordan Singer, Jeremy Goldberg) 2517 * Copyright (c) 2013 - Midway. All rights reserved. 2518 * http://www.shipp.co/midway 2519 */ 2520(function($) { 2521 eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(m).l(5(){4 c=$(\'.0\').1(\'6\',- +$(\'.0\').7()/2);4 d=$(\'.3\').1(\'8\',- +$(\'.3\').9()/2);c;d;$(".0").1({\'h\':\'f\',\'g\':\'e%\',\'i\':\'e%\'});$(j).k(5(){4 a=$(\'.0\').1(\'6\',- +$(\'.0\').7()/2);4 b=$(\'.3\').1(\'8\',- +$(\'.3\').9()/2);a;b})});',23,23,'centerHorizontal|css||centerVertical|var|function|marginLeft|width|marginTop|outerHeight|||||50|absolute|top|position|left|window|resize|ready|document'.split('|'),0,{})) 2522})(jQuery); 2523 2524/* ======================================== 2525 PARALLAX (includes.modules.module.script) 2526========================================*/ 2527(function($) { 2528 "use strict"; 2529 2530 $(document).ready(function() 2531 { 2532 $.cloudfw_utilities = $.cloudfw_utilities || {}; 2533 $.cloudfw_utilities.supported = {}; 2534 $.cloudfw_utilities.supports = (function() { 2535 var div = document.createElement('div'), 2536 vendors = ['Khtml', 'Ms', 'Moz', 'Webkit']; 2537 2538 return function(prop, vendor_overwrite) { 2539 if ( div.style[prop] !== undefined ) { return ""; }
2540 if (vendor_overwrite !== undefined) { vendors = vendor_overwrite; } 2541 2542 prop = prop.replace(/^[a-z]/, function(val) { 2543 return val.toUpperCase(); 2544 }); 2545 2546 var len = vendors.length; 2547 while(len--) { 2548 if ( div.style[vendors[len] + prop] !== undefined ){ 2549 return "-" + vendors[len].toLowerCase() + "-"; 2550 } 2551 } 2552 2553 return false; 2554 }; 2555 2556 }()); 2557 2558 $.cloudfw_utilities.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement; 2559 2560 //activate parallax scrolling for backgrounds. 2561 if( $.fn.cloudfw_parallax ) { 2562 $('.ui--parallax').cloudfw_parallax(); 2563 } 2564 2565 }); 2566 2567 $.CloudFwParallaxElement = function(options, element) { 2568 this.$el = $( element ).addClass('active-parallax'); 2569 this.$win = $( window ); 2570 this.$parent = this.$el.parent(); 2571 this.property = {}; 2572 this.isMobile = $.cloudfw_utilities.isMobile; 2573 this.ratio = this.$el.data('data-stellar-ratio') || 0.5; 2574 this.transform = document.documentElement.className.indexOf('csstransforms') !== -1 ? true : false; 2575 this.transform3d = document.documentElement.className.indexOf('csstransforms3d') !== -1 ? true : false; 2576 2577 if( $.cloudfw_utilities.supported.transition === undefined ){ 2578 $.cloudfw_utilities.supported.transition = $.cloudfw_utilities.supports('transition'); 2579 } 2580 2581 this._init( options ); 2582 } 2583 2584 $.CloudFwParallaxElement.prototype = { 2585 2586 _init: function( options ) 2587 { 2588 var _self = this; 2589 /*if( _self.isMobile ) 2590 { 2591 return; //disable parallax scrolling on mobile 2592 }*/ 2593 2594 //fetch window constants 2595 this._fetch_properties(); 2596 //this.$win.on("load resize make@2x", $.proxy( _self._fetch_properties, _self)); 2597 this.$win.load($.proxy( _self._fetch_properties, _self)); 2598 this.$win.smartresize($.proxy( _self._fetch_properties, _self)); 2599 2600 setTimeout(function(){ 2601 _self._fetch_properties(); 2602 },1000); 2603 2604 //activate the scrolling 2605 setTimeout(function() 2606 { 2607 _self.$win.on( 'scroll', function(){ window.requestAnimationFrame( $.proxy( _self._parallax_scroll, _self) )} ); 2608 2609 },100); 2610 }, 2611 2612 _fetch_properties: function() 2613 { 2614 this.property.offset = this.$parent.offset().top; 2615 this.property.wh = this.$win.height(); 2616 this.property.height = this.$parent.outerHeight(); 2617 2618 //set the height of the element based on the windows height, offset ratio and parent height 2619 this.$el.height(Math.ceil((this.property.wh * this.ratio) + this.property.height)); 2620 2621 //re-position the element 2622 this._parallax_scroll(); 2623 }, 2624 2625 _parallax_scroll: function(e) { 2626 var winTop = this.$win.scrollTop(), 2627 winBottom = winTop + this.property.wh, 2628 scrollPos = "0", 2629 prop = {}; 2630 2631 if( this.property.offset < winBottom && winTop <= this.property.offset + this.property.height ) 2632 { 2633 scrollPos = Math.round( (winBottom - this.property.offset) * this.ratio ); 2634 2635 if( this.transform3d ) { 2636 prop[$.cloudfw_utilities.supported.transition+"transform"] = "translate3d(0px,"+ scrollPos +"px, 0px)"; 2637 } else if( this.transform ) { 2638 prop[$.cloudfw_utilities.supported.transition+"transform"] = "translate(0px,"+ scrollPos +"px)"; 2639 } else { 2640 prop["background-position"] = "0px "+ scrollPos +"px"; 2641 } 2642 2643 this.$el.css(prop); 2644 } 2645 } 2646 } 2647 2648 2649 $.fn.cloudfw_parallax = function(options){ 2650 2651 return this.each(function(){ 2652 var self = $.data( this, 'cloudfw_parallax' ); 2653 if( ! self ) { 2654 self = $.data( this, 'cloudfw_parallax', new $.CloudFwParallaxElement( options, this ) ); 2655 } 2656 }); 2657 } 2658 2659}(jQuery)); 2660 2661/* ======================================== 2662 RESPONSIVE OPTIONS (includes.modules.module.script) 2663========================================*/ 2664function detectDeviceViaPageWidth(){ 2665 "use strict"; 2666 2667 var device; 2668 2669 if ( Modernizr.mq('only all and (max-width: 767px)') ) { 2670 device = 'phone'; 2671 } 2672 else if ( Modernizr.mq('only all and (min-width: 768px) and (max-width: 979px)') ) { 2673 device = 'tablet'; 2674 } 2675 else { 2676 device = 'widescreen'; 2677 } 2678 2679 if ( ! CloudFwOp.responsive ) { 2680 device = 'widescreen'; 2681 } 2682 2683 return device; 2684 2685}; 2686 2687var responsiveOptionsCallback = function(){ 2688 "use strict"; 2689 2690 var elements = jQuery("[data-responsive]"); 2691 elements.each(function(){ 2692 var that = jQuery(this); 2693 var options = {}; 2694 var data_responsive = that.attr('data-responsive'); 2695 var device = detectDeviceViaPageWidth(); 2696 2697 if ( data_responsive ) { 2698 try { 2699 options = jQuery.parseJSON( data_responsive ); 2700 } catch (e) {} 2701 2702 if ( options.replaceClass ) { 2703 jQuery.each( options.replaceClass, function( k,v ){ 2704 var default_val = k, 2705 new_class = ''; 2706 2707 if ( typeof v[ device ] != 'undefined' || v[ device ] !== null ) 2708 new_class = v[ device ]; 2709 else 2710 new_class = default_val; 2711 2712 2713 if ( new_class !== '' && new_class != default_val ) { 2714 that.removeClass( that.attr('data-replaced-class') ).removeClass( default_val ).addClass( new_class ); 2715 that.attr('data-replaced-class', new_class); 2716 } else { 2717 var replaced_class = that.attr('data-replaced-class'); 2718 if ( replaced_class ) 2719 that.removeClass( replaced_class ).addClass( default_val ); 2720 2721 } 2722 2723 }); 2724 } 2725 2726 if ( options.css ) { 2727 jQuery.each( options.css, function( k,v ){ 2728 var property = k, 2729 object = {}; 2730 2731 object[ property ] = (typeof v[ device ] == 'undefined' || v[ device ] === null) ?
2732 ( (typeof v.widescreen != 'undefined' && v.widescreen !== null) ? v.widescreen : '' ) 2733 : v[ device ]; 2734 2735 that.css(object); 2736 2737 }); 2738 } 2739 2740 } 2741 2742 }); 2743 2744 2745}; 2746 2747jQuery(document).ready(responsiveOptionsCallback); 2748jQuery(window).resize(responsiveOptionsCallback); 2749 2750 2751var prepareResponsiveFullwidthContainer = function(){ 2752 "use strict"; 2753 2754 var fullwidth_containers = jQuery('.fullwidth-container'); 2755 2756 if ( fullwidth_containers.length ) { 2757 2758 var prepareResponsiveFullwidthContainer_Resize = function(){ 2759 2760 var page_width = jQuery('body').innerWidth(); 2761 if ( page_width <= 767 ) { 2762 fullwidth_containers.each(function(){ 2763 var that = jQuery(this); 2764 that.width( that.parent().width() ); 2765 }); 2766 2767 } else { 2768 fullwidth_containers.css({width: ''}); 2769 } 2770 2771 } 2772 2773 prepareResponsiveFullwidthContainer_Resize(); 2774 jQuery(window).resize(prepareResponsiveFullwidthContainer_Resize); 2775 2776 } 2777}; 2778jQuery(document).ready(prepareResponsiveFullwidthContainer); 2779 2780/** 2781 * Resizes fullwidth container by the page width 2782 * @return void 2783 */ 2784var prepareResponsiveFullwidthContainerPage = function(){ 2785 "use strict"; 2786 2787 var fullwidth_contents = jQuery('.fullwidth-content'); 2788 2789 if ( fullwidth_contents.length ) { 2790 2791 var prepareResponsiveFullwidthContainerPage_Resize = function(){ 2792 2793 var is_boxed = jQuery('body').hasClass('layout--boxed'); 2794 var content_width = jQuery('#page-content > .container').width(); 2795 2796 if ( is_boxed ) { 2797 var page_width = jQuery('#page-content').innerWidth(); 2798 var offset = 0 - (( page_width - content_width ) / 2) - 1; 2799 } else { 2800 var page_width = jQuery('body').innerWidth(); 2801 var offset = 0 - (( page_width - content_width ) / 2) - 1; 2802 } 2803 2804 if ( ! CloudFwOp.RTL ) { 2805 fullwidth_contents.css({ 2806 'width': page_width + 1, 2807 'margin-left': offset, 2808 'margin-right': 0 2809 }); 2810 } else { 2811 fullwidth_contents.css({ 2812 'width': page_width + 1, 2813 'margin-right': offset, 2814 'margin-left': 0 2815 }); 2816 } 2817 } 2818 2819 prepareResponsiveFullwidthContainerPage_Resize(); 2820 jQuery(window).resize(prepareResponsiveFullwidthContainerPage_Resize); 2821 2822 } 2823}; 2824jQuery(document).ready(prepareResponsiveFullwidthContainerPage); 2825 2826 2827var parseResponsiveAttribute = function( data_responsive, selector, default_value ){ 2828 "use strict"; 2829 2830 var data = {}; 2831 2832 if ( data_responsive ) { 2833 try { 2834 2835 if ( typeof data_responsive != 'object' ) 2836 data = jQuery.parseJSON( data_responsive ); 2837 2838 } catch (e) {} 2839 2840 if ( typeof data[ selector ] != 'undefined' || data[ selector ] !== null ) 2841 return data[ selector ]; 2842 else 2843 return default_value; 2844 } 2845 2846}; 2847 2848/* ======================================== 2849 TOPBAR (includes.modules.module.script) 2850========================================*/ 2851jQuery(document).ready(function(){ 2852 2853 if ( jQuery.isFunction( jQuery.fn.superfish ) ) { 2854 2855 var topbar_menu = jQuery('.ui--custom-menu', '#top-bar'); 2856 var topbar_menu_custom_animation_speed = topbar_menu.attr('data-animation-speed'); 2857 2858 topbar_menu.superfish({ 2859 hoverClass: 'hover',
2860 cssArrows: false, 2861 delay: 500, 2862 speed: topbar_menu_custom_animation_speed || 50, 2863 speedOut: topbar_menu_custom_animation_speed || 50 2864 }); 2865 } 2866 2867 2868 var search_form = jQuery('#widget--search', '#top-bar'), 2869 toggle = search_form.find('a'), 2870 input = search_form.find('input'), 2871 form = search_form.find('.ui--search-form'), 2872 cssanimations = jQuery('html').hasClass('cssanimations'); 2873 2874 2875 toggle.click(function(e){ 2876 e.preventDefault(); 2877 input.focus(); 2878 2879 }); 2880 2881 input.bind('focus', function(){ 2882 if( cssanimations ) { 2883 search_form.addClass('state--open'); 2884 } 2885 else { 2886 form.stop(1).animate({'width': 150}); 2887 } 2888 2889 //toggle.addClass('ui--gradient-primary').removeClass('ui--gradient-grey'); 2890 2891 }); 2892 2893 input.bind('blur', function(){ 2894 if( cssanimations ) { 2895 search_form.removeClass('state--open'); 2896 } 2897 else { 2898 form.stop(1).animate({'width': 0}); 2899 } 2900 2901 //toggle.removeClass('ui--gradient-primary').addClass('ui--gradient-grey'); 2902 }); 2903 2904}); 2905 2906/* ======================================== 2907 PANEL (includes.modules.module.side_panel) 2908========================================*/ 2909jQuery(document).ready(function(){ 2910 "use strict"; 2911 2912 var side_panel_handlers = jQuery('.ui--side-panel'), 2913 side_panel = jQuery('#side-panel'), 2914 side_panel_items = jQuery('#side-panel').children('div'), 2915 html = jQuery('html'), 2916 listener = false; 2917 2918 if ( side_panel.length && side_panel_handlers.length ) { 2919 2920 var side_panel_close_listener = function(){ 2921 listener = true; 2922 2923 jQuery('#main-container').click(function(e){ 2924 if ( ! jQuery(event.target).is('a') ) { 2925 html.removeClass('side-panel-open'); 2926 } 2927 }); 2928 2929 jQuery('#ui--side-panel-close-button').click(function(){ 2930 html.removeClass('side-panel-open'); 2931 }); 2932 } 2933 2934 var side_panel_toggle = function( target ){ 2935 2936 if ( ! html.hasClass('side-panel-open') ) { 2937 2938 setTimeout( function() { 2939 side_panel.show(); 2940 side_panel_items.hide(); 2941 2942 if ( target ) { 2943 side_panel_items.filter('#' + target).show(); 2944 } else { 2945 side_panel_items.first().show(); 2946 } 2947 2948 jQuery('body, html').animate({scrollTop:0}, '500', 'swing', function() { 2949 html.addClass('side-panel-open'); 2950 }); 2951 2952 }, 25 ); 2953 2954 } else { 2955 html.removeClass('side-panel-open'); 2956 } 2957 2958 if ( ! listener ) { 2959 side_panel_close_listener(); 2960 } 2961 2962 } 2963 2964 side_panel_handlers.bind('click', function(e){ 2965 e.preventDefault(); 2966 side_panel_toggle( jQuery(this).attr('data-target') ); 2967 }); 2968 2969 jQuery( document ).on( "openSidePanel", {}, function( event, target ) { 2970 side_panel_toggle( target ); 2971 }); 2972 2973 } 2974 2975}); 2976 2977/* ======================================== 2978 UNIFORM (includes.modules.module.uniform) 2979========================================*/ 2980jQuery(document).ready(function(){ 2981 "use strict"; 2982 2983 if ( ! CloudFwOp.uniform_elements ) { 2984 return true; 2985 } 2986 2987 var CloudFw_Uniform = function( wrapper ){ 2988 2989 if( jQuery('html').hasClass('old-browser') ) 2990 return true; 2991 2992 if ( ! wrapper ) 2993 wrapper = null; 2994 else { 2995 if ( typeof wrapper.jquery == 'undefined' ) 2996 wrapper = jQuery( wrapper ); 2997 2998 if ( ! wrapper.length ) 2999 return true; 3000 } 3001 3002 /** 3003 * Select 3004 */ 3005 jQuery("select", wrapper).each(function(){ 3006 var that = jQuery(this); 3007 3008 if ( that.css('display') == 'none' ) { 3009 return true; 3010 } 3011 3012 if ( that.hasClass('no-uniform') ) { 3013 return true; 3014 } 3015 3016 if ( CloudFwOp.disable_gravity_uniform_select ) { 3017 if ( that.hasClass('gfield_select') ) { 3018 return true; 3019 } 3020 } 3021 3022 if ( that.hasClass('state_select') ) { 3023 return true; 3024 } 3025 3026 if ( CloudFw_jQueried('cloudfw-select', that) ) { 3027 return true; 3028 } 3029 3030 if ( that.attr('multiple') ) { 3031 return true; 3032 } 3033 3034 var ui_wrapper = jQuery('<span/>').addClass('ui--select-wrapper ui--box ui--gradient ui--gradient-grey').addClass( that.attr('data-wrapper-classes') ); 3035 var resize_callback = function(){ 3036 var margin = that.css({'margin': ''}).css('margin'); 3037 var width = that.css({'width': ''}).css('width'); 3038 3039 ui_wrapper.css({'margin': margin}); 3040 ui_wrapper.css({'width': width}); 3041 3042 } 3043 resize_callback(); 3044 3045 that.wrap( ui_wrapper ); 3046 3047 var title = jQuery('<span/>').addClass('ui--select-title'); 3048 that.before( title ); 3049 3050 var arrow = jQuery('<i/>
3050').addClass('ui--icon icon fontawesome-angle-down ui--select-arrow'); 3051 that.before( arrow ); 3052 3053 3054 var change_callback = function() { 3055 var val = that.find(':selected').first().text(); 3056 3057 if ( val == '' ) { 3058 var default_title = that.attr('data-default-title'); 3059 if ( default_title ) 3060 var val = default_title; 3061 } 3062 3063 title.text(val); 3064 } 3065 3066 jQuery(document).delegate( that, 'change', change_callback); 3067 change_callback(); 3068 3069 that.bind('focus', function(){ 3070 that.parent().addClass('active'); 3071 }); 3072 3073 that.bind('blur', function(){ 3074 that.parent().removeClass('active'); 3075 }); 3076 3077 if ( that.attr('data-init') ) 3078 that.change(); 3079 3080 3081 3082 }); 3083 3084 3085 } 3086 3087 CloudFw_Uniform(); 3088 jQuery(document).on('ajaxSuccess',CloudFw_Uniform); 3089 3090}); 3091 3092/* ======================================== 3093 WOOCOMMERCE (includes.modules.module.woocommerce) 3094========================================*/ 3095jQuery(document).ready(function(){ 3096 3097 jQuery( '.woocommerce-tabs' ).each( function() { 3098 var hash = window.location.hash, 3099 url = window.location.href, 3100 tabs = jQuery( this ), 3101 tabs_offset = tabs.offset().top; 3102 3103 if ( hash.toLowerCase().indexOf( "comment-" ) >= 0 ) { 3104 jQuery('ul.ui--tabs-titles li.reviews_tab a', tabs ).click(); 3105 3106 jQuery('html, body').animate({ 3107 scrollTop: tabs_offset 3108 }, 2000); 3109 3110 } else if ( url.indexOf( "comment-page-" ) > 0 || url.indexOf( "cpage=" ) > 0 ) { 3111 jQuery('ul.ui--tabs-titles li.reviews_tab a', tabs ).click(); 3112 3113 jQuery('html, body').animate({ 3114 scrollTop: tabs_offset 3115 }, 2000); 3116 3117 } 3118 }); 3119 3120 jQuery( 'a.woocommerce-review-link' ).click( function() { 3121 jQuery('ul.ui--tabs-titles li.reviews_tab a', jQuery( '.woocommerce-tabs' ) ).click(); 3122 3123 jQuery('html, body').animate({ 3124 scrollTop: jQuery( '.woocommerce-tabs' ).offset().top 3125 }, 2000); 3126 3127 return true; 3128 }); 3129 3130}); 3131 3132/* ======================================== 3133 QUICKVIEW (includes.modules.module.yith_quickview) 3134========================================*/ 3135jQuery(document).ready(function(){ 3136 3137 jQuery('.ui--quickview-button > .btn').click(function(e){ 3138 e.preventDefault(); 3139 var that = jQuery(this); 3140 jQuery.CloudFwPrettyPhoto.open( that.attr('data-href') ); 3141 }); 3142 3143}); 3144 3145/* ======================================== 3146 FLEXSLIDER (includes.sliders.flex_slider) 3147========================================*/ 3148jQuery(document).ready(function(){ 3149 3150 jQuery('.flexslider-navigation-prev').click(function(){ 3151 var that = jQuery(this); 3152 var slider = that.parents('.flexslider-wrapper').first().find('.flexslider'); 3153 3154 slider.flexslider("prev"); 3155 }); 3156 3157 3158 jQuery('.flexslider-navigation-next').click(function(){ 3159 var that = jQuery(this); 3160 var slider = that.parents('.flexslider-wrapper').first().find('.flexslider'); 3161 3162 slider.flexslider("next"); 3163 }); 3164 3165 3166}); 3167 3168jQuery(window).load(function(){ 3169 jQuery('.flexslider .flex-control-paging li a').html('<div class="ui--bullets"><div class="ui--bullets-color ui--accent-gradient"></div></div>'); 3170});
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.