PageSourceSearch

http://lescapricesdantan.qc.ca/wp-content/themes/parallax/js/themify.script.js?ver=7.1.3

js lescapricesdantan.qc.ca collected 2026-10-08 09:54:07 UTC 31,503 bytes, 931 lines download raw bytes

1;// Themify Theme Scripts - http://themify.me/
2
3// Themify Lightbox, Fixed Header and Parallax /////////////////////////
4var FixedHeader, ThemifyParallax;
5
6// Begin jQuery functions
7(function($) {
8
9	function UpdateQueryString(a,b,c){
10		c||(c=window.location.href);var d=RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(d.test(c))return b!==void 0&&null!==b?c.replace(d,"$1"+a+"="+b+"$2$3"):c.replace(d,"$1$3").replace(/(&|\?)$/,"");if(b!==void 0&&null!==b){var e=-1!==c.indexOf("?")?"&":"?",f=c.split("#");return c=f[0]+e+a+"="+b,f[1]&&(c+="#"+f[1]),c}return c;
11	}
12
13	// Scroll to Element //////////////////////////////
14	function themeScrollTo(offset, duration) {
15		duration = duration || 800;
16		$('html, body').stop().animate({ scrollTop: offset }, duration);
17	}
18
19	// Themify Scroll
20	(function($, window, document, undefined) {
21
22		// Create the defaults once
23		var pluginName = "themifyScroll", defaults = {
24			speed : 1800
25		};
26
27		// The actual plugin constructor
28		function Plugin(element, options) {
29			this.element = element;
30			this.options = $.extend({}, defaults, options);
31			this._defaults = defaults;
32			this._name = pluginName;
33			this.onClicking = false;
34			this.init();
35		}
36
37		Plugin.prototype = {
38			sections: [],
39			init : function() {
40				var self = this,
41					IE = this.ie();
42
43				self.sections = $('#main-nav li a').map(function(){
44					return this.hash || null;
45				}).get();
46				self.sections.push('#header');
47
48				// click event
49				$('body').on('click', 'a[href*=#]', function(e) {
50					var $this = $(this), elementClick = $this.prop('hash');
51					
52					if ( 'undefined' != typeof elementClick && elementClick.indexOf('#') != -1 && $(elementClick).length > 0 ) {
53						var destination = $(elementClick).offset().top + 10, newHash = '#' + elementClick.replace('#', '');
54						if( $(elementClick).length === 0 ) { return; }
55
56						// update state
57						self.onClicking = true;
58
59						e.preventDefault();
60						$("html,body").animate({
61							scrollTop: destination
62						}, self.options.speed, function(){
63							// add active class
64							$this.parent('li').addClass('current_page_item').siblings().removeClass('current_page_item');
65
66							if(elementClick.replace('#','') !== 'header'){
67								self.setHash(newHash);
68							} else {
69								self.clearHash();
70							}
71
72							self.onClicking = false;
73						});
74					}
75
76					// close mobile menu
77					if($(window).width() <= 768 && $('#main-nav').is(':visible')){
78						$('#menu-icon').trigger('click');
79					}
80				});
81
82				// change hash url
83				if( !IE || (IE && IE > 9) ) {
84					this.changeHash();
85				}
86			},
87
88			changeHash : function() {
89				var self = this;
90
91				if (self.sections.length > 0) {
92					var didScroll = false,
93						currentHash;
94					$(window).scroll(function() {
95						didScroll = true;
96					});
97
98					setInterval(function() {
99
100						if(self.onClicking) return;
101
102						if ( didScroll ) {
103							didScroll = false;
104							currentHash = window.location.hash.replace(/^#\!\//, "");
105
106							if ( $(window).scrollTop() == 0 && currentHash != '' ) {
107								self.clearHash();
108							}
109
110							$.each(self.sections, function(index, value){
111								var section = value, obj = $(value);
112								if (obj.length > 0) {
113									var offsetY = obj.offset().top,
114										elemHeight = obj.outerHeight();
115
116									if ( offsetY < window.pageYOffset && offsetY + elemHeight > window.pageYOffset ) {
117										if( section == currentHash || section == '#header' ) return;
118										
119										self.setHash(section);
120										$('a[href*='+section+']').parent('li').addClass('current_page_item').siblings().removeClass('current_page_item current-menu-item');
121										
122									}
123								}
124							});
125						}
126						
127					}, 500);
128				}
129			},
130
131			setHash: function(hash) {
132				if(history.pushState) {
133					history.pushState(null, null, hash);
134				}
135				else {
136					location.hash = hash;
137				}
138			},
139
140			clearHash: function() {
141				// remove hash
142				if ( window.history && window.history.replaceState ) { 
143					window.history.replaceState('', '', window.location.pathname); 
144				} else { 
145					window.location.href = window.location.href.replace(/#.*$/, '#'); 
146				}
147			},
148
149			ie: function() {
150				var undef,
151					v = 3,
152					div = document.createElement('div'),
153					all = div.getElementsByTagName('i');
154				
155				while (
156					div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
157					all[0]
158				);
159				
160				return v > 4 ? v : undef;
161			}
162		};
163
164		$.fn[pluginName] = function(options) {
165			return this.each(function() {
166				if (!$.data(this, "plugin_" + pluginName)) {
167					$.data(this, "plugin_" + pluginName, new Plugin(this, options));
168				}
169			});
170		};
171
172	})(jQuery, window, document);
173
174	// Test if touch event exists //////////////////////////////
175	function is_touch_device() {
176		return ('true' == themifyScript.isTouch) || !!('window.navigator.msMaxTouchPoints' in window);
177	}
178
179	function is_ie() {
180		return navigator.appName == 'Microsoft Internet Explorer';
181	}
182
183	// Start infinite scroll and isotope
184	function infiniteIsotope(containerSelector, itemSelectorIso, itemSelectorInf, containerInfinite, doIso, isoColW) {
185
186		// Get max pages for regular category pages and home
187		var scrollMaxPages = parseInt(themifyScript.maxPages), $container = $(containerSelector), $containerInfinite = $(containerInfinite);
188		// Get max pages for Query Category pages
189		if ( typeof qp_max_pages != 'undefined')
190			scrollMaxPages = qp_max_pages;
191
192		if ((!$('body.list-post').length > 0) && doIso) {
193			// isotope init
194			$container.isotope({
195				masonry : {
196					columnWidth : isoColW
197				},
198				itemSelector : itemSelectorIso,
199				transformsEnabled : false,
200				animationEngine : 'jquery'
201			});
202			$(window).resize();
203		}
204
205		// infinite scroll
206		$containerInfinite.infinitescroll({
207			navSelector : '#load-more a:last', // selector for the paged navigation
208			nextSelector : '#load-more a:last', // selector for the NEXT link (to page 2)
209			itemSelector : itemSelectorInf, // selector for all items you'll retrieve
210			loadingText : '',
211			donetext : '',
212			loading : {
213				img : themifyScript.loadingImg
214			},
215			maxPage : scrollMaxPages,
216			behavior : 'auto' != themifyScript.autoInfinite ? 'twitter' : '',
217			pathParse : function(path, nextPage) {
218				return path.match(/^(.*?)\b2\b(?!.*\b2\b)(.*?$)/).slice(1);
219			}
220		}, function(newElements) {
221			// call Isotope for new elements
222			var $newElems = $(newElements).hide();
223
224			// Mark new items: remove newItems from already loaded items and add it to loaded items
225			$('.post.newItems').removeClass('newItems');
226			$newElems.addClass('newItems');
227
228			$newElems.imagesLoaded(function() {
229
230				$newElems.fadeIn();
231
232				$('#infscr-loading').fadeOut('normal');
233				if (1 == scrollMaxPages) {
234					$('#load-more, #infscr-loading').remove();
235				}
236
237				// Apply lightbox/fullscreen gallery to new items
238				Themify.InitGallery();
239                                // Create carousel on portfolio new items
240                                if($('.type-portfolio.newItems .slideshow' ).length>0){
241                                    if(!$.fn.carouFredSel){
242                                        Themify.LoadAsync(themify_vars.url+'/js/carousel.js',function(){
243                                            createCarousel( $( '.type-portfolio.newItems .slideshow' ), 'normal' );
244                                        });
245                                    }
246                                    else{
247                                       createCarousel( $( '.type-portfolio.newItems .slideshow' ), 'normal' );
248                                    }
249                                }
250				if ((!$('body.list-post').length > 0) && doIso) {
251					$container.isotope('appended', $newElems);
252				}
253
254				// Apply Transitin Effect
255				if( themifyScript.transitionEffect ) {
256					ThemifyParallax.parallaxElements();
257					if ( 'undefined' !== typeof ThemifyBuilderModuleJs ) {
258						ThemifyBuilderModuleJs.doAnimation(true);
259					}
260				}
261
262				// reset the breakpoints for portfolio expander
263				portfolio_item_break_point();
264			});
265
266			scrollMaxPages = scrollMaxPages - 1;
267			if (1 < scrollMaxPages && 'auto' != themifyScript.autoInfinite)
268				$('#load-more a').show();
269		});
270
271		// disable auto infinite scroll based on user selection
272		if ('auto' == themifyScript.autoInfinite) {
273			$('#load-more, #load-more a').hide();
274		}
275
276	}
277
278	// Initialize carousels
279	function createCarousel(obj, mode) {
280		obj.each(function() {
281			var $this = $(this),
282				this_id = $this.data('id');
283			$this.carouFredSel({
284				responsive: true,
285				prev: function() {
286					if ( $this.closest( '.module-portfolio' ).length > 0 ) {
287						var path = '#' + $this.closest( '.module-portfolio' ).eq(0).attr('id') + ' #' + this_id + ' .carousel-prev';
288						return path;
289					} else if ( $this.closest( '.type-page' ).length > 0 ) {
290						var path = '#' + $this.closest( '.type-page' ).eq(0).attr('id') + ' .page-content .shortcode #' + this_id + ' .carousel-prev';
291						return path;
292					} else if ( $this.closest( '#loops-wrapper' ).length > 0 ) {
293						return '#loops-wrapper #' + this_id + ' .carousel-prev';
294					} else {
295						return '#' + this_id + ' .carousel-prev';
296					}
297				},
298				next: function() {
299					if ( $this.closest( '.module-portfolio' ).length > 0 ) {
300						var path = '#' + $this.closest( '.module-portfolio' ).eq(0).attr('id') + ' #' + this_id + ' .carousel-next';
301						return path;
302					} else if ( $this.closest( '.type-page' ).length > 0 ) {
303						var path = '#' + $this.closest( '.type-page' ).eq(0).attr('id') + ' .page-content .shortcode #' + this_id + ' .carousel-next';
304						return path;
305					} else if ( $this.closest( '#loops-wrapper' ).length > 0 ) {
306						return '#loops-wrapper #' + this_id + ' .carousel-next';
307					} else {
308						return '#' + this_id + ' .carousel-next';
309					}
310				},
311				pagination: {
312					container: function() {
313					if ( $this.closest( '.module-portfolio' ).length > 0 ) {
314						var path = '#' + $this.closest( '.module-portfolio' ).eq(0).attr('id') + ' #' + this_id + ' .carousel-pager';
315						return path;
316					} else if ( $this.closest( '.type-page' ).length > 0 ) {
317						var path = '#' + $this.closest( '.type-page' ).eq(0).attr('id') + ' .page-content .shortcode #' + this_id + ' .carousel-pager';
318						return path;
319					} else if ( $this.closest( '#loops-wrapper' ).length > 0 ) {
320						return '#loops-wrapper #' + this_id + ' .carousel-pager';
321					} else {
322						return '#' + this_id + ' .carousel-pager';
323					}
324				}
325				},
326				circular: true,
327				infinite: true,
328				swipe: true,
329				scroll: {
330					items: 1,
331					fx: $this.data('effect'),
332					duration: parseInt($this.data('speed'))
333				},
334				auto: {
335					play: ('off' != $this.data('autoplay')),
336					timeoutDuration: 'off' != $this.data('autoplay') ? parseInt($this.data('autoplay')) : 0
337				},
338				items: {
339					visible: {
340						min: 1,
341						max: 1
342					},
343					width: 222
344				},
345				onCreate: function() {
346					$this.closest('.slideshow-wrap').css({
347						'visibility': 'visible',
348						'height': 'auto'
349					});
350					$('.carousel-next, .carousel-prev', $this.closest('.slideshow-wrap')).hide();
351					$(window).resize();
352				}
353			});
354		});
355	}
356
357	// Fixed Header /////////////////////////
358	FixedHeader = {
359		init : function() {
360			if ( 'fixed-header' !== themifyScript.fixedHeader ) {
361				return;
362			}
363			this.headerHeight = $('#header').outerHeight() - $('#nav-bar').outerHeight();
364
365			if ( $('body').hasClass('ie') ) { $('html, body').addClass('iefix'); }
366
367			$(window).on('scroll', this.activate)
368			.on('touchstart.touchScroll', this.activate)
369			.on('touchmove.touchScroll', this.activate);
370		},
371		activate : function() {
372
373			if ( $(window).scrollTop() <= FixedHeader.headerHeight ) {
374				FixedHeader.scrollDisabled();
375			} else {
376				FixedHeader.scrollEnabled();
377			}
378		},
379		scrollDisabled : function() {
380			$('#nav-bar').removeClass('fixed-nav-bar');
381			$('body').removeClass('fixed-header-on');
382		},
383		scrollEnabled : function() {
384			$('#nav-bar').addClass('fixed-nav-bar');
385			$('body').addClass('fixed-header-on');
386		}
387	};
388
389	// Parallax /////////////////////////
390	ThemifyParallax = {
391		init: function() {
392			this.windowHeight = $(window).height();
393			$(window).resize(function(){
394				ThemifyParallax.windowHeight = $(window).height();
395			});
396
397			if(themifyScript.scrollingEffect) {
398				if(themifyScript.scrollingEffectType == 'effect1'){
399					this.setup_effect_1();
400				} else {
401					this.setup_effect_2();
402				}
403			} else {
404				this.setBackground();
405			}
406		},
407
408		setup_effect_1: function() {
409			var self = ThemifyParallax;
410
411			self.setBackground(); // set background fullcover
412
413			// only work in query section
414			if ( ! $('body').hasClass('query-section') || is_ie() ){ return; }
415			
416			$('.section-post, #headerwrap').each(function(){
417				var ids = $(this).prop('id'),
418					$elemns = $('#' + ids ),
419					didScroll = false;
420
421				setInterval(function() {
422					if ( didScroll ) {
423						didScroll = false;
424						self.run($elemns);
425					}
426				}, 550);
427
428				$(window).on('scroll touchstart.touchScroll touchmove.touchScroll', function(){
429					didScroll = true;
430				});
431			});
432		},
433
434		setup_effect_2: function(){
435			$('.section-post, #headerwrap').each(function(){
436				// Store some variables based on where we are
437				var $self = $(this),
438					bgImage = typeof $self.data('bg') !== 'undefined' ? 'url("'+ $self.data('bg') +'")' : '';
439
440				$self.addClass('scrolling-bg-image').css({
441					backgroundImage: bgImage
442				});
443
444				if( typeof $.fn.builderParallax !== 'undefined' ){
445					$self.builderParallax("50%", 0.1);
446				}
447			});
448		},
449
450		run: function(elemns) {
451			var $window = $(window),
452				pos = $window.scrollTop(),
453				$element = elemns,
454				top = $element.offset().top,
455				height = $element.outerHeight(true);	
456
457			// Check if totally above or totally below viewport
458			if (top + height < pos || top > pos + ThemifyParallax.windowHeight) {
459				return;
460			}
461			var cssTopPos = Math.max(Math.round((pos - top) * 0.2), 0) + 'px';
462
463			$element.css('top', cssTopPos);
464
465			if($('#nav-bar').hasClass('fixed-nav-bar')) {
466				$('#nav-bar').css({'bottom': ''});
467			}
468		},
469
470		newPos: function( pos, adjust, ratio ) {
471			return ((pos - adjust) * ratio)  + "px";
472		},
473
474		parallaxElements: function(){
475			// shortcode columns add class
476			$('.col2-1.first, .col3-1.first, .col3-2.first, .col4-1.first, .col4-2.first, .col4-3.first', $('#body, #footer')).each(function(){
477				var $this = $(this);
478				if($this.hasClass('col2-1')) {
479					$this.next('.col2-1').addClass('last');
480					$this.next('.col4-1').addClass('third').next('.col4-1').addClass('last');
481				} else if($this.hasClass('col3-1')) {
482					$this.next('.col3-1').addClass('second').next('.col3-1').addClass('last');
483					$this.next('.col3-2').addClass('last');
484				} else if($this.hasClass('col3-2')) {
485					$this.next('.col3-1').addClass('last');
486				} else if($this.hasClass('col4-1')) {
487					$this.next('.col4-1').addClass('second').next('.col4-1').addClass('third').next('.col4-1').addClass('last');
488					$this.next('.col4-1').next('.col4-2').addClass('last');
489				} else if($this.hasClass('col4-2')) {
490					$this.next('.col4-2').addClass('last');
491					$this.next('.col4-1').addClass('third').next('.col4-1').addClass('last');
492				} else if($this.hasClass('col4-3')) {
493					$this.next('.col4-1').addClass('last');
494				}
495			});
496			// gallery transition classes
497			$('.gallery', $('#body')).each(function(){
498				var columns = $(this).attr('class').match(/gallery-columns-([0-9])/)[1];
499				$('dl', $(this)).addClass('middle');
500				$('dl:nth-of-type('+columns+'n+1)', $(this)).addClass('first');
501				$('dl:nth-of-type('+columns+'n+1)', $(this)).removeClass('middle');
502				$('dl:nth-of-type('+columns+'n+'+columns+')', $(this)).addClass('last');
503				$('dl:nth-of-type('+columns+'n+'+columns+')', $(this)).removeClass('middle');
504				if(columns > 3) {
505					$('dl:nth-of-type('+columns+'n+2)', $(this)).addClass('second');
506					$('dl:nth-of-type('+columns+'n+2)', $(this)).removeClass('middle');
507					$('dl:nth-of-type('+columns+'n+'+(columns-1)+')', $(this)).addClass('third');
508					$('dl:nth-of-type('+columns+'n+'+(columns-1)+')', $(this)).removeClass('middle');
509				}
510			});
511
512			$.each(themifyScript.transitionSetup.selectors, function(key, val){
513				$(val).addClass(themifyScript.transitionSetup.effect);
514			});
515		},
516
517		setBackground: function(){
518			// Fullscreen bg
519			if ( typeof $.fn.backstretch !== 'undefined') {
520				var $section = $('.section-post, #headerwrap'),
521					resizeId;
522				$section.each(function() {
523					var bg = $(this).data('bg');
524					if ( typeof bg !== 'undefined') {
525						if ($(this).hasClass('fullcover')) {
526							$(this).backstretch(bg);
527						} else {
528							$(this).css('background-image', 'url(' + bg + ')');
529						}
530					}
531				});
532
533				$(window).on('backstretch.show', function(e, instance) {
534					instance.$container.css('z-index', '');
535				}).on('resize', function(){
536					clearTimeout(resizeId);
537					resizeId = setTimeout(function(){
538						$section.each(function(){
539							if($(this).hasClass('fullcover')){
540								var instance = $(this).data("backstretch");
541								if('undefined' !== typeof instance) instance.resize();
542							}
543						});
544					}, 500);
545				});
546			}
547		}
548	};
549
550	// portfolio ajax post break point
551	function portfolio_item_break_point() {
552		// section portfolio break point
553		$('.shortcode.portfolio, .module.module-portfolio, #loops-wrapper.query-type-portfolio').each(function(){
554			var selector = '', viewport = $(window).width();
555
556			// reset
557			$(this).find('.sec-post-break').remove();
558
559			if($(this).hasClass('grid2-thumb') || $(this).hasClass('grid2')){
560				selector = '.post:nth-of-type(2n+2)';
561			} else if($(this).hasClass('grid4')) {
562				selector = '.post:nth-of-type(4n+4)';
563			} else if($(this).hasClass('grid3')){
564				selector = '.post:nth-of-type(3n+3)';
565			} else if($(this).hasClass('grid2')) {
566				selector = '.post:nth-of-type(2n+2)';
567			} else {
568				selector = '.post:nth-of-type(1n+1)';
569			}
570
571			// mobile
572			if(viewport < 480) {
573				selector = '.post:nth-of-type(1n+1)';
574			}
575
576			$(this).find(selector).each(function(){
577				$('<div class="sec-post-break" />').insertAfter($(this));
578			});
579		});
580	}
581
582	// Returns real dimensions from scaled or hidden elements
583	function realDimension($obj, dimension) {
584		var $clone = $obj.clone().css('visibility', 'hidden').appendTo($('body') ),
585			value = 'width' == dimension ? $clone.width() : $clone.height();
586		$clone.remove();
587		return value;
588	}
589
590	// Execute Earlier than $.ready and $.load
591	if ( themifyScript.transitionEffect ) {
592		ThemifyParallax.parallaxElements();
593	}
594
595	/////////////////////////////////////////////
596	// Execute when DOM is ready
597	/////////////////////////////////////////////
598	$(document).ready(function() {
599
600		var $body = $('body'),
601			$skills = $('.progress-bar', $body);
602
603		// Toggle main nav on mobile
604		$body.on('click', '#menu-icon', function(event){
605			event.preventDefault();
606			$("#main-nav").fadeToggle();
607			$("#headerwrap #top-nav").hide();
608			$(this).toggleClass("active");
609		});
610
611		// Back to top
612		$('.not-ie .back-top a').on('click', function(e){
613			e.preventDefault();
614			themeScrollTo(0);
615		});
616
617		// Remove padding for admin bar, just let it sit on top of the background
618		if ( $body.hasClass( 'home' ) && $body.hasClass( 'admin-bar' ) ) {
619			$('html').css( 'cssText', 'margin-top:0 !important;' );
620		}
621
622		// If is touch device, add class
623		if (is_touch_device()) {
624			$body.addClass('is-touch');
625			var vh = $(window).height();
626			if ( $body.hasClass('home') ) {
627				$('#headerwrap, #header').css('height', vh);
628			}
629		}
630		
631		// Show/Hide direction arrows
632		$('#body').on('mouseover mouseout', '.slideshow-wrap', function(event) {
633			if (event.type == 'mouseover') {
634				if( $(window).width() > 600 ){
635					$('.carousel-next, .carousel-prev', $(this)).css('display', 'block');
636				}
637			} else {
638				if( $(window).width() > 600 ){
639					$('.carousel-next, .carousel-prev', $(this)).css('display', 'none');
640				}
641			}
642		});
643
644		// Fixed header
645		FixedHeader.init();
646
647		// Parallax section background
648		ThemifyParallax.init();
649
650		// Height of top bar
651		var menuHeight = $('#nav-bar').outerHeight();
652
653		// portfolio breakpoint
654		portfolio_item_break_point();
655
656		// Portfolio expand js
657		var portoInitialPos;
658		$( 'body' ).on( 'click', '.porto-expand-js', function(e){
659			if ( 0 === $(e.target).closest( '.themify_builder_slider' ).length ) {
660				e.preventDefault();
661				var $this = $(this),
662					url = UpdateQueryString( 'porto_expand', 1, $this.attr('href') ),
663					placehold = $this.closest('.post').nextAll('.sec-post-break').first();
664
665				if ( placehold.length === 0 ) placehold = $this.closest('.shortcode');
666				if ( placehold.length === 0 ) placehold = $this.closest('.module-portfolio');
667				if ( placehold.length === 0 ) placehold = $('<div class="sec-post-break" />').appendTo( $this.closest('.post').parent() );
668
669				// cache the initial position
670				portoInitialPos = $(window).scrollTop();
671
672				$('.portfolio-expanded').remove();
673				$('<div class="portfolio-expanded"><div class="portfolio-expand-scaler"><iframe id="portfolio-lightbox-iframe" frameborder="0" allowfullscreen></iframe></div></div>')
674				.appendTo(placehold).hide();
675				$('.portfolio-loader').remove();
676				$('<div class="portfolio-loader">').appendTo($this.closest('.portfolio-post').find('.post-image')).show();
677
678				$('.portfolio-expanded').show();
679				$('#portfolio-lightbox-iframe').prop('src', url).load(function(){
680					var $contents = $(this).contents();
681					$('.portfolio-loader').remove();
682					$('.portfolio-expanded').hide().slideDown('slow');
683					themeScrollTo( $('.portfolio-expanded').offset().top - menuHeight, 1000 );
684					$body.trigger('portfolio_expanded');
685
686					$contents.find('.close-expanded').on('click', function(e){
687						e.preventDefault();
688						$('.portfolio-expanded').slideUp(800, function(){
689							$(this).remove();
690						});
691						themeScrollTo(portoInitialPos);
692					});
693				}).iframeAutoHeight({
694					callback: function() {
695						var $this = $(this);
696						setTimeout(function(){
697							$this.height( $this.contents().find('body').height() );
698						}, 800);
699					}
700				});
701			}
702		});
703
704		// #main-nav
705		$body.on('touchstart touchmove touchend', '#main-nav', function(e) {
706			e.stopPropagation();
707		});
708
709		/////////////////////////////////////////////
710		// Chart Initialization
711		/////////////////////////////////////////////
712                if($('.chart').length>0){
713                    if(!$.fn.waypoint || !$.fn.easyPieChart){
714                        Themify.LoadAsync(themify_vars.url+'/js/jquery.easy-pie-chart.js',function(){
715                            Themify.LoadAsync(themify_vars.url+'/js/waypoints.min.js',ThemifyChart);
716                        });
717                    }
718                    else{
719                        ThemifyChart();
720                    }
721                }
722		
723                function ThemifyChart(){
724                    $.each(themifyScript.chart, function(index, value){
725                            if( 'false' == value || 'true' == value ){
726                                    themifyScript.chart[index] = 'false'!=value;
727                            } else if( parseInt(value) ){
728                                    themifyScript.chart[index] = parseInt(value);
729                            } else if( parseFloat(value) ){
730                                    themifyScript.chart[index] = parseFloat(value);
731                            }
732                    });
733                    $('.chart', $body).each(function(){
734                            var $self = $(this),
735                                    barColor = $self.data('color'),
736                                    percent = $self.data('percent');
737
738                            if( typeof barColor !== 'undefined' ) {
739                                    themifyScript.chart.barColor = '#' + barColor.toString().replace('#', '');
740
741                                    $self.easyPieChart( themifyScript.chart );
742                                    $self.data('easyPieChart').update(0);
743                                    if(themifyScript.transitionEffect ) {
744                                            $self.waypoint(function(direction){
745                                                    $self.data('easyPieChart').update(percent);
746                                            }, {offset: '80%'});
747                                            $self.waypoint(function(direction){
748                                                    if(direction === 'up') {
749                                                            $self.data('easyPieChart').update(0);
750                                                    }
751                                            }, {offset: '92%'});
752                                    } else {
753                                            $self.data('easyPieChart').update(percent);
754                                    }
755                            }
756                    });
757                }
758		$('.no-chart', $body).not('.module-feature').each(function () {
759			var $self  = $(this),
760				$img   = $self.find('img'),
761				width  = themifyScript.chart.size,
762				height = themifyScript.chart.size;
763
764			if ( $img.length > 0 ) {
765				width  = realDimension($img, 'width');
766				height = realDimension($img, 'height');
767			}
768
769			$self.css({
770				'width' : width + 'px',
771				'height': height + 'px'
772			}).addClass('no-chart-ready');
773		});
774		
775		/////////////////////////////////////////////
776		// Skillset Animation
777		/////////////////////////////////////////////
778		if( themifyScript.transitionEffect && $skills.length>0) {
779                    if(!$.fn.waypoint){
780                        Themify.LoadAsync(themify_vars.url+'/js/waypoints.min.js',ThemifySkils);
781                    }
782                    else{
783                        ThemifySkils();
784                    }
785		}
786                function ThemifySkils(){
787                    $skills.each(function(){
788                        var $self = $(this).find('span'),
789                            percent = $self.data('percent');
790                            $self.waypoint(function(direction){
791                                    $self.animate({width: percent}, 800);
792                            }, {offset: '80%'})
793                            .waypoint(function(direction){
794                                    if(direction === 'up') {
795                                            $self.animate({width: percent}, 800);
796                                    }
797                            }, {offset: '20%'})
798                            .waypoint(function(direction){
799                                    if(direction === 'up') {
800                                            $self.width(0);
801                                    }
802                            }, {offset: -10})
803                            .waypoint(function(direction){
804                                    if(direction === 'down') {
805                                            $self.width(0);
806                                    }
807                            }, {offset: '110%'});
808                    });
809                }
810		$(window).on('resize', function () {
811			// Section Type Message Vertical Height
812			var $context = $('#loops-wrapper'),
813                            $verticalSection = $('.section-post.message', $context);
814				
815			for (var i = 0; i < $verticalSection.length; i++) {
816				var $selection = $verticalSection.eq(i);
817				$selection.css({'lineHeight': parseInt( $verticalSection.css('height') ) + 'px'});
818				if($selection.find('.vertical-centered').length == 0){
819					$selection.find('.section-inner').wrapInner('<div class="vertical-centered" />');
820				}
821			}
822		});
823	});
824
825	/////////////////////////////////////////////
826	// Execute when page is fully loaded
827	/////////////////////////////////////////////
828	$(window).load(function() {
829		// scrolling nav
830		$('body').themifyScroll({
831			speed : 1000
832		});
833
834		// Header Video
835                function ThemifyBideo(){
836                    var $videos = $('[data-fullwidthvideo]').not('.themify_builder_row'),
837                        fwvideos = [];
838                    $.each($videos, function (i, elm) {
839                            fwvideos[i] = new $.BigVideo({
840                                    useFlashForFirefox: false,
841                                    container: $(elm).find('#header'),
842                                    id: i
843                            });
844                            fwvideos[i].init();
845                            fwvideos[i].show($(elm).data('fullwidthvideo'), {
846                                    doLoop : true
847                            });
848                    });
849                }
850                if ($('[data-fullwidthvideo]').not('.themify_builder_row').length>
8500 && !is_touch_device()) {
851                    if(typeof $.BigVideo == 'undefined'){
852                         Themify.LoadAsync(themify_vars.url+'/js/video.js',function(){
853                             Themify.LoadAsync(themify_vars.url+'/js/bigvideo.js',ThemifyBideo);
854                         });
855                    }
856                    else{
857                       ThemifyBideo();
858                    }
859                }
860		// Header Background Color
861		var $headerColor = $('#headerwrap[data-bgcolor]');
862		if ( $headerColor.length > 0 ) {
863			var bgColor = $headerColor.data('bgcolor');
864			if ( ! $headerColor.hasClass('header-gallery') ) {
865				var $stretchColor = $headerColor.find('.backstretch');
866				if ( $stretchColor.length > 0 ) {
867					$headerColor.css( 'background', 'none' );
868					$stretchColor.css( 'background-color', '#' + bgColor );
869				} else {
870					$headerColor.css( 'background-color', '#' + bgColor );
871				}
872			}
873		}
874
875		// Carousel initialization //////////////////////////
876                if($('.portfolio-post .slideshow').length>0){
877                    if(!$.fn.carouFredSel){
878                        Themify.LoadAsync(themify_vars.url+'/js/carousel.js',function(){
879                            createCarousel( $( '.portfolio-post .slideshow' ), 'normal' );
880                        });
881                    }
882                    else{
883                       createCarousel( $( '.portfolio-post .slideshow' ), 'normal' );
884                    }
885                }
886
887		var target = window.location.hash.replace(/^#\!\//, "").replace('#','');
888		if (target !== '' && $('#' + target).length > 0) {
889			var anchor = $('#' + target), destination = anchor.offset().top;
890			themeScrollTo( destination, 1000 );
891		}
892
893		// Check if isotope is enabled ////////////////
894		if ( typeof ($.fn.infinitescroll) !== 'undefined') {
895
896			if ($('.post').length > 0) {
897				// isotope container, isotope item, item fetched by infinite scroll, infinite scroll
898				infiniteIsotope('#loops-wrapper', '.post', '#content .post', '#loops-wrapper', false, '');
899			}
900
901			if ($('.portfolio-post').length > 0) {
902				// isotope container, isotope item, item fetched by infinite scroll, infinite scroll
903				infiniteIsotope('.portfolio-wrapper', '.portfolio-post', '.portfolio-post', '.portfolio-wrapper', false, '');
904			}
905
906		}
907	
908		// EDGE MENU //
909		jQuery(function ($) {
910			$("#main-nav li").on('mouseenter mouseleave', function (e) {
911				if ($('ul', this).length) {
912					var elm = $('ul:first', this);
913					var off = elm.offset();
914					var l = off.left;
915					var w = elm.width();
916					var docW = $(window).width();
917					var isEntirelyVisible = (l + w <= docW);
918
919					if (!isEntirelyVisible) {
920						$(this).addClass('edge');
921					} else {
922						$(this).removeClass('edge');
923					}
924
925				}
926			});
927		});
928	
929	});
930
931}(jQuery));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.