PageSourceSearch

https://rescentr47.ru/wp-content/themes/porto/js/theme-async.js?ver=6.0.5

js rescentr47.ru collected 2026-10-06 06:27:24 UTC 37,048 bytes, 1,405 lines download raw bytes

1(function(theme, $) {
2	'use strict';
3
4	theme = theme || {};
5
6	$.extend(theme, {
7		mfpConfig: {
8			tClose: js_porto_vars.popup_close,
9			tLoading: '<div class="porto-ajax-loading"><i class="porto-loading-icon"></i></div>',
10			gallery: {
11				tPrev: js_porto_vars.popup_prev,
12				tNext: js_porto_vars.popup_next,
13				tCounter: js_porto_vars.mfp_counter
14			},
15			image: {
16				tError: js_porto_vars.mfp_img_error
17			},
18			ajax: {
19				tError: js_porto_vars.mfp_ajax_error
20			},
21			callbacks: {
22				open: function() {
23					$('body').addClass('lightbox-opened');
24					var fixed = this.st.fixedContentPos;
25					if (fixed) {
26						$('#header.sticky-header .header-main.sticky, #header.sticky-header .main-menu-wrap, .fixed-header #header.sticky-header .header-main, .fixed-header #header.sticky-header .main-menu-wrap').css(theme.rtl_browser?'left':'right', theme.getScrollbarWidth());
27					}
28					/* D3-Ahsan - Start */
29					var that = $(this._lastFocusedEl);
30					if ( ( that.closest('.portfolios-lightbox').hasClass('with-thumbs') ) && $(document).width() >= 1024 ){
31						
32						var portfolio_lightbox_thumbnails_base = that.closest('.portfolios-lightbox.with-thumbs').find('.porto-portfolios-lighbox-thumbn
32ails').clone(),
33							magnificPopup = $.magnificPopup.instance;
34						
35						$('body').prepend( portfolio_lightbox_thumbnails_base );
36						
37						var $portfolios_lightbox_thumbnails = $( 'body > .porto-portfolios-lighbox-thumbnails'),
38							$portfolios_lightbox_thumbnails_carousel = $portfolios_lightbox_thumbnails.children('.owl-carousel');
39						$portfolios_lightbox_thumbnails_carousel.themeCarousel( $portfolios_lightbox_thumbnails_carousel.data('plugin-options') );
40						$portfolios_lightbox_thumbnails_carousel.trigger('refresh.owl.carousel');
41
42						var $carousel_items_wrapper = $portfolios_lightbox_thumbnails_carousel.find('.owl-stage');
43					
44						$carousel_items_wrapper.find('.owl-item').removeClass('current');
45						$carousel_items_wrapper.find('.owl-item').eq( magnificPopup.currItem.index ).addClass('current');
46
47						$.magnificPopup.instance.next = function() {
48							var magnificPopup = $.magnificPopup.instance;
49							$.magnificPopup.proto.next.call(this);
50							$carousel_items_wrapper.find('.owl-item').removeClass('current');
51							$carousel_items_wrapper.find('.owl-item').eq( magnificPopup.currItem.index ).addClass('current');
52						};
53						
54						$.magnificPopup.instance.prev = function() {
55							var magnificPopup = $.magnificPopup.instance;
56							$.magnificPopup.proto.prev.call(this);
57							$carousel_items_wrapper.find('.owl-item').removeClass('current');
58							$carousel_items_wrapper.find('.owl-item').eq( magnificPopup.currItem.index ).addClass('current');
59						};
60						
61						$carousel_items_wrapper.find('.owl-item').on( 'click', function(){
62							$carousel_items_wrapper.find('.owl-item').removeClass('current');
63							$.magnificPopup.instance.goTo( $(this).index() );
64							$(this).addClass('current');
65						});
66						
67					}
68					/* End - D3-Ahsan */
69				},
70				close: function() {
71					$('body').removeClass('lightbox-opened');
72					var fixed = this.st.fixedContentPos;
73					if (fixed) {
74						$('#header.sticky-header .header-main.sticky, #header.sticky-header .main-menu-wrap, .fixed-header #header.sticky-header .header-main, .fixed-header #header.sticky-header .main-menu-wrap').css(theme.rtl_browser?'left':'right', '');
75					}
76					$('.owl-carousel .owl-stage').each(function() {
77						var $this = $(this),
78							w = $this.width() + parseInt($this.css('padding-left')) + parseInt($this.css('padding-right'));
79
80						$this.css({'width': w + 200});
81						setTimeout(function() {
82							$this.css({'width': w});
83						}, 0);
84					});
85					/* D3-Ahsan - Start */
86					var that = $(this._lastFocusedEl);
87					if( ( that.parents('.portfolios-lightbox').hasClass('with-thumbs') ) && $(document).width() >= 1024 ){
88						$(' body >
88 .porto-portfolios-lighbox-thumbnails').remove();
89					}
90					/* End - D3-Ahsan */
91				}
92			}
93		},
94	});
95
96}).apply(this, [window.theme, jQuery]);
97
98// Lightbox
99(function(theme, $) {
100	'use strict';
101
102	theme = theme || {};
103
104	var instanceName = '__lightbox';
105
106	var Lightbox = function($el, opts) {
107		return this.initialize($el, opts);
108	};
109
110	Lightbox.defaults = {
111		callbacks: {
112			open: function() {
113				$('body').addClass('lightbox-opened');
114			},
115			close: function() {
116				$('body').removeClass('lightbox-opened');
117			}
118		}
119	};
120
121	Lightbox.prototype = {
122		initialize: function($el, opts) {
123			if ($el.data(instanceName)) {
124				return this;
125			}
126
127			this.$el = $el;
128
129			this
130				.setData()
131				.setOptions(opts)
132				.build();
133
134			return this;
135		},
136
137		setData: function() {
138			this.$el.data(instanceName, this);
139
140			return this;
141		},
142
143		setOptions: function(opts) {
144			this.options = $.extend(true, {}, Lightbox.defaults, theme.mfpConfig, opts, {
145				wrapper: this.$el
146			});
147
148			return this;
149		},
150
151		build: function() {
152			if (!($.isFunction($.fn.magnificPopup))) {
153				return this;
154			}
155
156			this.options.wrapper.magnificPopup(this.options);
157
158			return this;
159		}
160	};
161
162	// expose to scope
163	$.extend(theme, {
164		Lightbox: Lightbox
165	});
166
167	// jquery plugin
168	$.fn.themeLightbox = function(opts) {
169		return this.map(function() {
170			var $this = $(this);
171
172			if ($this.data(instanceName)) {
173				return $this.data(instanceName);
174			} else {
175				return new theme.Lightbox($this, opts);
176			}
177
178		});
179	}
180
181}).apply(this, [window.theme, jQuery]);
182
183// Visual Composer Image Zoom
184(function(theme, $) {
185	'use strict';
186
187	theme = theme || {};
188
189	var instanceName = '__toggle';
190
191	var VcImageZoom = function($el, opts) {
192		return this.initialize($el, opts);
193	};
194
195	VcImageZoom.defaults = {
196
197	};
198
199	VcImageZoom.prototype = {
200		initialize: function($el, opts) {
201			if ($el.data(instanceName)) {
202				return this;
203			}
204
205			this.$el = $el;
206
207			this
208				.setData()
209				.setOptions(opts)
210				.build();
211
212			return this;
213		},
214
215		setData: function() {
216			this.$el.data(instanceName, this);
217
218			return this;
219		},
220
221		setOptions: function(opts) {
222			this.options = $.extend(true, {}, VcImageZoom.defaults, opts, {
223				wrapper: this.$el
224			});
225
226			return this;
227		},
228
229		build: function() {
230			var self = this,
231				$el = this.options.container;
232			$el.parent().magnificPopup($.extend(true, {}, theme.mfpConfig, {
233				delegate: ".porto-vc-zoom",
234				gallery: {
235					enabled: true
236				},
237				mainClass: 'mfp-with-zoom',
238				zoom: {
239					enabled: true,
240					duration: 300
241				},
242				type: 'image'
243			}));
244
245			return this;
246		}
247	};
248
249	// expose to scope
250	$.extend(theme, {
251		VcImageZoom: VcImageZoom
252	});
253
254	// jquery plugin
255	$.fn.themeVcImageZoom = function(opts) {
256		return this.map(function() {
257			var $this = $(this);
258
259			if ($this.data(instanceName)) {
260				return $this.data(instanceName);
261			} else {
262				return new theme.VcImageZoom($this, opts);
263			}
264
265		});
266	}
267
268}).apply(this, [window.theme, jQuery]);
269
270// Post Ajax on Modal
271(function(theme, $) {
272	'use strict';
273
274	theme = theme || {};
275
276	var $rev_sliders;
277
278	$.extend(theme, {
279
280		PostAjaxModal: {
281
282			defaults: {
283				elements: '.page-portfolios'
284			},
285
286			initialize: function($elements, post_type) {
287				this.$elements = ($elements || $(this.defaults.elements));
288				if (typeof post_type == 'undefined') {
289					post_type = 'portfolio';
290				}
291
292				this.build(post_type);
293
294				return this;
295			},
296
297			build: function(post_type) {
298				var parentobj = this,
299				postAjaxOnModal = {
300
301					$wrapper: null,
302					modals: [],
303					currentModal: 0,
304					total: 0,
305					p_type: 'portfolio',
306
307					build: function($this, p_type) {
308						var self = this;
309						self.$wrapper = $this;
310						if (!self.$wrapper) {
311							return;
312						}
313						self.modals = [];
314						self.total = 0;
315						self.p_type = p_type;
316
317						$this.find('a[data-ajax-on-modal]').each(function() {
318							self.add($(this));
319						});
320
321						$this.off('mousedown', 'a[data-ajax-on-modal]').on('mousedown', 'a[data-ajax-on-modal]', function (ev) {
322							if (ev.which == 2) {
323								ev.preventDefault();
324								return false;
325							}
326						});
327					},
328
329					add: function($el) {
330
331						var self = this,
332							href = $el.attr('href'),
333							index = self.total;
334
335						self.modals.push({src: href});
336						self.total++;
337
338						$el.off('click').on('click', function(e) {
339							e.preventDefault();
340							self.show(index);
341							return false;
342						});
343
344					},
345
346					next: function() {
347						var self = this;
348						if(self.currentModal + 1 < self.total) {
349							self.show(self.currentModal + 1);
350						} else {
351							self.show(0);
352						}
353					},
354
355					prev: function() {
356						var self = this;
357
358						if((self.currentModal - 1) >= 0) {
359							self.show(self.currentModal - 1);
360						} else {
361							self.show(self.total - 1);
362						}
363					},
364
365					show: function(i) {
366						var self = this;
367
368						self.currentModal = i;
369
370						if (i < 0 || i > (self.total-1)) {
371							return false;
372						}
373
374						$.magnificPopup.close();
375						$.magnificPopup.open($.extend(true, {}, theme.mfpConfig, {
376							type: 'ajax',
377							items: self.modals,
378							gallery: {
379								enabled: true
380							},
381							ajax: {
382								settings: {
383									type: 'post',
384									data: {
385										ajax_action: self.p_type + '_ajax_modal'
386									}
387								}
388							},
389							mainClass: self.p_type + '-ajax-modal',
390							fixedContentPos: false,
391							callbacks: {
392								parseAjax: function(mfpResponse) {
393									var $response = $(mfpResponse.data),
394										$post = $response.find('#content article.' + self.p_type),
395										$vc_css = $response.filter('style[data-type]:not("")'),
396										vc_css = '';
397
398									$vc_css.each(function() {
399										vc_css += $(this).text();
400									});
401
402									if ($('#' + self.p_type + 'AjaxCSS').get(0)) {
403										$('#' + self.p_type + 'AjaxCSS').text(vc_css);
404									} else {
405										$('<style id="' + self.p_type + 'AjaxCSS">' + vc_css + '</style>').appendTo( "head" )
406									}
407
408									$post.find('.' + self.p_type + '-nav-all').html('<a href="#" data-ajax-' + self.p_type + '-close data-tooltip data-original-title="' + js_porto_vars.popup_close + '" data-placement="bottom"><i class="fas fa-th"></i></a>');
409									$post.find('.' + self.p_type + '-nav').html('<a href="#" data-ajax-' + self.p_type + '-prev class="' + self.p_type + '-nav-prev" data-tooltip data-original-title="' + js_porto_vars.popup_prev + '" data-placement="bottom"><i class="fa"></i></a><a href="#" data-toggle="tooltip" data-ajax-' + self.p_type + '-next class="' + self.p_type + '-nav-next" data-tooltip data-original-title="' + js_porto_vars.popup_next + '" data-placement="bottom"><i class="fa"></i></a>');
410									$post.find('.elementor-invisible').removeClass('elementor-invisible');
411									mfpResponse.data = '<div class="ajax-container">' + $post.html() + '</div>';
412								},
413								ajaxContentAdded: function() {
414									// Wrapper
415									var $wrapper = $('.' + self.p_type + '-ajax-modal');
416
417									// Close
418									$wrapper.find('a[data-ajax-' + self.p_type + '-close]').on('click', function(e) {
419										e.preventDefault();
420										$.magnificPopup.close();
421										return false;
422									});
423
424									$rev_sliders = $wrapper.find('.rev_slider, rs-module');
425
426									// Remove Next and Close
427									if(self.modals.length <= 1) {
428										$wrapper.find('a[data-ajax-' + self.p_type + '-prev], a[data-ajax-' + self.p_type + '-next]').remove();
429									} else {
430										// Prev
431										$wrapper.find('a[data-ajax-' + self.p_type + '-prev]').on('click', function(e) {
432											e.preventDefault();
433											if ($rev_sliders && $rev_sliders.get(0)) {
434												try {$rev_sliders.revkill();} catch(err) {}
435											}
436											$wrapper.find('.mfp-arrow-left').trigger('click');
437											return false;
438										});
439										// Next
440										$wrapper.find('a[data-ajax-' + self.p_type + '-next]').on('click', function(e) {
441											e.preventDefault();
442											if ($rev_sliders && $rev_sliders.get(0)) {
443												try {$rev_sliders.revkill();} catch(err) {}
444											}
445											$wrapper.find('.mfp-arrow-right').trigger('click');
446											return false;
447										});
448									}
449									if ('portfolio' == self.p_type) {
450										$(window).trigger('resize');
451									}
452									porto_init();
453									theme.refreshVCContent($wrapper);
454									setTimeout(function() {
455										var videos = $wrapper.find('video');
456										if (videos.get(0)) {
457											videos.each(function() {
458												$(this)[0].play();
459												$(this).parent().parent().parent().find('.video-controls').attr('data-action','play');
460												$(this).parent().parent().parent().find('.video-controls').html('<i class="ult-vid-cntrlpause"></i>');
461											});
462										}
463									}, 600);
464									$wrapper.off('scroll').on('scroll', function() {
465										$.fn.appear.run();
466									});
467								},
468								change: function() {
469									$('.mfp-wrap .ajax-container').click();
470								},
471								beforeClose: function() {
472									if ($rev_sliders && $rev_sliders.get(0)) {
473										try {$rev_sliders.revkill();} catch(err) {}
474									}
475									// Wrapper
476									var $wrapper = $('.' + self.p_type + '-ajax-modal');
477									$wrapper.off('scroll');
478								}
479							}
480						}), i);
481					}
482				};
483
484				parentobj.$elements.each(function() {
485
486					var $this = $(this);
487
488					if (!$this.find('a[data-ajax-on-modal]').get(0))
489						return;
490
491					postAjaxOnModal.build($this, post_type);
492
493					$this.data(post_type + 'AjaxOnModal', postAjaxOnModal);
494				});
495
496				return parentobj;
497			}
498		}
499
500	});
501
502	// Key Press
503	$(document.documentElement).on('keydown', function(e) {
504		try {
505			if (e.keyCode == 37 || e.keyCode == 39) {
506				if ($rev_sliders && $rev_sliders.get(0)) {
507					$rev_sliders.revkill();
508				}
509			}
510		} catch(err) {}
511	});
512
513}).apply(this, [window.theme, jQuery]);
514
515// Portfolio Ajax on Page
516(function(theme, $) {
517	'use strict';
518
519	theme = theme || {};
520
521	var activePortfolioAjaxOnPage;
522
523	$.extend(theme, {
524
525		PortfolioAjaxPage: {
526
527			defaults: {
528				elements: '.page-portfolios'
529			},
530
531			initialize: function($elements) {
532				this.$elements = ($elements || $(this.defaults.elements));
533
534				this.build();
535
536				return this;
537			},
538
539			build: function() {
540				var self = this;
541
542				self.$elements.each(function() {
543
544					var $this = $(this);
545
546					if (!$this.find('#portfolioAjaxBox').get(0))
547						return;
548
549					var $container = $(this),
550						portfolioAjaxOnPage = {
551
552							$wrapper: $container,
553							pages: [],
554							currentPage: 0,
555							total: 0,
556							$ajaxBox: $this.find('#portfolioAjaxBox'),
557							$ajaxBoxContent: $this.find('#portfolioAjaxBoxContent'),
558
559							build: function() {
560								var self = this;
561
562								self.pages = [];
563								self.total = 0;
564
565								$this.find('a[data-ajax-on-page]').each(function() {
566									self.add($(this));
567								});
568
569								$this.off('mousedown', 'a[data-ajax-on-page]').on('mousedown', 'a[data-ajax-on-page]', function (ev) {
570									if (ev.which == 2) {
571										ev.preventDefault();
572										return false;
573									}
574								});
575							},
576
577							add: function($el) {
578
579								var self = this,
580									href = $el.attr('href');
581
582								self.pages.push(href);
583								self.total++;
584
585								$el.off('click').on('click', function(e) {
586								   e.preventDefault();
587								   /* D3-Start */
588									var _class = e.target.className
589									if( _class == 'owl-next' ){
590										return false;
591									}else if( _class == 'owl-prev' ){
592										return false;
593									} else{
594										self.show(self.pages.indexOf(href));
595									}
596									/* End-D3 */
597									return false;
598								});
599
600							},
601
602							events: function() {
603								var self = this;
604
605								// Close
606								$this.off('click', 'a[data-ajax-portfolio-close]').on('click', 'a[data-ajax-portfolio-close]', function(e) {
607									e.preventDefault();
608									self.close();
609									return false;
610								});
611
612								if (self.total <= 1) {
613									$('a[data-ajax-portfolio-prev], a[data-ajax-portfolio-next]').remove();
614								} else {
615									// Prev
616									$this.off('click', 'a[data-ajax-portfolio-prev]').on('click', 'a[data-ajax-portfolio-prev]', function(e) {
617										e.preventDefault();
618										self.prev();
619										return false;
620									});
621									// Next
622									$this.off('click', 'a[data-ajax-portfolio-next]').on('click', 'a[data-ajax-portfolio-next]', function(e) {
623										e.preventDefault();
624										self.next();
625										return false;
626									});
627								}
628							},
629
630							close: function() {
631								var self = this;
632
633								if (self.$ajaxBoxContent.find('.rev_slider, rs-module').get(0)) {
634									try {self.$ajaxBoxContent.find('.rev_slider, rs-module').revkill();} catch(err) {}
635								}
636								self.$ajaxBoxContent.empty();
637								self.$ajaxBox.removeClass('ajax-box-init').removeClass('ajax-box-loading');
638							},
639
640							next: function() {
641								var self = this;
642								if(self.currentPage + 1 < self.total) {
643									self.show(self.currentPage + 1);
644								} else {
645									self.show(0);
646								}
647							},
648
649							prev: function() {
650								var self = this;
651
652								if((self.currentPage - 1) >= 0) {
653									self.show(self.currentPage - 1);
654								} else {
655									self.show(self.total - 1);
656								}
657							},
658
659							show: function(i) {
660								var self = this;
661
662								activePortfolioAjaxOnPage = null;
663
664								if (self.$ajaxBoxContent.find('.rev_slider, rs-module').get(0)) {
665									try {self.$ajaxBoxContent.find('.rev_slider, rs-module').revkill();} catch(err) {}
666								}
667								self.$ajaxBoxContent.empty();
668								self.$ajaxBox.removeClass('ajax-box-init').addClass('ajax-box-loading');
669
670								theme.scrolltoContainer(self.$ajaxBox);
671
672								self.currentPage = i;
673
674								if (i < 0 || i > (self.total-1)) {
675									self.close();
676									return false;
677								}
678
679								// Ajax
680								$.ajax({
681									url: self.pages[i],
682									complete: function(data) {
683										var $response = $(data.responseText),
684											$portfolio = $response.find('#content article.portfolio'),
685											$vc_css = $response.filter('style[data-type]:not("")'),
686											vc_css = '';
687
688										if ($('#portfolioAjaxCSS').get(0)) {
689											$('#portfolioAjaxCSS').text(vc_css);
690										} else {
691											$('<style id="portfolioAjaxCSS">' + vc_css + '</style>').appendTo( "head" )
692										}
693
694										$portfolio.find('.portfolio-nav-all').html('<a href="#" data-ajax-portfolio-close data-tooltip data-original-title="' + js_porto_vars.popup_close + '"><i class="fas fa-th"></i></a>');
695										$portfolio.find('.portfolio-nav').html('<a href="#" data-ajax-portfolio-prev class="portfolio-nav-prev" data-tooltip data-original-title="' + js_porto_vars.popup_prev + '"><i class="fa"></i></a><a href="#" data-toggle="tooltip" data-ajax-portfolio-next class="portfolio-nav-next" data-tooltip data-original-title="' + js_porto_vars.popup_next + '"><i class="fa"></i></a>');
696										self.$ajaxBoxContent.html($portfolio.html()).append('<div class="row"><div class="col-lg-12"><hr class="tall"></div></div>');
697										self.$ajaxBox.removeClass('ajax-box-loading');
698										$(window).trigger('resize');
699										porto_init();
700										theme.refreshVCContent(self.$ajaxBoxContent);
701										self.events();
702										activePortfolioAjaxOnPage = self;
703
704										self.$ajaxBoxContent.find('.lightbox:not(.manual)').each(function() {
705											var $this = $(this),
706												opts;
707
708											var pluginOptions = $this.data('plugin-options');
709											if (pluginOptions)
710												opts = pluginOptions;
711
712											$this.themeLightbox(opts);
713										});
714									}
715								});
716							}
717						};
718
719					portfolioAjaxOnPage.build();
720
721					$this.data('portfolioAjaxOnPage', portfolioAjaxOnPage);
722				});
723
724				return self;
725			}
726		}
727
728	});
729
730	// Key Press
731	$(document.documentElement).on('keyup', function(e) {
732		try {
733			if (!activePortfolioAjaxOnPage) return;
734			// Next
735			if (e.keyCode == 39) {
736				activePortfolioAjaxOnPage.next();
737			}
738			// Prev
739			if (e.keyCode == 37) {
740				activePortfolioAjaxOnPage.prev();
741			}
742		} catch(err) {}
743	});
744
745}).apply(this, [window.theme, jQuery]);
746
747// Post Filter
748(function(theme, $) {
749	'use strict';
750
751	theme = theme || {};
752
753	$.extend(theme, {
754
755		PostFilter: {
756
757			defaults: {
758				elements: '.portfolio-filter'
759			},
760
761			initialize: function($elements, post_type) {
762				this.$elements = ($elements || $(this.defaults.elements));
763				this.post_type = (typeof post_type == 'undefined' ? 'portfolio' : post_type);
764
765				this.build();
766
767				return this;
768			},
769
770			build: function() {
771				var self = this;
772
773				self.$elements.each(function() {
774					var $this = $(this);
775					$this.find('li').on('click', function(e) {
776						e.preventDefault();
777						if ($(this).hasClass('active')) {
778							return;
779						}
780
781						var selector = $(this).attr('data-filter'),
782							position = $this.data('position'),
783							$parent;
784
785						$this.find('.active').removeClass('active');
786
787						if (position == 'sidebar') {
788							$parent = $('.main-content .page-' + self.post_type + 's');
789							//theme.scrolltoContainer($parent);
790							$('.sidebar-overlay').click();
791						} else if (position == 'global') {
792							$parent = $('.main-content .page-' + self.post_type + 's');
793						} else {
794							$parent = $(this).closest('.page-' + self.post_type + 's');
795						}
796
797						if ('faq' == self.post_type) {
798							$parent.find('.faq').each(function() {
799								var $that = $(this), easing = "easeInOutQuart", timeout = 300;
800								if (selector == '*') {
801									if ($that.css('display') == 'none') $that.stop(true).slideDown(timeout, easing, function() {
802										$(this).attr('style', '').show();
803									});
804									selected++;
805								} else {
806									if ($that.hasClass(selector)) {
807										if ($that.css('display') == 'none') $that.stop(true).slideDown(timeout, easing, function() {
808											$(this).attr('style', '').show();
809										});
810										selected++;
811									} else {
812										if ($that.css('display') != 'none') $that.stop(true).slide
812Up(timeout, easing, function() {
813											$(this).attr('style', '').hide();
814										});
815									}
816								}
817							});
818
819							if (!selected && $parent.find('.faqs-infinite').length && typeof ($.fn.infinitescroll) != 'undefined') {
820								$parent.find('.faqs-infinite').infinitescroll('retrieve');
821							}
822						} else if ($parent.hasClass('portfolios-timeline')) {
823							var selected = 0;
824							$parent.find('.portfolio').each(function() {
825								var $that = $(this), easing = "easeInOutQuart", timeout = 300;
826								if (selector == '*') {
827									if ($that.css('display') == 'none') $that.stop(true).slideDown(timeout, easing, function() {
828										$(this).attr('style', '').show();
829									});
830									selected++;
831								} else {
832									if ($that.hasClass(selector)) {
833										if ($that.css('display') == 'none') $that.stop(true).slideDown(timeout, easing, function() {
834											$(this).attr('style', '').show();
835										});
836										selected++;
837									} else {
838										if ($that.css('display') != 'none') $that.stop(true).slideUp(timeout, easing, function() {
839											$(this).attr('style', '').hide();
840										});
841									}
842								}
843							});
844							if (!selected && $parent.find('.portfolios-infinite').length && typeof ($.fn.infinitescroll) != 'undefined') {
845								$parent.find('.portfolios-infinite').infinitescroll('retrieve');
846							}
847							setTimeout(function() {
848								theme.FilterZoom.initialize($parent);
849							}, 400);
850						} else {
851							$parent.find('.' + self.post_type + '-row').isotope({
852								filter: selector == '*' ? selector : '.' + selector
853							});
854						}
855
856						$(this).addClass('active');
857
858						if (position == 'sidebar') {
859							self.$elements.each(function() {
860								var $that = $(this);
861
862								if ($that == $this && $that.data('position') != 'sidebar') return;
863								$that.find('li').removeClass('active');
864								$that.find('li[data-filter="' + selector + '"]').addClass('active');
865							});
866						}
867
868						window.location.hash = '#' + selector;
869						theme.refreshVCContent();
870
871					});
872				});
873
874				function hashchange() {
875					var $filter = $(self.$elements.get(0)), hash = window.location.hash;
876
877					if (hash) {
878						var $o = $filter.find('li[data-filter="' + hash.replace('#', '') + '"]');
879						if (!$o.hasClass('active')) {
880							$o.click();
881						}
882					}
883				}
884
885				$(window).on('hashchange', hashchange);
886				hashchange();
887
888				return self;
889			}
890		}
891
892	});
893
894}).apply(this, [window.theme, jQuery]);
895
896// Member Ajax on Page
897(function(theme, $) {
898	'use strict';
899
900	theme = theme || {};
901
902	var activeMemberAjaxOnPage;
903
904	$.extend(theme, {
905
906		MemberAjaxPage: {
907
908			defaults: {
909				elements: '.page-members'
910			},
911
912			initialize: function($elements) {
913				this.$elements = ($elements || $(this.defaults.elements));
914
915				this.build();
916
917				return this;
918			},
919
920			build: function() {
921				var self = this;
922
923				self.$elements.each(function() {
924
925					var $this = $(this);
926
927					if (!$this.find('#memberAjaxBox').get(0))
928						return;
929
930					var $container = $(this),
931						memberAjaxOnPage = {
932
933							$wrapper: $container,
934							pages: [],
935							currentPage: 0,
936							total: 0,
937							$ajaxBox: $this.find('#memberAjaxBox'),
938							$ajaxBoxContent: $this.find('#memberAjaxBoxContent'),
939
940							build: function() {
941								var self = this;
942
943								self.pages = [];
944								self.total = 0;
945
946								$this.find('a[data-ajax-on-page]').each(function() {
947									self.add($(this));
948								});
949
950								$this.off('mousedown', 'a[data-ajax-on-page]').on('mousedown', 'a[data-ajax-on-page]', function (ev) {
951									if (ev.which == 2) {
952										ev.preventDefault();
953										return false;
954									}
955								});
956							},
957
958							add: function($el) {
959
960								var self = this,
961									href = $el.attr('href');
962
963								self.pages.push(href);
964								self.total++;
965
966								$el.off('click').on('click', function(e) {
967									e.preventDefault();
968									self.show(self.pages.indexOf(href));
969									return false;
970								});
971
972							},
973
974							next: function() {
975								var self = this;
976								if(self.currentPage + 1 < self.total) {
977									self.show(self.currentPage + 1);
978								} else {
979									self.show(0);
980								}
981							},
982
983							prev: function() {
984								var self = this;
985
986								if((self.currentPage - 1) >= 0) {
987									self.show(self.currentPage - 1);
988								} else {
989									self.show(self.total - 1);
990								}
991							},
992
993							show: function(i) {
994								var self = this;
995
996								activeMemberAjaxOnPage = null;
997
998								if (self.$ajaxBoxContent.find('.rev_slider, rs-module').get(0)) {
999									try {self.$ajaxBoxContent.find('.rev_slider, rs-module').revkill();} catch(err) {}
1000								}
1001								self.$ajaxBoxContent.empty();
1002								self.$ajaxBox.removeClass('ajax-box-init').addClass('ajax-box-loading');
1003
1004								theme.scrolltoContainer(self.$ajaxBox);
1005
1006								self.currentPage = i;
1007
1008								if (i < 0 || i > (self.total-1)) {
1009									self.close();
1010									return false;
1011								}
1012
1013								// Ajax
1014								$.ajax({
1015									url: self.pages[i],
1016									complete: function(data) {
1017										var $response = $(data.responseText),
1018											$member = $response.find('#content article.member'),
1019											$vc_css = $response.filter('style[data-type]:not("")'),
1020											vc_css = '';
1021
1022										$vc_css.each(function() {
1023											vc_css += $(this).text();
1024										});
1025
1026										if ($('#memberAjaxCSS').get(0)) {
1027											$('#memberAjaxCSS').text(vc_css);
1028										} else {
1029											$('<style id="memberAjaxCSS">' + vc_css + '</style>').appendTo( "head" )
1030										}
1031
1032										var $append = self.$ajaxBox.find('.ajax-content-append'), html = '';
1033										if ($append.length) html = $append.html();
1034										self.$ajaxBoxContent.html($member.html()).prepend('<div class="row"><div class="col-lg-12"><hr class="tall m-t-none"></div></div>').append('<div class="row"><div class="col-md-12"><hr class="m-t-md"></div></div>' + html);
1035
1036										self.$ajaxBox.removeClass('ajax-box-loading');
1037										$(window).trigger('resize');
1038										porto_init();
1039										theme.refreshVCContent(self.$ajaxBoxContent);
1040										activeMemberAjaxOnPage = self;
1041									}
1042								});
1043							}
1044						};
1045
1046					memberAjaxOnPage.build();
1047
1048					$this.data('memberAjaxOnPage', memberAjaxOnPage);
1049				});
1050
1051				return self;
1052			}
1053		}
1054
1055	});
1056
1057	// Key Press
1058	$(document.documentElement).on('keyup', function(e) {
1059		try {
1060			if (!activeMemberAjaxOnPage) return;
1061			// Next
1062			if (e.keyCode == 39) {
1063				activeMemberAjaxOnPage.next();
1064			}
1065			// Prev
1066			if (e.keyCode == 37) {
1067				activeMemberAjaxOnPage.prev();
1068			}
1069		} catch(err) {}
1070	});
1071
1072}).apply(this, [window.theme, jQuery]);
1073
1074// Filter Zoom
1075(function(theme, $) {
1076	'use strict';
1077
1078	theme = theme || {};
1079
1080	$.extend(theme, {
1081
1082		FilterZoom: {
1083
1084			defaults: {
1085				elements: null
1086			},
1087
1088			initialize: function($elements) {
1089				this.$elements = ($elements || this.defaults.elements);
1090
1091				this.build();
1092
1093				return this;
1094			},
1095
1096			build: function() {
1097				var self = this;
1098
1099				self.$elements.each(function() {
1100					var $this = $(this),
1101						zoom = $this.find('.zoom, .thumb-info-zoom').get(0);
1102
1103					if (!zoom) return;
1104
1105					$this.find('.zoom, .thumb-info-zoom').off('click');
1106					var links = [];
1107					var i = 0;
1108					$this.find('article').each(function() {
1109						var $that = $(this);
1110						if ($that.css('display') != 'none') {
1111							var $zoom = $that.find('.zoom, .thumb-info-zoom'),
1112								slide,
1113								src = $zoom.data('src'),
1114								title = $zoom.data('title');
1115
1116							$zoom.data('index', i);
1117							if (Array.isArray(src)) {
1118								$.each(src, function(index, value) {
1119									slide = {};
1120									slide.src = value;
1121									slide.title = title[index];
1122									links[i] = slide;
1123									i++;
1124								});
1125							} else {
1126								slide = {};
1127								slide.src = src;
1128								slide.title = title;
1129								links[i] = slide;
1130								i++;
1131							}
1132						}
1133					});
1134					$this.find('article').each(function() {
1135						var $that = $(this);
1136						if ($that.css('display') != 'none') {
1137							$that.off('click', '.zoom, .thumb-info-zoom').on('click', '.zoom, .thumb-info-zoom', function(e) {
1138								var $zoom = $(this), $parent = $zoom.parents('.thumb-info'), offset = 0;
1139								if ($parent.get(0)) {
1140									var $slider = $parent.find('.porto-carousel');
1141									if ($slider.get(0)) {
1142										offset = $slider.data('owl.carousel').current() - $slider.find('.cloned').length / 2;
1143									}
1144								}
1145								e.preventDefault();
1146								if ($.fn.magnificPopup) {
1147									$.magnificPopup.close();
1148									$.magnificPopup.open($.extend(true, {}, theme.mfpConfig, {
1149										items: links,
1150										gallery: {
1151											enabled: true
1152										},
1153										type: 'image'
1154									}), $zoom.data('index') + offset);
1155								}
1156								return false;
1157							});
1158						}
1159					});
1160				});
1161
1162				return self;
1163			}
1164		}
1165
1166	});
1167
1168}).apply(this, [window.theme, jQuery]);
1169
1170
1171/* initialize */
1172jQuery(document).ready(function($) {
1173	'use strict';
1174
1175	// Visual Composer Image Zoom
1176	if ($.isFunction($.fn.themeVcImageZoom)) {
1177
1178		$(function() {
1179			var $galleryParent = null;
1180			$('.porto-vc-zoom:not(.manual)').each(function() {
1181				var $this = $(this),
1182					opts,
1183					gallery = $this.attr('data-gallery');
1184
1185				var pluginOptions = $this.data('plugin-options');
1186				if (pluginOptions)
1187					opts = pluginOptions;
1188
1189				if (typeof opts == "undefined") {
1190					opts = {};
1191				}
1192				opts.container = $this.parent();
1193
1194				if (gallery == 'true') {
1195					var container = 'vc_row';
1196
1197					if ($this.attr('data-container'))
1198						container = $this.attr('data-container');
1199
1200					var $parent = $($this.closest('.' + container).get(0));
1201					if ($parent.length > 0 && $galleryParent != null && $galleryParent.is($parent)) {
1202						return;
1203					} else if ($parent.length > 0) {
1204						$galleryParent = $parent;
1205					}
1206					if ($galleryParent != null && $galleryParent.length > 0) {
1207						opts.container = $galleryParent;
1208					}
1209				}
1210
1211				$this.themeVcImageZoom(opts);
1212			});
1213		});
1214	}
1215
1216	function porto_modal_open($this) {
1217		var trigger = $this.data('trigger-id'),
1218			overlayClass = $this.data('overlay-class'),
1219			type = $this.data('type');
1220		if (typeof trigger != 'undefined'/* && $('#' + escape(trigger)).length > 0*/) {
1221			if (typeof type == 'undefined') {
1222				type = 'inline';
1223			}
1224			if (type == 'inline') {
1225				trigger = '#' + escape(trigger);
1226			}
1227			var args = {
1228				items: {
1229					src: trigger
1230				},
1231				type: type,
1232			};
1233			if ($this.hasClass('porto-onload')) {
1234				args['callbacks'] = {
1235					'beforeClose': function() {
1236						if ($('.mfp-wrap .porto-modal-content .porto-disable-modal-onload').length && $('.mfp-wrap .porto-modal-content .porto-disable-modal-onload').is(':checked')) {
1237							$.cookie('porto_modal_disable_onload', 'true', { expires : 7 });
1238						}
1239					}
1240				};
1241			}
1242			if (typeof overlayClass != "undefined" && overlayClass) {
1243				args.mainClass = escape(overlayClass);
1244			}
1245			$.magnificPopup.open($.extend(true, {}, theme.mfpConfig, args), 0);
1246		}
1247	}
1248
1249	function porto_init_magnific_popup_functions() {
1250		$('.lightbox:not(.manual)').each(function() {
1251			var $this = $(this),
1252				opts;
1253
1254			var pluginOptions = $this.data('plugin-options');
1255			if (pluginOptions)
1256				opts = pluginOptions;
1257
1258			$this.themeLightbox(opts);
1259		});
1260
1261		// Popup with video or map
1262		$('.porto-popup-iframe').magnificPopup($.extend(true, {}, theme.mfpConfig, {
1263			disableOn: 700,
1264			type: 'iframe',
1265			mainClass: 'mfp-fade',
1266			removalDelay: 160,
1267			preloader: false,
1268			fixedContentPos: false
1269		}));
1270
1271		// Popup with ajax
1272		$('.porto-popup-ajax').magnificPopup($.extend(true, {}, theme.mfpConfig, {
1273			type: 'ajax'
1274		}));
1275
1276		// Popup with content
1277		$('.porto-popup-content').each(function() {
1278			var animation = $(this).attr('data-animation');
1279			$(this).magnificPopup($.extend(true, {}, theme.mfpConfig, {
1280				type: 'inline',
1281				fixedContentPos: false,
1282				fixedBgPos: true,
1283				overflowY: 'auto',
1284				closeBtnInside: true,
1285				preloader: false,
1286				midClick: true,
1287				removalDelay: 300,
1288				mainClass: animation
1289			}));
1290		});
1291
1292		// Porto Modal
1293		$('.popup-youtube, .popup-vimeo, .popup-gmaps').each(function(index) {
1294			var overlayClass = $(this).find('.porto-modal-trigger').data('overlay-class'),
1295				args = {
1296					type: 'iframe',
1297					removalDelay: 160,
1298					preloader: false,
1299
1300					fixedContentPos: false
1301				};
1302			if (typeof overlayClass != "undefined" && overlayClass) {
1303				args.mainClass = escape(overlayClass);
1304			}
1305			$(this).magnificPopup(args);
1306		});
1307
1308		if ($('.porto-modal-trigger.porto-onload').length > 0) {
1309			var $obj = $('.porto-modal-trigger.porto-onload').eq(0),
1310				timeout = 0;
1311			if ($obj.data('timeout')) {
1312				timeout = parseInt($obj.data('timeout'), 10);
1313			}
1314			setTimeout(function() {
1315				porto_modal_open($obj);
1316			}, timeout);
1317		}
1318		$('.porto-modal-trigger').on('click', function(e) {
1319			e.preventDefault();
1320			porto_modal_open($(this));
1321		});
1322
1323		/* Woocommerce */
1324		// login popup
1325		$('.login-popup .porto-link-login, .login-popup .porto-link-register').magnificPopup({
1326			items: {
1327				src: theme.ajax_url + '?action=porto_account_login_popup&nonce=' + js_porto_vars.porto_nonce,
1328				type: 'ajax'
1329			},
1330			tLoading: '<i class="porto-loading-icon"></i>',
1331			callbacks: {
1332				ajaxContentAdded: function() {
1333					$(window).trigger('porto_login_popup_opened');
1334				}
1335			}
1336		});
1337
1338		$('.product-images').magnificPopup(
1339			$.extend(true, {}, theme.mfpConfig, {
1340				delegate: '.img-thumbnail a.zoom',
1341				type: 'image',
1342				gallery: { enabled:true }
1343			})
1344		);
1345	}
1346
1347	if ($.isFunction($.fn.magnificPopup)) {
1348		porto_init_magnific_popup_functions();
1349	} else {
1350		setTimeout(function() {
1351			if ($.isFunction($.fn.magnificPopup)) {
1352				porto_init_magnific_popup_functions();
1353			}
1354		}, 500);
1355	}
1356
1357	// Post Ajax Modal
1358	if (typeof theme.PostAjaxModal !== 'undefined') {
1359		// Portfolio
1360		if ($('.page-portfolios').length) {
1361			theme.PostAjaxModal.initialize($('.page-portfolios'));
1362		}
1363		// Member
1364		if ($('.page-members').length) {
1365			theme.PostAjaxModal.initialize($('.page-members'), 'member');
1366		}
1367	}
1368
1369	// Portfolio Ajax on Page
1370	if (typeof theme.PortfolioAjaxPage !== 'undefined') {
1371		theme.PortfolioAjaxPage.initialize();
1372	}
1373
1374	// Post Filter
1375	if (typeof theme.PostFilter !== 'undefined') {
1376		// Portfolio
1377		if ($('.portfolio-filter').length) {
1378			theme.PostFilter.initialize($('.portfolio-filter'), 'portfolio');
1379		}
1380		// Member
1381		if ($('.member-filter').length) {
1382			theme.PostFilter.initialize($('.member-filter'), 'member');
1383		}
1384		// Faq
1385		if ($('.faq-filter').length) {
1386			theme.PostFilter.initialize($('.faq-filter'), 'faq');
1387		}
1388	}
1389
1390	// Member Ajax on Page
1391	if (typeof theme.MemberAjaxPage !== 'undefined') {
1392		theme.MemberAjaxPage.initialize();
1393	}
1394
1395	// Filter Zooms
1396	if (typeof theme.FilterZoom !== 'undefined') {
1397		// Portfolio Filter Zoom
1398		theme.FilterZoom.initialize($('.page-portfolios'));
1399		// Member Filter Zoom
1400		theme.FilterZoom.initialize($('.page-members'));
1401		// Posts Related Style Filter Zoom
1402		theme.FilterZoom.initialize($('.blog-posts-related'));
1403	}
1404
1405});

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.