PageSourceSearch

https://www.ashcroftassociates.ca/wp-content/plugins/divi-plus/inc…/dipl-teamgrid-custom.min.js?ver=1.0.4

js ashcroftassociates.ca collected 2026-10-08 09:34:27 UTC 15,018 bytes, 401 lines download raw bytes

1(function( $ ) {
2	$.fn.DiviPlusTeamGridPagination = function( $options = {} ) {
3		let $defaults = {
4				paginationClass: 'dipl_team_grid_pagination',
5				hideOnlyOnePage: true,
6				totalPages: 1,
7				visiblePages: 10,
8				startPage: 1,
9				initiateStartPageClick: false,
10				first: false,
11				last: false,
12				prev: false,
13				next: false,
14			},
15			$pagination = this;
16		
17		$options = $.extend({}, $defaults, $options);
18		$pagination.twbsPagination($options);
19	}
20} ( jQuery ) );
21
22function diplTeamGridGetQueryVars() {
23	let $vars    = {},
24		$hashes  = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'),
25		$hash;
26	
27	for( let i = 0; i < $hashes.length; i++ ) {
28		$hash = $hashes[i].split('=');
29		$vars[$hash[0]] = $hash[1];
30	}
31
32	return $vars;
33}
34
35jQuery(function($) {
36	dipl_calc_overlay_height();
37	
38	/* Module: TeamGrid */
39	if ( $('.dipl_team_grid').find('.dipl_team_link').length > 0 ) {
40		$('body').on( 'click', '.dipl_team_link', function(e) {
41			if ( $(e.target).is( $(this).find('.dipl_team_member_social_icon') ) ) {
42				return;
43			}
44			e.preventDefault();
45			let link    = $(this).data('link'),
46				target  = $(this).data('link_target');
47			window.open( link, target );
48		});
49	}
50
51	// Module: TeamGrid.
52	if ( $('.dipl_team_grid').find('.dipl_team_popup').length > 0 ) {
53		$('body').on( 'click', '.dipl_team_popup', function(e) {
54			if ( $(e.target).is( $(this).find('.dipl_team_member_social_icon') ) ) {
55				return;
56			}
57			e.preventDefault();
58			
59			let $this = $(this).closest('.dipl_team_popup');
60			let $wrap = $this.parents( '.dipl_team_grid_container' );
61			if ( ! $this.hasClass( 'dipl_team_grid_item' ) ) {
62				$this = $this.parents( '.dipl_team_grid_item' );
63			}
64
65			let $globProps           = $wrap.data(),
66				$thisProps           = $this.data(),
67				$position            = $this.data('close_icon_position'),
68				$close_icon_position = 'inside' === $position ? true : false;
69
70			let $props = $.extend( {}, $globProps, $thisProps );
71
72			$this.addClass('dipl_team_lightbox_loader');
73			$.ajax({
74				type: 'POST',  
75				url: DiviPlusTeamGridData.ajaxurl,
76				data: {
77					action: 'dipl_get_teamgrid_page',
78					dipl_team_popup_nonce: DiviPlusTeamGridData.ajaxnonce,
79					props: $props
80				},
81				success: function(response) {
82					let $orderClass = $this.closest('.dipl_team_grid').prop('class').match(/(dipl_team_grid\_[^\s]*)/)[0] + '_lightbox';
83					$this.removeClass('dipl_team_lightbox_loader');
84					$.magnificPopup.open({
85						preloader: true,
86						items: {
87							src: $(response),
88							type: 'inline'
89						},
90						callbacks: {
91							open: function() {
92								if ( $('body').find('.dipl_team_member_lightbox .dipl_skill_bar_wrapper').length > 0 ) {
93									if ( $('.dipl_team_member_lightbox').find('.dipl_filled_bar').length > 0 ) {
94										$('.dipl_team_member_lightbox').find('.dipl_filled_bar').each(function(){
95											let $this = $(this);
96											$this.waypoint({
97												handler: function() {
98													let width = $this.data('percent');
99													$this.css('width', width);
100												},
101												context: $this
102											});
103										});
104									}
105									if ( $('.dipl_team_member_lightbox').find('.dipl_bar_counter_chunks').length > 0 ) {
106										$('.dipl_team_member_lightbox').find('.dipl_bar_counter_filled_chunks').each(function() {
107											let $this = $(this);
108											$this.waypoint({
109												handler: function() {
110													$this.addClass('dipl_animate_filled');
111												},
112												context: $this
113											});
114										});
115									}
116								}
117							},
118						},
119						closeOnContentClick: false,
120						closeBtnInside: $close_icon_position,
121						mainClass: 'dipl_team_member_lightbox ' + $orderClass
122					});
123				},
124				error: function(){
125
126				}
127			});
128		});
129	}
130
131	if ( $('body').find('.dipl_team_grid').length > 0 ) {
132		$('.dipl_team_grid').each(function(){
133			let $this = $(this);
134
135			/* Pagination */
136			if ( $this.find('.dipl_team_grid_pagination_wrapper').length > 0 ) {
137				let $pagination_wrapper = $this.find('.dipl_team_grid_pagination_wrapper'),
138					$pagination         = $pagination_wrapper.find('ul'),
139					$include_categories = $pagination_wrapper.data('include_categories'),
140					$perPage            = isNaN( $pagination_wrapper.data('posts_number') ) || 0 === parseInt( $pagination_wrapper.data('posts_number') ) ? -1 : parseInt( $pagination_wrapper.data('posts_number') ),
141					$totalPages         = isNaN( $pagination_wrapper.data('total_pages') ) || 0 === parseInt( $pagination_wrapper.data('total_pages') ) ? 1 : parseInt( $pagination_wrapper.data('total_pages') ),
142					$options            = {
143						totalPages: $totalPages,
144						onPageClick: function (event, page) {
145							let $props = $pagination_wrapper.data();
146							$props['page'] = page;
147							$this.fadeTo( '100', 0.2 );
148							$.ajax({
149								type: 'POST',  
150								url: DiviPlusTeamGridData.ajaxurl,
151								data: {
152									action: 'dipl_get_team_members', 
153									dipl_get_team_members_nonce: DiviPlusTeamGridData.ajaxnonce,
154									props: $props,
155								},
156								success: function(response) {
157									$this.fadeTo( '100', 1 );
158									if ( response.success ) {
159										$this.find('.dipl_team_grid_items').fadeOut('fast', function(){
160											$(this).html(response.items);
161											$(this).fadeIn('fast', function(){
162												dipl_calc_overlay_height();
163											});
164										});
165									}
166								}
167							});
168
169							let topHeaderHeight     = 0,
170								mainHeaderHeight    = 0,
171								tbHeaderHeight      = 0;
172
173							if ( $('body').find('#top-header').length > 0 && $('body').hasClass('et_fixed_nav') ) {
174								topHeaderHeight = parseFloat( $('#top-header').innerHeight() );
175							}
176							
177							if ( $('body').find('#main-header').length > 0 && $('body').hasClass('et_fixed_nav') ) {
178								mainHeaderHeight = parseFloat( $('#main-header').innerHeight() );
179							}
180
181							if ( $('body').find('.et-l--header').length > 0 && $('body').find('.et-l--header .et_builder_inner_content').hasClass('has_et_pb_sticky') ) {
182								tbHeaderHeight = parseFloat( $('.et-l--header').innerHeight() );
183							}
184
185							let headerHeight = topHeaderHeight + mainHeaderHeight + tbHeaderHeight + 50;
186							$( 'html, body' ).animate({
187								scrollTop: ( $this.offset().top - headerHeight )
188							});
189						}
190					};
191
192				if ( 'on' === $pagination_wrapper.data('show_prev_next') ) {
193					$options.prev = $pagination_wrapper.data('prev_text');
194					$options.next = $pagination_wrapper.data('next_text');
195				}
196
197				$pagination.DiviPlusTeamGridPagination( $options );
198
199				$this.find('.dipl-team-items-categories li').on('click', function() {
200					if ( $(this).hasClass('dipl-team-active-category') ) {
201						return false;
202					}
203
204					$(this).closest('.dipl-team-items-categories').find('li').removeClass('dipl-team-active-category');
205					$(this).addClass('dipl-team-active-category');
206					let $props      = $pagination_wrapper.data(),
207						$category   = $(this).data('id');
208						
209					$props['page'] = 1;
210
211					if ( '' !== $category ) {
212						$props['include_categories']    = $category;
213						$props['tax_query_field']       = 'term_id';
214					} else {
215						$props['include_categories']    = $include_categories;
216						$props['tax_query_field']       = 'term_id';
217					}
218
219					$this.fadeTo( '100', 0.2 );
220					$.ajax({
221						type: 'POST',  
222						url: DiviPlusTeamGridData.ajaxurl,
223						data: {
224							action: 'dipl_get_team_members', 
225							dipl_get_team_members_nonce: DiviPlusTeamGridData.ajaxnonce,
226							props: $props
227						},
228						success: function(response) {
229							$this.fadeTo( '100', 1 );
230							if ( response.success ) {
231								$this.find('.dipl_team_grid_items').fadeOut('fast', function(){
232									$(this).html(response.items);
233									$(this).fadeIn('fast', function(){
234										dipl_calc_overlay_height();
235									});
236								});
237								
238								/* Re-render Pagination */
239								let $perPage    = isNaN( $pagination_wrapper.data('posts_number') ) || 0 === parseInt( $pagination_wrapper.data('posts_number') ) ? -1 : parseInt( $pagination_wrapper.data('posts_number') ),
240									$totalPages = parseInt( response.total_pages ),
241									$options    = {
242										totalPages: $totalPages,
243										onPageClick: function (event, page) {
244											$props['page'] = page;
245											$this.fadeTo( '100', 0.2 );
246											$.ajax({
247												type: 'POST',  
248												url: DiviPlusTeamGridData.ajaxurl,
249												data: {
250													action: 'dipl_get_team_members', 
251													dipl_get_team_members_nonce: DiviPlusTeamGridData.ajaxnonce,
252													props: $props
253												},
254												success: function(response) {
255													$this.fadeTo( '100', 1 );
256													if ( response.success ) {
257														$this.find('.dipl_team_grid_items').fadeOut('fast', function(){
258															$(this).html(response.items);
259															$(this).fadeIn('fast', function(){
260																dipl_calc_overlay_height();
261															});
262														});
263													}
264												}
265											});
266
267											if ( $this.offset().top > 0 ) {
268												let topHeaderHeight     = 0,
269													mainHeaderHeight    = 0,
270													tbHeaderHeight      = 0;
271
272												if ( $('body').find('#top-header').length > 0 && $('body').hasClass('et_fixed_nav') ) {
273													topHeaderHeight = parseFloat( $('#top-header').innerHeight() );
274												}
275												
276												if ( $('body').find('#main-header').length > 0 && $('body').hasClass('et_fixed_nav') ) {
277													mainHeaderHeight = parseFloat( $('#main-header').innerHeight() );
278												}
279
280												if ( $('body').find('.et-l--header').length > 0 && $('body').find('.et-l--header .et_builder_inner_content').hasClass('has_et_pb_sticky') ) {
281													tbHeaderHeight = parseFloat( $('.et-l--header').innerHeight() );
282												}
283
284												let headerHeight = topHeaderHeight + mainHeaderHeight + tbHeaderHeight + 50;
285												$( 'html, body' ).animate({
286													scrollTop: ( $this.offset().top - headerHeight )
287												});
288											}
289										}
290									};
291
292								if ( 'on' === $pagination_wrapper.data('show_prev_next') ) {
293									$options.prev = $pagination_wrapper.data('prev_text');
294									$options.next = $pagination_wrapper.data('next_text');
295								}
296
297								$pagination.twbsPagination('destroy');
298								$pagination.DiviPlusTeamGridPagination( $options );
299							}
300						}
301					});
302				});
303			} else {
304				let $include_categories = $this.find('.dipl-team-items-categories').data('include_categories');
305				$this.find('.dipl-team-items-categories li').on('click', function() {
306					if ( $(this).hasClass('dipl-team-active-category') ) {
307						return false;
308					}
309
310					$(this).closest('.dipl-team-items-categories').find('li').removeClass('dipl-team-active-category');
311					$(this).addClass('dipl-team-active-category');
312
313					let $category = $(this).data('id'),
314						$props = $this.find('.dipl-team-items-categories').data();
315
316					if ( '' !== $category ) {
317						$props['include_categories']    = $category;
318						$props['tax_query_field']       = 'term_id';
319					} else {
320						$props['include_categories']    = $include_categories;
321						$props['tax_query_field']       = 'term_id';
322					}
323
324					$this.fadeTo( '100', 0.2 );
325					$.ajax({
326						type: 'POST',  
327						url: DiviPlusTeamGridData.ajaxurl,
328						data: {
329							action: 'dipl_get_team_members', 
330							dipl_get_team_members_nonce: DiviPlusTeamGridData.ajaxnonce,
331							props: $props
332						},
333						success: function(response) {
334							$this.fadeTo( '100', 1 );
335							if ( response.success ) {
336								$this.find('.dipl_team_grid_items').fadeOut('fast', function(){
337									$(this).html(response.items);
338									$(this).fadeIn('fast', function(){
339										dipl_calc_overlay_height();
340									});
341								});
342							}
343						}
344					});
345				});
346			}
347		});
348	}
349	
350	function dipl_calc_overlay_height() {
351		let $winWidth = parseFloat( $(window).width() );
352
353		if ( $('.dipl_team_grid').find('.layout1').length > 0 ) {
354			$('.dipl_team_grid .layout1').find('.dipl_team_grid_item').each(function(){
355				let $paddingTopDesktop      = parseFloat( $(this).data('padding_top_desktop') ),
356					$paddingTopTablet       = parseFloat( $(this).data('padding_top_tablet') ),
357					$paddingTopPhone        = parseFloat( $(this).data('padding_top_phone') ),
358					$paddingBottomDesktop   = parseFloat( $(this).data('padding_bottom_desktop') ),
359					$paddingBottomTablet    = parseFloat( $(this).data('padding_bottom_tablet') ),
360					$paddingBottomPhone     = parseFloat( $(this).data('padding_bottom_phone') ),
361					$paddingDesktop         = $paddingTopDesktop + $paddingBottomDesktop,
362					$paddingTablet          = $paddingTopTablet + $paddingBottomTablet,
363					$paddingPhone           = $paddingTopPhone + $paddingBottomPhone,
364					$padding                = $winWidth > 980 ? $paddingDesktop : $winWidth < 768 ? $paddingPhone : $paddingTablet,
365					$innerHeight            = $(this).find(".dipl_team_member_visible_wrapper").length > 0 ? parseFloat( $(this).find(".dipl_team_member_visible_wrapper").height() ) : 0,
366					$translate              = $padding + $innerHeight;
367				if ( 0 === $innerHeight ) {
368					$(this).find('.dipl_team_overlay_wrapper').css('transform', 'translateY(100%)');    
369				} else {
370					$(this).find('.dipl_team_overlay_wrapper').css('transform', 'translateY(calc(100% - '+$translate +'px ))');
371				}
372			});
373		}
374
375		 if ( $('.dipl_team_grid').find('.layout2').length > 0 ) {
376			$('.dipl_team_grid .layout2').find('.dipl_team_grid_item').each(function(){
377				let $paddingTopDesktop      = parseFloat( $(this).data('padding_top_desktop') ),
378					$paddingTopTablet       = parseFloat( $(this).data('padding_top_tablet') ),
379					$paddingTopPhone        = parseFloat( $(this).data('padding_top_phone') ),
380					$paddingBottomDesktop   = parseFloat( $(this).data('padding_bottom_desktop') ),
381					$paddingBottomTablet    = parseFloat( $(this).data('padding_bottom_tablet') ),
382					$paddingBottomPhone     = parseFloat( $(this).data('padding_bottom_phone') ),
383					$paddingDesktop         = $paddingTopDesktop + $paddingBottomDesktop,
384					$paddingTablet          = $paddingTopTablet + $paddingBottomTablet,
385					$paddingPhone           = $paddingTopPhone + $paddingBottomPhone,
386					$padding                = $winWidth > 980 ? $paddingDesktop : $winWidth < 768 ? $paddingPhone : $paddingTablet,
387					$innerHeight            = $(this).find(".dipl_team_member_visible_wrapper").length > 0 ? parseFloat( $(this).find(".dipl_team_member_visible_wrapper").height() ) : 0,
388					$translate              = $padding + $innerHeight;
389				if ( 0 === $innerHeight ) {
390					$(this).find('.dipl_team_overlay_wrapper').css('transform', 'translateY(100%)');    
391				} else {
392					$(this).find('.dipl_team_overlay_wrapper').css('transform', 'translateY(calc(100% - '+$translate +'px ))');
393				}
394			} );
395		}
396	}
397
398	$(window).on('resize', function() {
399		dipl_calc_overlay_height();
400	} );
401} );

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.