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(); 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 47 }); 48 49 } 50 51 }); 52 53 /** Init Toggles */ 54 jQuery('.ui--accordion').each(function () { 55 jQuery(this).CloudFwAccordions(); 56 }); 57 58}); 59 60/* ======================================== 61 CAROUSEL (includes.shortcodes.shortcode.carousel) 62========================================*/ 63var boxGalleryInit; 64 65jQuery(document).ready(function(){ 66 "use strict"; 67 68 if ( jQuery.isFunction( jQuery.fn.flexslider ) ) { 69 70 var carouselInit = function( parent ){ 71 if ( typeof parent == 'undefined' || !parent.jquery ) 72 parent = jQuery( '.ui--carousel' ); 73 74 parent.each(function(){ 75 var that = jQuery(this); 76 var fullwidth = ! that.parents('.ui-row').length; 77 var pass = that.parents('.ui--pass'); 78 var wrapper = pass.length ? pass : that; 79 80 var title_bordered = that.prev('.ui--title-bordered').length ? that.prev('.ui--title-bordered') : wrapper.prev('.ui--title-bordered'); 81 var title_widget = wrapper.prev('.ui--widget-title'); 82 var slider_data = that.data('flexslider'); 83 84 85 if ( !slider_data ) { 86 87 var slides = that.find('.slides'); 88 89 if ( slides.length > 1 ) { 90 slides.last().unwrap(); 91 } 92 93 if ( fullwidth ) { 94 that.addClass( 'fullwidth-content' ); 95 var children = slides.first().children(); 96 97 children.each(function(){ 98 var child = jQuery(this); 99 100 if ( child.hasClass('.ui-row') ) { 101 child.wrap('<div class="ui--carousel-content clearfix" />').wrap('<div class="container" />'); 102 } else { 103 child.wrap('<div class="ui--carousel-content clearfix" />').wrap('<div class="container" />').wrap('<div class="ui-row" />'); 104 } 105 106 }); 107 108 prepareResponsiveFullwidthContainerPage( that ); 109 } else { 110 slides.first().children('.ui-row').wrap('<div class="ui--carousel-content clearfix" />'); 111 } 112 113 var items = slides.children(); 114 if ( !( items.length > 1 ) ) { 115 items.show(); 116 return false; 117 } 118 119 var options = CloudFwParseAttribute(that.attr('data-options')); 120 121 if ( options.auto_rotate == '1' ) 122 options.auto_rotate = true; 123 else 124 options.auto_rotate = false; 125 126 if ( typeof options.animate == 'undefined' || options.animate == '1' ) 127 options.animate = 600; 128 else 129 options.animate = 1; 130 131 var that = that.flexslider({ 132 namespace: "ui--carousel-", 133 selector: ".slides > div", 134 animation: options.effect || "slide", 135 slideshow: options.auto_rotate, 136 //slideshow: false, 137 slideshowSpeed: options.rotate_time || 7000, 138 smoothHeight: true, 139 animationLoop: false, 140 controlNav: false, 141 directionNav: false, 142 animationSpeed: 1000, 143 itemMargin: 30, 144 start: function( obj ) { 145 if ( typeof boxGalleryInit != 'undefined' ) { 146 boxGalleryInit( that ); 147 } 148 } 149 150 }); 151 152 var slider_data = that.data('flexslider'); 153 154 if ( options.arrows == '1' ) { 155 156 var to_prev = function(){ that.flexslider('prev'); jQuery(window).scroll(); } 157 var to_next = function(){ that.flexslider('next'); jQuery(window).scroll(); } 158 159 if ( title_bordered.length ) { 160 title_bordered.addClass('with-navigation'); 161 title_bordered.find('.ui--title-navigation').remove(); 162 title_bordered.append( jQuery('<div/>').addClass('ui--title-navigation') ); 163 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>'); 164 title_bordered.find('.ui--title-navigation > .ui--carosuel-prev').click( to_prev ); 165 title_bordered.find('.ui--title-navigation > .ui--carosuel-next').click( to_next ); 166 } else if ( title_widget.length ) { 167 title_widget.addClass('with-navigation'); 168 title_widget.find('.ui--title-navigation').remove(); 169 title_widget.append( jQuery('<div/>').addClass('ui--title-navigation') ); 170 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>'); 171 title_widget.find('.ui--title-navigation > .ui--carosuel-prev').click( to_prev ); 172 title_widget.find('.ui--title-navigation > .ui--carosuel-next').click( to_next ); 173 } else { 174 that.find('.ui--carousel-navigation').remove(); 175 that.append( jQuery('<div/>').addClass('ui--carousel-navigation clearfix') ); 176 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>'); 177 that.find('.ui--carousel-navigation > .ui--carosuel-prev').click( to_prev ); 178 that.find('.ui--carousel-navigation > .ui--carosuel-next').click( to_next ); 179 } 180 181 } 182 183 } 184 185 }); 186 187 } 188 189 /*var timeout = setTimeout( function(){ 190 carouselInit(); 191 clearTimeout( timeout ); 192 }, 500); 193 */ 194 jQuery( '.ui--carousel' ).each(function(){ 195 var that = jQuery(this); 196 that.find('.slides > div:first').find('img:first').imagesLoaded(function(){ 197 var timeout = setTimeout( function(){ 198 carouselInit( that ); 199 clearTimeout( timeout ); 200 }, 300); 201 202 }); 203 }); 204 jQuery(window).load(carouselInit); 205 206 207 208 209 boxGalleryInit = function( parent ){ 210 211 parent.find( '.ui--content-box-gallery' ).each(function(){ 212 var that = jQuery(this); 213 var slider_data = that.data('flexslider'); 214 215 216 if ( !slider_data ) { 217 218 jQuery(window).load(function(){ boxGalleryInit( parent ); }); 219 var options = CloudFwParseAttribute(that.attr('data-options')); 220 options.auto_rotate = (options.auto_rotate == '1') ? true : false;
221 222 that.flexslider({ 223 namespace: "ui--content-box-gallery-", 224 selector: ".mini-slides > div", 225 animation: options.effect || "slide", 226 slideshow: options.auto_rotate || false, 227 slideshowSpeed: 7000, 228 smoothHeight: false, 229 controlNav: false, 230 directionNav: false, 231 keyboard: false 232 }); 233 234 var slider_data = that.data('flexslider'); 235 236 var to_prev = function(){ that.flexslider("prev"); } 237 var to_next = function(){ that.flexslider("next"); } 238 239 that.find('.ui--content-box-gallery-navigation').remove(); 240 that.append( jQuery('<div/>').addClass('ui--content-box-gallery-navigation') ); 241 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>'); 242 that.find('.ui--content-box-gallery-navigation > .ui--carosuel-prev').click( to_prev ); 243 that.find('.ui--content-box-gallery-navigation > .ui--carosuel-next').click( to_next ); 244 245 246 } 247 248 }); 249 250 } 251 252 jQuery('.ui--content-box').each(function(){ 253 var that = jQuery(this), 254 parents = that.parents(); 255 256 if ( !parents.filter('.ui--carousel').length && !parents.filter('.ui--masonry').length ) { 257 boxGalleryInit( that ); 258 jQuery(window).load(function(){ boxGalleryInit( that ); }); 259 } 260 261 262 }); 263 264 265 266 267 } 268 269}); 270 271/* ======================================== 272 GALLERY (includes.shortcodes.shortcode.gallery) 273========================================*/ 274(function( jQuery ){ 275 "use strict"; 276 277 jQuery(document).ready(function(){ 278 279 if ( !CloudFwOp.gallery_overlay_opacity ) { 280 CloudFwOp.gallery_overlay_opacity = 0.60; 281 } 282 283 jQuery('.ui--gallery-item a').hover(function(){ 284 var that = jQuery(this), 285 overlay = that.find('.ui--gallery-overlay'); 286 287 overlay.stop(1).fadeTo(500, CloudFwOp.gallery_overlay_opacity); 288 289 },function(){ 290 var that = jQuery(this), 291 overlay = that.find('.ui--gallery-overlay'); 292 293 overlay.stop(1).fadeTo(500,0); 294 295 }); 296 297 }); 298 299})(jQuery); 300 301/* ======================================== 302 GMAP (includes.shortcodes.shortcode.gmap) 303========================================*/ 304jQuery(document).ready(function(){ 305 "use strict"; 306 307 jQuery(".gmap").each(function(){ 308 var that = jQuery(this), 309 gmap = '', 310 api = '', 311 data = that.attr('data-gmap-options') || '', 312 defaults = {}; 313 314 try { 315 316 if ( typeof data != 'object' ) { 317 var gmap_metadata = jQuery.parseJSON( data ); 318 } else { 319 var gmap_metadata = data; 320 } 321 322 } catch (e) { 323 var gmap_metadata = {}; 324 } 325 326 var defaults = { 327 zoom : 12, 328 latitude : 0, 329 longitude : 0, 330 maptype : "ROADMAP", 331 doubleclickzoom : 1, 332 scrollwheel : 1, 333 controls : false 334 }; 335 336 var gmap_options = jQuery.extend( {}, defaults, gmap_metadata ); 337 338 that.unbind('gMapReady').bind('gMapReady',function(){ 339 gmap = that.gMap( gmap_options ); 340 api = that.data('gMap.reference'); 341 that.data( "gMapReady", true ); 342 343 var styles = gmap_options.stylers || {}; 344 345 if ( styles ) { 346 api.setOptions({styles: styles}); 347 } 348 349 }).data("gMapReady", false); 350 351 var init_now = true; 352 353 if ( init_now ) { 354 that.trigger( 'gMapReady' ); 355 } 356 357 var device_callback = function(){ 358 var device = detectDeviceViaPageWidth(); 359 360 if ( device == 'phone' ) { 361 that.trigger('gMapReady'); 362 } 363 } 364 365 device_callback(); 366 //jQuery(window).bind('CloudFwDetectDevice', device_callback ); 367 368 }); 369 370}); 371 372/* ======================================== 373 MASONRY (includes.shortcodes.shortcode.masonry) 374========================================*/ 375jQuery(document).ready(function(){ 376 "use strict"; 377 378 //return true; 379 380 if ( jQuery.isFunction( jQuery.fn.isotope ) ) { 381 382 // code found on this page: http://isotope.metafizzy.co/custom-layout-modes/masonry-gutters.html 383 384 // modified Isotope methods for gutters in masonry 385 jQuery.Isotope.prototype._getMasonryGutterColumns = function() { 386 var gutter = this.options.masonry && this.options.masonry.gutterWidth || 0; 387 var containerWidth = this.element.width(); 388 389 this.masonry.columnWidth = this.options.masonry && this.options.masonry.columnWidth || 390 // or use the size of the first item 391 this.$filteredAtoms.outerWidth(true) || 392 containerWidth; 393 394 this.masonry.columnWidth += gutter; 395 396 this.masonry.cols = Math.floor((containerWidth + gutter) / this.masonry.columnWidth); 397 this.masonry.cols = Math.max(this.masonry.cols, 1); 398 } 399 400 jQuery.Isotope.prototype._masonryReset = function() { 401 // layout-specific props 402 this.masonry = {}; 403 this._getMasonryGutterColumns(); 404 var i = this.masonry.cols; 405 this.masonry.colYs = []; 406 while (i--) { 407 this.masonry.colYs.push(0); 408 } 409 } 410 411 jQuery.Isotope.prototype._masonryResizeChanged = function() { 412 var prevSegments = this.masonry.cols; 413 // update cols/rows 414 this._getMasonryGutterColumns(); 415 // return if updated cols/rows is not equal to previous 416 return (this.masonry.cols !== prevSegments); 417 } 418 419 var masonryInit = function(){ 420 421 jQuery( '.ui--masonry' ).each(function(){ 422 var that = jQuery(this); 423 var title_bordered = that.prev('.ui--title-bordered'); 424 var title_widget = that.prev('.ui--widget-title'); 425 var masonry_data = that.data('masonry'); 426 var init = new Object(); 427 var is_fluid = false;
428 429 if ( that.hasClass('row-fluid') || that.parents('.ui-row').length ) { 430 is_fluid = true; 431 } 432 433 if ( !masonry_data ) { 434 435 CloudFwLoaded( that ); 436 437 var items = that.find('.ui--content-item'); 438 items.each(function(){ 439 if( !jQuery(this).parent().hasClass('ui-column') ) { 440 jQuery(this).wrap('<div class="ui-column span12"/>'); 441 } 442 }); 443 444 that.find('> .ui-row > .ui-column').addClass('ui--isotope-item'); 445 that.imagesLoaded(masonryInit); 446 447 } 448 449 if ( masonry_data == true && !is_fluid ) { 450 that.isotope( 'reLayout' ); 451 return false; 452 } 453 454 /** Init Object */ 455 init.resizable = false; 456 init.itemSelector = '.ui--isotope-item'; 457 init.onLayout = function(){ 458 that.show(); 459 if ( typeof boxGalleryInit != 'undefined' ) 460 boxGalleryInit( that ); 461 }; 462 init.layoutMode = 'masonry'; 463 464 if ( is_fluid ) { 465 var containerWidth = that.width(), 466 column = CloudFwGetColumByClassname( that.find('.ui--isotope-item') ), 467 gutter = (containerWidth * column) / 100, 468 gutterWidth = gutter * (column - 1), 469 columnWidth = Math.floor(((containerWidth - gutterWidth) / column)); 470 471 init.masonry = { 472 columnWidth: columnWidth, 473 gutterWidth: gutter 474 }; 475 } 476 477 that.data('masonry',true); 478 that.css("visibility", "visible").css("overflow", "visible").isotope(init); 479 that.addClass('ui--done'); 480 481 }); 482 483 } 484 485 if ( BrowserDetect.browser == 'IE' ) { 486 jQuery(window).load(masonryInit); 487 } else { 488 masonryInit(); 489 } 490 491 jQuery(window).smartresize(masonryInit, 5000); 492 493 } 494 495}); 496 497/* ======================================== 498 TABLE (includes.shortcodes.shortcode.pricing_table) 499========================================*/ 500jQuery(document).ready(function(){ 501 "use strict"; 502 503 var pricingTableInit = function(){ 504 505 jQuery('.ui--pricing-table').each(function(){ 506 var that = jQuery(this), 507 before_htmls = that.find( '.ui--pricing-table-before-html' ), 508 features = that.find( '.ui--pricing-table-features' ); 509 510 before_htmls.css({'min-height': ''}).css({'min-height': Math.max.apply(null, before_htmls.map(function(){return jQuery(this).height();}).get())}); 511 512 features.first().children('.ui--pricing-table-feature').each(function(){ 513 var group = jQuery(this).attr('data-group'), 514 items = that.find( '.' + group ); 515 516 items.css({'min-height': ''}).css({'min-height': Math.max.apply(null, items.map(function(){return jQuery(this).height();}).get())}); 517 518 }); 519 520 }); 521 522 } 523 524 pricingTableInit(); 525 jQuery(window).load( pricingTableInit ); 526 jQuery(window).smartresize( pricingTableInit ); 527 528}); 529 530/* ======================================== 531 PROGRESS BAR (includes.shortcodes.shortcode.progress_bar) 532========================================*/ 533jQuery(document).ready(function(){ 534 "use strict"; 535 536 if ( ! jQuery.isFunction( jQuery.inviewport ) ) 537 return false; 538 539 var progressBarInit = function(){ 540 541 jQuery('.ui--progress:in-viewport').each(function(){ 542 var that = jQuery(this); 543 544 if( ! that.hasClass('animated') ) { 545 var percent = that.find('.ui--progress-percent'); 546 var callback = function(){ 547 548 } 549 550 percent.css({'visibility': 'visible'}); 551 if ( animation_type == 'css' ) { 552 553 that.addClass('lock'); 554 that.addClass('animated'); 555 556 var delay = setInterval(function(){ 557 that.removeClass('lock'); 558 clearInterval(delay); 559 }, 500); 560 561 that.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", callback); 562 563 } else { 564 565 that.addClass('animated'); 566 var width = percent.attr('data-value'); 567 percent.width('0').animate({'width': width}, 600, callback); 568 569 } 570 571 572 } 573 }); 574 575 } 576 577 if ( jQuery('.ui--progress').length ) { 578 var animation_type = jQuery('html').hasClass('cssanimations') ? 'css' : 'javascript'; 579 580 if ( animation_type == 'css' ) { 581 progressBarInit(); 582 jQuery(window).load( progressBarInit ); 583 jQuery(window).scroll( jQuery.throttle( 250, progressBarInit ) ); 584 } 585 586 } 587}); 588 589/* ========================================
590 PROGRESS CIRCLE (includes.shortcodes.shortcode.progress_circle) 591========================================*/ 592jQuery(document).ready(function(){ 593 "use strict"; 594 595 if ( ! jQuery.isFunction( jQuery.inviewport ) || ! jQuery.isFunction( jQuery.easyPieChart ) ) { 596 return false; 597 } 598 599 var initPieChart = function() { 600 jQuery('.ui--progress-circle').each(function(){ 601 var that = jQuery(this), 602 wrapper = that.parent(), 603 wrapper_width = wrapper.width(), 604 percent_text = wrapper.find('.ui--progress-circle-percent'), 605 percent = parseInt(that.attr('data-percent-update'), 10), 606 width = parseInt(that.attr('data-width'), 10); 607 608 if ( !width || width > wrapper_width ) { 609 width = wrapper_width; 610 } 611 612 that.easyPieChart({ 613 animate: 1000, 614 trackColor: '#f1f1f1', 615 barColor: '#169FE5', 616 scaleColor: false, 617 lineCap: 'butt', 618 rotate: -90, 619 lineWidth: 15, 620 size: width, 621 onStep: function(value) { percent_text.text(~~value); }, 622 onStop: function(value) { percent_text.text(percent); } 623 }); 624 625 that.find('.ui--center-vertical').uiVerticalCenter(); 626 627 628 }); 629 630 initPieChartUpdate(); 631 632 }; 633 634 var initPieChartResize = function() { 635 636 jQuery('.ui--progress-circle').each(function(){ 637 var that = jQuery(this); 638 639 that.removeData( 'easyPieChart' ); 640 that.removeData( 'inViewport' ); 641 that.css({ 642 'width' : '', 643 'height' : '', 644 'line-height' : '' 645 }); 646 that.find('canvas').remove(); 647 648 }); 649 650 initPieChart(); 651 652 }; 653 654 var initPieChartUpdate = function() { 655 jQuery('.ui--progress-circle:in-viewport').each(function(){ 656 var that = jQuery(this); 657 658 if ( ! that.is(':visible') ) { 659 return true; 660 } 661 662 if ( that.data('inViewport') ) { 663 return true; 664 } 665 666 that.data('inViewport', true); 667 668 var percent = parseInt(that.attr('data-percent-update'), 10); 669 that.data('easyPieChart').update( percent ); 670 }); 671 }; 672 673 674 if ( jQuery('.ui--progress-circle').length ) { 675 var animation_type = jQuery('html').hasClass('cssanimations') ? 'css' : 'javascript'; 676 677 if ( animation_type == 'css' ) { 678 initPieChart(); 679 jQuery(window).load( initPieChartUpdate ); 680 jQuery(window).scroll( jQuery.throttle( 250, initPieChartUpdate ) ); 681 jQuery(window).smartresize( initPieChartResize, 5000 ); 682 } 683 }; 684 685}); 686 687/* ======================================== 688 TABS (includes.shortcodes.shortcode.tabs) 689========================================*/ 690jQuery(document).ready(function(){ 691 "use strict"; 692 693 jQuery.fn.extend({ 694 /** 695 * CloudFw Tabs 696 * 697 * @since 1.0 698 */ 699 CloudFwTabs: function() { 700 var in_proccess = false, 701 tabs = this, 702 titles = tabs.find('.ui--tabs-header .ui--tabs-titles').children('li'), 703 border_before = tabs.find('.ui--tabs-header .ui--tabs-border-before'), 704 border_after = tabs.find('.ui--tabs-header .ui--tabs-border-after'), 705 border_top = tabs.find('.ui--tabs-header .ui--tabs-border-top'), 706 border_bottom = tabs.find('.ui--tabs-header .ui--tabs-border-bottom'), 707 contents = tabs.children('.ui--tabs-contents').children('li'); 708 709 titles.first().addClass('first-item'); 710 titles.last().addClass('last-item'); 711 712 contents.first().show().removeClass('hidden').addClass('active').addClass('first-item'); 713 contents.last().addClass('last-item'); 714 715 titles.find('a').click(function(e) { 716 //e.preventDefault(); 717 718 var that = jQuery(this), 719 li = that.parents('li').first(), 720 width = li.width(), 721 height = li.height(), 722 pos = li.position(), 723 index = li.index(); 724 725 726 if (in_proccess === true ) { 727 return false; 728 } 729 730 in_proccess = true; 731 732 if ( ! li.hasClass('active') ) { 733 contents.filter('.active').removeClass('active').addClass('hidden'); 734 contents.eq(index).removeClass('hidden').addClass('active'); 735 736 titles.filter('.active').removeClass('active'); 737 li.addClass('active'); 738 } 739 740 border_after.css( { left: (pos.left + width) } ); 741 border_before.css( { left: -(border_before.width() - pos.left) } ); 742 743 border_top.css( { top: -(border_top.height() - pos.top) } ); 744 border_bottom.css( { top: (pos.top + height) } ); 745 746 tabs.addClass('ui--done'); 747 748 in_proccess = false;
749 jQuery(window).trigger('scroll'); 750 jQuery(window).trigger('make@2x'); 751 752 }); 753 754 titles.first().find('a').click(); 755 756 var refresh_titles = function(){ 757 titles.filter('.active').find('a').click(); 758 }; 759 760 jQuery(window).smartresize(refresh_titles, 20); 761 jQuery(document).ready(refresh_titles); 762 jQuery(window).load(refresh_titles); 763 764 } 765 766 }); 767 768 /** Prepare Tabs */ 769 jQuery('.ui--tabs').each(function () { 770 jQuery(this).CloudFwTabs(); 771 }); 772 773}); 774 775/* ======================================== 776 TITLES (includes.shortcodes.shortcode.titles) 777========================================*/ 778jQuery(document).ready(function(){ 779 "use strict"; 780 781 var bordered_titles_callback = function(){ 782 jQuery('.ui--title-bordered').each(function(){ 783 var that = jQuery(this), 784 text = that.find('.ui--title-text'), 785 pos = text.position(), 786 width = text.outerWidth(), 787 border_left = that.find('.ui--title-border-left'), 788 border_right = that.find('.ui--title-border-right'); 789 790 791 border_left.show().css({ left: 0 - (border_left.width() - pos.left) }); 792 border_right.show().css( { left: (pos.left + width) } ); 793 794 }); 795 } 796 797 bordered_titles_callback(); 798 jQuery(window).load( bordered_titles_callback ); 799 jQuery(window).smartresize( bordered_titles_callback ); 800 801 802}); 803 804/* ======================================== 805 TOGGLES (includes.shortcodes.shortcode.toggles) 806========================================*/ 807jQuery(document).ready(function(){ 808 "use strict"; 809 810 jQuery.fn.extend({ 811 812 CloudFwToggle: function() { 813 var in_progress = false, 814 toggle = this, 815 title = toggle.children('.ui--toggle-title'), 816 title_link = title.children('a'), 817 content = toggle.children('.ui--toggle-content'); 818 819 title_link.click(function( e ) { 820 e.preventDefault(); 821 822 if (in_progress === true) { 823 return false; 824 } 825 826 in_progress = true; 827 828 var that = jQuery(this), 829 group = toggle.attr("data-group"); 830 831 toggle.addClass('not'); 832 833 if (group && toggle.hasClass('ui--toggle-state-closed')) { 834 jQuery('[data-group="' + group + '"]').not('.not').removeClass('ui--toggle-state-opened').addClass('ui--toggle-state-closed'); 835 } 836 837 if (toggle.hasClass('ui--toggle-state-opened')) { 838 toggle.removeClass('ui--toggle-state-opened').removeClass('not').addClass('ui--toggle-state-closed'); 839 in_progress = false; 840 841 } else { 842 toggle.removeClass('ui--toggle-state-closed').removeClass('not').addClass('ui--toggle-state-opened'); 843 in_progress = false; 844 jQuery(window).trigger('scroll'); 845 jQuery(window).trigger('make@2x'); 846 } 847 848 }); 849 850 851 } 852 853 }); 854 855 /** Init Toggles */ 856 jQuery('.ui--toggle').each(function () { 857 jQuery(this).CloudFwToggle(); 858 }); 859 860}); 861 862/* ======================================== 863 GALLERY (includes.shortcodes.shortcode.ui_box) 864========================================*/ 865jQuery(document).ready(function(){ 866 "use strict"; 867 868 if ( jQuery.isFunction( jQuery.fn.flexslider ) ) { 869 //jQuery( '.ui--carousel' ).imagesLoaded(boxGalleryInit); 870 871 } 872 873 jQuery('.ui--content-box').each(function(){ 874 var that = jQuery(this); 875 var options = CloudFwParseAttribute(that.attr('data-ligthbox')); 876 877 if ( options ) { 878 if ( options.src ) { 879 that.find('.ui--content-box-link').bind('click', function(){ 880 jQuery.CloudFwPrettyPhoto.open(options.src, null, options.desc); 881 return false; 882 883 }); 884 } 885 } 886 887 888 }); 889 890 891 892}); 893 894/* ======================================== 895 BLOG (includes.modules.module.blog) 896========================================*/ 897jQuery(document).ready(function(){ 898 899 900 blogGalleryInit = function( parent ){ 901 902 jQuery( '.ui--blog-gallery' ).each(function(){ 903 var that = jQuery(this); 904 var slider_data = that.data('flexslider'); 905 906 907 if ( !slider_data ) { 908 909 jQuery(window).load(function(){ blogGalleryInit( parent ); }); 910 var options = CloudFwParseAttribute(that.attr('data-options')); 911 options.auto_rotate = (options.auto_rotate == '1') ? true : false; 912 913 that.flexslider({ 914 namespace: "ui--blog-gallery-", 915 selector: ".slides > div", 916 animation: options.effect || "slide", 917 slideshow: options.auto_rotate || false, 918 slideshowSpeed: 7000, 919 smoothHeight: false, 920 controlNav: false, 921 directionNav: false, 922 keyboard: false 923 }); 924 925 var slider_data = that.data('flexslider'); 926 927 var to_prev = function(){ that.flexslider("prev"); } 928 var to_next = function(){ that.flexslider("next"); } 929 930 that.find('.ui--blog-gallery-navigation').remove(); 931 that.append( jQuery('<div/>').addClass('ui--blog-gallery-navigation') ); 932 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>'); 933 that.find('.ui--blog-gallery-navigation > .ui--carosuel-prev').click( to_prev ); 934 that.find('.ui--blog-gallery-navigation > .ui--carosuel-next').click( to_next ); 935 936 937 } 938 939 }); 940 941 } 942 943 blogGalleryInit(); 944 jQuery(window).load(function(){ blogGalleryInit(); }); 945 946 947}); 948 949/* ======================================== 950 EFFECTS (includes.modules.module.effects) 951========================================*/ 952jQuery(document).ready(function(){ 953 'use strict'; 954 955 var initEffects = function() { 956 957 jQuery('.ui--animation-in:in-viewport').each(function(){ 958 var parent = jQuery(this); 959 960 if ( ! parent.is(':visible') ) { 961 return true; 962 } 963 964 if ( parent.data('inViewport') ) { 965 return true; 966 } 967 968 parent.data('inViewport', true); 969 970 initEffectsFire( parent ); 971 972 }); 973 974 }; 975 976 var initEffectsFire = function( parent ) { 977 978 var animator = parent.hasClass('ui--animation-in') ? parent : parent.parents('.ui--animation-in:first'); 979 980 var elements = parent.find('.ui--animation'), 981 effect = animator.attr('data-fx'), 982 start_delay = parseInt( parent.attr('data-start-delay'), 10 ) || 0, 983 delay = parseInt( animator.attr('data-delay'), 10 ) || 150; 984 985 var carousel = parent.find('.ui--carousel'); 986 if ( carousel.length ) { 987 var active_carousel = carousel.find('.ui--carousel-active-slide'); 988 989 if ( active_carousel.length ) { 990 var passive_elements = elements; 991 992 if ( carousel.parents('.ui--animation').length ) { 993 initEffectsFire( carousel.find('.ui--carousel-active-slide') ); 994 } else { 995 elements = carousel.find('.ui--carousel-active-slide').find('.ui--animation'); 996 } 997 passive_elements.not( elements ).addClass('ui--animation-fire');/*.removeClass('ui--animation')*/; 998 } 999 1000 } 1001 1002 elements = elements.filter(function(index){ 1003 var parent_animations = jQuery(this).parents('.ui--animation'); 1004 1005 parent_animations = parent_animations.filter(function(){ 1006 return jQuery(this).find('.ui--animation-in').length === 0; 1007 }); 1008 1009 return parent_animations.length === 0; 1010 }); 1011 1012 /*elements = elements.filter(function(index){ 1013 var all_parents = jQuery(this).parents(); 1014 var has_ui_animation = false;
1015 1016 all_parents.each(function(){ 1017 var up_element = jQuery(this); 1018 if ( up_element.hasClass( '.ui--animation-in' ) ) { 1019 return false; 1020 } else if ( up_element.hasClass( '.ui--animation' ) ) { 1021 has_ui_animation = true; 1022 return false; 1023 } 1024 }); 1025 1026 return has_ui_animation ? false : true; 1027 });*/ 1028 1029 1030 1031 elements.each(function(i){ 1032 1033 var element = jQuery(this), 1034 element_effect = element.attr('data-fx'), 1035 element_delay = parseInt( element.attr('data-delay'), 10 ) || 0, 1036 current_delay = (start_delay + element_delay) + (i * delay); 1037 1038 //element.attr('data-current-delay', current_delay); 1039 1040 if ( element_effect ) { 1041 element.addClass( element_effect ); 1042 } else if ( effect ) { 1043 element.addClass( effect ); 1044 } 1045 1046 var timeout = setTimeout(function(){ 1047 1048 //element.bind("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd", function(){}); 1049 element.addClass('ui--animation-fire').attr('DELAY', current_delay); 1050 1051 if ( element.find('.ui--animation') ) { 1052 element.removeClass('ui--animation'); 1053 initEffectsFire( element ); 1054 } 1055 1056 }, (current_delay)); 1057 1058 }); 1059 1060 }; 1061 1062 var animation_type = jQuery('html').hasClass('cssanimations') ? 'css' : 'javascript'; 1063 1064 if ( animation_type == 'css' ) { 1065 //setTimeout( initEffects, 200 ); 1066 jQuery(window).load( initEffects ); 1067 jQuery(window).focus( initEffects ); 1068 jQuery(window).scroll( jQuery.throttle( 250, initEffects ) ); 1069 } 1070 1071}); 1072 1073/* ======================================== 1074 LIKES (includes.modules.module.likes) 1075========================================*/ 1076jQuery(document).ready(function($){ 1077 1078 jQuery('.ui--likes').on('click', 1079 function() { 1080 var that = jQuery(this); 1081 1082 //if(that.hasClass('active')) 1083 // return false; 1084 1085 var id = that.attr('data-post-id'), 1086 options = CloudFwParseAttribute(that.attr('data-options')); 1087 1088 var options_encoded = {}; 1089 jQuery.each( options, function( k, v ){ 1090 options_encoded[ k ] = encodeURIComponent(v); 1091 }); 1092 1093 jQuery.post(CloudFwOp.ajaxUrl, { 1094 action: 'cloudfw_likes', 1095 likes_id: id, 1096 options: options_encoded 1097 }, function(data){ 1098 that.html(data).addClass('active').attr('title','You already like this'); 1099 }); 1100 1101 return false; 1102 }); 1103 1104}); 1105 1106/* ======================================== 1107 PRIMARY NAVIGATION (includes.modules.module.nav) 1108========================================*/ 1109jQuery(document).ready(function(){ 1110 1111 if ( jQuery.isFunction( jQuery.fn.superfish ) ) { 1112 var navigation = jQuery('#header-navigation'); 1113 1114 navigation.superfish({ 1115 hoverClass: 'hover',
1116 cssArrows: false, 1117 delay: 800, 1118 speed: 200, 1119 speedOut: 200, 1120 onBeforeShow: function( $ul ){ 1121 navigation.addClass('active'); 1122 }, 1123 onShow: function( $ul ){ 1124 jQuery(window).trigger('scroll'); 1125 jQuery(window).trigger('make@2x'); 1126 }, 1127 onBeforeHide: function(){ 1128 navigation.removeClass('active'); 1129 } 1130 }); 1131 } 1132 1133 1134 jQuery('#header-navigation-toggle > a').click(function(){ 1135 var that = jQuery(this), 1136 nav = jQuery('#header-navigation'); 1137 1138 if ( nav.is(':visible') ) { 1139 nav.slideUp(); 1140 } else { 1141 nav.slideDown(); 1142 } 1143 1144 }); 1145 1146}); 1147 1148/* ======================================== 1149 PORTFOLIO (includes.modules.module.portfolio) 1150========================================*/ 1151jQuery(document).ready(function(){ 1152 1153 function splitarray(input, spacing) 1154 { 1155 var output = []; 1156 1157 for (var i = 0; i < input.length; i += spacing) 1158 { 1159 output[output.length] = input.slice(i, spacing); 1160 } 1161 1162 return output; 1163 } 1164 1165 /** Portfolio Filters */ 1166 jQuery('.portfolio-filters > li > a').click(function(e){ 1167 e.preventDefault(); 1168 1169 var that = jQuery(this), 1170 wrapper = that.parents('.portfolio-container-wrapper').first(), 1171 container = wrapper.find('.portfolio-container'), 1172 layout = wrapper.attr('data-layout'), 1173 columns = parseInt(wrapper.attr('data-columns')), 1174 parent = that.parents('.portfolio-filters').first(), 1175 parent_li = that.parent('li'), 1176 isotope = parent.attr('data-isotope'), 1177 selector = that.attr('data-filter'); 1178 1179 1180 if ( layout == 'masonry' ) { 1181 jQuery(""+isotope+"").find('.ui--masonry').first().isotope({ filter: selector }); 1182 1183 } else if ( layout == 'carousel' ) { 1184 1185 } else { 1186 1187 var items = container.find('> .ui-row > .ui-column'), 1188 count = items.length, 1189 rows = container.children('.ui-row'); 1190 1191 items.show().removeClass('passive-item').fadeTo(1000,1).not('' + selector).stop(1).addClass('passive-item').fadeTo(1000,.3); 1192 } 1193 1194 parent.children('li.active-item').removeClass('active-item'); 1195 parent_li.addClass('active-item'); 1196 parent.children('li').not('.active-item'); 1197 1198 }); 1199 1200}); 1201 1202/* ======================================== 1203 REVSLIDER (includes.modules.module.revslider) 1204========================================*/ 1205jQuery(document).ready(function(){ 1206 "use strict"; 1207 1208 jQuery('.rev_slider_wrapper').bind("revolution.slide.onloaded",function (e) { 1209 var that = jQuery(this); 1210 1211 that.find( '.caption-primary' ).wrapInner('<div />'); 1212 that.find( '.tp-leftarrow' ).html( '<div class="slider-navigation-wrapper"><i class="fontawesome-chevron-left"></i></div>' ); 1213 that.find( '.tp-rightarrow' ).html( '<div class="slider-navigation-wrapper"><i class="fontawesome-chevron-right"></i></div>' ); 1214 that.find( '.tp-bullets.round > .bullet' ).html( '<div class="ui--bullets"><div class="ui--bullets-color ui--accent-gradient"></div></div>' ); 1215 1216 }); 1217 1218 1219}); 1220 1221 1222 1223/* ======================================== 1224 BROWSER (includes.modules.module.script) 1225========================================*/ 1226var BrowserDetect = 1227{ 1228 init: function () 1229 { 1230 this.browser = this.searchString(this.dataBrowser) || "Other"; 1231 this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown"; 1232 }, 1233 1234 searchString: function (data) 1235 { 1236 for (var i=0 ; i < data.length ; i++) 1237 { 1238 var dataString = data[i].string; 1239 this.versionSearchString = data[i].subString; 1240 1241 if (dataString.indexOf(data[i].subString) != -1) 1242 { 1243 return data[i].identity; 1244 } 1245 } 1246 }, 1247 1248 searchVersion: function (dataString) 1249 { 1250 var index = dataString.indexOf(this.versionSearchString); 1251 if (index == -1) return; 1252 return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); 1253 }, 1254 1255 dataBrowser: 1256 [ 1257 { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, 1258 { string: navigator.userAgent, subString: "MSIE", identity: "IE" }, 1259 { string: navigator.userAgent, subString: "Trident/", identity: "IE" }, 1260 { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, 1261 { string: navigator.userAgent, subString: "Safari", identity: "Safari" }, 1262 { string: navigator.userAgent, subString: "Opera", identity: "Opera" }, 1263 ] 1264 1265}; 1266BrowserDetect.init(); 1267 1268/* ======================================== 1269 HOVER INTENT (includes.modules.module.script) 1270========================================*/ 1271/*! 1272 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ 1273 * http://cherne.net/brian/resources/jquery.hoverIntent.html 1274 * 1275 * You may use hoverIntent under the terms of the MIT license. Basically that 1276 * means you are free to use hoverIntent as long as this header is left intact. 1277 * Copyright 2007, 2013 Brian Cherne 1278 */ 1279 1280/* hoverIntent is similar to jQuery's built-in "hover" method except that 1281 * instead of firing the handlerIn function immediately, hoverIntent checks 1282 * to see if the user's mouse has slowed down (beneath the sensitivity 1283 * threshold) before firing the event. The handlerOut function is only 1284 * called after a matching handlerIn. 1285 * 1286 * // basic usage ... just like .hover() 1287 * .hoverIntent( handlerIn, handlerOut ) 1288 * .hoverIntent( handlerInOut ) 1289 * 1290 * // basic usage ... with event delegation! 1291 * .hoverIntent( handlerIn, handlerOut, selector ) 1292 * .hoverIntent( handlerInOut, selector ) 1293 * 1294 * // using a basic configuration object 1295 * .hoverIntent( config ) 1296 * 1297 * @param handlerIn function OR configuration object 1298 * @param handlerOut function OR selector for delegation OR undefined 1299 * @param selector selector OR undefined 1300 * @author Brian Cherne <brian(at)cherne(dot)net> 1301 */ 1302(function($) { 1303 $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { 1304 1305 // default configuration values 1306 var cfg = { 1307 interval: 100, 1308 sensitivity: 7, 1309 timeout: 0 1310 }; 1311
1312 if ( typeof handlerIn === "object" ) { 1313 cfg = $.extend(cfg, handlerIn ); 1314 } else if ($.isFunction(handlerOut)) { 1315 cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); 1316 } else { 1317 cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); 1318 } 1319 1320 // instantiate variables 1321 // cX, cY = current X and Y position of mouse, updated by mousemove event 1322 // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval 1323 var cX, cY, pX, pY; 1324 1325 // A private function for getting mouse position 1326 var track = function(ev) { 1327 cX = ev.pageX; 1328 cY = ev.pageY; 1329 }; 1330 1331 // A private function for comparing current and previous mouse position 1332 var compare = function(ev,ob) { 1333 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1334 // compare mouse positions to see if they've crossed the threshold 1335 if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { 1336 $(ob).off("mousemove.hoverIntent",track); 1337 // set hoverIntent state to true (so mouseOut can be called) 1338 ob.hoverIntent_s = 1; 1339 return cfg.over.apply(ob,[ev]); 1340 } else { 1341 // set previous coordinates for next time 1342 pX = cX; pY = cY; 1343 // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) 1344 ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); 1345 } 1346 }; 1347 1348 // A private function for delaying the mouseOut function 1349 var delay = function(ev,ob) { 1350 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1351 ob.hoverIntent_s = 0; 1352 return cfg.out.apply(ob,[ev]); 1353 }; 1354 1355 // A private function for handling mouse 'hovering' 1356 var handleHover = function(e) { 1357 // copy objects to be passed into t (required for event object to be passed in IE) 1358 var ev = jQuery.extend({},e); 1359 var ob = this; 1360 1361 // cancel hoverIntent timer if it exists 1362 if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } 1363 1364 // if e.type == "mouseenter" 1365 if (e.type == "mouseenter") { 1366 // set "previous" X and Y position based on initial entry point 1367 pX = ev.pageX; pY = ev.pageY; 1368 // update "current" X and Y position based on mousemove 1369 $(ob).on("mousemove.hoverIntent",track); 1370 // start polling interval (self-calling timeout) to compare mouse coordinates over time 1371 if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} 1372 1373 // else e.type == "mouseleave" 1374 } else { 1375 // unbind expensive mousemove event 1376 $(ob).off("mousemove.hoverIntent",track); 1377 // if hoverIntent state is true, then call the mouseOut function after the specified delay 1378 if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} 1379 } 1380 }; 1381 1382 // listen for mouseenter and mouseleave 1383 return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); 1384 }; 1385})(jQuery); 1386 1387/* ======================================== 1388 SUPERFISH (includes.modules.module.script) 1389========================================*/ 1390/* 1391 * jQuery Superfish Menu Plugin 1392 * Copyright (c) 2013 Joel Birch 1393 * 1394 * Dual licensed under the MIT and GPL licenses: 1395 * http://www.opensource.org/licenses/mit-license.php 1396 * http://www.gnu.org/licenses/gpl.html 1397 */ 1398 1399(function ($) { 1400 "use strict"; 1401 1402 var methods = (function () { 1403 // private properties and methods go here 1404 var c = { 1405 bcClass: 'sf-breadcrumb', 1406 menuClass: 'sf-js-enabled', 1407 anchorClass: 'sf-with-ul', 1408 menuArrowClass: 'sf-arrows' 1409 }, 1410 ios = (function () { 1411 var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent); 1412 if (ios) { 1413 // iOS clicks only bubble as far as body children 1414 $(window).load(function () { 1415 $('body').children().on('click', $.noop); 1416 }); 1417 } 1418 return ios; 1419 })(), 1420 wp7 = (function () { 1421 var style = document.documentElement.style; 1422 return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent)); 1423 })(), 1424 toggleMenuClasses = function ($menu, o) { 1425 var classes = c.menuClass; 1426 if (o.cssArrows) { 1427 classes += ' ' + c.menuArrowClass; 1428 }
1429 $menu.toggleClass(classes); 1430 }, 1431 setPathToCurrent = function ($menu, o) { 1432 return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels) 1433 .addClass(o.hoverClass + ' ' + c.bcClass) 1434 .filter(function () { 1435 return ($(this).children(o.popUpSelector).hide().show().length); 1436 }).removeClass(o.pathClass); 1437 }, 1438 toggleAnchorClass = function ($li) { 1439 $li.children('a').toggleClass(c.anchorClass); 1440 }, 1441 toggleTouchAction = function ($menu) { 1442 var touchAction = $menu.css('ms-touch-action'); 1443 touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y'; 1444 $menu.css('ms-touch-action', touchAction); 1445 }, 1446 applyHandlers = function ($menu, o) { 1447 var targets = 'li:has(' + o.popUpSelector + ')'; 1448 if ($.fn.hoverIntent && !o.disableHI) { 1449 $menu.hoverIntent(over, out, targets); 1450 } 1451 else { 1452 $menu 1453 .on('mouseenter.superfish', targets, over) 1454 .on('mouseleave.superfish', targets, out); 1455 } 1456 var touchevent = 'MSPointerDown.superfish'; 1457 if (!ios) { 1458 touchevent += ' touchend.superfish'; 1459 } 1460 if (wp7) { 1461 touchevent += ' mousedown.superfish'; 1462 } 1463 $menu 1464 .on('focusin.superfish', 'li', over) 1465 .on('focusout.superfish', 'li', out) 1466 .on(touchevent, 'a', o, touchHandler); 1467 }, 1468 touchHandler = function (e) { 1469 var $this = $(this), 1470 $ul = $this.siblings(e.data.popUpSelector); 1471 1472 if ($ul.length > 0 && $ul.is(':hidden')) { 1473 $this.one('click.superfish', false); 1474 if (e.type === 'MSPointerDown') { 1475 $this.trigger('focus'); 1476 } else { 1477 $.proxy(over, $this.parent('li'))(); 1478 } 1479 } 1480 }, 1481 over = function () { 1482 var $this = $(this), 1483 o = getOptions($this); 1484 clearTimeout(o.sfTimer); 1485 $this.siblings().superfish('hide').end().superfish('show'); 1486 }, 1487 out = function () { 1488 var $this = $(this), 1489 o = getOptions($this); 1490 if (ios) { 1491 $.proxy(close, $this, o)(); 1492 } 1493 else { 1494 if ( o.sfTimer ) { 1495 clearTimeout(o.sfTimer); 1496 } 1497 o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay); 1498 } 1499 }, 1500 close = function (o) { 1501 o.retainPath = ($.inArray(this[0], o.$path) > -1); 1502 this.superfish('hide'); 1503 1504 if (!this.parents('.' + o.hoverClass).length) { 1505 o.onIdle.call(getMenu(this)); 1506 if (o.$path.length) { 1507 $.proxy(over, o.$path)(); 1508 } 1509 } 1510 }, 1511 getMenu = function ($el) { 1512 return $el.closest('.' + c.menuClass); 1513 }, 1514 getOptions = function ($el) { 1515 return getMenu($el).data('sf-options'); 1516 }; 1517 1518 return { 1519 // public methods 1520 hide: function (instant) { 1521 if (this.length) { 1522 var $this = this, 1523 o = getOptions($this); 1524 if (!o) { 1525 return this; 1526 } 1527 var not = (o.retainPath === true) ? o.$path : '', 1528 $ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector), 1529 speed = o.speedOut; 1530 1531 if (instant) { 1532 $ul.show(); 1533 speed = 0; 1534 } 1535 o.retainPath = false; 1536 o.onBeforeHide.call($ul); 1537 $ul.stop(true, true).animate(o.animationOut, speed, function () { 1538 var $this = $(this); 1539 o.onHide.call($this); 1540 }); 1541 } 1542 return this; 1543 }, 1544 show: function () { 1545 var o = getOptions(this); 1546 if (!o) { 1547 return this; 1548 } 1549 var $this = this.addClass(o.hoverClass), 1550 $ul = $this.children(o.popUpSelector); 1551 1552 o.onBeforeShow.call($ul); 1553 $ul.stop(true, true).animate(o.animation, o.speed, function () { 1554 o.onShow.call($ul); 1555 }); 1556 return this; 1557 }, 1558 destroy: function () { 1559 return this.each(function () { 1560 var $this = $(this), 1561 o = $this.data('sf-options'), 1562 $hasPopUp; 1563 if (!o) { 1564 return false; 1565 } 1566 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 1567 clearTimeout(o.sfTimer); 1568 toggleMenuClasses($this, o); 1569 toggleAnchorClass($hasPopUp); 1570 toggleTouchAction($this); 1571 // remove event handlers 1572 $this.off('.superfish').off('.hoverIntent'); 1573 // clear animation's inline display style 1574 $hasPopUp.children(o.popUpSelector).attr('style', function (i, style) { 1575 return style.replace(/display[^;]+;?/g, ''); 1576 }); 1577 // reset 'current' path classes 1578 o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass); 1579 $this.find('.' + o.hoverClass).removeClass(o.hoverClass); 1580 o.onDestroy.call($this); 1581 $this.removeData('sf-options'); 1582 }); 1583 }, 1584 init: function (op) { 1585 return this.each(function () { 1586 var $this = $(this); 1587 if ($this.data('sf-options')) { 1588 return false;
1589 } 1590 var o = $.extend({}, $.fn.superfish.defaults, op), 1591 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 1592 o.$path = setPathToCurrent($this, o); 1593 1594 $this.data('sf-options', o); 1595 1596 toggleMenuClasses($this, o); 1597 toggleAnchorClass($hasPopUp); 1598 toggleTouchAction($this); 1599 applyHandlers($this, o); 1600 1601 $hasPopUp.not('.' + c.bcClass).superfish('hide', true); 1602 1603 o.onInit.call(this); 1604 }); 1605 } 1606 }; 1607 })(); 1608 1609 $.fn.superfish = function (method, args) { 1610 if (methods[method]) { 1611 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 1612 } 1613 else if (typeof method === 'object' || ! method) { 1614 return methods.init.apply(this, arguments); 1615 } 1616 else { 1617 return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish'); 1618 } 1619 }; 1620 1621 $.fn.superfish.defaults = { 1622 popUpSelector: 'ul, .sf-mega', // within menu context 1623 hoverClass: 'sfHover', 1624 pathClass: 'overrideThisToUse', 1625 pathLevels: 1, 1626 delay: 800, 1627 animation: {opacity: 'show'}, 1628 animationOut: {opacity: 'hide'}, 1629 speed: 'normal', 1630 speedOut: 'fast', 1631 cssArrows: true, 1632 disableHI: false, 1633 onInit: $.noop, 1634 onBeforeShow: $.noop, 1635 onShow: $.noop, 1636 onBeforeHide: $.noop, 1637 onHide: $.noop, 1638 onIdle: $.noop, 1639 onDestroy: $.noop 1640 }; 1641 1642 // soon to be deprecated 1643 $.fn.extend({ 1644 hideSuperfishUl: methods.hide, 1645 showSuperfishUl: methods.show 1646 }); 1647 1648})(jQuery); 1649 1650/* ======================================== 1651 IMAGELOADED (includes.modules.module.script) 1652========================================*/ 1653/*! 1654 * imagesLoaded PACKAGED v3.0.4 1655 * JavaScript is all like "You images are done yet or what?" 1656 */ 1657 1658(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);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.naturalWi
1658dth)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); 1659 1660/* ======================================== 1661 UI (includes.modules.module.script) 1662========================================*/ 1663;(function ( $, window, document, undefined ) { 1664 1665 // Create the defaults once 1666 var pluginName = "uiVerticalCenter", 1667 defaults = {}; 1668 1669 // The actual plugin constructor 1670 function Plugin( element, options ) { 1671 this.element = element; 1672 this.options = $.extend( {}, defaults, options ); 1673 1674 this._defaults = defaults; 1675 this._name = pluginName; 1676 1677 this.init(); 1678 } 1679 1680 Plugin.prototype = { 1681 1682 init: function() { 1683 var element = jQuery(this.element); 1684 var images = element.find('img'); 1685 var height = element.outerHeight(); 1686 1687 element.css({'margin-top' : - (height / 2) }).attr('data-height', height ); 1688 if ( images.length ) { 1689 images.imagesLoaded(function(){ 1690 var height = element.outerHeight(); 1691 element.css({'margin-top' : - (height / 2) }); 1692 }); 1693 } 1694 1695 }, 1696 1697 calcHeight: function () { 1698 var that = jQuery(this.element); 1699 1700 var height = 1701 parseInt(that.css('margin-top'), 10) + 1702 parseInt(that.css('padding-top'), 10) + 1703 parseInt(that.css('border-top-width'), 10) + 1704 parseInt(that.height(), 10) + 1705 parseInt(that.css('border-bottom-width'), 10) + 1706 parseInt(that.css('padding-bottom'), 10) + 1707 parseInt(that.css('margin-bottom'), 10); 1708 1709 return height; 1710 } 1711 1712 1713 }; 1714 1715 $.fn[pluginName] = function ( options ) { 1716 return this.each(function () { 1717 if (!$.data(this, "plugin_" + pluginName)) { 1718 $.data(this, "plugin_" + pluginName, new Plugin( this, options )); 1719 } 1720 }); 1721 }; 1722 1723})( jQuery, window, document ); 1724 1725jQuery(document).ready(function(){ 1726 var centerVertical = function(){ 1727 jQuery('.ui--center-vertical').uiVerticalCenter(); 1728 }; 1729 1730 setTimeout(function(){ 1731 centerVertical(); 1732 }, 100 ); 1733 1734 jQuery(window).resize( centerVertical ); 1735 jQuery(window).load( centerVertical ); 1736 1737 1738}); 1739 1740/* ======================================== 1741 CURRENT MENU (includes.modules.module.script) 1742========================================*/ 1743jQuery(document).ready(function(){ 1744 "use strict"; 1745 1746 jQuery.fn.extend({ 1747 /** 1748 * CloudFw Select Current Menu Item 1749 * 1750 * @since 1.0 1751 */ 1752 selectCurrentMenu : function() { 1753 1754 jQuery.fn.extend({ 1755 1756 /* Match Classes */ 1757 matchClasses : function() { 1758 1759 //this.addClass('passed'); 1760 1761 if ( this.is('.current-menu-item, .current-menu-ancestor, .current-menu-parent, .current_page_parent, .current_page_ancestor, .current_page_item') ) { 1762 if ( this.parents('.depth-0').length ) { 1763 this.parents('.depth-0').last().addClass('current-item-handler'); 1764 } else { 1765 this.addClass('current-item-handler'); 1766 } 1767 } 1768 this.removeClass('current-menu-item current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor current_page_item'); 1769 return this; 1770 }, 1771 1772 /* Loop Items */ 1773 loopItems : function() { 1774 1775 if ( this.length ){ 1776 1777 this.each(function(){ 1778 var item = jQuery(this); 1779 item.matchClasses(); 1780 1781 if ( item.children('.sub-menu').length ) { 1782 item.children('.sub-menu').children().loopItems(); 1783 } 1784 1785 }); 1786 1787 } 1788 1789 }, 1790 1791 /* Set Final */ 1792 setCurrentItem : function() { 1793 1794 var currentItemClass = 'current-menu-item'; 1795 1796 if ( this.find( '.current-item-handler' ).length ){ 1797 if ( this.find( '.current-item-handler' ).is('.force-for-select') ) 1798 this.find( '.current-item-handler.force-for-select' ).removeClass( 'current-item-handler' ).first().addClass( currentItemClass ); 1799 else 1800 this.find( '.current-item-handler' ).removeClass( 'current-item-handler' ).first().addClass( currentItemClass ); 1801 } 1802 /*else 1803 this.children().first().addClass( currentItemClass );*/ 1804 1805 } 1806 1807 1808 }); 1809 1810 /* Run the Plugin */ 1811 return this.each(function() { 1812 var theMenu = jQuery(this); 1813 var menuItems = theMenu.children(); 1814 1815 menuItems.loopItems(); 1816 theMenu.setCurrentItem(); 1817 }); 1818 }, 1819 1820 /** 1821 * CloudFw Prepare Menus 1822 * 1823 * @since 1.0 1824 */ 1825 prepareMenu: function() { 1826 /* Run the Plugin */ 1827 return this.each(function() { 1828 var theMenu = jQuery(this); 1829 var navMenuItems = theMenu.find('li'); 1830 1831 navMenuItems.each(function(){ 1832 1833 if ( jQuery(this).find('.sub-menu').length ) 1834 if ( !jQuery(this).hasClass('has-sub-menu') ) 1835 jQuery(this) 1836 .addClass('has-sub-menu') 1837 .find('a') 1838 .first() 1839 .append('<span class="indicator"></span>'); 1840 1841 }); 1842 1843 /** Add class to first level navigation menu items */ 1844 var navMenuFirstLevelItems = theMenu.children('ul > li.depth-0'); 1845 var navMenuFirstLevelItemsLenght = navMenuFirstLevelItems.length; 1846 navMenuFirstLevelItems.each(function(itemNumber) { 1847 jQuery(this).addClass('asc-' + itemNumber++ ).addClass('desc-' + parseInt(navMenuFirstLevelItemsLenght - itemNumber, 10)); 1848 }); 1849 1850 }); 1851 1852 } 1853 1854 }); 1855 1856 jQuery('#header-navigation').selectCurrentMenu(); 1857 1858}); 1859 1860/* ======================================== 1861 GLOBAL (includes.modules.module.script) 1862========================================*/ 1863jQuery(document).ready(function(){ 1864 1865 jQuery("a[data-rel^='prettyPhoto']").CloudFwPrettyPhoto({ 1866 theme: 'pp_envision', 1867 show_title: true, 1868 slideshow: false, 1869 social_tools: false, 1870 deeplinking: false, 1871 modal: false 1872 }); 1873 1874}); 1875 1876/* ======================================== 1877 HASHCHANGE (includes.modules.module.script) 1878========================================*/ 1879/* 1880 * jQuery hashchange event - v1.3 - 7/21/2010 1881 * http://benalman.com/projects/jquery-hashchange-plugin/ 1882 * 1883 * Copyright (c) 2010 "Cowboy" Ben Alman 1884 * Dual licensed under the MIT and GPL licenses. 1885 * http://benalman.com/about/license/ 1886 */ 1887(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)}
1887$('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); 1888 1889jQuery(function(){ 1890 "use strict"; 1891 1892 jQuery(window).hashchange( function() { 1893 1894 var hash = location.hash.replace('#', ''); 1895 if ( hash ) { 1896 jQuery('a[href$=' + hash + ']').click(); 1897 } 1898 1899 }); 1900 1901 jQuery(window).hashchange(); 1902 1903}); 1904 1905/* ======================================== 1906 LOADING (includes.modules.module.script) 1907========================================*/ 1908var CloudFwLoaded = function( item ){ 1909 if ( typeof item.jquery == 'undefined' ) 1910 return false; 1911 1912 if ( item.hasClass('ui--loading') ) { 1913 item.removeClass('ui--loading'); 1914 item.next('.ui--loading-progress').addClass('loaded'); 1915 1916 //console.log(item.next('.ui--loading-progress')); 1917 } 1918 1919}; 1920 1921/* ======================================== 1922 MIDWAY (includes.modules.module.script) 1923========================================*/ 1924/** 1925 * Midway.js 1926 * Version: 1.0 1927 * Author: Shipp Co. (Brandon Jacoby, Jordan Singer, Jeremy Goldberg) 1928 * Copyright (c) 2013 - Midway. All rights reserved. 1929 * http://www.shipp.co/midway 1930 */ 1931(function($) { 1932 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,{})) 1933})(jQuery); 1934 1935/* ======================================== 1936 RESPONSIVE OPTIONS (includes.modules.module.script) 1937========================================*/ 1938var detectDeviceViaPageWidth = function(){ 1939 "use strict"; 1940 1941 var device; 1942 var page_width = jQuery( '#main-container' ).width(); 1943 //console.log(page_width); 1944 1945 if ( page_width <= 767 ) 1946 device = 'phone'; 1947 else if ( page_width > 767 && page_width < 980 ) 1948 device = 'tablet'; 1949 else 1950 device = 'widescreen'; 1951 1952 return device; 1953 1954}; 1955 1956var responsiveOptionsCallback = function(){ 1957 "use strict"; 1958 1959 var elements = jQuery("[data-responsive]"); 1960 elements.each(function(){ 1961 var that = jQuery(this); 1962 var options = {}; 1963 var data_responsive = that.attr('data-responsive'); 1964 var device = detectDeviceViaPageWidth(); 1965 1966 if ( data_responsive ) { 1967 try { 1968 options = jQuery.parseJSON( data_responsive ); 1969 } catch (e) {} 1970 1971 if ( options.replaceClass ) { 1972 jQuery.each( options.replaceClass, function( k,v ){ 1973 var default_val = k, 1974 new_class = ''; 1975 1976 if ( typeof v[ device ] != 'undefined' || v[ device ] !== null ) 1977 new_class = v[ device ]; 1978 else 1979 new_class = default_val; 1980 1981 1982 if ( new_class !== '' && new_class != default_val ) { 1983 that.removeClass( that.attr('data-replaced-class') ).removeClass( default_val ).addClass( new_class ); 1984 that.attr('data-replaced-class', new_class); 1985 } else { 1986 var replaced_class = that.attr('data-replaced-class'); 1987 if ( replaced_class ) 1988 that.removeClass( replaced_class ).addClass( default_val ); 1989 1990 } 1991 1992 }); 1993 } 1994 1995 if ( options.css ) { 1996 jQuery.each( options.css, function( k,v ){ 1997 var property = k, 1998 object = {}; 1999 2000 object[ property ] = (typeof v[ device ] == 'undefined' || v[ device ] === null) ?
2001 ( (typeof v.widescreen != 'undefined' && v.widescreen !== null) ? v.widescreen : '' ) 2002 : v[ device ]; 2003 2004 that.css(object); 2005 2006 }); 2007 } 2008 2009 } 2010 2011 }); 2012 2013 2014}; 2015 2016jQuery(document).ready(responsiveOptionsCallback); 2017jQuery(window).resize(responsiveOptionsCallback); 2018 2019 2020var prepareResponsiveFullwidthContainer = function(){ 2021 "use strict"; 2022 2023 var fullwidth_containers = jQuery('.fullwidth-container'); 2024 2025 if ( fullwidth_containers.length ) { 2026 2027 var prepareResponsiveFullwidthContainer_Resize = function(){ 2028 2029 var page_width = jQuery('body').innerWidth(); 2030 if ( page_width <= 767 ) { 2031 fullwidth_containers.each(function(){ 2032 var that = jQuery(this); 2033 that.width( that.parent().width() ); 2034 }); 2035 2036 } else { 2037 fullwidth_containers.css({width: ''}); 2038 } 2039 2040 } 2041 2042 prepareResponsiveFullwidthContainer_Resize(); 2043 jQuery(window).resize(prepareResponsiveFullwidthContainer_Resize); 2044 2045 } 2046}; 2047jQuery(document).ready(prepareResponsiveFullwidthContainer); 2048 2049/** 2050 * Resizes fullwidth container by the page width 2051 * @return void 2052 */ 2053var prepareResponsiveFullwidthContainerPage = function(){ 2054 "use strict"; 2055 2056 var fullwidth_contents = jQuery('.fullwidth-content'); 2057 2058 if ( fullwidth_contents.length ) { 2059 2060 var prepareResponsiveFullwidthContainerPage_Resize = function(){ 2061 2062 var page_width = jQuery('body').innerWidth(); 2063 var content_width = jQuery('#the-content').width(); 2064 2065 fullwidth_contents.css({ 2066 'width': page_width + 1, 2067 'margin-left': 0 - (( page_width - content_width ) / 2) - 1, 2068 'margin-right': 0 2069 }); 2070 } 2071 2072 prepareResponsiveFullwidthContainerPage_Resize(); 2073 jQuery(window).resize(prepareResponsiveFullwidthContainerPage_Resize); 2074 2075 } 2076}; 2077jQuery(document).ready(prepareResponsiveFullwidthContainerPage); 2078 2079 2080var parseResponsiveAttribute = function( data_responsive, selector, default_value ){ 2081 "use strict"; 2082 2083 var data = {}; 2084 2085 if ( data_responsive ) { 2086 try { 2087 2088 if ( typeof data_responsive != 'object' ) 2089 data = jQuery.parseJSON( data_responsive ); 2090 2091 } catch (e) {} 2092 2093 if ( typeof data[ selector ] != 'undefined' || data[ selector ] !== null ) 2094 return data[ selector ]; 2095 else 2096 return default_value; 2097 } 2098 2099}; 2100 2101/* ======================================== 2102 TOPBAR (includes.modules.module.script) 2103========================================*/ 2104jQuery(document).ready(function(){ 2105 2106 if ( jQuery.isFunction( jQuery.fn.superfish ) ) { 2107 jQuery('.ui--custom-menu', '#top-bar').superfish({ 2108 hoverClass: 'hover',
2109 cssArrows: false, 2110 delay: 500, 2111 speed: 200, 2112 speedOut: 200 2113 }); 2114 } 2115 2116 2117 var search_form = jQuery('#widget--search', '#top-bar'), 2118 toggle = search_form.find('a'), 2119 input = search_form.find('input'), 2120 form = search_form.find('.ui--search-form'), 2121 cssanimations = jQuery('html').hasClass('cssanimations'); 2122 2123 2124 toggle.click(function(e){ 2125 e.preventDefault(); 2126 input.focus(); 2127 2128 }); 2129 2130 input.bind('focus', function(){ 2131 if( cssanimations ) 2132 search_form.addClass('state--open'); 2133 else 2134 form.stop(1).animate({'width': 150}); 2135 2136 //toggle.addClass('ui--gradient-primary').removeClass('ui--gradient-grey'); 2137 2138 }); 2139 2140 input.bind('blur', function(){ 2141 if( cssanimations ) 2142 search_form.removeClass('state--open'); 2143 else 2144 form.stop(1).animate({'width': 0}); 2145 2146 //toggle.removeClass('ui--gradient-primary').addClass('ui--gradient-grey'); 2147 }); 2148 2149}); 2150 2151/* ======================================== 2152 PANEL (includes.modules.module.side_panel) 2153========================================*/ 2154jQuery(window).ready(function(){ 2155 "use strict"; 2156 2157 var side_panel_handlers = jQuery('.ui--side-panel'), 2158 side_panel = jQuery('#side-panel'), 2159 side_panel_items = jQuery('#side-panel').children('div'), 2160 html = jQuery('html'), 2161 listener = false; 2162 2163 if ( side_panel.length && side_panel_handlers.length ) { 2164 2165 var side_panel_close_listener = function(){ 2166 listener = true; 2167 2168 jQuery('#main-container').click(function(){ 2169 html.removeClass('side-panel-open'); 2170 }); 2171 } 2172 2173 side_panel_handlers.bind('click', function(e){ 2174 e.preventDefault(); 2175 2176 var that = jQuery(this); 2177 2178 if ( ! html.hasClass('side-panel-open') ) { 2179 2180 setTimeout( function() { 2181 side_panel_items.hide(); 2182 2183 if ( that.attr('data-target') ) { 2184 side_panel_items.filter('#' + that.attr('data-target')).show(); 2185 } else { 2186 side_panel_items.first().show(); 2187 } 2188 2189 jQuery('body').animate({scrollTop:0}, '500', 'swing', function() { 2190 html.addClass('side-panel-open'); 2191 }); 2192 2193 }, 25 ); 2194 2195 } else { 2196 html.removeClass('side-panel-open'); 2197 } 2198 2199 if ( ! listener ) { 2200 side_panel_close_listener(); 2201 } 2202 2203 }); 2204 2205 2206 } 2207 2208}); 2209 2210/* ======================================== 2211 UNIFORM (includes.modules.module.uniform) 2212========================================*/ 2213jQuery(document).ready(function(){ 2214 2215 var CloudFw_Uniform = function( wrapper ){ 2216 2217 if( jQuery('html').hasClass('old-browser') ) 2218 return true; 2219 2220 if ( ! wrapper ) 2221 wrapper = null; 2222 else { 2223 if ( typeof wrapper.jquery == 'undefined' ) 2224 wrapper = jQuery( wrapper ); 2225 2226 if ( ! wrapper.length ) 2227 return true; 2228 } 2229 2230 /** 2231 * Select 2232 */ 2233 jQuery("select", wrapper).each(function(){ 2234 var that = jQuery(this); 2235 2236 if ( that.css('display') == 'none' ) 2237 return true; 2238 2239 if ( that.hasClass('no-uniform') ) 2240 return true; 2241 2242 if(CloudFw_jQueried('cloudfw-select', that)) 2243 return true; 2244 2245 var ui_wrapper = jQuery('<span/>').addClass('ui--select-wrapper ui--box ui--gradient ui--gradient-grey').addClass( that.attr('data-wrapper-classes') ); 2246 var resize_callback = function(){ 2247 var margin = that.css({'margin': ''}).css('margin'); 2248 var width = that.css({'width': ''}).css('width'); 2249 2250 ui_wrapper.css({'margin': margin}); 2251 ui_wrapper.css({'width': width}); 2252 2253 } 2254 resize_callback(); 2255 2256 that.wrap( ui_wrapper ); 2257 2258 var title = jQuery('<span/>').addClass('ui--select-title'); 2259 that.before( title ); 2260 2261 var arrow = jQuery('<i/>').addClass('ui--icon icon fontawesome-angle-down ui--select-arrow'); 2262 that.before( arrow ); 2263 2264 2265 var change_callback = function() { 2266 var val = that.find(':selected').first().text(); 2267 2268 if ( val == '' ) { 2269 var default_title = that.attr('data-default-title'); 2270 if ( default_title ) 2271 var val = default_title; 2272 } 2273 2274 title.text(val); 2275 } 2276 2277 that.on('change', change_callback); 2278 change_callback(); 2279 2280 that.bind('focus', function(){ 2281 that.parent().addClass('active'); 2282 }); 2283 2284 that.bind('blur', function(){ 2285 that.parent().removeClass('active'); 2286 }); 2287 2288 if ( that.attr('data-init') ) 2289 that.change(); 2290 2291 2292 2293 }); 2294 2295 2296 } 2297 2298 CloudFw_Uniform(); 2299 jQuery(document).on('ajaxSuccess',CloudFw_Uniform); 2300 2301}); 2302 2303/* ======================================== 2304 FLEXSLIDER (includes.sliders.flex_slider) 2305========================================*/ 2306jQuery(document).ready(function(){ 2307 2308 jQuery('.flexslider-navigation-prev').click(function(){ 2309 var that = jQuery(this); 2310 var slider = that.parents('.flexslider-wrapper').first().find('.flexslider'); 2311 2312 slider.flexslider("prev"); 2313 }); 2314 2315 2316 jQuery('.flexslider-navigation-next').click(function(){ 2317 var that = jQuery(this); 2318 var slider = that.parents('.flexslider-wrapper').first().find('.flexslider'); 2319 2320 slider.flexslider("next"); 2321 }); 2322 2323 2324}); 2325 2326jQuery(window).load(function(){ 2327 jQuery('.flexslider .flex-control-paging li a').html('<div class="ui--bullets"><div class="ui--bullets-color ui--accent-gradient"></div></div>'); 2328}); 2329
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.