PageSourceSearch

https://global-hearts.com/wp-content/themes/zona/js/custom.js

js global-hearts.com collected 2026-10-04 19:22:06 UTC 25,905 bytes, 962 lines download raw bytes

1// When DOM is fully loaded
2jQuery(document).ready(function($) {
3
4	"use strict";
5
6
7	/* Main Settings
8	 ---------------------------------------------------------------------- */
9
10	// Detect Touch Devices
11	var isTouch = ( ( 'ontouchstart' in window ) || ( navigator.msMaxTouchPoints > 0 ) );
12
13	if ( isTouch ) {
14
15		$( 'body' ).addClass( 'touch-device' );
16
17	}
18
19
20	/* Remove / Update plugins after page loaded
21	 ---------------------------------------------------------------------- */
22	(function() {
23
24		if ( $.fn.waypoints ) {
25				setTimeout(function(){
26				$.waypoints('refresh');
27				$.waypoints( 'destroy' );
28			}, 400)
29		}
30
31		// Isotope
32		if ( $.fn.isotope ) {
33			if ( $( '.masonry' ).data( 'isotope') ) {
34				$( '.masonry' ).isotope( 'destroy' );
35			}
36			if ( $( '.items' ).data( 'isotope') ) {
37				$( '.items' ).isotope( 'destroy' );
38			}
39		}
40		
41		
42		/* UPDATE Scamp player content and events
43		 ---------------------------------------------------------------------- */
44		if ( typeof scamp_player !== 'undefined' && scamp_player != null ) {
45			scamp_player.update_content();
46			scamp_player.update_events( 'body' );
47		}
48
49		
50	})();
51
52
53	/* Responsive navigation
54	 ---------------------------------------------------------------------- */
55	(function() {
56
57		// If menu is activated
58		if ( $( '#responsive-nav' ).hasClass( 'activated' ) ) {
59			return
60		}
61
62	 	if ( $( '#layer--nav-wrapper').length && $( '#layer--nav-wrapper').children().length ) {
63
64
65		 	// Scroll
66			var responsive_scroll = new IScroll( '#layer--nav-wrapper', {
67			    mouseWheel: true,
68			    interactiveScrollbars: true,
69			    scrollbars: 'custom',
70			    click: true
71			});
72
73			$( '#responsive-nav' ).addClass( 'activated' );
74
75			// Navigation list
76			$( '#responsive-nav .menu-item-has-children > a' ).each(function(){
77				$( this ).after('<i class="submenu-trigger icon icon-angle-down"></i>' );
78			});
79
80			$( '#responsive-nav > ul > li' ).addClass( 'first-child' );
81			$( '#responsive-nav .submenu-trigger, #responsive-nav .menu-item-has-children > a[href="#"]' ).on( 'click', function(e){
82				e.preventDefault();
83				var li = $( this ).closest('li'),
84					main_index = $( this ).parents( '.first-child' ).index(),
85					open_li = $( '#responsive-nav > ul > li:not(:eq('+main_index+'))'),
86					main_parent;
87
88				if ( $( this ).parent().hasClass( 'first-child' ) ) {
89					main_parent = $( this ).parent().children();
90					main_parent.find('.is-visible').removeClass( 'is-visible' );
91					main_parent.find( 'ul:visible' ).slideUp(0);
92				}
93				open_li.removeClass( 'is-visible' );
94				li.toggleClass( 'is-visible' );
95
96				open_li.find( 'ul:visible' ).slideUp();
97				li.find( ' > ul' ).slideToggle(400);
98				setTimeout( function(){ responsive_scroll.refresh() }, 400  );
99			});
100
101			/* Responsive Layer */
102			$( '.nav--responsive-trigger' ).on( 'click', function(){
103		 		$( '.layer--nav' ).addClass( 'is-active is-nav' ).css( 'visibility', 'visible' );
104		 		responsive_scroll.refresh();
105		 	});
106		 	$( '.layer--nav .layer--close' ).on( 'click', function(){
107		 		$( '.layer--nav' ).removeClass( 'is-active is-nav' ).css( 'visibility', 'visible' );
108		 		setTimeout( function(){
109		 			$( '.layer--nav' ).css( 'visibility', 'hidden' );
110		 			$( '#responsive-nav .is-visible' ).removeClass( 'is-visible' ).find( 'ul:visible' ).slideUp();
111		 		}, 300);
112		 	});
113		 	$( '#responsive-nav a:not([href="#"])' ).on( 'click' , function(){
114		 		setTimeout( function(){
115		 			$( '.layer--nav' ).css( 'visibility', 'hidden' ).removeClass( 'is-active is-nav' );
116		 			$( '#responsive-nav .is-visible' ).removeClass( 'is-visible' ).find( 'ul:visible' ).slideUp();
117		 		}, 800);
118
119			});
120
121			
122	 	}
123	 })();
124
125
126
127	/* Scroll Actions
128	 ---------------------------------------------------------------------- */
129	(function() {
130		$( '#wpadminbar' ).css( 'position', 'fixed' );
131
132		// Fixed header
133		if ( $( 'body' ).hasClass( 'header-fixed' ) ) {
134
135			// Overlay
136			if ( $( 'body' ).hasClass( 'header-overlay' ) ) {
137
138				var scroll_actions = function() {
139					var st = $( window ).scrollTop();
140
141					if ( st > 0 ) {
142						$( '.header-overlay .main-header' ).removeClass('ontop');
143					} else {
144						$( '.header-overlay .main-header' ).addClass('ontop');
145					}
146
147				}
148
149				$( window ).on( 'scroll', scroll_actions );
150
151				scroll_actions();
152	
153			}
154
155			// wpadmin bar fix
156			if ( $( '#wpadminbar' ).length ) {
157				var resize_actions = function() {
158					var admin_bar_h = $( '#wpadminbar' ).outerHeight();
159					$( '.header-fixed .main-header .header--wrap' ).css( 'top', admin_bar_h )
160				}
161
162				resize_actions();
163				$( window ).on( 'resize', resize_actions );
164			}
165			return;
166		}
167
168		// Fixed header
169		if ( $( 'body' ).hasClass( 'header-fixed' ) ) {
170
171			// wpadmin bar fix
172			if ( $( '#wpadminbar' ).length ) {
173				var resize_actions = function() {
174					var admin_bar_h = $( '#wpadminbar' ).outerHeight();
175					$( '.header-fixed .main-header .header--wrap' ).css( 'top', admin_bar_h )
176				}
177
178				resize_actions();
179				$( window ).on( 'resize', resize_actions );
180			}
181			return;
182		}
183
184		// Static header
185		if ( $( 'body' ).hasClass( 'header-static' ) ) {
186			return;
187		}
188
189		// Moving header
190		var header_h,
191			nav_h,
192			sticky_nav_h = 0,
193			moving_header_h = 0,
194			lastScrollTop = 0;
195
196		// Scroll
197		var scroll_actions = function() {
198			var st = $( window ).scrollTop(),
199				wh = $( window ).height();
200
201			header_h = $( '.header' ).outerHeight();
202
203			// Header
204			if ( st > 0 ) {
205				$( '.header' ).css( 'height', header_h );
206				$( '.header--moving' ).addClass( 'sticky' );
207			} else {
208				setTimeout( function(){ 
209					$( '.header--moving' ).removeClass( 'sticky' );
210					$( '.header' ).css( 'height', 'auto' );
211				}, 400 );
212			}
213
214			if ( st > 50 ) {
215				$( '.header--moving' ).css( 'margin-top', -sticky_nav_h );
216			}
217
218			// Down
219			if ( st > lastScrollTop ){
220				if ( st > 50 ) {
221					$( '.header--moving' ).css( 'margin-top', -sticky_nav_h );
222				}
223
224			// UP
225			} else {
226				if ( st < 200 ) {
227					$( '.header--moving' ).css( 'margin-top', 0 );
228				}
229				
230			}
231			lastScrollTop = st;
232
233		};
234
235		scroll_actions();
236		$( window ).on( 'scroll', scroll_actions );
237
238		// Resize
239		var resize_actions = function() {
240
241			nav_h = $( '.nav--wrapper' ).outerHeight();
242			sticky_nav_h = 0;
243
244			header_h = $( '.header--moving' ).outerHeight();
245			sticky_nav_h = header_h - nav_h;
246
247			moving_header_h = $( '.header--moving' ).outerHeight();
248			$( '.header' ).css( 'height', moving_header_h );
249
250			scroll_actions();
251		}
252
253		resize_actions();
254		$( window ).on( 'resize', resize_actions );
255
256	})();
257
258
259	/* Parallax
260	 ---------------------------------------------------------------------- */
261	(function() {
262
263		var images;
264		
265		function init() {
266			images = [].slice.call( $('.slider--parallax') );
267			if(!images.length) { return }
268			
269			$( window ).on( 'scroll', doParallax );
270			$( window ).on( 'resize', doParallax );
271			doParallax();
272		}
273		
274		function getViewportHeight() {
275			var a = document.documentElement.clientHeight, b = window.innerHeight;
276			return a < b ? b : a;
277		}
278		
279		function getViewportScroll() {
280			if(typeof window.scrollY != 'undefined') {
281				return window.scrollY;
282			}
283			if(typeof pageYOffset != 'undefined') {
284				return pageYOffset;
285			}
286			var doc = document.documentElement;
287			doc = doc.clientHeight ? doc : document.body;
288			return doc.scrollTop;
289		}
290		
291		function doParallax() {
292			var el, elOffset, elHeight,
293				offset = getViewportScroll(),
294				vHeight = getViewportHeight();
295			
296			for(var i in images) {
297				el = images[i];
298				if ( $( el ).css( 'background-image' ) != 'none') {
299					elOffset = el.offsetTop;
300					elHeight = el.offsetHeight;
301					
302					if((elOffset > offset + vHeight) || (elOffset + elHeight < offset)) { continue; }
303					
304					el.style.backgroundPosition = '50% '+Math.round((elOffset - offset)*3/8)+'px';
305				}
306			}
307		}
308
309		init()
310	})();
311
312
313	/* DISQUS
314	 ---------------------------------------------------------------------- */
315	(function() {
316
317 		if ( $( '#disqus_thread' ).length <= 0 ) return;
318
319 		var 
320 			disqus_identifier = $( '#disqus_thread' ).attr( 'data-post_id' ),
321 			disqus_shortname = $( '#disqus_thread' ).attr( 'data-disqus_shortname' ),
322 			disqus_title = $( '#disqus_title' ).text(),
323 			disqus_url = window.location.href;
324 		/* * * Disqus Reset Function * * */
325		if ( typeof DISQUS != 'undefined' ) {
326			DISQUS.reset({
327	            reload: true,
328	            config: function () {
329	                this.page.identifier = disqus_identifier;
330	                this.page.url = disqus_url;
331	                this.page.title = disqus_title;
332	            }
333	        });
334		} else {
335			var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
336    		dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
337    		(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
338		}
339
340
341 	})();
342
343	/* Tracklist
344	 ---------------------------------------------------------------------- */
345	(function() {
346
347 		if ( $( '.sp--tracklist' ).length <= 0 ) return;
348
349 		// Add fixed width to progress elements
350 		function tracklist_resize() {
351
352 			var progress_width = $( '.sp--tracklist li' ).width();
353 			$( '.track-row-progress .sp-content-position span' ).css( 'width', progress_width+'px' );
354 			$( '.track-row-progress .sp-content-loading span' ).css( 'width', progress_width+'px' );
355
356 			if ( typeof scamp_player !== 'undefined' && scamp_player != null ) {
357			scamp_player.update_content();
358		
359		}
360
361 		}
362
363
364 		$( window ).on( 'resize', tracklist_resize );
365		tracklist_resize();
366
367		// Lyrics button
368		$( '.sp--tracklist li .track-lyrics' ).on( 'click', function(){
369			var $this = $( this ),
370			$li = $this.parents( 'li' ),
371			$list = $this.parents( '.sp--tracklist' );
372
373			$list.find( 'li').not($li).find( '.track-row-lyrics' ).slideUp();
374			$list.find( 'li').not($li).find( '.track-lyrics.is-active' ).removeClass( 'is-active' );
375
376			$this.toggleClass( 'is-active' );
377			$li.find( '.track-row-lyrics' ).slideToggle();
378
379
380		});
381
382
383
384 	})();
385
386
387	/* Content Slider
388	 ---------------------------------------------------------------------- */
389	(function() {
390
391 		if ( $( '.slider--content' ).length <= 0 ) return;
392
393		$( '.slider--content' ).each( function() {
394
395			// Carousel slider
396			var 
397				content_slider = $( this ),
398				id = '#' + $( this ).attr( 'id' ),
399				owl = $( id ),
400				navigation = content_slider.data( 'slider-nav' ),
401				pagination = content_slider.data( 'slider-pagination' ),
402				speed = content_slider.data( 'slider-speed' ),
403				pause_time = content_slider.data( 'slider-pause-time' ),
404				auto_height = content_slider.data( 'auto-height' ),
405				autoplay = false;
406
407				if ( pause_time > 0 ) {
408					autoplay = true;
409				} 
410
411			owl.on('changed.owl.carousel', function(e) {
412
413					return false;
414                	var 
415                		$this = $( e.target ),
416                		$this_slide = $this.find( '.owl-item.active' );
417                	var bg = $this_slide.find( '.slider--parallax' ).css('background-position');
418
419                	$this.find( '.owl-item:not(.active) .slider--parallax' ).css( 'background-position', 'center top' );
420
421                	
422                });
423
424			owl.owlCarousel({
425			    nav : navigation,
426			    navText : ['', ''],
427			    dots : pagination,
428			    smartSpeed : speed,
429			    autoplayTimeout : pause_time,
430			    autoplay : autoplay,
431			    autoHeight:auto_height,
432			    autoplayHoverPause : true,
433			    loop: true,
434			    items : 1,
435			    video : false,
436
437	  		});
438
439	  		var slider_sizes = function() {
440			setTimeout( function(){
441
442				var 
443					s = content_slider,
444					w = s.outerWidth(),
445					all_classes = 'slider--small slider--medium slider--large'
446
447				if ( w <= 300 )
448				    s.removeClass( all_classes ).addClass( 'slider--small' );
449				else if ( w <= 768 )
450				    s.removeClass( all_classes ).addClass( 'slider--medium' );
451				else if ( w <= 1170 )
452				    s.removeClass( all_classes ).addClass( 'slider--large' );
453				else
454				    s.removeClass( all_classes );
455
456
457			 }, 100);
458		}
459
460		$( window ).on( 'resize', slider_sizes );
461		slider_sizes();
462
463		});
464		
465  	})();
466
467
468  	/* Carousel Slider
469	 ---------------------------------------------------------------------- */
470	(function() {
471
472 		if ( $( '.slider--carousel' ).length <= 0 ) return;
473
474		$( '.slider--carousel' ).each( function() {
475
476			// Carousel slider
477			var 
478				content_slider = $( this ),
479				id = '#' + $( this ).attr( 'id' ),
480				owl = $( id ),
481				navigation = content_slider.data( 'slider-nav' ),
482				pagination = content_slider.data( 'slider-pagination' ),
483				speed = content_slider.data( 'slider-speed' ),
484				pause_time = content_slider.data( 'slider-pause-time' ),
485				auto_height = content_slider.data( 'auto-height' ),
486				items = $( this ).data( 'items' ),
487				autoplay = false;
488
489				if ( pause_time > 0 ) {
490					autoplay = true;
491				} 
492
493			owl.owlCarousel({
494			    nav : navigation,
495			    navText : ['', ''],
496			    dots : pagination,
497			    smartSpeed : speed,
498			    autoplayTimeout : pause_time,
499			    autoplay : autoplay,
500			    autoHeight:auto_height,
501			    autoplayHoverPause : true,
502			    loop: true,
503			    items : items,
504			    video : false,
505			    responsiveClass:true,
506			    responsive:{
507			        0:{
508			            items:1,
509			            dots:false,
510			            nav:true
511			        },
512			        600:{
513			            items:2,
514			        },
515			        900:{
516			            items : items,
517			        },
518			    }
519
520	  		});
521
522
523		});
524		
525  	})();
526
527
528	/* Small Functions
529	 ---------------------------------------------------------------------- */
530	(function() {
531
532		
533		/* Pause player on Iframe videos */
534		$( 'a.iframebox, .float--videos a, .videos--grid a' ).on( 'click', function(){
535			if ( typeof scamp_player !== 'undefined' && scamp_player != null ) {
536				scamp_player.playerAction( 'pause' );
537			}
538		} );
539
540
541		/* Resonsive videos
542	 	 ------------------------- */
543		if ( $.fn.ResVid ) {
544			$( 'body' ).ResVid();
545		}
546
547		/* Custom Post Navigation
548	 	 ------------------------- */
549		if ( ! $( 'body' ).hasClass( 'wp-ajax-loader' ) && $('.custom-post-nav' ).length ) {
550			
551			$('.custom-post-nav' ).detach().appendTo( 'body' );
552			setTimeout( function() { $('.custom-post-nav' ).addClass( 'is-active' ); },1000 );
553		}
554
555		/* Search
556	 	 ------------------------- */
557	 	$( 'a[href="#show-search"]' ).on( 'click', function(){
558	 		$( '.layer--search' ).addClass( 'is-active is-searching' ).css( 'visibility', 'visible' );
559	 		return false;
560	 	});
561	 	$( '.layer--search .layer--close' ).on( 'click', function(){
562	 		$( '.layer--search' ).removeClass( 'is-active is-searching' ).css( 'visibility', 'visible' );
563	 		setTimeout( function(){
564	 			$( '.layer--search' ).css( 'visibility', 'hidden' );
565	 		}, 300);
566	 	});
567	 	$( '.layer--search #s' ).focusout(function(){
568    		$( '.layer--search' ).removeClass( 'is-focused' );
569		});
570	 	$( '.layer--search #s' ).focusin(function(){
571    		$( '.layer--search' ).addClass( 'is-focused' );
572		});
573
574		$( '.layer--searchform' ).submit(function (e) {
575	 		setTimeout( function(){
576	 			$( '.layer--search' ).css( 'visibility', 'hidden' ).removeClass( 'is-active is-searching' );
577	 			$( '.layer--search #s' ).val( '' );
578	 		}, 800);
579
580		});
581
582		// Waypoints
583		$( '.is-anim .item-anim' ).waypoint( function() {
584
585				if ( $( this ).hasClass( 'is-ready' ) ) return false;
586
587				$( this ).addClass( 'is-ready' );
588		}, {
589			offset : '90%'
590		});
591		
592		// Spotify
593		 $( 'iframe[src*="embed.spotify.com"]' ).each(function() {
594        	$(this).attr( 'width', '100%' );
595    	}); 
596	
597
598	})();
599
600
601	/* Google Maps
602	 ---------------------------------------------------------------------- */
603	(function() {
604		if ( $.fn.gmap3 ) {
605
606			$( '.gmap' ).each( function(){
607
608				// Get Marker
609				var marker = '';
610				if ( theme_vars.map_marker !== '' ) {
611					marker = theme_vars.map_marker;
612				} else {
613					marker = theme_vars.theme_uri + '/images/map-marker.png';
614				}
615
616				var 
617					gmap = $( this ),
618					address = gmap.data( 'address' ), // Google map address e.g 'Level 13, 2 Elizabeth St, Melbourne Victoria 3000 Australia'
619					zoom = gmap.data( 'zoom' ), // Map zoom value. Default: 16
620					zoom_control, // Use map zoom. Default: true
621					scrollwheel; // Enable mouse scroll whell for map zooming: Default: false
622
623				if ( gmap.data( 'zoom_control' ) == 'true' ) {
624					zoom_control = true;
625				} else {
626					zoom_control = false;
627				}
628
629				if ( gmap.data( 'scrollwheel' ) == 'true' ) {
630					scrollwheel = true;
631				} else {
632					scrollwheel = false;
633				}
634
635				gmap.gmap3({
636						address: address,
637						zoom: zoom,
638						zoomControl: zoom_control, // Use map zoom. Default: true
639						scrollwheel: scrollwheel, // Enable mouse scroll whell for map zooming: Default: false
640						mapTypeId : google.maps.MapTypeId.ROADMAP,
641						mapTypeControlOptions: {
642				          mapTypeIds: [google.maps.MapTypeId.ROADMAP, "style1"]
643				        },
644				        styles: [
645						    {
646						        "featureType": "all",
647						        "elementType": "labels.text.fill",
648						        "stylers": [
649						            {
650						                "saturation": 36
651						            },
652						            {
653						                "color": "#696969"
654						            },
655						            {
656						                "lightness": 40
657						            }
658						        ]
659						    },
660						    {
661						        "featureType": "all",
662						        "elementType": "labels.text.stroke",
663						        "stylers": [
664						            {
665						                "visibility": "on"
666						            },
667						            {
668						                "color": "#000000"
669						            },
670						            {
671						                "lightness": 16
672						            }
673						        ]
674						    },
675						    {
676						        "featureType": "all",
677						        "elementType": "labels.icon",
678						        "stylers": [
679						            {
680						                "visibility": "off"
681						            }
682						        ]
683						    },
684						    {
685						        "featureType": "administrative",
686						        "elementType": "geometry.fill",
687						        "stylers": [
688						            {
689						                "color": "#000000"
690						            },
691						            {
692						                "lightness": 20
693						            }
694						        ]
695						    },
696						    {
697						        "featureType": "administrative",
698						        "elementType": "geometry.stroke",
699						        "stylers": [
700						            {
701						                "color": "#000000"
702						            },
703						            {
704						                "lightness": 17
705						            },
706						            {
707						                "weight": 1.2
708						            }
709						        ]
710						    },
711						    {
712						        "featureType": "landscape",
713						        "elementType": "geometry",
714						        "stylers": [
715						            {
716						                "color": "#000000"
717						            },
718						            {
719						                "lightness": 20
720						            }
721						        ]
722						    },
723						    {
724						        "featureType": "landscape",
725						        "elementType": "labels.text",
726						        "stylers": [
727						            {
728						                "lightness": "-8"
729						            }
730						        ]
731						    },
732						    {
733						        "featureType": "landscape",
734						        "elementType": "labels.text.fill",
735						        "stylers": [
736						            {
737						                "visibility": "on"
738						            },
739						            {
740						                "gamma": "1.60"
741						            }
742						        ]
743						    },
744						    {
745						        "featureType": "poi",
746						        "elementType": "geometry",
747						        "stylers": [
748						            {
749						                "color": "#000000"
750						            },
751						            {
752						                "lightness": 21
753						            }
754						        ]
755						    },
756						    {
757						        "featureType": "road.highway",
758						        "elementType": "geometry.fill",
759						        "stylers": [
760						            {
761						                "color": "#2f2f2f"
762						            },
763						            {
764						                "lightness": 17
765						            }
766						        ]
767						    },
768						    {
769						        "featureType": "road.highway",
770						        "elementType": "geometry.stroke",
771						        "stylers": [
772						            {
773						                "color": "#000000"
774						            },
775						            {
776						                "lightness": 29
777						            },
778						            {
779						                "weight": 0.2
780						            }
781						        ]
782						    },
783						    {
784						        "featureType": "road.arterial",
785						        "elementType": "geometry",
786						        "stylers": [
787						            {
788						                "color": "#1f1f1f"
789						            },
790						            {
791						                "lightness": 18
792						            }
793						        ]
794						    },
795						    {
796						        "featureType": "road.local",
797						        "elementType": "geometry",
798						        "stylers": [
799						            {
800						                "color": "#323232"
801						            },
802						            {
803						                "lightness": 16
804						            }
805						        ]
806						    },
807						    {
808						        "featureType": "transit",
809						        "elementType": "geometry",
810						        "stylers": [
811						            {
812						                "color": "#000000"
813						            },
814						            {
815						                "lightness": 19
816						            }
817						        ]
818						    },
819						    {
820						        "featureType": "water",
821						        "elementType": "geometry",
822						        "stylers": [
823						            {
824						                "color": "#000000"
825						            },
826						            {
827						                "lightness": "12"
828						            }
829						        ]
830						    }
831						]
832					}).marker({
833						address: address,
834				        icon: marker
835				});
836
837
838			});
839
840		}
841	})();
842
843
844	/* Magnific popup
845 	 ---------------------------------------------------------------------- */
846	(function() {
847	 
848	 	// Image
849		$( '.imagebox' ).magnificPopup( { 
850			type:'image',
851			closeMarkup: '<a href="#" class="mfp-close"></a>',
852		} );
853		// iframe
854		$( 'body' ).magnificPopup( { 
855			delegate: '.iframebox',
856			type:'iframe',
857			iframe: {
858		    	markup: '<div class="mfp-iframe-scaler">'+
859		                '<div class="mfp-close"></div>'+
860		                '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
861		                '<div class="mfp-title">Some caption</div>'+
862		              '</div>'
863		  	},
864		  	callbacks: {
865		    	markupParse: function(template, values, item) {
866		     		values.title = item.el.attr('title');
867
868		    	}
869		  	},
870
871			closeMarkup: '<a href="#" class="mfp-close"></a>',
872		} );
873		$( '.vclightbox .vc_figure a' ).magnificPopup( { 
874			type:'image', 
875			closeMarkup: '<a href="#" class="mfp-close"></a>',
876		} );
877		$( '.vcvideobox .vc_single_image-wrapper' ).magnificPopup( { 
878			type:'iframe', 
879			closeMarkup: '<a href="#" class="mfp-close"></a>',
880		} );
881		// WP Gallery
882		$( '.gallery' ).each(function() {
883
884			var gallery = $( this ),
885				id = $( this ).attr( 'id' ),
886				attachment_id = false;
887			if ( $( 'a[href*="attachment_id"]', gallery ).length ) {
888				return false;
889			}
890			$( 'a[href*="uploads"]', gallery ).each( function(){
891				$( this ).attr( 'data-group', id );
892				$( this ).addClass( 'thumb' );
893				if ( $( this ).parents( '.gallery-item' ).find( '.gallery-caption' ).length ) {
894					var caption = $( this ).parents( '.gallery-item' ).find( '.gallery-caption' ).text();
895					$( this ).attr( 'title', caption );
896				}	
897
898			});
899
900			$( this ).magnificPopup({
901				delegate: 'a',
902				closeMarkup: '<a href="#" class="mfp-close"></a>',
903		        type: 'image',
904		        fixedBgPos: true,
905		        gallery: {
906		          	arrowMarkup: '<a href="#" class="mfp-arrow mfp-arrow-%dir%"></a>',
907	          		enabled:true
908		        }
909		    });
910
911		});
912
913		// Theme Gallery
914		$( '.images--grid' ).magnificPopup({
915			delegate: 'a.g-item',
916			closeMarkup: '<a href="#" class="mfp-close"></a>',
917	        type: 'image',
918	        image: {
919				verticalFit: true,
920			},
921			callbacks: {
922			    elementParse: function( item ) {
923
924					if ( item.el.hasClass( 'iframe-link' ) ) {
925						item.type = 'iframe';
926					} else {
927						item.type = 'image';
928					}
929
930			    }
931			},
932	        gallery: {
933	        	arrowMarkup: '<a href="#" class="mfp-arrow mfp-arrow-%dir%"></a>',
934	          	enabled:true
935	        }
936	    });
937
938
939		var title = '';
940		var src_content = '';
941		$( '.news-more' ).magnificPopup({
942			type: 'inline',
943			callbacks: {
944				beforeOpen: function() {
945					title = JSON.parse(this.st.el.attr('data-title'));
946					src_content = JSON.parse(this.st.el.attr('data-content'));
947				},
948				elementParse: function(item) {
949					item.src = '<div class="white-popup"><h5>'+title+'</h5><br />'+src_content+'</div>';
950				},
951				beforeClose: function() {
952					title = '';
953					src_content = '';
954				}
955			},
956			closeMarkup: '<a href="#" class="mfp-close"></a>',
957		});
958
959
960	})();
961
962});

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.