PageSourceSearch

https://limerickwriterscentre.com/wp-content/themes/ecologie/theme…/js/jquery.isotope.mode.js?ver=1.0.0

js limerickwriterscentre.com collected 2026-10-02 12:58:07 UTC 26,981 bytes, 955 lines download raw bytes

1/**
2 * @package 	WordPress
3 * @subpackage 	Ecologie
4 * @version		1.0.0
5 * 
6 * Modes & Functions for jQuery Isotope Plugin
7 * Created by CMSMasters
8 * 
9 */
10
11
12"use strict";
13
14/* iLightbox Settings */
15var ilightbox_settings = { 
16	skin : 					cmsmasters_isotope_mode.ilightbox_skin, 
17	path : 					cmsmasters_isotope_mode.ilightbox_path, 
18	infinite : 				(cmsmasters_isotope_mode.ilightbox_infinite == '1') ? true : false, 
19	keepAspectRatio : 		(cmsmasters_isotope_mode.ilightbox_aspect_ratio == '1') ? true : false, 
20	mobileOptimizer : 		(cmsmasters_isotope_mode.ilightbox_mobile_optimizer == '1') ? true : false, 
21	maxScale : 				Number(cmsmasters_isotope_mode.ilightbox_max_scale), 
22	minScale : 				Number(cmsmasters_isotope_mode.ilightbox_min_scale), 
23	innerToolbar : 			(cmsmasters_isotope_mode.ilightbox_inner_toolbar == '1') ? true : false, 
24	smartRecognition : 		(cmsmasters_isotope_mode.ilightbox_mobile_optimizer == '1') ? true : false, 
25	fullAlone : 			(cmsmasters_isotope_mode.ilightbox_fullscreen_one_slide == '1') ? true : false, 
26	fullViewPort : 			cmsmasters_isotope_mode.ilightbox_fullscreen_viewport, 
27	controls : { 
28		toolbar : 			(cmsmasters_isotope_mode.ilightbox_controls_toolbar == '1') ? true : false, 
29		arrows : 			(cmsmasters_isotope_mode.ilightbox_controls_arrows == '1') ? true : false, 
30		fullscreen : 		(cmsmasters_isotope_mode.ilightbox_controls_fullscreen == '1') ? true : false, 
31		thumbnail : 		(cmsmasters_isotope_mode.ilightbox_controls_thumbnail == '1') ? true : false, 
32		keyboard : 			(cmsmasters_isotope_mode.ilightbox_controls_keyboard == '1') ? true : false, 
33		mousewheel : 		(cmsmasters_isotope_mode.ilightbox_controls_mousewheel == '1') ? true : false, 
34		swipe : 			(cmsmasters_isotope_mode.ilightbox_controls_swipe == '1') ? true : false, 
35		slideshow : 		(cmsmasters_isotope_mode.ilightbox_controls_slideshow == '1') ? true : false 
36	}, 
37	text : { 
38		close : 			cmsmasters_isotope_mode.ilightbox_close_text, 
39		enterFullscreen : 	cmsmasters_isotope_mode.ilightbox_enter_fullscreen_text, 
40		exitFullscreen : 	cmsmasters_isotope_mode.ilightbox_exit_fullscreen_text, 
41		slideShow : 		cmsmasters_isotope_mode.ilightbox_slideshow_text, 
42		next : 				cmsmasters_isotope_mode.ilightbox_next_text, 
43		previous : 			cmsmasters_isotope_mode.ilightbox_previous_text 
44	}, 
45	errors : { 
46		loadImage : 		cmsmasters_isotope_mode.ilightbox_load_image_error, 
47		loadContents : 		cmsmasters_isotope_mode.ilightbox_load_contents_error, 
48		missingPlugin : 	cmsmasters_isotope_mode.ilightbox_missing_plugin_error 
49	} 
50};
51
52
53
54/* Isotope Timeline Layout Mode */
55(function(window, factory) {
56	factory(window.Isotope.LayoutMode);
57} (window, function factory(LayoutMode) {
58	'use strict';
59	
60	
61	var Timeline = LayoutMode.create('Timeline'), 
62		proto = Timeline.prototype;
63	
64	
65	proto._resetLayout = function () { 
66		this.Timeline = { 
67			colA : 0, 
68			colB : 0, 
69			arrayLeft : [], 
70			arrayRight : [], 
71			postMargin : 40, 
72			dateHeight : 110 
73		};
74	};
75	
76	
77	proto._getItemLayoutPosition = function (item) {
78		item.getSize();
79		
80		
81		var props = 	this.Timeline, 
82			centerX = 	Math.round(this.isotope.size.innerWidth / 2), 
83			isColA = 	props.colA <= props.colB, 
84			x = 		isColA ? 
85							centerX - item.size.outerWidth : // left side 
86							centerX, // right side 
87			yCache = 	isColA ? props.colA : props.colB, 
88			y = 		yCache, 
89			minMargin = props.postMargin;
90		
91		
92		if (isColA) {
93			jQuery(item.element).addClass('cmsmasters_timeline_left');
94			jQuery(item.element).removeClass('cmsmasters_timeline_right');
95			
96			
97			if (props.arrayRight.length > 0) {
98				for (var i = 0, il = props.arrayRight.length; i < il; i += 1) {
99					if (y < props.arrayRight[i] + props.dateHeight) {
100						minMargin = props.dateHeight;
101						
102						
103						y = props.arrayRight[i] + minMargin;
104					} else {
105						y = yCache + minMargin;
106					}
107				}
108			}
109			
110			
111			props.arrayLeft.push(y);
112		} else {
113			jQuery(item.element).addClass('cmsmasters_timeline_right');
114			jQuery(item.element).removeClass('cmsmasters_timeline_left');
115			
116			
117			if (props.arrayLeft.length > 0) {
118				for (var j = 0, jl = props.arrayLeft.length; j < jl; j += 1) {
119					if (y < props.arrayLeft[j] + props.dateHeight) {
120						minMargin = props.dateHeight;
121						
122						
123						y = props.arrayLeft[j] + minMargin;
124					} else {
125						y = yCache + minMargin;
126					}
127				}
128			}
129			
130			
131			props.arrayRight.push(y);
132		}
133		
134		
135		props[(isColA ? 'colA' : 'colB')] = item.size.outerHeight + y;
136		
137		
138		var position = {
139			x: x,
140			y: y
141		};
142		
143		
144		return position;
145	};
146	
147	
148	proto._getContainerSize = function () { 
149		var size = {};
150		
151		
152		size.height = this.Timeline[(this.Timeline.colB > this.Timeline.colA ? 'colB' : 'colA')];
153		
154		
155		return size;
156	};
157
158
159	return Timeline;
160}));
161
162
163
164
165
166/* ========== Isotope Run ========== */
167
168/* Filter Button Click Function */
169jQuery('.cmsmasters_items_filter_but').on('click', function () { 
170	var filter_block = jQuery(this).closest('.cmsmasters_items_filter_block'), 
171		filter_list = filter_block.find('.cmsmasters_items_filter_list');
172	
173	if (jQuery(this).hasClass('current')) {
174		jQuery(this).removeClass('current');
175		
176		filter_list.hide(300);
177	} else {
178		jQuery(this).addClass('current');
179		
180		filter_list.show(300);
181	}
182} );
183
184
185/* Get Columns Width Function */
186function getNumbColumns(container) { 
187	var containerWidth = container.width(), 
188		firstPost = container.find('> article:eq(0), .cmsmasters_gallery_item:eq(0)'), 
189		postMinWidth = Number(firstPost.css('minWidth').replace('px', '')), 
190		maxColumnNumb = Math.floor(containerWidth / postMinWidth), 
191		columnNumb = 1, 
192		layoutGrid = false;
193	
194	
195	if (
196		container.parent().data('layoutMode') === 'perfect' || 
197		container.parent().data('layoutMode') === 'grid' || 
198		container.parent().data('type') === 'grid' 
199	) {
200		layoutGrid = true;
201	}
202	
203	
204	maxColumnNumb = (maxColumnNumb !== 0) ? maxColumnNumb : 1;
205	
206	
207	if (container.hasClass('cmsmasters_5')) {
208		columnNumb = 5;
209	} else if (container.hasClass('cmsmasters_4')) {
210		columnNumb = 4;
211	} else if (container.hasClass('cmsmasters_3')) {
212		columnNumb = 3;
213	} else if (container.hasClass('cmsmasters_2')) {
214		columnNumb = 2;
215	}
216	
217	
218	if (maxColumnNumb < columnNumb) {
219		if (layoutGrid && columnNumb == 4 && maxColumnNumb == 3) {
220			columnNumb = 2;
221		} else if (layoutGrid && columnNumb == 3 && maxColumnNumb == 2) {
222			columnNumb = 1;
223		} else {
224			columnNumb = maxColumnNumb;
225		}
226	}
227	
228	
229	return columnNumb;
230}
231
232
233
234/* Set Columns Width Function */
235function setColumnWidth(container) { 
236	var containerWidth = container.width(), 
237		columnNumb = getNumbColumns(container), 
238		postWidth = Math.floor(containerWidth / columnNumb) - 1;
239	
240	
241	container.find('> article, .cmsmasters_gallery_item').each(function () { 
242		jQuery(this).css( { 
243			width : postWidth + 'px' 
244		} );
245	} );
246}
247
248
249
250/* Rearrange Posts Function */
251function reArrangePosts(blog, blogColumns) { 
252	if (blogColumns) {
253		setColumnWidth(blog);
254	}
255	
256	
257	blog.isotope('layout');
258}
259
260
261
262/* Set Puzzle Columns Width Function */
263function setPuzzleColumnWidth(container) { 
264	var containerWidth = container.width(), 
265		firstPost = container.find('> article:eq(0)'), 
266		postMinWidth = Number(firstPost.css('minWidth').replace('px', '')), 
267		postPaddingLeft = Number(firstPost.css('paddingLeft').replace('px', '')), 
268		postPaddingRight = Number(firstPost.css('paddingRight').replace('px', '')), 
269		postStaticWidth = Math.floor(containerWidth / 4), 
270		postStaticHeight = Math.floor((postStaticWidth / 100) * (cmsmasters_isotope_mode.project_puzzle_proportion * 100)/* preloader padding bottom in % */), 
271		postStaticPadding = Math.floor(((postPaddingLeft + postPaddingRight) / 100) * (cmsmasters_isotope_mode.project_puzzle_proportion * 100)/* preloader padding bottom in % */), 
272		postWidth = postStaticWidth, 
273		postHeight = postStaticHeight;
274	
275	
276	if (containerWidth < postMinWidth * 4) {
277		container.addClass('resp_portfolio_puzzle');
278	} else {
279		container.removeClass('resp_portfolio_puzzle');
280	}
281	
282	
283	container.find('article.project').each(function () { 
284		if (jQuery(this).hasClass('four_x_four')) {
285			postWidth = postStaticWidth * 4;
286			postHeight = (postStaticHeight * 4) - postStaticPadding;
287		} else if (jQuery(this).hasClass('three_x_three')) {
288			if (containerWidth > postMinWidth * 4) {
289				postWidth = postStaticWidth * 3;
290				postHeight = (postStaticHeight * 3) - postStaticPadding;
291			} else if (containerWidth > postMinWidth * 2) {
292				postWidth = postStaticWidth * 2;
293				postHeight = (postStaticHeight * 2) - postStaticPadding;
294			} else {
295				postWidth = postStaticWidth * 4;
296				postHeight = (postStaticHeight * 4) - postStaticPadding;
297			}
298		} else if (jQuery(this).hasClass('three_x_two')) {
299			if (containerWidth > postMinWidth * 4) {
300				postWidth = postStaticWidth * 3;
301				postHeight = (postStaticHeight * 2) - postStaticPadding;
302			} else if (containerWidth > postMinWidth * 2) {
303				postWidth = postStaticWidth * 2;
304				postHeight = Math.floor((postStaticHeight * 4) / 3) - postStaticPadding;
305			} else {
306				postWidth = postStaticWidth * 4;
307				postHeight = Math.floor((postStaticHeight * 8) / 3) - postStaticPadding;
308			}
309		} else if (jQuery(this).hasClass('three_x_one')) {
310			if (containerWidth > postMinWidth * 4) {
311				postWidth = postStaticWidth * 3;
312				postHeight = postStaticHeight - postStaticPadding;
313			} else if (containerWidth > postMinWidth * 2) {
314				postWidth = postStaticWidth * 2;
315				postHeight = Math.floor((postStaticHeight * 2) / 3) - postStaticPadding;
316			} else {
317				postWidth = postStaticWidth * 4;
318				postHeight = Math.floor((postStaticHeight * 4) / 3) - postStaticPadding;
319			}
320		} else if (jQuery(this).hasClass('two_x_three')) {
321			if (containerWidth > postMinWidth * 2) {
322				postWidth = postStaticWidth * 2;
323				postHeight = (postStaticHeight * 3) - postStaticPadding;
324			} else {
325				postWidth = postStaticWidth * 4;
326				postHeight = (postStaticHeight * 6) - postStaticPadding;
327			}
328		} else if (jQuery(this).hasClass('two_x_two')) {
329			if (containerWidth > postMinWidth * 2) {
330				postWidth = postStaticWidth * 2;
331				postHeight = (postStaticHeight * 2) - postStaticPadding;
332			} else {
333				postWidth = postStaticWidth * 4;
334				postHeight = (postStaticHeight * 4) - postStaticPadding;
335			}
336		} else if (jQuery(this).hasClass('two_x_one')) {
337			if (containerWidth > postMinWidth * 2) {
338				postWidth = postStaticWidth * 2;
339				postHeight = postStaticHeight - postStaticPadding;
340			} else {
341				postWidth = postStaticWidth * 4;
342				postHeight = (postStaticHeight * 2) - postStaticPadding;
343			}
344		} else if (jQuery(this).hasClass('one_x_three')) {
345			if (containerWidth > postMinWidth * 4) {
346				postWidth = postStaticWidth;
347				postHeight = (postStaticHeight * 3) - postStaticPadding;
348			} else if (containerWidth > postMinWidth * 2) {
349				postWidth = postStaticWidth * 2;
350				postHeight = (postStaticHeight * 6) - postStaticPadding;
351			} else {
352				postWidth = postStaticWidth * 4;
353				postHeight = (postStaticHeight * 12) - postStaticPadding;
354			}
355		} else if (jQuery(this).hasClass('one_x_two')) {
356			if (containerWidth > postMinWidth * 4) {
357				postWidth = postStaticWidth;
358				postHeight = (postStaticHeight * 2) - postStaticPadding;
359			} else if (containerWidth > postMinWidth * 2) {
360				postWidth = postStaticWidth * 2;
361				postHeight = (postStaticHeight * 4) - postStaticPadding;
362			} else {
363				postWidth = postStaticWidth * 4;
364				postHeight = (postStaticHeight * 8) - postStaticPadding;
365			}
366		} else if (jQuery(this).hasClass('one_x_one')) {
367			if (containerWidth > postMinWidth * 4) {
368				postWidth = postStaticWidth;
369				postHeight = postStaticHeight - postStaticPadding;
370			} else if (containerWidth > postMinWidth * 2) {
371				postWidth = postStaticWidth * 2;
372				postHeight = (postStaticHeight * 2) - postStaticPadding;
373			} else {
374				postWidth = postStaticWidth * 4;
375				postHeight = (postStaticHeight * 4) - postStaticPadding;
376			}
377		}
378		
379		
380		jQuery(this).css( { 
381			width : postWidth + 'px' 
382		} );
383		
384		
385		jQuery(this).find('.project_outer').css( { 
386			height : postHeight + 'px' 
387		} );
388		
389		
390		jQuery(this).find('.preloader').css( { 
391			paddingBottom : postHeight + 'px' 
392		} );
393		
394		
395		jQuery(this).find('.cmsmasters_img_rollover').css( { 
396			paddingBottom : jQuery(this).find('.project_inner').outerHeight() + 'px' 
397		} );
398	} );
399}
400
401
402
403/* Rearrange Projects Function */
404function reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle) { 
405	if (portfolioGrid) {
406		setColumnWidth(portfolio);
407	} else if (portfolioPuzzle) {
408		setPuzzleColumnWidth(portfolio);
409	}
410	
411	
412	portfolio.isotope('layout');
413}
414
415
416
417/* Start Blog Isotope Function */
418function startBlog(id, layout, layoutMode, url, orderby, order, count, categories, metadata) { 
419	var blogContainer = 	jQuery(id), 
420		blog = 				blogContainer.find('> .blog'), 
421		blogColumns = 		(layout === 'columns') ? true : false;
422	
423	
424	if (blogContainer.find('article').length == 0) {
425		return false;
426	}
427	
428	
429	if (blogColumns) {
430		setColumnWidth(blog);
431	}
432	
433	
434	jQuery(window).load(function () { 
435		blog.isotope( { 
436			itemSelector : 	'article.post' 
437		} );
438		
439		
440		if (!blog.hasClass('isotope')) {
441			blog.addClass('isotope');
442		}
443		
444		
445		if (layout === 'columns' && (layoutMode === 'grid' || layoutMode === 'puzzle')) {
446			blog.isotope( { 
447				layoutMode : 	'fitRows', 
448				resizable : 	false 
449			} );
450		} else if (layout === 'columns' && layoutMode === 'masonry') {
451			blog.isotope( { 
452				layoutMode : 	'masonry', 
453				resizable : 	true 
454			} );
455		} else if (layout === 'timeline') {
456			blog.isotope( { 
457				layoutMode : 	'Timeline', 
458				resizable : 	true 
459			} );
460		}
461	} );
462	
463	
464	blogContainer.find('.cmsmasters_post_filter_block .cmsmasters_post_filter_list a').on('click', function () { 
465		var filter = 			jQuery(this), 
466			filterSelector = 	filter.attr('data-filter');
467		
468		
469		filter.parent().parent().find('> li.current').removeClass('current');
470		
471		
472		filter.parent().addClass('current');
473		
474		
475		blog.isotope( { 
476			filter : 	filterSelector 
477		} );
478		
479		
480		setTimeout(function () { 
481			reArrangePosts(blog, blogColumns);
482		}, 300);
483		
484		
485		return false;
486	} );
487	
488	
489	blogContainer.find('.cmsmasters_post_loader').on('click', function () { 
490		blogContainer.find('.cmsmasters_wrap_more_items').addClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideUp('fast');
491		
492		jQuery.ajax( { 
493			type : 		'POST', 
494			dataType : 	'html', 
495			url : 		url + 'inc/post/posts-loader.php', 
496			data : { 
497				layout : 		layout, 
498				layoutmode: 	layoutMode, 
499				orderby : 		orderby, 
500				order : 		order, 
501				count : 		count, 
502				categories : 	categories, 
503				metadata : 		metadata, 
504				offset : 		blog.find('.post').length 
505			}, 
506			success : function (data) { 
507				if (data !== '') {
508					var newHTML = jQuery(data.replace(/cmsmasters_post_timeline/g, 'cmsmasters_post_timeline shortcode_animated').replace(/cmsmasters_post_masonry/g, 'cmsmasters_post_masonry shortcode_animated')), 
509						lightboxVars = [];
510					
511					
512					if (data.slice(0, 6) === 'finish') {
513						newHTML = jQuery(data.replace(/cmsmasters_post_timeline/g, 'cmsmasters_post_timeline shortcode_animated').replace(/cmsmasters_post_masonry/g, 'cmsmasters_post_masonry shortcode_animated').slice(6, -1));
514						
515						
516						blogContainer.find('.cmsmasters_wrap_more_items').hide();
517					} else {
518						blogContainer.find('.cmsmasters_wrap_more_items').removeClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideDown('fast');
519					}
520					
521					
522					newHTML.find('a[rel^="ilightbox["]').each(function () { 
523						if (jQuery.inArray(jQuery(this).attr('rel'), lightboxVars) === -1) {
524							lightboxVars.push(jQuery(this).attr('rel'));
525						}
526					} );
527					
528					
529					newHTML.imagesLoaded(function () { 
530						blogContainer.find('.blog').isotope('insert', newHTML);
531						
532						
533						setTimeout(function () { 
534							jQuery('body').trigger('debouncedresize');
535							
536							
537							reArrangePosts(blog, blogColumns);
538							
539							
540							var settings = {};
541							
542							
543							if (typeof _wpmejsSettings !== 'undefined') {
544								settings.pluginPath = _wpmejsSettings.pluginPath;
545							}
546							
547							
548							jQuery('.wp-audio-shortcode, .wp-video-shortcode').filter(':not(.mejs-container)').mediaelementplayer(settings);
549							
550							
551							for (var i = 0, il = lightboxVars.length; i < il; i += 1) { 
552								blogContainer.find('a[rel="' + lightboxVars[i] + '"]').iLightBox(ilightbox_settings);
553							}
554						}, 300);
555					} );
556				}
557			} 
558		} );
559		
560		
561		return false;
562	} );
563
564
565	jQuery(window).on('debouncedresize', function () { 
566		reArrangePosts(blog, blogColumns);
567	} );
568}
569
570
571
572/* Start Portfolio Isotope Function */
573function startPortfolio(id, layout, layoutMode, url, orderby, order, count, categories, metadata) { 
574	var portfolioContainer = 	jQuery(id), 
575		portfolio = 			portfolioContainer.find('> .portfolio'), 
576		portfolioGrid = 		(layout === 'grid') ? true : false, 
577		portfolioPuzzle = 		(layout === 'puzzle') ? true : false;
578	
579	
580	if (portfolioContainer.find('article').length == 0) {
581		return false;
582	}
583	
584	
585	if (portfolioGrid) {
586		setColumnWidth(portfolio);
587	} else if (portfolioPuzzle) {
588		setPuzzleColumnWidth(portfolio);
589	}
590	
591	
592	jQuery(window).load(function () { 
593		if (!portfolio.hasClass('isotope')) {
594			portfolio.addClass('isotope');
595		}
596		
597		
598		if (portfolioGrid) {
599			portfolio.isotope( { 
600				itemSelector : 	'article.project', 
601				getSortData : { 
602					project_name : function (el) { 
603						return jQuery(el).find('.entry-title > a').text();
604					}, 
605					project_date : function (el) { 
606						return parseInt(jQuery(el).find('.meta-date').text());
607					} 
608				} 
609			} );
610			
611			
612			if (layoutMode === 'perfect') {
613				portfolio.isotope( { 
614					layoutMode : 	'fitRows', 
615					resizable : 	false 
616				} );
617			} else if (layoutMode === 'masonry') {
618				portfolio.isotope( { 
619					layoutMode : 	'masonry', 
620					resizable : 	true 
621				} );
622			}
623		} else if (portfolioPuzzle) {
624			portfolio.isotope( { 
625				itemSelector : 	'article.project', 
626				layoutMode : 	'masonry', 
627				resizable : 	false, 
628				masonry : { 
629					columnWidth : Math.floor(portfolio.width() / 4) 
630				}
631			} );
632		}
633		
634		
635		if ( 
636			!checker.os.iphone && 
637			!checker.os.ipod && 
638			!checker.os.ipad && 
639			!checker.os.blackberry && 
640			!checker.os.android 
641		) {
642			portfolio.waypoint(function (dir) { 
643				if (dir === 'down') {
644					var el = 		jQuery(this), 
645						items = 	el.find('article.project'), 
646						delay = 	200, 
647						i = 		1;
648					
649					
650					items.each(function () { 
651						var item = 	jQuery(this);
652						
653						
654						setTimeout(function () { 
655							item.addClass('shortcode_animated');
656						}, delay * i);
657						
658						
659						i += 1;
660					} );
661				}
662			}, { 
663				offset : 		'100%' 
664			} ).waypoint(function (dir) { 
665				if (dir === 'up') {
666					var el = 		jQuery(this), 
667						items = 	el.find('article.project'), 
668						delay = 	200, 
669						i = 		1;
670					
671					
672					items.each(function () { 
673						var item = 	jQuery(this);
674						
675						
676						setTimeout(function () { 
677							item.addClass('shortcode_animated');
678						}, delay * i);
679						
680						
681						i += 1;
682					} );
683				}
684			}, { 
685				offset : 		'25%' 
686			} );
687		} else {
688			portfolio.find('article.project').addClass('shortcode_animated');
689		}
690		
691		
692		setTimeout(function () { 
693			reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle);
694		}, 300);
695	} );
696	
697	
698	portfolioContainer.find('.cmsmasters_project_filter_block .cmsmasters_project_filter_list a').on('click', function () { 
699		var filter = 			jQuery(this), 
700			filterSelector = 	filter.attr('data-filter');
701		
702		
703		filter.parent().parent().find('> li.current').removeClass('current');
704		
705		
706		filter.parent().addClass('current');
707		
708		
709		portfolio.isotope( { 
710			filter : 	filterSelector 
711		} );
712		
713		
714		setTimeout(function () { 
715			reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle);
716		}, 300);
717		
718		
719		return false;
720	} );
721	
722	
723	portfolioContainer.find('.cmsmasters_project_sort_block .cmsmasters_project_sort_but').on('click', function () { 
724		var type = jQuery(this).attr('name'), 
725			asc = (type === 'project_name') ? true : false, 
726			current = (jQuery(this).hasClass('current')) ? true : false, 
727			reversed = (jQuery(this).hasClass('reversed')) ? true : false;
728		
729		
730		if (current) { 
731			if (reversed) { 
732				jQuery(this).removeClass('reversed');
733				
734				asc = true;
735			} else { 
736				jQuery(this).addClass('reversed');
737				
738				asc = false;
739			}
740		} else { 
741			jQuery(this).parent().find('.current').removeClass('current');
742			
743			jQuery(this).parent().find('.reversed').removeClass('reversed');
744			
745			
746			if (type === 'project_name') { 
747				jQuery(this).addClass('current');
748			} else { 
749				jQuery(this).addClass('current reversed');
750			}
751		}
752		
753		
754		portfolio.isotope( { 
755			sortBy : type, 
756			sortAscending : asc 
757		} );
758		
759		
760		setTimeout(function () { 
761			reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle);
762		}, 300);
763		
764		
765		return false;
766	} );
767	
768	
769	portfolioContainer.find('.cmsmasters_project_loader').on('click', function () { 
770		portfolioContainer.find('.cmsmasters_wrap_more_items').addClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideUp('fast');
771		
772		jQuery.ajax( { 
773			type : 		'POST', 
774			dataType : 	'html', 
775			url : 		url + 'inc/project/projects-loader.php', 
776			data : { 
777				layout : 		layout, 
778				layoutmode: 	layoutMode, 
779				orderby : 		orderby, 
780				order : 		order, 
781				count : 		count, 
782				categories : 	categories, 
783				metadata : 		metadata, 
784				offset : 		portfolio.find('.project').length 
785			}, 
786			success : 	function (data) { 
787				if (data !== '') {
788					var newHTML = jQuery(data.replace(/type-project/g, 'type-project shortcode_animated')), 
789						lightboxVars = [];
790					
791					
792					if (data.slice(0, 6) === 'finish') {
793						newHTML = jQuery(data.replace(/type-project/g, 'type-project shortcode_animated').slice(6, -1));
794						
795						
796						portfolioContainer.find('.cmsmasters_wrap_more_items').hide();
797					} else {
798						portfolioContainer.find('.cmsmasters_wrap_more_items').removeClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideDown('fast');
799					}
800					
801					
802					newHTML.find('a[rel^="ilightbox["]').each(function () { 
803						if (jQuery.inArray(jQuery(this).attr('rel'), lightboxVars) === -1) {
804							lightboxVars.push(jQuery(this).attr('rel'));
805						}
806					} );
807					
808					
809					newHTML.imagesLoaded(function () { 
810						portfolioContainer.find('.portfolio').isotope('insert', newHTML);
811						
812						
813						setTimeout(function () { 
814							reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle);
815							
816							
817							var settings = {};
818							
819							
820							if (typeof _wpmejsSettings !== 'undefined') {
821								settings.pluginPath = _wpmejsSettings.pluginPath;
822							}
823							
824							
825							jQuery('.wp-audio-shortcode, .wp-video-shortcode').filter(':not(.mejs-container)').mediaelementplayer(settings);
826							
827							
828							for (var i = 0, il = lightboxVars.length; i < il; i += 1) { 
829								portfolioContainer.find('a[rel="' + lightboxVars[i] + '"]').iLightBox(ilightbox_settings);
830							}
831						}, 300);
832					} );
833				}
834			} 
835		} );
836		
837		
838		return false;
839	} );
840
841
842	jQuery(window).on('debouncedresize', function () { 
843		reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle);
844		
845		
846		if (portfolioPuzzle) {
847			portfolio.isotope( { 
848				masonry : { 
849					columnWidth : Math.floor(portfolio.width() / 4) 
850				}
851			} );
852		}
853	} );
854}
855
856
857
858/* Start Gallery Isotope Function */
859function startGallery(id, gallery_type, gallery_count) { 
860	var galleryContainer = 	jQuery(id), 
861		gallery = 			galleryContainer.find('> .cmsmasters_gallery'), 
862		gallery_hidden =	galleryContainer.find('> .cmsmasters_hidden_gallery'), 
863		gallery_count = 	gallery_count, 
864		gallery_arr = 		[], 
865		gallery_items = 	'', 
866		gallery_rel = 		'', 
867		ilightbox_run = 	'';
868	
869	
870	if (galleryContainer.find('.cmsmasters_gallery_item').length == 0) {
871		return false;
872	}
873	
874	
875	gallery_hidden.find('.cmsmasters_gallery_item').each(function () {
876		gallery_arr.push(this);
877	} );
878	
879	
880	setColumnWidth(gallery);
881	
882	
883	jQuery(window).load(function () { 
884		gallery.isotope( { 
885			itemSelector : 	'.cmsmasters_gallery_item' 
886		} );
887		
888		
889		if (!gallery.hasClass('isotope')) {
890			gallery.addClass('isotope');
891		}
892		
893		
894		if (gallery_type === 'grid') {
895			gallery.isotope( { 
896				layoutMode : 	'fitRows', 
897				resizable : 	false 
898			} );
899		} else if (gallery_type === 'masonry') {
900			gallery.isotope( { 
901				layoutMode : 	'masonry', 
902				resizable : 	true 
903			} );
904		}
905	} );
906	
907	
908	ilightbox_run = gallery.find('[rel^="ilightbox["]').iLightBox(ilightbox_settings);
909	
910	gallery_rel = gallery.find('[rel^="ilightbox["]').attr('rel');
911	
912	if (gallery_arr.length > 0) {
913		galleryContainer.find('.cmsmasters_gallery_items_loader').on('click', function () {
914			galleryContainer.find('.cmsmasters_wrap_more_items').addClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideUp('fast');
915			
916			gallery_items = gallery_arr.splice(0, gallery_count);
917			
918			
919			jQuery(gallery_items).each(function () {
920				gallery.isotope('insert', jQuery(this));
921				
922				
923				jQuery(this).addClass('shortcode_animated');
924				
925				
926				if (gallery_rel !== undefined) {
927					jQuery(this).find('a').attr('rel', gallery_rel);
928				}
929				
930				
931				jQuery(this).imagesLoaded(function () {
932					reArrangePosts(gallery, true);
933				} );
934			} );
935			
936			
937			ilightbox_run.destroy();
938			
939			ilightbox_run = gallery.find('[rel^="ilightbox["]').iLightBox(ilightbox_settings);
940			
941			
942			if (gallery_arr.length == 0) {
943				galleryContainer.find('.cmsmasters_wrap_more_items').hide();
944			} else {
945				galleryContainer.find('.cmsmasters_wrap_more_items').removeClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideDown('fast');
946 			}
947		} );
948	}
949	
950	
951	jQuery(window).on('debouncedresize', function () { 
952		reArrangePosts(gallery, true);
953	} );
954}
955

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.