PageSourceSearch

https://rcht.org/wp-content/themes/dispatch-premium/premium/js/hoot.theme.premium.js?ver=4.12.1

js rcht.org collected 2026-10-02 21:02:24 UTC 5,992 bytes, 150 lines download raw bytes

1jQuery(document).ready(function($) {
2	"use strict";
3
4	/*** Lightbox ***/
5
6	if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightbox || 'enable' == hootData.lightbox ) {
7		if (typeof $.fn.lightGallery != 'undefined') {
8
9			// Add lightbox to Images
10			if ( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightboxImg || 'enable' == hootData.lightboxImg ) {
11
12				$('.woocommerce .entry.product > .images a').addClass('no-lightbox'); // Remove lightbox from woocommerce images, and let woo's lightbox take over
13				$('a[href]').filter(function() {
14					var href = $(this).attr('href'),
15						islb = href.match(/\.(jpg|gif|png|webp)\/?(\?+[^\s]*)*$/);
16					if ( !islb ) islb = /\/\/(?:www\.)?youtu(?:\.be\/|be\.com\/(?:watch\?v=|embed\/)+)/i.test(href);
17					if ( !islb ) islb = /\/\/(?:www\.)?vimeo.com\/(\d+)(?:\/[0-9a-z]+)?/i.test(href);
18					if ( !islb ) islb = /\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i.test(href);
19					if ( !islb ) islb =  /\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i.test(href);
20					return islb;
21					}).each(function(i){
22					var self    = $(this),
23						href    = self.attr('href'),
24						caption = '',
25						child   = self.children('img'),
26						alt     = self.attr('data-alt'),
27						title   = self.attr('title');
28					if ( !title ) title = self.attr('data-title');
29					if ( !title ) title = child.attr('data-title');
30					if ( !alt ) alt = child.attr('alt');
31
32					self.attr('data-src', href).attr('data-lightbox','yes');
33					if(title)   caption += '<h4>'+title+'</h4>';
34					if(alt)     caption += '<p>'+alt+'</p>';
35					if(caption) caption = '<div class="customHtml">'+caption+'</div>';
36					if(caption) self.attr('data-sub-html', caption);
37
38					// Add lightbox if this is not a WordPress Gallery image, not a Jetpack Tiled Gallery or explicitly told not to use lightbox
39					if(
40						!self.parent('.gallery-icon').length &&
41						!self.parent('.tiled-gallery-item').length &&
42						!self.is('.no-lightbox') &&
43						!(self.closest('.lightGallery').length) &&
44						!(self.closest('.wp-block-gallery').length)
45					) {
46						$(self.parent()).addClass('apply-lightbox');
47					}
48				});
49				$('.apply-lightbox').lightGallery({
50					selector : "a[data-lightbox='yes']" // this
51				});
52
53			}
54
55			// Add lightbox to WordPress Gallery and Jetpack Tiled Gallery
56			if ( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightboxWpGal || 'enable' == hootData.lightboxWpGal ) {
57				$(".gallery").each(function(i){
58					var galID = $(this).attr('id');
59					$(this).lightGallery({
60						selector : "#"+galID+" .gallery-icon > a[href$='.jpg'], #"+galID+" .gallery-icon > a[href$='.png'], #"+galID+" .gallery-icon > a[href$='.jpeg'], #"+galID+" .gallery-icon > a[href$='.gif'], #"+galID+" .gallery-icon > a[href$='.webp']"
61					});
62				});
63				$(".wp-block-gallery").each(function(i){
64					var galID = 'hoot-block-gallery-' + i;
65					$(this).addClass( galID );
66					$(this).lightGallery({
67						selector : "."+galID+" figure > a[href$='.jpg'], ."+galID+" figure > a[href$='.png'], ."+galID+" figure > a[href$='.jpeg'], ."+galID+" figure > a[href$='.gif'], ."+galID+" figure > a[href$='.webp']"
68					});
69				});
70				$(".tiled-gallery").each(function(i){
71					var galID = 'hoot-tiled-gallery-' + i;
72					$(this).addClass( galID );
73					$(this).lightGallery({
74						selector : "."+galID+" .tiled-gallery-item > a[href$='.jpg'], ."+galID+" .tiled-gallery-item > a[href$='.png'], ."+galID+" .tiled-gallery-item > a[href$='.jpeg'], ."+galID+" .tiled-gallery-item > a[href$='.gif'], ."+galID+" .tiled-gallery-item > a[href$='.webp']"
75					});
76				});
77			}
78
79		}
80	}
81
82	/*** LightGallery (for brevity) ***/
83
84	if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.lightGallery || 'enable' == hootData.lightGallery ) {
85		if (typeof $.fn.lightGallery != 'undefined') {
86			$(".lightGallery").lightGallery({
87				selector : 'a'
88			});
89		}
90	}
91
92	/*** Isotope for Archive Mosaic Type ***/
93
94	if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.isotope || 'enable' == hootData.isotope ) {
95		if (typeof $.fn.isotope != 'undefined') {
96			var $mosaic = $(".archive-mosaic").first().parent(),
97				mosaic_relayout = function() { $mosaic.isotope( 'layout' ); };
98			$mosaic.isotope({
99				itemSelector: '.archive-mosaic'
100			});
101			//$(window).load(function() { $mosaic.isotope( 'layout' ); });
102			$(window).load(mosaic_relayout); // bug fix for cases when images are without width/height atts
103		}
104	}
105
106	/*** Shortcodes ***/
107
108	/* Toggles */
109	if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.scToggle || 'enable' == hootData.scToggle ) {
110		$('.shortcode-toggle-head').click( function() {
111			$( this ).siblings( '.shortcode-toggle-box' ).slideToggle( 'fast' );
112			$( this ).toggleClass( 'shortcode-toggle-active' );
113			$( this ).children( 'i' ).toggleClass( 'fa-plus fa-minus' );
114		});
115	}
116
117	/* Tabset */
118	if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.scTabset || 'enable' == hootData.scTabset ) {
119		$('.shortcode-tabset').each(function(i){
120			var self    = $(this),
121				nav     = self.find('.shortcode-tabset-nav > li'),
122				box     = self.children('.shortcode-tabset-box'),
123				tabs    = box.children('div');
124
125			nav.click( function() {
126				var navself = $(this),
127					tabid   = navself.data('tab'),
128					tabself = tabs.filter('[data-tab="'+tabid+'"]');
129
130				tabs.removeClass('current');
131				tabself.addClass('current');
132				nav.removeClass('current');
133				navself.addClass('current');
134			});
135		});
136	}
137
138	/* Scroller (Divider) */
139	if( 'undefined' == typeof hootData || 'undefined' == typeof hootData.scScroller || 'enable' == hootData.scScroller ) {
140		$('.shortcode-divider > a').on('click', function(e) {
141			e.preventDefault();
142			var target = $(this).attr('href');
143			var destin = $(target).offset().top;
144			if( target != '#page-wrapper')
145				destin -= 50;
146			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destin}, 500 );
147		});
148	}
149
150});

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.