PageSourceSearch

https://www.buildingstack.com/wp-content/plugins/responsive-lightbox/js/front.js

js buildingstack.com collected 2026-10-01 15:49:52 UTC 26,538 bytes, 793 lines download raw bytes

1( function ( $ ) {
2
3	// parse query string
4	var parse_str = function( name, str ) {
5		var regex = new RegExp( '[?&]' + name.replace( /[\[\]]/g, '\\$&' ) + '(=([^&#]*)|&|#|$)' ),
6			results = regex.exec( '&' + str );
7
8		return ( ! results || ! results[2] ? '' : decodeURIComponent( results[2].replace( /\+/g, ' ' ) ) );
9	}
10
11	// observe DOM changes
12	var observe_script_dom = ( function () {
13		var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
14			eventListenerSupported = window.addEventListener;
15
16		return function ( obj, only_added, callback ) {
17			if ( MutationObserver ) {
18				// define a new observer
19				var obs = new MutationObserver( function ( mutations, observer ) {
20					if ( only_added ) {
21						if ( mutations[0].addedNodes.length )
22							callback();
23					} else {
24						if ( mutations[0].addedNodes.length || mutations[0].removedNodes.length )
25							callback();
26					}
27				} );
28
29				// have the observer observe for changes in children
30				obs.observe( obj, { childList: true, subtree: true } );
31			} else if ( eventListenerSupported ) {
32				obj.addEventListener( 'DOMNodeInserted', callback, false );
33
34				if ( !only_added ) {
35					obj.addEventListener( 'DOMNodeRemoved', callback, false );
36				}
37			}
38		}
39	} )();
40
41	// ready event handler
42	$( document ).on( 'ready' + rlArgs.customEvents, function () {
43		var containers = [];
44
45		// check for infinite galleries
46		$( '.rl-gallery-container' ).each( function() {
47			var container = $( this );
48
49			// is it ifinite scroll gallery?
50			if ( container.hasClass( 'rl-pagination-infinite' ) ) {
51				containers.push( container );
52			} else {
53				// remove loading class
54				container.removeClass( 'rl-loading' );
55			}
56		} );
57
58		// any infinite galleries?
59		if ( containers.length > 0 ) {
60			for ( var i = 0; i < containers.length; i++ ) {
61				var container = containers[i],
62					gallery = container.find( '.rl-gallery' ),
63					gallery_id = parseInt( container.data( 'gallery_id' ) ),
64					gallery_scroll_type = container.find( '.rl-pagination-bottom' ).data( 'button' ),
65					gallery_button = typeof gallery_scroll_type !== 'undefined' && gallery_scroll_type === 'manually';
66
67				// initialize infinite scroll
68				gallery.infiniteScroll( {
69					path: '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-pagination-bottom .next',
70					append: '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-gallery-item' + ( gallery.hasClass( 'rl-masonry-gallery' ) || gallery.hasClass( 'rl-basicmasonry-gallery' ) ? '-no-append' : '' ),
71					status: false,
72					hideNav: '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-pagination-bottom',
73					prefill: ! gallery_button,
74					loadOnScroll: true,
75					scrollThreshold: gallery_button ? false : 0,
76					button: gallery_button ? '.rl-gallery-container[data-gallery_id="' + gallery_id + '"] .rl-load-more' : false,
77					debug: false,
78					history: false,
79					onInit: function() {
80						// infinite with button?
81						if ( container.hasClass( 'rl-pagination-infinite' ) && gallery_button ) {
82							// remove loading class
83							container.removeClass( 'rl-loading' );
84						}
85
86						// store gallery ID for append event
87						var _gallery_id = gallery_id;
88
89						// request event
90						this.on( 'request', function( path ) {
91							// add loading class
92							container.addClass( 'rl-loading' );
93						} );
94
95						// append event
96						this.on( 'append', function ( response, path, items ) {
97							// remove loading class
98							container.removeClass( 'rl-loading' );
99
100							$.event.trigger( {
101								type: 'doResponsiveLightbox',
102								script: rlArgs.script,
103								selector: rlArgs.selector,
104								args: rlArgs,
105								pagination_type: 'infinite',
106								gallery_id: _gallery_id,
107								masonry: gallery.hasClass( 'rl-masonry-gallery' ) || gallery.hasClass( 'rl-basicmasonry-gallery' ),
108								infinite: {
109									gallery: gallery,
110									response: response,
111									items: items
112								}
113							} );
114						} );
115					}
116				} );
117			}
118		}
119
120		// initialize event
121		$.event.trigger( {
122			type: 'doResponsiveLightbox',
123			script: rlArgs.script,
124			selector: rlArgs.selector,
125			args: rlArgs
126		} );
127	} );
128
129	// pagination
130	$( document ).on( 'click', '.rl-pagination a.page-numbers', function ( e ) {
131		var link = $( this ),
132			container = link.closest( '.rl-gallery-container' );
133
134		// ajax type pagination?
135		if ( container.hasClass( 'rl-pagination-ajax' ) ) {
136			e.preventDefault();
137			e.stopPropagation();
138
139			var gallery_id = container.data( 'gallery_id' );
140
141			// add loading class
142			container.addClass( 'rl-loading' );
143
144			$.post( rlArgs.ajaxurl, {
145				action: 'rl-get-gallery-page-content',
146				gallery_id: gallery_id,
147				page: parse_str( 'rl_page', link.prop( 'href' ) ),
148				nonce: rlArgs.nonce
149			} ).done( function ( response ) {
150				// replace container with new content
151				container.replaceWith( $( response ).removeClass( 'rl-loading' ) );
152
153				// trigger main event
154				$.event.trigger( {
155					type: 'doResponsiveLightbox',
156					script: rlArgs.script,
157					selector: rlArgs.selector,
158					args: rlArgs,
159					pagination_type: 'ajax',
160					gallery_id: gallery_id
161				} );
162			} ).fail( function () {
163				container.removeClass( 'rl-loading' );
164			} );
165
166			return false;
167		}
168	} );
169
170	// this is similar to the WP function add_action();
171	$( document ).on( 'doResponsiveLightbox', function ( event ) {
172		if ( typeof event.masonry !== 'undefined' && event.masonry === true ) {
173			return false;
174		}
175
176		var script = event.script,
177			selector = event.selector,
178			args = event.args;
179
180		if ( typeof script === 'undefined' || typeof selector === 'undefined' ) {
181			return false;
182		}
183
184		rl_view_image = function ( script, url ) {
185			$.event.trigger( {
186				type: 'doLightboxViewImage',
187				script: script,
188				url: url
189			} );
190		}
191
192		rl_hide_image = function ( script, url ) {
193			$.event.trigger( {
194				type: 'doLightboxHideImage',
195				script: script,
196				url: url
197			} );
198		}
199
200		// WooCommerce 3.0+ compatibility
201		setTimeout( function () {
202			var flex = $( '.flex-viewport' );
203
204			if ( args.woocommerce_gallery === '1' && flex.length ) {
205				$( '.zoomImg' ).css( 'cursor', 'pointer' );
206
207				$( document ).on( 'click', '.flex-active-slide .zoomImg', function ( e ) {
208					e.preventDefault();
209					e.stopPropagation();
210
211					flex.find( '.flex-active-slide a[data-rel]' ).trigger( 'click' );
212				} );
213			}
214		}, 10 );
215
216		// init lightbox
217		switch ( script ) {
218			case 'swipebox':
219				var slide = $( '#swipebox-overlay' ).find( '.slide.current' ),
220					image_source = '',
221					allow_hide = false,
222					close_executed = false;
223
224				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).swipebox( {
225					useCSS: ( args.animation === '1' ? true : false ),
226					useSVG: ( args.useSVG === '1' ? true : false ),
227					hideCloseButtonOnMobile: ( args.hideCloseButtonOnMobile === '1' ? true : false ),
228					removeBarsOnMobile: ( args.removeBarsOnMobile === '1' ? true : false ),
229					hideBarsDelay: ( args.hideBars === '1' ? parseInt( args.hideBarsDelay ) : 0 ),
230					videoMaxWidth: parseInt( args.videoMaxWidth ),
231					loopAtEnd: ( args.loopAtEnd === '1' ? true : false ),
232					afterOpen: function () {
233						close_executed = false;
234
235						// update current slide container
236						slide = $( '#swipebox-overlay' ).find( '.slide.current' );
237
238						// get image source
239						var image = slide.find( 'img' ).attr( 'src' );
240
241						// valid image source?
242						if ( typeof image !== 'undefined' ) {
243							image_source = image;
244
245							// trigger image view
246							rl_view_image( script, image_source );
247						} else {
248							image_source = '';
249						}
250
251						// add current slide observer
252						observe_script_dom( document.getElementById( 'swipebox-slider' ), false, function () {
253							if ( image_source === '' ) {
254								// get image source
255								var image = slide.find( 'img' ).attr( 'src' );
256
257								// valid image source?
258								if ( typeof image !== 'undefined' ) {
259									image_source = image;
260
261									// trigger image view
262									rl_view_image( script, image_source );
263								} else {
264									image_source = '';
265								}
266							}
267						} );
268					},
269					nextSlide: function () {
270						// update current slide container
271						slide = $( '#swipebox-overlay' ).find( '.slide.current' );
272
273						// get image source
274						var image = slide.find( 'img' ).attr( 'src' );
275
276						// valid image source?
277						if ( typeof image !== 'undefined' ) {
278							image_source = image;
279
280							// trigger image view
281							rl_view_image( script, image_source );
282						} else {
283							image_source = '';
284						}
285					},
286					prevSlide: function () {
287						// update current slide container
288						slide = $( '#swipebox-overlay' ).find( '.slide.current' );
289
290						// get image source
291						var image = slide.find( 'img' ).attr( 'src' );
292
293						// valid image source?
294						if ( typeof image !== 'undefined' ) {
295							image_source = image;
296
297							// trigger image view
298							rl_view_image( script, image_source );
299						} else {
300							image_source = '';
301						}
302					},
303					afterClose: function () {
304						// afterClose event executed
305						close_executed = true;
306
307						// allow to hide image?
308						if ( allow_hide ) {
309							// trigger image hide
310							rl_hide_image( script, image_source );
311
312							allow_hide = false;
313						}
314					}
315				} );
316
317				// additional event to prevent rl_hide_image to execure while opening modal
318				$( window ).on( 'resize', function () {
319					if ( !close_executed ) {
320						allow_hide = true;
321					}
322				} );
323				break;
324
325			case 'prettyphoto':
326				var view_disabled = false,
327					last_image = '';
328
329				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function () {
330					var el = $( this );
331
332					// set description
333					el.attr( 'title', el.data( 'rl_caption' ) );
334
335					// set title
336					el.find( 'img' ).attr( 'alt', el.data( 'rl_title' ) );
337				} );
338
339				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).prettyPhoto( {
340					hook: 'data-rel',
341					animation_speed: args.animationSpeed,
342					slideshow: ( args.slideshow === '1' ? parseInt( args.slideshowDelay ) : false ),
343					autoplay_slideshow: ( args.slideshowAutoplay === '1' ? true : false ),
344					opacity: args.opacity,
345					show_title: ( args.showTitle === '1' ? true : false ),
346					allow_resize: ( args.allowResize === '1' ? true : false ),
347					allow_expand: ( args.allowExpand === '1' ? true : false ),
348					default_width: parseInt( args.width ),
349					default_height: parseInt( args.height ),
350					counter_separator_label: args.separator,
351					theme: args.theme,
352					horizontal_padding: parseInt( args.horizontalPadding ),
353					hideflash: ( args.hideFlash === '1' ? true : false ),
354					wmode: args.wmode,
355					autoplay: ( args.videoAutoplay === '1' ? true : false ),
356					modal: ( args.modal === '1' ? true : false ),
357					deeplinking: ( args.deeplinking === '1' ? true : false ),
358					overlay_gallery: ( args.overlayGallery === '1' ? true : false ),
359					keyboard_shortcuts: ( args.keyboardShortcuts === '1' ? true : false ),
360					social_tools: ( args.social === '1' ? '<div class="pp_social"><div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href=' + location.href + '&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>' : '' ),
361					ie6_fallback: true,
362					changepicturecallback: function () {
363						// is view disabled?
364						if ( view_disabled ) {
365							// enable view
366							view_disabled = false;
367
368							return;
369						}
370
371						last_image = $( '#pp_full_res' ).find( 'img' ).attr( 'src' );
372
373						// trigger image view
374						rl_view_image( script, last_image );
375
376						// is expanding allowed?
377						if ( args.allowExpand === '1' ) {
378							// disable changepicturecallback event after expanding
379							$( 'a.pp_expand' ).on( 'click', function () {
380								view_disabled = true;
381							} );
382						}
383					},
384					callback: function () {
385						// trigger image hide
386						rl_hide_image( script, last_image );
387					}
388				} );
389				break;
390
391			case 'fancybox':
392				var last_image = '';
393
394				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).fancybox( {
395					modal: ( args.modal === '1' ? true : false ),
396					overlayShow: ( args.showOverlay === '1' ? true : false ),
397					showCloseButton: ( args.showCloseButton === '1' ? true : false ),
398					enableEscapeButton: ( args.enableEscapeButton === '1' ? true : false ),
399					hideOnOverlayClick: ( args.hideOnOverlayClick === '1' ? true : false ),
400					hideOnContentClick: ( args.hideOnContentClick === '1' ? true : false ),
401					cyclic: ( args.cyclic === '1' ? true : false ),
402					showNavArrows: ( args.showNavArrows === '1' ? true : false ),
403					autoScale: ( args.autoScale === '1' ? true : false ),
404					scrolling: args.scrolling,
405					centerOnScroll: ( args.centerOnScroll === '1' ? true : false ),
406					opacity: ( args.opacity === '1' ? true : false ),
407					overlayOpacity: parseFloat( args.overlayOpacity / 100 ),
408					overlayColor: args.overlayColor,
409					titleShow: ( args.titleShow === '1' ? true : false ),
410					titlePosition: args.titlePosition,
411					transitionIn: args.transitions,
412					transitionOut: args.transitions,
413					easingIn: args.easings,
414					easingOut: args.easings,
415					speedIn: parseInt( args.speeds ),
416					speedOut: parseInt( args.speeds ),
417					changeSpeed: parseInt( args.changeSpeed ),
418					changeFade: parseInt( args.changeFade ),
419					padding: parseInt( args.padding ),
420					margin: parseInt( args.margin ),
421					width: parseInt( args.videoWidth ),
422					height: parseInt( args.videoHeight ),
423					onComplete: function () {
424						last_image = $( '#fancybox-content' ).find( 'img' ).attr( 'src' );
425
426						// trigger image view
427						rl_view_image( script, last_image );
428					},
429					onClosed: function () {
430						// trigger image hide
431						rl_hide_image( script, last_image );
432					}
433				} );
434
435				break;
436
437			case 'nivo':
438				$.each( $( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ), function () {
439					var attr = $( this ).attr( 'data-rel' );
440
441					// check data-rel attribute first
442					if ( typeof attr === 'undefined' || attr == false ) {
443						// if not found then try to check rel attribute for backward compatibility
444						attr = $( this ).attr( 'rel' );
445					}
446
447					// for some browsers, `attr` is undefined; for others, `attr` is false. Check for both.
448					if ( typeof attr !== 'undefined' && attr !== false ) {
449						var match = attr.match( new RegExp( selector + '\\-(gallery\\-(?:[\\da-z]{1,4}))', 'ig' ) );
450
451						if ( match !== null ) {
452							$( this ).attr( 'data-lightbox-gallery', match[0] );
453						}
454					}
455
456				} );
457
458				var observer_initialized = false,
459					change_allowed = true,
460					last_image = '';
461
462				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).nivoLightbox( {
463					effect: args.effect,
464					clickOverlayToClose: ( args.clickOverlayToClose === '1' ? true : false ),
465					keyboardNav: ( args.keyboardNav === '1' ? true : false ),
466					errorMessage: args.errorMessage,
467					afterShowLightbox: function ( lightbox ) {
468						var content = $( lightbox )[0].find( '.nivo-lightbox-content' );
469
470						// is observer initialized?
471						if ( !observer_initialized ) {
472							// turn it off
473							observer_initialized = true;
474
475							// add content observer
476							observe_script_dom( document.getElementsByClassName( 'nivo-lightbox-content' )[0], true, function () {
477								if ( change_allowed ) {
478									last_image = content.find( '.nivo-lightbox-image img' ).attr( 'src' );
479
480									// trigger image view
481									rl_view_image( script, last_image );
482
483									// disallow observer changes
484									change_allowed = false;
485								}
486							} );
487						}
488					},
489					afterHideLightbox: function () {
490						// allow observer changes
491						change_allowed = true;
492
493						// trigger image hide
494						rl_hide_image( script, last_image );
495					},
496					onPrev: function ( element ) {
497						// disallow observer changes
498						change_allowed = false;
499
500						last_image = element[0].attr( 'href' );
501
502						// trigger image view
503						rl_view_image( script, last_image );
504					},
505					onNext: function ( element ) {
506						// disallow observer changes
507						change_allowed = false;
508
509						last_image = element[0].attr( 'href' );
510
511						// trigger image view
512						rl_view_image( script, last_image );
513					}
514				} );
515				break;
516
517			case 'imagelightbox':
518				var selectors = [ ],
519					last_image = '';
520
521				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function ( i, item ) {
522					var attr = $( item ).attr( 'data-rel' );
523
524					// check data-rel attribute first
525					if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
526						selectors.push( attr );
527					// if not found then try to check rel attribute for backward compatibility
528					else {
529						attr = $( item ).attr( 'rel' );
530
531						if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
532							selectors.push( attr );
533					}
534				} );
535
536				if ( selectors.length > 0 ) {
537					// make unique
538					selectors = $.unique( selectors );
539
540					$( selectors ).each( function ( i, item ) {
541						if ( typeof event.pagination_type !== 'undefined' ) {
542							$( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).each( function() {
543								$( this ).off( 'click.imageLightbox' );
544							} );
545						}
546
547						$( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).imageLightbox( {
548							animationSpeed: parseInt( args.animationSpeed ),
549							preloadNext: ( args.preloadNext === '1' ? true : false ),
550							enableKeyboard: ( args.enableKeyboard === '1' ? true : false ),
551							quitOnEnd: ( args.quitOnEnd === '1' ? true : false ),
552							quitOnImgClick: ( args.quitOnImageClick === '1' ? true : false ),
553							quitOnDocClick: ( args.quitOnDocumentClick === '1' ? true : false ),
554							onLoadEnd: function () {
555								last_image = $( '#imagelightbox' ).attr( 'src' );
556 
557								// trigger image view
558								rl_view_image( script, last_image );
559							},
560							onEnd: function () {
561								// trigger image hide
562								rl_hide_image( script, last_image );
563							}
564						} );
565					} );
566				}
567				break;
568
569			case 'tosrus':
570				var selectors = [ ],
571					last_image = '';
572
573				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function ( i, item ) {
574					var attr = $( item ).attr( 'data-rel' );
575
576					// check data-rel attribute first
577					if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
578						selectors.push( attr );
579					// if not found then try to check rel attribute for backward compatibility
580					else {
581						attr = $( item ).attr( 'rel' );
582
583						if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
584							selectors.push( attr );
585					}
586				} );
587
588				if ( selectors.length > 0 ) {
589					// make unique
590					selectors = $.unique( selectors );
591
592					$( selectors ).each( function ( i, item ) {
593						if ( typeof event.pagination_type !== 'undefined' ) {
594							$( 'body' ).find( '.tosrus-' + item ).remove();
595
596							$( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).each( function() {
597								$( this ).off( 'click.tos' );
598							} );
599						}
600
601						var tos = $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).tosrus( {
602							infinite: ( args.infinite === '1' ? true : false ),
603							autoplay: {
604								play: ( args.autoplay === '1' ? true : false ),
605								pauseOnHover: ( args.pauseOnHover === '1' ? true : false ),
606								timeout: args.timeout
607							},
608							effect: args.effect,
609							keys: {
610								prev: ( args.keys === '1' ? true : false ),
611								next: ( args.keys === '1' ? true : false ),
612								close: ( args.keys === '1' ? true : false )
613							},
614							pagination: {
615								add: ( args.pagination === '1' ? true : false ),
616								type: args.paginationType
617							},
618							// forced
619							show: false,
620							buttons: true,
621							caption: {
622								add: true,
623								attributes: [ "title" ]
624							},
625							wrapper: {
626								classes: 'tosrus-' + item,
627								onClick: args.closeOnClick === '1' ? 'close' : 'toggleUI'
628							}
629						} );
630
631						tos.bind( 'sliding.tos', function ( event, number ) {
632							last_image = $( $( event.target ).find( '.tos-slider .tos-slide' )[number] ).find( 'img' ).attr( 'src' );
633
634							// trigger image view
635							rl_view_image( script, last_image );
636						} );
637
638						tos.bind( 'closing.tos', function () {
639							// trigger image hide
640							rl_hide_image( script, last_image );
641						} );
642					} );
643				}
644				break;
645
646			case 'featherlight':
647				var selectors = [ ],
648					last_image = '';
649
650				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function ( i, item ) {
651					var attr = $( item ).attr( 'data-rel' );
652
653					// check data-rel attribute first
654					if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
655						selectors.push( attr );
656					// if not found then try to check rel attribute for backward compatibility
657					else {
658						attr = $( item ).attr( 'rel' );
659
660						if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
661							selectors.push( attr );
662					}
663				} );
664
665				if ( selectors.length > 0 ) {
666					// make unique
667					selectors = $.unique( selectors );
668
669					// set defaults
670					$.extend( $.featherlight.defaults, {
671						openSpeed: parseInt( args.openSpeed ),
672						closeSpeed: parseInt( args.closeSpeed ),
673						closeOnClick: args.closeOnClick,
674						closeOnEsc: ( args.closeOnEsc === '1' ? true : false ),
675						afterOpen: function ( event ) {
676							last_image = event.currentTarget.href;
677
678							// trigger image view
679							rl_view_image( script, last_image );
680						},
681						afterClose: function () {
682							// trigger image hide
683							rl_hide_image( script, last_image );
684						}
685					} );
686
687					$( selectors ).each( function ( i, item ) {
688						if ( typeof event.pagination_type !== 'undefined' ) {
689							$( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).each( function() {
690								$( this ).off( 'click.featherlight' );
691							} );
692						}
693
694						// gallery?
695						if ( /-gallery-/.test( item ) ) {
696							$( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlightGallery( {
697								galleryFadeIn: parseInt( args.galleryFadeIn ),
698								galleryFadeOut: parseInt( args.galleryFadeOut ),
699								previousIcon: '&#10094;',
700								nextIcon: '&#10095;'
701							} );
702						// video?
703						} else if ( /-video-/.test( item ) ) {
704							$( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight();
705						// single image?
706						} else {
707							$( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ).featherlight();
708						}
709					} );
710
711				}
712				break;
713
714			case 'magnific':
715				var selectors = [ ],
716					last_image = '';
717
718				$( 'a[rel*="' + selector + '"], a[data-rel*="' + selector + '"]' ).each( function ( i, item ) {
719					var attr = $( item ).attr( 'data-rel' );
720
721					// check data-rel attribute first
722					if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
723						selectors.push( attr );
724					// if not found then try to check rel attribute for backward compatibility
725					else {
726						attr = $( item ).attr( 'rel' );
727
728						if ( typeof attr !== 'undefined' && attr !== false && attr !== 'norl' )
729							selectors.push( attr );
730					}
731				} );
732
733				if ( selectors.length > 0 ) {
734					// make unique
735					selectors = $.unique( selectors );
736
737					$( selectors ).each( function ( i, item ) {
738						var subselector = $( 'a[data-rel="' + item + '"], a[rel="' + item + '"]' ),
739							element = $( subselector[0] ),
740							media_type = element.data( 'magnific_type' ),
741							content_type = element.data( 'rl_content' );
742
743						// check content type first
744						if ( typeof content_type !== 'undefined' ) {
745							media_type = content_type;
746						}
747
748						// then media type if needed
749						if ( typeof media_type === 'undefined' ) {
750							media_type = 'image';
751						}
752
753						subselector.magnificPopup( {
754							type: media_type === 'gallery' ? 'image' : ( media_type === 'video' ? 'iframe' : media_type ),
755							disableOn: args.disableOn,
756							midClick: args.midClick === '1',
757							preloader: args.preloader === '1',
758							closeOnContentClick: args.closeOnContentClick === '1',
759							closeOnBgClick: args.closeOnBgClick === '1',
760							closeBtnInside: args.closeBtnInside === '1',
761							showCloseBtn: args.showCloseBtn === '1',
762							enableEscapeKey: args.enableEscapeKey === '1',
763							alignTop: args.alignTop === '1',
764							autoFocusLast: args.autoFocusLast === '1',
765							fixedContentPos: args.fixedContentPos === 'auto' ? 'auto' : ( args.fixedContentPos === '1' ),
766							fixedBgPos: args.fixedBgPos === 'auto' ? 'auto' : ( args.fixedBgPos === '1' ),
767							image: {
768								titleSrc: function ( item ) {
769									return item.el.attr( 'data-rl_title' ) + '<small>' + item.el.attr( 'data-rl_caption' ) + '</small>';
770								}
771							},
772							gallery: {
773								enabled: subselector.length > 1 && media_type === 'gallery',
774								navigateByImgClick: true,
775								preload: [0,1]
776							},
777							callbacks: {
778								close: function() {
779									rl_hide_image( script, this.currItem.src );
780								},
781								imageLoadComplete: function() {
782									// trigger image view
783									rl_view_image( script, this.currItem.src );
784								}
785							}
786						} );
787					} );
788				}
789				break;
790		}
791	} );
792
793} )( 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.