PageSourceSearch

https://zsjasionka.szkola.pl/skin/pics/js/skinResponsiveScripts.js?v=6cc048

js zsjasionka.szkola.pl collected 2026-09-26 02:46:06 UTC 63,962 bytes, 1,305 lines download raw bytes

1$j(document).ready(function($) {	
2	var edubarMainSkin = null;
3	if (!edubarMainSkin) edubarMainSkin = $('.edubarMainSkin').last();
4	var zoom = edubarMainSkin.hasClass('blindFriendly') ? 2 : 1;
5	var fixedSidebars = null;
6	function initFixedHeaderWidth() {		
7		if (!edubarMainSkin) edubarMainSkin = $('.edubarMainSkin').last();
8		$('.skgd.skgdFixedHeader').each(function() {
9			if ($(this).hasClass('fixed') || $(this).hasClass('forceFixed')) {				
10				var left = $('.edubarMainSkin').first().offset().left/zoom;
11				var right = ($(window).width() - ($('.edubarMainSkin').first().offset().left + $('.edubarMainSkin').first().outerWidth()))/zoom;
12				$(this).css('left',left+'px');
13				$(this).css('right',right+'px');
14			} else {
15				$(this).css('left','0');
16				$(this).css('right','0');
17			}
18		});
19		
20		
21		fixedSidebars = $('.skgd.skgdFixedSidebar').each(function() {
22			if (!edubarMainSkin.hasClass('wmaxL1') || $(this).hasClass('forceFixed')) {				
23				var left = edubarMainSkin.offset().left/zoom;
24				var top = edubarMainSkin.offset().top/zoom;
25				$(this).css('left',left+'px');
26				$(this).css('top',top+'px');
27			} 
28		});
29	}
30	
31	function initResponsiveDivs() {
32		if (!edubarMainSkin) edubarMainSkin = $('.edubarMainSkin').last();
33		var divs = edubarMainSkin; 		
34		var ww = window.innerWidth;
35		
36		divs.toggleClass('nowmaxL',false);
37		if (divs.hasClass('rpwContent')) {
38			divs.toggleClass('wmaxL1', false).toggleClass('wmaxL2',false);
39		} else {
40			divs.toggleClass('wmaxL1', ww<=980 || edubarMainSkin.hasClass('blindFriendly')).toggleClass('wmaxL2', ww<=500 || edubarMainSkin.hasClass('blindFriendly'));		
41		}
42		
43	}
44	
45	function initFixedHeader() {		
46		//if (!edubarMainSkin) edubarMainSkin = $('.edubarMainSkin').last();
47		var fixedHeader = $('.skgd.skgdFixedHeader');	
48		
49		
50		if (fixedHeader.length > 0) {
51			var headerPos =  $('.edubarMainSkin').first().offset().top;			
52			var offset = fixedHeader.offset();		
53			offset.top = offset.top/zoom;
54			offset.left = offset.left/zoom; 
55			var s = '<div class="skgdFixedHeaderReplacement"></div>';
56			fixedHeader.parent().find('.skgdFixedHeaderReplacement').remove();
57			var headerReplacement = $(s).appendTo(fixedHeader.parent());
58			headerReplacement.height(fixedHeader.outerHeight());
59			$(window).off('scroll.skgdFixedHeader').on('scroll.skgdFixedHeader',function() {				
60					
61				
62				var posY = $(window).scrollTop();
63				var isFixed = offset.top < posY+headerPos;
64				
65				
66				if (fixedHeader.hasClass('forceFixed')) isFixed = true;			
67					
68				fixedHeader.toggleClass('fixed',isFixed);
69			
70				fixedHeader.css('top',isFixed ? ((headerPos*(1/zoom))+'px') : '');
71				headerReplacement.toggle(isFixed);
72				initFixedHeaderWidth();
73				if (isFixed) {
74					fixedHeader.find('.skgdSubmenuDiv').css('max-height',(($(window).innerHeight()-fixedHeader.outerHeight()-2)/(zoom))+'px');
75				} else {				
76					fixedHeader.find('.skgdSubmenuDiv').css('max-height','none');
77				}							
78			});
79		}	
80	}
81	function reflowMasonry() {
82		$('.skgdMasonryList').each(function() {
83			var that = this;
84			setTimeout(function() {
85				$(that).css('width','');									
86				$(that).masonry();
87			}, 100);
88		});
89	}
90	
91	function initFullWidthContainers() {
92		if (!edubarMainSkin) edubarMainSkin = $('.edubarMainSkin').last();
93		var pageOffset = $(edubarMainSkin).offset();
94		$('.skgdFullWidthContainer').each(function() {
95			var offset = $(this).offset();			
96			offset.left = pageOffset.left;
97			
98			var w = $(edubarMainSkin).width();
99			if (!edubarMainSkin.hasClass('wmaxL1') && fixedSidebars && fixedSidebars.length > 0) {
100				var fw = fixedSidebars.first().width();
101				w = w - fw;
102				offset.left += fw;
103			}
104			$(this).css('width',w/zoom);
105			$(this).offset(offset);			
106		});
107		if ($('body').attr('data-isLoginSkin') == '1' && $('body').attr('data-m') == 'register') {
108			var elem = $('main.sgmain.maing').first();
109			
110			elem.parents().each(function() {
111				fixMaxW($(this));
112
113			});
114		}
115
116	}
117
118	function fixMaxW(elem) {
119		
120		if (elem.css('padding-top') == '15vh' || parseFloat(elem.css('padding-top').replace('px',''))>=$(window).height()*0.12) {
121			
122			elem.css('padding-top','2vh');
123		}
124		var maxW = elem.css('max-width');
125		if (!maxW || maxW == 'none') return;
126		if (!maxW.endsWith('px')) return;				
127		maxW = parseFloat(maxW.replace('px',''));
128		if (maxW >= 500 && maxW <=700) {
129			elem.css('max-width','1200px');
130			elem.children().each(function() {
131				fixMaxW($(this));
132			})
133		}	
134	}
135		
136	function initElements() {
137		var origW = $(window).width(); 
138		$(window).off('resize.skgdResponsive').on('resize.skgdResponsive',function() {
139			if ($(window).width() == origW) return;		
140			origW = $(window).width()
141			
142			initResponsiveDivs();
143			
144			initFixedHeaderWidth();
145			
146			
147			
148			reflowMasonry();
149			
150			initFullWidthContainers();
151		});
152		
153		
154		$('.skgd.menub').each(function() {
155			if (!$(this).data('responsiveMenuSkinGadget')) {
156				$(this).responsiveMenuSkinGadget({});
157			}
158		});
159		
160		$('.skgd.menu .skgdToggleMenuBtn').off('click.skgdResponsive').on('click.skgdResponsive',function(event) {
161			event.stopPropagation();
162			var menuElem = $(this).closest('.skgd.menu');
163			
164			if (menuElem.hasClass('opened')) {
165				closeMenu(menuElem);
166			} else {
167				var origWindowWidth = $(window).width();
168				menuElem.toggleClass('opened',true);
169				menuElem.find('.skgdToggleMenu').toggleClass('nav_submenuSliding', true);				
170				menuElem.find('.skgdToggleMenu .menuOpen').toggleClass('menuOpen_x',true).toggleClass('menuOpen',false);
171				$(document).on('click.skgdMenu',function(event) {				
172					if ($(event.target).closest('.skgd.menu').attr('id') != menuElem.attr('id')) {
173						closeMenu(menuElem);
174					}
175				});
176				$(window).on('resize.skgdMenu',function() {
177					if (origWindowWidth != $(window).width()) {					
178						closeMenu(menuElem);
179					}
180				});
181			}
182			
183			function closeMenu(menuElem) {			
184				menuElem.toggleClass('opened',false);
185				menuElem.find('.skgdToggleMenu').toggleClass('nav_submenuSliding', false).toggleClass('menuOpen',true);
186				menuElem.find('.skgdToggleMenu .menuOpen_x').toggleClass('menuOpen_x',false).toggleClass('menuOpen',true);				
187				$(document).off('click.skgdMenu');
188				$(window).off('resize.skgdMenu');
189			}		
190		}).off('keypress.skgdResponsive').on('keypress.skgdResponsive',function(e) {
191			if (e.which == 13) {
192				$(this).click();
193			}
194		});
195		
196		$('.skgd.vmenu .skgdSubmenuNoLink > a').off('click.skgdResponsive').on('click.skgdResponsive',function(event) {
197			var li = $(this).closest('.skgdSubmenuNoLink').get(0);
198			var ul = $(li).closest('ul');				
199			var cls1 = ul.attr('data-cls1');
200			var cls2 = ul.attr('data-cls2');
201			ul.children('li').each(function() {
202				var that = this;
203				if (this == li && !$(this).hasClass('opened')) {
204					
205					$(that).children('ul').show('fast',function() {
206						$(that).toggleClass('opened',true);						
207						$(that).find(' > a > i.submenuIconIndicator').toggleClass('fa-'+cls1,false).toggleClass('fa-'+cls2,true);
208					});				
209				} else {
210					$(that).children('ul').hide('fast', function() {
211						$(that).toggleClass('opened',false);
212						$(that).find(' > a > i.submenuIconIndicator').toggleClass('fa-'+cls1,true).toggleClass('fa-'+cls2,false);
213					});		
214				}
215			});	
216			
217		}).off('keypress.skgdResponsive').on('keypress.skgdResponsive',function(e) {
218			if (e.which == 13) {
219				$(this).click();
220			}
221		});
222		
223		$('.skgdMasonryList').each(function() {
224			var that = this;
225			var origMargin = 'auto';
226			$(this).imagesLoaded( function() {							
227	 			$(that).masonry({
228					itemSelector: 'li.skgdLi',		
229					percentPosition: false,
230					transitionDuration: 0,
231					fitWidth: false		
232				});				
233			});			
234		});
235		
236		if (document.fonts && document.fonts.ready && document.fonts.ready.then) {
237					
238			$('.skgdFitText').on('reportswordspanscreated',function() {
239				var overlow = $(this).css('overflow');		
240				$(this).css('overflow','auto');	
241				var ww = $(this).outerWidth();
242				var cw = this.scrollWidth;
243				
244				var wh = $(this).outerHeight();
245				var ch = this.scrollHeight;
246				
247				var fs = parseFloat($(this).css('font-size').replace('px',''));
248				
249				var fitWidth = $(this).hasClass('skftfitWidth') || $(this).hasClass('skftfitBoth');
250				var fitHeight = $(this).hasClass('skftfitHeight') || $(this).hasClass('skftfitBoth');
251				function isOk(cw, ww, ch, wh) {
252					if (fitWidth && cw>ww && Math.abs(cw - ww)>1.3) return false;
253					if (fitHeight && ch>wh && Math.abs(ch - wh)>1.3) return false;
254					return true;
255				}
256				
257				var i = 0;							
258				while (i < 120 && fs > 7 && !isOk(cw, ww, ch, wh)) {
259					fs = fs-1;
260					$(this).css('font-size',(fs).toFixed(2)+'px');
261					
262					var ww = $(this).outerWidth();
263					var cw = this.scrollWidth;
264					var wh = $(this).outerHeight();
265					var ch = this.scrollHeight;
266					
267					if (isOk(cw, ww, ch, wh)) break;
268					i++;
269				}
270				$(this).css('overflow',overlow);
271			});
272				
273		}
274		
275		var edubarMainSkinHeight = edubarMainSkin.height();
276		var edubarMainSkinWidth = edubarMainSkin.width();
277		$('.skgdChangeFontSize').off('click.skgdResponsive').on('click.skgdResponsive',function() {
278			if ($(this).attr('data-change') == 'contrast') {
279				barStartLoading();
280				$.post('/?toggleHighContrast=1',{}, function() {
281					document.location.reload();
282				});
283			} else {
284				var add = $(this).attr('data-change')*1;
285				var zoomInd = edubarMainSkin.data('zoomInd') ? edubarMainSkin.data('zoomInd') : 0;
286				var zooms = [1, 1.5, 2, 2.5];
287				zoomInd += add;
288				zoomInd = Math.max(0,Math.min(zooms.length-1, zoomInd));
289
290				edubarMainSkin.data('zoomInd', zoomInd);
291				edubarMainSkin.data('zoomVal', zooms[zoomInd]);							
292				
293				edubarMainSkin.css('font-size', zooms[zoomInd].toFixed(1)+'em');
294				edubarMainSkin.toggleClass('fontResized',zoomInd != 0);
295
296				$('.skgdSearchbox').each(function() {
297					$(this).closest('.skgdSection').toggleClass('searchBoxFontResized', zoomInd != 0);
298				})
299				$(window).resize();
300			}
301		}).off('keypress.skgdResponsive').on('keypress.skgdResponsive',function(e) {
302			if (e.which == 13) {
303				$(this).click();
304			}
305		});
306		
307		edubarMainSkin.find('.edupage-gallery-link').off('click.skgdResponsive').on('click.skgdResponsive',function(e) {
308			e.preventDefault();
309			var itemElem = $(this);
310			var albumid = itemElem.attr('data-albumid');
311			var dirid = itemElem.attr('data-dirid');
312			var id = itemElem.attr('data-id');
313
314			if (!albumid) {				
315				var href = itemElem.attr('href');
316				var pom = href.split('#');
317				var h = (pom[1] || "").split(':');
318				albumid = h[1] || "";
319				dirid = h[2] || "";
320			}
321
322			var ids = null;
323			var hasLastMore = false;
324			var photosSectionSelector = '.plainTextErte.skgd';
325			/*if (itemElem.closest(photosSectionSelector).length == 0) {
326				photosSectionSelector = '.erte.erte-main';
327			}*/
328			if (itemElem.closest(photosSectionSelector).length > 0) {
329				itemElem.closest(photosSectionSelector).find('.edupage-gallery-link').each(function() {
330					var $this = $(this);
331					
332					if ($this.attr('data-albumid') == albumid && $this.attr('data-dirid') == dirid) {
333						if (!ids) ids = [];
334						ids.push($this.attr('data-id'));
335					
336						if ($this.hasClass('isLastMore')) {
337							if ($this.attr('data-moreids')) {
338								var pom = $this.attr('data-moreids').split(';');
339								for (var i=0;i<pom.length;i++) {
340									if (!pom[i]) continue;
341									ids.push(pom[i]);
342								}
343							} else {
344								hasLastMore = true;
345							}
346						}
347					}
348				});
349			}
350
351			if (hasLastMore) ids = null;
352
353			
354			SkinResponsive.openGallery(albumid, dirid, id, ids, {
355				fromNews: itemElem.closest('.skgdNews').length > 0 ? '1' : '',
356			});	
357		}).off('keypress.skgdResponsive').on('keypress.skgdResponsive',function(e) {
358			if (e.which == 13) {
359				$(this).click();
360			}
361		});
362		
363		
364		edubarMainSkin.find('.edupage-image-link').off('click.skgdResponsive').on('click.skgdResponsive',function() {
365			var itemElem = $(this);			
366			var id = itemElem.attr('data-id');
367			
368			var ids = []
369			
370			$(this).closest('.erte-photos').find(".edupage-image-link").each(function() {
371				ids.push($(this).attr('data-id'));	
372			});
373			
374			
375			 
376			SkinResponsive.openGallery('clipart', '', id, ids);	
377		}).off('keypress.skgdResponsive').on('keypress.skgdResponsive',function(e) {
378			if (e.which == 13) {
379				$(this).click();
380			}
381		});
382		
383		
384		initFullWidthContainers();
385
386		edubarMainSkin.find('.langChooserMenuBtn').click(function() {
387			var menuItems = JSON.parse($(this).attr('data-langs'));
388			var dlg = barNewReactSourceDlg('/app/pics/jsw/components/AppSimpleMenu.js','AppSimpleMenuDlg',{
389				items: menuItems,
390				title: ls(9998),
391				itemClick: function(item) {
392					window.location = item.url;
393				},			
394			}, {
395				dialogClass: 'whiteDialog noPadding',
396				width: 400,
397				title: lset(9998),
398			});
399
400		}).off('keypress.skgdResponsive').on('keypress',function(e) {
401			if (e.which == 13) {
402				$(this).click();
403			}
404		});
405		edubarMainSkin.find('.skgdCountryChooser').off('click.skgdResponsive').on('click.skgdResponsive',function(e) {						
406			var dlg = barNewReactSourceDlg('/skin/pics/jsw/countrychooser.js','CountryChooser',{
407				
408			}, {
409				dialogClass: 'whiteDialog noPadding noBorder',
410				width: 400,
411				title: lset(9998),
412				closeOnOverlayClick: true
413			});
414
415		}).each(function() {
416			
417			if (!$(this).attr('data-showpartnerredirect')) return;
418			if ($(this).attr('data-countryredirectdone')) return;
419
420			$(this).attr('data-countryredirectdone',1);
421			var s = '<div class="skgdCountryRedirectDlg"></div>';
422			var elem = $(s).appendTo($(this).parent()).attr('data-country', $(this).attr('data-country')).attr('data-lang', $(this).attr('data-lang'));
423
424			
425			barRenderReactComponent(elem.get(0), '/skin/pics/jsw/countrychooser.js','CountryRedirectMsg', {
426				country: $(this).attr('data-country'),
427				lang: $(this).attr('data-lang'),
428			})
429		});
430
431		edubarMainSkin.find('a.skgdv2loginlnk[href="/login/"]').on('click',function(e) {
432			e.preventDefault();
433			if (!/^https:\/\/[^.]+\.edupage\.org\//.test(window.location.href)) {
434				var edupage = $('html').attr('data-edupage');
435				if (edupage) {
436					window.location.href = 'https://'+(edupage || '').toLowerCase().replace(/[^a-z0-9-]/g, '')+'.edupage.org/login/?dl=a';
437					return;
438				}
439				
440			}
441			var dlg = barNewDialog({
442				source: '/login/?cmd=MainLogin&cl=1',
443				dialogData: {
444					
445				},
446				closeOnBack: true,
447				dialogClass: 'whiteDialog noPadding fullScreenDialog fullScreenDialogEx fixedPos transparentDialog'
448			});
449		})
450		
451		
452
453		if (true) {
454			var prependh1 = true;
455			edubarMainSkin.find('h1,h2,h3,h4,h5,h6').each(function() {
456				if (this.tagName == "H1") {
457					prependh1 = false;
458				}
459				return false;
460			});
461		
462			if (prependh1) {
463				edubarMainSkin.find('main').each(function() {
464					var s = $('head').find('title').html();
465					$(this).prepend('<h1 class="skgdMainHeading">'+et(s)+'</h1>');
466				})
467			}
468		}
469		
470	}
471	
472	$(document).on('skinUpdated',function() {
473		initFixedHeaderWidth();
474		initResponsiveDivs();
475		initFixedHeader();
476		initElements();	
477		reflowMasonry();
478		
479	});
480	initFixedHeaderWidth();
481	initResponsiveDivs();
482	initFixedHeader();
483	initElements();	
484});
485
486var SkinResponsive = {};
487SkinResponsive.lightboxSkinGadget = function($) {
488	$.widget('edupage.lightboxskingadget', {
489		options: {		
490			
491		},
492		popupBg: null,	
493		popupElem: null,	
494		mainDiv: null,
495		_create: function() {
496			var self = this;		
497			this.initProperties({});		
498			this.createContent();				
499		},			
500		initProperties: function(obj) {
501			for (var x in obj) {
502				this.options[x] = obj[x];
503			}					
504		},	
505		createContent: function() {			
506			var self = this;
507			
508			this.mainDiv = this.element.closest('.edubarMainSkin').last();
509			
510			
511			this.element.on('click', function(event) {				
512			
513				
514				if (typeof SkinUtils == 'undefined' 
515					|| !SkinUtils.pageEditor || SkinUtils.pageEditor.selectedGadgetid == self.element.attr('id')) {
516					event.preventDefault();
517					event.stopPropagation();
518					self.openPopup(true);
519				}
520			});
521			
522			if (this.element.hasClass('popupOpened')) {
523				this.openPopup();
524			}
525			
526			this.element.find('.skgdLightboxPopup').on('childSelected',function() {
527				self.openPopup();
528			}).on('selectedGadget',function() {
529				self.openPopup();
530			});
531						
532		},		
533		preparePopup: function() {
534			var self = this;
535			var s = '<div class="skgdLightboxBg">';
536			s += '<div class="skgdPopupBox0">';
537				s += '<div class="skgdPopupBoxTitle">'; 
538					s += '<h1></h1>';
539					s += '<a class="skgdPopupCloseBtn"><img src="/user/pics/ic_action_cancel.png" alt=""></a>';
540				s += '</div>';
541				s += '<div class="skgdPopupBox1 skgd"></div>';
542			s += '</div>';
543			s += '</div>';			
544			this.popupBg = $(s).appendTo(this.mainDiv);		
545			this.popupBg.find('.skgdPopupCloseBtn').click(function() {
546				self.closePopup();
547			});		
548			
549			this.popupBg.click(function(event) {				
550				if (event.target == event.currentTarget || $(event.target).hasClass('skgdPopupBoxTitle')) {
551					self.closePopup();
552				}
553			});	
554		},
555		openPopup: function(animate) {	
556			var self = this;						
557			var popupElem = this.element.find('.skgdLightboxPopup');			
558			if (popupElem.length == 0) return;
559			
560			this.popupElem = popupElem;
561			
562			if (!this.popupBg) {
563				this.preparePopup();
564			}
565			this.popupBg.find('.skgdPopupBox1').append(this.popupElem);
566			
567			if (animate) {
568				this.popupBg.fadeIn('slow');
569				this.popupElem.fadeIn('slow');
570								
571			} else {
572				this.popupBg.show();
573				this.popupElem.show();
574			
575			}
576			this.resize(true);
577			this.popupElem.find('.skgd').trigger('popupOpened');
578			this.resize();
579			this.element.toggleClass('popupOpened', true);
580			
581			
582			$(window).off('resize.popup'+this.element.attr('id')).on('resize.popup'+this.element.attr('id'), function() {
583				self.popupElem.css('width','');
584				self.popupElem.css('height','');
585				self.resize();
586			});			
587		},
588		closePopup: function() {						
589			this.popupElem.hide();
590			this.popupBg.hide();
591			this.element.append(this.popupElem);
592			
593			this.element.toggleClass('popupOpened', false);	
594			this.popupElem.find('.skgd').trigger('popupClosed');				
595		},
596	    resize: function(skipMaxCheck) {
597	    	var popupBox = this.popupBg.find('.skgdPopupBox0');	    	
598	    	var maxw = this.mainDiv.width()*0.9;
599	    	var maxh = $(window).height()*0.9-100;
600	    	
601	    	var w = this.popupElem.width();
602	    	var h = this.popupElem.height();
603	    		    	
604		    if (w > maxw) {
605	    		 this.popupElem.width(maxw);
606	    	}
607	    	if (!skipMaxCheck) {
608	    		if (h > maxh) {
609	    			this.popupElem.height(maxh);
610	    		}
611	    	}
612	    		
613	    	
614	    	popupBox.width(this.popupElem.width());
615	    	popupBox.height(this.popupElem.height()+60);
616	    	var pos = {
617	    		left: ($(window).width()-popupBox.outerWidth())/2,
618	    		top: ($(window).height()-popupBox.outerHeight()-100)/2
619	    	};
620	    	popupBox.css('left',pos.left+'px');
621	    	popupBox.css('top',pos.top+'px');
622	    }
623		
624	});
625}
626SkinResponsive.lightboxSkinGadget(jQuery);
627
628SkinResponsive.responsiveMenuSkinGadget = function($) {
629	$.widget('edupage.responsiveMenuSkinGadget', {
630		options: {		
631			
632		},
633		submenuItems: null,	
634		hideMenuTimeout: null,
635		showMenuTimeout: null,
636		miniMode: false,	
637		fixedHeader: null,
638		menuDiv: null,
639		isMenuShown: false,
640		menuMode: '',
641		_create: function() {		
642			$(this).data('responsiveMenuSkinGadget', this);
643			var self = this;					
644			
645			self.menuMode = '';
646			if (this.element.hasClass('sidebar')) {
647				self.menuMode = 'sidebar';
648			}
649			
650			
651			
652			this.fixedHeader = this.element.closest('.skgdFixedHeader');
653			this.menuDiv = this.element.find('.skgdFullMenu');
654			
655			this.submenuItems = this.element.find('.skgdMenuItem.hasSubmenu');
656			this.submenuItemLinks = this.submenuItems.find('.skgdMenuItemLink');
657			
658			
659			this.initSubmenuItemsLinks(this.submenuItemLinks);
660			
661			
662			this.submenuItems.hover(function() {
663				var that = this;		
664				if (self.miniMode) return;		
665				if (self.hideMenuTimeout) {clearTimeout(self.hideMenuTimeout);}
666				if (self.showMenuTimeout) {clearTimeout(self.showMenuTimeout);}		
667				if (self.isMenuShown) {		
668					self.toggleMenu($(that), true);
669				} else {
670					self.showMenuTimeout = setTimeout(function() {					
671						self.toggleMenu($(that), true);
672					},1500);
673				}
674			},function() {
675				var that = this;
676				if (self.miniMode) return;
677				if (self.hideMenuTimeout) {clearTimeout(self.hideMenuTimeout);}
678				if (self.showMenuTimeout) {clearTimeout(self.showMenuTimeout);}				
679				/*self.hideMenuTimeout = setTimeout(function() {					
680					self.toggleMenu($(that), false);
681				},300);*/
682			});
683			
684			this.element.find('.skgdMiniMenuLink').click(function() {
685				self.toggleMiniMenu();
686			}).on('keypress', function(e) {
687				if (e.which == 13) {
688					$(this).click();
689				}
690			})
691			
692			
693			var sideMenuBtn = this.element.find('.skgdSideMenuOpenBtn');
694			if (!this.edubarMainSkin) this.edubarMainSkin = $('.edubarMainSkin').last();
695			this.sideMenuBtn = sideMenuBtn;
696			sideMenuBtn.appendTo(this.edubarMainSkin.find('.skgdContainer').first().parent());
697			sideMenuBtn.attr('tabindex','0');
698			sideMenuBtn.click(function() {
699				self.toggleSideMenu(true);
700			}).on('keypress',function(e) {
701				if (e.which == 13) {
702					$(this).click();
703				}
704			})		
705			
706			
707			
708			if (sessionStorage.getItem('skgdSideMenuVis') == '1') {
709				self.toggleSideMenu(false, true);
710			}
711
712			
713			$(document).off('keydown.skgdMenub').on('keydown.skgdMenub', function(e) {
714				
715				if (e.which == 27) {					
716					if (self.isMenuShown) {		
717						self.toggleMenu(self.isMenuShown.item, false);
718						if (self.miniMode) sessionStorage.setItem('srmItemOpened', '');
719					}
720				}
721			});
722
723		},
724		initSubmenuItemsLinks: function(submenuItemLinks) {
725			var self = this;
726			submenuItemLinks.disableSelection();
727			var ind = 0;
728			this.element.find('.skgdMenuItem.hasSubmenu.skgdTopMenuItem').each(function() {
729				ind++;
730				$(this).data('itemid',ind);
731
732				if (sessionStorage.getItem('srmItemOpened') == ind) {
733					self.toggleMenu($(this), true);
734				}
735
736				
737				
738			});
739			submenuItemLinks.click(function() {
740				var menuItem = $(this).closest('.skgdTopMenuItem');
741				
742				if (self.isMenuShown 
743					&& self.isMenuShown.item.get(0) == menuItem.get(0)
744					&& self.isMenuShown.since < (new Date()).getTime()-1000) {
745					self.toggleMenu(menuItem, false);
746					if (self.miniMode) sessionStorage.setItem('srmItemOpened', '');
747				} else {
748					self.toggleMenu(menuItem, true);
749
750					if (self.miniMode) sessionStorage.setItem('srmItemOpened', menuItem.data('itemid'));
751				}
752				
753			});
754			
755			submenuItemLinks.on('keydown',function(event) {				
756				if (event.which == 13) {
757					$(this).click();
758				}
759			});
760		},
761		toggleSideMenu: function(animation, visible) {
762			if (!this.edubarMainSkin) this.edubarMainSkin = $('.edubarMainSkin').last();
763			
764			var self = this;
765			if (!this.sideMenuElem) {
766				var ss = this.element.find('.skgdFullMenu').html();
767				var s = '';
768				
769				ss = EdubarUtils.strtr(ss, {
770						'skgd': 'skgd-sb-'
771					 });
772				
773				
774				s += '<div class="skgd-menu-sidebar">';
775				
776				var s3 = '';
777				s3 += '<div class="skgd-menu-sidebar-logo">';
778					s3 += '<a class="skgdSideMenuOpenBtn2" tabindex="0">';
779						s3 += '<i class="fa fa-fw fa-remove"></i>';
780					s3 += '</a>';
781					
782					if (self.options.editable) {
783						s3 += '<a class="skgdSideMenuEdit" title="{#1474}: {#2339}">';
784							s3 += '<i class="fa fa-fw fa-pencil"></i>';
785						s3 += '</a>';
786					}
787				s3 += '</div>';
788				
789				s += renderS(s3, {
790						opts: this.options
791					});
792				
793				s += '<ul class="level0">';
794				s += ss;
795				s += '</ul>';
796				s += '</div>';
797				
798				this.sideMenuElem = $(s).appendTo(this.element);
799				this.sideMenuElem.find('.skgdSideMenuOpenBtn2').click(function() {					
800					self.toggleSideMenu(true);
801				}).on('keypress',function(e) {
802					if (e.which == 13) {
803						$(this).click();
804					}
805				})	
806				
807				var menuItems = this.sideMenuElem.find('.skgd-sb-MenuItem');
808				var submenuItems = this.sideMenuElem.find('.skgd-sb-MenuItem.hasSubmenu');
809			 	var submenuItemLinks = submenuItems.find('.skgd-sb-MenuItemLink');
810			 	
811			 	submenuItemLinks.disableSelection();
812			 	var ind = 0;
813			 	submenuItemLinks.each(function() {
814			 		$(this).data('linkIndex',ind);
815			 		
816			 		var sesitem = sessionStorage.getItem('skgdSubmenuVis'+$(this).data('linkIndex'));
817			 		var opened = sesitem == '1';
818			 		if (!opened && sesitem !== '0' && ind == 0 && menuItems.length < 10) {
819			 			opened = true;
820			 		}
821			 		
822			 		if (opened) {
823			 			var menuItem = $(this).closest('.skgd-sb-TopMenuItem');
824			 			var pomelem = menuItem.find('.skgd-sb-SubmenuDiv2');
825			 			pomelem.show();
826			 		}
827
828					$(this).attr('aria-expanded', !opened ? 'false' : 'true');
829			 		ind++;
830			 	});
831				submenuItemLinks.click(function() {
832					var menuItem = $(this).closest('.skgd-sb-TopMenuItem');
833					var pomelem = menuItem.find('.skgd-sb-SubmenuDiv2');
834					sessionStorage.setItem('skgdSubmenuVis'+$(this).data('linkIndex'),(pomelem.is(':visible') ? '0' : '1'));
835					$(this).attr('aria-expanded', pomelem.is(':visible') ? 'false' : 'true');
836					pomelem.slideToggle();					
837				});
838				
839				submenuItemLinks.on('keydown',function(event) {				
840					if (event.which == 13) {
841						$(this).click();
842					}
843				});
844				
845				this.sideMenuElem.on('scroll',function() {					
846					sessionStorage.setItem('skgdSideMenuScroll', $(this).scrollTop());
847				});
848				
849				if (this.options.editable) {
850					this.sideMenuElem.find('.skgdSideMenuEdit').click(function() {
851						barNewDialog({
852							source: '/customize/modules.php'
853						})
854					});
855				}
856				
857				
858				this.resizeSideMenu();
859				
860				$(window).off('resize.skgdSideMenu').on('resize.skgdSideMenu',function() {
861					
862					self.resizeSideMenu();
863				});
864				
865				$(document).off('skinUpdated.skgdSideMenu').on('skinUpdated.skgdSideMenu',function() {
866					self.resizeSideMenu();
867				});
868				
869				
870			}
871			var vis = visible === false || visible === true ? !visible : this.sideMenuElem.is(':visible');
872			
873			this.element.find('.skgdSideMenuOpenBtn i').toggleClass('fa-bars',vis).toggleClass('fa-close',!vis);
874			sessionStorage.setItem('skgdSideMenuVis',(vis  ? '0' : '1'));
875			
876			if (animation) {
877				if (!vis) {
878					this.sideMenuBtn.css('display',vis ? '' : 'none');
879				} 
880				this.edubarMainSkin.toggleClass('skgdSideMenuOpened', (vis  ? false : true), 200)
881				this.sideMenuElem.css('margin-'+ertl('left','right'),vis ? '0' : '-300px');
882				var anp = {};
883				anp['margin-'+ertl('left','right')] = vis ? -300 : 0;
884				this.sideMenuElem.animate(anp, {
885					start: function() {
886						
887						if (!vis) {
888							$(this).show();
889						}
890					},
891					duration: 200,
892					done: function() {
893						if (vis) {
894							$(this).hide();
895						}
896						$(document).trigger('skinUpdated');
897						self.sideMenuBtn.css('display',vis ? '' : 'none');												
898						if (vis) {
899							$('.skgdSideMenuOpenBtn').first().focus();						
900						} else {
901							$('.skgdSideMenuOpenBtn2').focus();						
902						}
903					}
904				});
905			} else {
906				this.sideMenuBtn.css('display',vis ? '' : 'none');
907				this.sideMenuElem.css('margin-'+ertl('left','right'),'0');
908				this.edubarMainSkin.toggleClass('skgdSideMenuOpened', (vis  ? false : true));				
909				if (vis) {
910					this.sideMenuElem.hide();
911				} else {
912					this.sideMenuElem.show();
913				}
914				//this.sideMenuElem.toggle(!vis);
915				if (sessionStorage.getItem('skgdSideMenuScroll')) {				
916					this.sideMenuElem.scrollTop(sessionStorage.getItem('skgdSideMenuScroll'));
917				}
918				$(document).trigger('skinUpdated');
919			}			
920		},
921		resizeSideMenu: function() {
922			if (!this.sideMenuElem) return;			
923			if (!this.edubarMainSkin) this.edubarMainSkin = $('.edubarMainSkin').last();
924			
925			var mo = this.edubarMainSkin.offset();
926			var ml = this.edubarMainSkin.css('margin-left').replace('px','')*1;			
927			this.sideMenuElem.css('top',mo.top);
928			this.sideMenuElem.css('left',mo.left-ml);
929		},
930		toggleMenu: function(menuItem, val) {
931			var self = this;
932			if (self.hideMenuTimeout) {clearTimeout(self.hideMenuTimeout);}			
933			var isOpened = menuItem.hasClass('opened');
934			if (isOpened && val === true) return;
935			
936			if (this.isMenuShown && !isOpened && val !== false) {
937				this.submenuItems.find('.skgdSubmenuDiv2').hide();
938			} else {
939				this.submenuItems.find('.skgdSubmenuDiv2').fadeOut('fast');
940			}
941			this.submenuItems.toggleClass('opened', false);			
942			menuItem.children('.skgdMenuItemLink').attr('aria-expanded',!isOpened ? 'true' : 'false');
943			if (!isOpened && val !== false) {
944				
945				
946				if (this.isMenuShown) {
947					menuItem.find('.skgdSubmenuDiv2').show();
948				} else {
949					menuItem.find('.skgdSubmenuDiv2').fadeIn('fast');
950				}				
951				menuItem.toggleClass('opened', true);
952			}
953			this.isMenuShown = val ? {since: (new Date()).getTime(), item: menuItem} : false;
954			
955			if (val) {				
956				$(document).off('click.skgdMenuB').on('click.skgdMenuB', function(e) {
957					if ($(e.target).closest('.skgd.menub').length>0) return;
958					if (self.isMenuShown) {
959						self.toggleMenu(self.isMenuShown.item, false);
960						if (self.miniMode) sessionStorage.setItem('srmItemOpened', '');
961					} else {
962						$(document).off('click.skgdMenuB');
963					}
964				});
965				this.submenuItems.find('.skgdSubmenuDiv2').off('focusout.skgdMenuB');
966				menuItem.find('.skgdSubmenuDiv2').on('focusout.skgdMenuB', function(e) {
967					var submenu = this;
968					var related = e.relatedTarget;
969					if (related && $.contains(submenu, related)) return;
970					setTimeout(function() {
971						if (!self.isMenuShown || self.isMenuShown.item.get(0) !== menuItem.get(0)) return;
972						var active = document.activeElement;
973						if (active && $.contains(submenu, active)) return;
974						self.toggleMenu(menuItem, false);
975						if (self.miniMode) sessionStorage.setItem('srmItemOpened', '');
976					}, 0);
977				});
978			} else {				
979				$(document).off('click.skgdMenuB');
980				this.submenuItems.find('.skgdSubmenuDiv2').off('focusout.skgdMenuB');
981			}
982		},
983		toggleMiniMenu: function(val) {		
984			var self  = this;				
985			var fixedHeader = this.fixedHeader;			
986			var menuDiv = this.menuDiv;			
987			var isOpened = menuDiv.hasClass('opened');
988			if (val !== false && val !== true) val = !isOpened;			
989			menuDiv.toggleClass('opened', val);
990			this.miniMode = val;
991			
992			if (val) {							
993				this.element.find('.skgdSubmenuDiv').toggleClass('skgdSubmenuDivMini', true).toggleClass('skgdSubmenuDiv', false);				
994				
995				this.element.find('.skgdMiniMenuLink').toggleClass('opened',true);
996				this.element.find('.skgdMiniMenuLink i').toggleClass('fa-bars', false).toggleClass('fa-close',true);
997				if (this.fixedHeader.length > 0) {
998					this.fixedHeader.toggleClass('fixed', true).toggleClass('forceFixed',true);				
999				}  else {
1000					this.element.toggleClass('fixedMode', true);
1001				}		
1002				
1003				$('body').css('overflow','hidden');		
1004				this.resizeMiniMenu();				
1005				
1006				$(window).off('resize.skgdMiniMenu').on('resize.skgdMiniMenu',function() {
1007					if (window.innerWidth > 980) {
1008						self.toggleMiniMenu(false);
1009						return;
1010					}
1011					
1012					self.resizeMiniMenu();
1013				});
1014				$(window).scroll();
1015				barRegisterPopstateHandler(menuDiv.get(0), function() {
1016					self.toggleMiniMenu(false);
1017				});
1018				
1019			} else {
1020				$('body').css('overflow','');
1021				this.element.find('.skgdSubmenuDivMini').toggleClass('skgdSubmenuDiv', true).toggleClass('skgdSubmenuDivMini', false);
1022				$(window).off('resize.skgdMiniMenu');
1023				
1024				if (fixedHeader.length > 0) {
1025					fixedHeader.toggleClass('forceFixed',false);
1026					$(window).scroll();
1027				} else {
1028					this.element.toggleClass('fixedMode', false);
1029				}
1030				menuDiv.css('height','');
1031				menuDiv.css('width','');
1032				menuDiv.css('left','');				
1033				this.element.find('.skgdMiniMenuLink').toggleClass('opened',false);
1034				this.element.find('.skgdMiniMenuLink i').toggleClass('fa-close', false).toggleClass('fa-bars',true);
1035				barUnregisterPopstateHandler(menuDiv.get(0));
1036			}
1037		},
1038		
1039		resizeMiniMenu: function() {
1040			if (!this.edubarMainSkin) this.edubarMainSkin = $('.edubarMainSkin').last();
1041			if (this.element.hasClass('sidebar')) return;
1042			var zoom = this.edubarMainSkin.hasClass('blindFriendly') ? 2 : 1;	
1043			
1044			if (!this.edubarMainSkin) this.edubarMainSkin = $('.edubarMainSkin').last();
1045			
1046			var mo = this.edubarMainSkin.offset();
1047			
1048					
1049			var offset =  this.menuDiv.offset()
1050			var h = $(window).height()-offset.top;
1051			if (this.fixedHeader.length > 0) {				
1052				h = $(window).innerHeight()-this.fixedHeader.outerHeight()*zoom;
1053			}  else {				
1054				h = $(window).innerHeight()-this.element.outerHeight()*zoom;
1055			}
1056			this.menuDiv.outerHeight(h/zoom);
1057			
1058			offset.left = mo.left;
1059			this.menuDiv.offset(offset);
1060			this.menuDiv.outerWidth(($(window).innerWidth()-offset.left)/zoom);
1061		}
1062	});
1063}
1064SkinResponsive.responsiveMenuSkinGadget(jQuery);
1065
1066SkinResponsive.accordionMenuSkinGadget = function($) {
1067	$.widget('edupage.accordionMenuSkinGadget', {
1068		options: {		
1069			
1070		},
1071		submenuItems: null,	
1072		hideMenuTimeout: null,
1073		showMenuTimeout: null,
1074		miniMode: false,	
1075		fixedHeader: null,
1076		menuDiv: null,
1077		isMenuShown: false,
1078		_create: function() {		
1079			var self = this;					
1080			this.submenuItems = this.element.find('.skgdMenuItem.hasSubmenu');
1081			this.submenuItemLinks = this.submenuItems.find('.skgdMenuItemLink');
1082			
1083			this.fixedHeader = this.element.closest('.skgdFixedHeader');
1084			this.menuDiv = this.element.find('.skgdFullMenu');
1085			this.submenuItemLinks.disableSelection();
1086			this.submenuItemLinks.click(function() {				
1087				var menuItem = $(this).closest('.skgdTopMenuItem');
1088				
1089				if (self.isMenuShown 
1090					&& self.isMenuShown.item.get(0) == menuItem.get(0)
1091					&& self.isMenuShown.since < (new Date()).getTime()-1000) {
1092					self.toggleMenu(menuItem, false);
1093				} else {
1094					self.toggleMenu(menuItem, true);
1095				}
1096			});
1097			
1098			this.submenuItemLinks.on('keydown',function(event) {				
1099				if (event.which == 13) {
1100					$(this).click();
1101				}
1102			});
1103			
1104			this.submenuItems.hover(function() {
1105				var that = this;		
1106				if (self.miniMode) return;		
1107				if (self.hideMenuTimeout) {clearTimeout(self.hideMenuTimeout);}
1108				if (self.showMenuTimeout) {clearTimeout(self.showMenuTimeout);}		
1109				if (self.isMenuShown) {		
1110					self.toggleMenu($(that), true);
1111				} else {
1112					self.showMenuTimeout = setTimeout(function() {					
1113						self.toggleMenu($(that), true);
1114					},300);
1115				}
1116			},function() {
1117				var that = this;
1118				if (self.miniMode) return;
1119				if (self.hideMenuTimeout) {clearTimeout(self.hideMenuTimeout);}
1120				if (self.showMenuTimeout) {clearTimeout(self.showMenuTimeout);}				
1121				self.hideMenuTimeout = setTimeout(function() {					
1122					self.toggleMenu($(that), false);
1123				},300);
1124			});
1125			
1126			this.element.find('.skgdMiniMenuLink').click(function() {
1127				self.toggleMiniMenu();
1128			});		
1129			
1130		},
1131		toggleMenu: function(menuItem, val) {
1132			if (self.hideMenuTimeout) {clearTimeout(self.hideMenuTimeout);}			
1133			var isOpened = menuItem.hasClass('opened');
1134			if (isOpened && val === true) return;
1135						
1136			if (this.isMenuShown && !isOpened && val !== false) {
1137				this.submenuItems.find('.skgdSubmenuDiv').hide();
1138			} else {
1139				this.submenuItems.find('.skgdSubmenuDiv').fadeOut('fast');
1140			}
1141			this.submenuItems.toggleClass('opened', false);
1142		
1143			menuItem.attr('aria-expanded',isOpened ? 'true' : 'false');
1144			if (!isOpened && val !== false) {
1145				
1146				
1147				if (this.isMenuShown) {
1148					menuItem.find('.skgdSubmenuDiv').show();
1149				} else {
1150					menuItem.find('.skgdSubmenuDiv').fadeIn('fast');
1151				}				
1152				menuItem.toggleClass('opened', true);
1153			}
1154			this.isMenuShown = val ? {since: (new Date()).getTime(), item: menuItem} : false;
1155		},
1156		toggleMiniMenu: function(val) {		
1157			var self  = this;				
1158			var fixedHeader = this.fixedHeader;			
1159			var menuDiv = this.menuDiv;
1160			
1161			var isOpened = menuDiv.hasClass('opened');
1162			if (val !== false && val !== true) val = !isOpened;			
1163			menuDiv.toggleClass('opened', val);
1164			this.miniMode = val;
1165			
1166			if (val) {							
1167				this.element.find('.skgdSubmenuDiv').toggleClass('skgdSubmenuDivMini', true).toggleClass('skgdSubmenuDiv', false);				
1168				
1169				
1170				this.element.find('.skgdMiniMenuLink i').toggleClass('fa-bars', false).toggleClass('fa-close',true);
1171				if (this.fixedHeader.length > 0) {
1172					this.fixedHeader.toggleClass('fixed', true).toggleClass('forceFixed',true);				
1173				}  else {
1174					this.element.toggleClass('fixedMode', true);
1175				}
1176				
1177				this.resizeMiniMenu();				
1178				
1179				$(window).off('resize.skgdMiniMenu').on('resize.skgdMiniMenu',function() {
1180					if (window.innerWidth > 980) {
1181						self.toggleMiniMenu(false);
1182						return;
1183					}
1184					
1185					self.resizeMiniMenu();
1186				});
1187			} else {
1188				this.element.find('.skgdSubmenuDivMini').toggleClass('skgdSubmenuDiv', true).toggleClass('skgdSubmenuDivMini', false);
1189				$(window).off('resize.skgdMiniMenu');
1190				
1191				if (fixedHeader.length > 0) {
1192					fixedHeader.toggleClass('forceFixed',false);
1193					$(window).scroll();
1194				} else {
1195					this.element.toggleClass('fixedMode', false);
1196				}
1197				menuDiv.css('height','');
1198				menuDiv.css('width','');
1199				menuDiv.css('left','');				
1200				this.element.find('.skgdMiniMenuLink i').toggleClass('fa-close', false).toggleClass('fa-bars',true);
1201			}
1202		},
1203		resizeMiniMenu: function() {
1204			var offset =  this.menuDiv.offset()
1205			var h = $(window).height()-offset.top;
1206			if (this.fixedHeader.length > 0) {				
1207				h = $(window).innerHeight()-this.fixedHeader.outerHeight();
1208			}  else {				
1209				h = $(window).innerHeight()-this.element.outerHeight();
1210			}
1211			this.menuDiv.outerHeight(h);
1212			
1213			offset.left = 0;
1214			this.menuDiv.offset(offset);
1215			this.menuDiv.width($(window).innerWidth());
1216		}
1217	});
1218}
1219SkinResponsive.responsiveMenuSkinGadget(jQuery);
1220
1221SkinResponsive.openGallery = function(albumid, galleryid, fileid, files, opts) {		
1222	if (!opts) opts = {};
1223	if (MobileAppBridge.isV2Active()) {
1224		EdupageApp.pushReactComponentView("/app/pics/jsw/views/noticeboard/GalleryView.js",{
1225			albumid: albumid,
1226			galleryid: galleryid,
1227			fileid: fileid, 
1228			files: files,
1229			fromNews: opts.fromNews,
1230			noTransitions: true
1231		})
1232		return;
1233	}
1234
1235	if (window.edupageOpenedGallery == albumid+':'+galleryid) {
1236		return;
1237	}
1238
1239	if (MobileAppBridge.isActive() && !MobileAppBridge.isIOS()) {
1240		if ($(window).width() > $(window).height()) {
1241			window.ascFullscreenOpened = true;
1242			MobileAppBridge.runFlexMethod('fullScreenOpen',[]);
1243			
1244		}	
1245	}
1246	
1247	var elements =  [];
1248	inner = false;
1249	var parentElem = !inner ? $j('body') : elem;
1250
1251	var origScrollTop = $(window).scrollTop();
1252	
1253	$j(parentElem).children().each(function() {
1254		if ($j(this).is(':visible')) {							
1255			elements.push({elem: $j(this), display: $j(this).css('display')});
1256			$j(this).css('display','none');
1257		}
1258	});
1259	var $div = $j('<div class="photos-galleryWindow photos-outerWindow '+et(MobileAppBridge.isActive() ? 'photos-galleryWindow-mobile' : '')+'"></div>').appendTo(parentElem);
1260	
1261	fileid = fileid ? fileid : ''
1262	
1263	var postData = {
1264		fromNews: opts.fromNews || "",
1265	};
1266	if (files) {
1267		postData['files'] = files.join(';');
1268	}
1269	$j.post('/photos/?jwgc=EdupageGalleryViewer&photo='+albumid+'&gallery='+galleryid+'&fileid='+fileid, postData, function(data) {              
1270     	if (data != '') {
1271			$div.html(data);
1272			if (!MobileAppBridge.isActive()) { 
1273				 $div.css('background-image','none');            			                                             
1274			}
1275        }                         
1276    }); 
1277    shownGalleryDialog = $div;
1278    
1279    $div.on('remove',function() {			    	        			
1280		window.location.hash = '';
1281		shownGalleryDialog = null;
1282		for (var i=0;i<elements.length;i++) {
1283			elements[i].elem.css('display', elements[i].display);
1284		}
1285
1286		$(window).scrollTop(origScrollTop);
1287	});					
1288    return $div;
1289}
1290
1291function AscMasonry() {
1292
1293
1294	/*!
1295	* Masonry PACKAGED v4.0.0
1296	* Cascading grid layout library
1297	* http://masonry.desandro.com
1298	* MIT License
1299	* by David DeSandro
1300	*/
1301
1302	!function(t,e){"use strict";"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var c=d.apply(u,n);o=void 0===o?c:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||[];return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);r.isBoxSizeOuter=s=200==t(o.width),i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,c=0;u>c;c++){var l=h[c],f=r[l],m=parseFloat(f);a[l]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,E=a.borderTopWidth+a.borderBottomWidth,z=d&&s,b=t(r.width);b!==!1&&(a.width=b+(z?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(z?0:g+E)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+E),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e},i.makeArray=function(t){var e=[];
1302if(Array.isArray(t))e=t;else if(t&&"number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];t&&clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i||100)}},i.docReady=function(t){"complete"==document.readyState?t():document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var n=t.console;return i.htmlInit=function(e,o){i.docReady(function(){var r=i.toDashed(o),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",c=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(n&&n.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);c&&c.data(t,o,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t,t.EvEmitter,t.getSize))}(window,function(t,e,i){"use strict";function n(t){for(var e in t)return!1;return e=null,!0}function o(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function r(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var s=document.documentElement.style,a="string"==typeof s.transition?"transition":"WebkitTransition",h="string"==typeof s.transform?"transform":"WebkitTransform",u={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[a],d=[h,a,a+"Duration",a+"Property"],c=o.prototype=Object.create(e.prototype);c.constructor=o,c._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},c.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},c.getSize=function(){this.size=i(this.element)},c.css=function(t){var e=this.element.style;for(var i in t){var n=d[i]||i;e[n]=t[i]}},c.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=this.layout.size,s=-1!=n.indexOf("%")?parseFloat(n)/100*r.width:parseInt(n,10),a=-1!=o.indexOf("%")?parseFloat(o)/100*r.height:parseInt(o,10);s=isNaN(s)?0:s,a=isNaN(a)?0:a,s-=e?r.paddingLeft:r.paddingRight,a-=i?r.paddingTop:r.paddingBottom,this.position.x=s,this.position.y=a},c.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",c=this.position.y+t[h];e[u]=this.getYValue(c),e[d]="",this.css(e),this.emitEvent("layout",[this])},c.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},c.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},c._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return void this.layoutPosition();var a=t-i,h=e-n,u={};u.transform=this.getTranslate(a,h),this.transition({to:u,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},c.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},c.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},c.moveTo=c._transitionTo,c.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},c._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},c._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+r(d.transform||"transform");c.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:l,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(u,this,!1))},c.transition=o.prototype[a?"_transition":"_nonTransition"],c.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},c.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform"};c.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,i=f[t.propertyName]||t.propertyName;if(delete e.ingProperties[i],n(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd){var o=e.onEnd[i];o.call(this),delete e.onEnd[i]}this.emitEvent("transitionEnd",[this])}},c.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1},c._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var m={transitionProperty:"",transitionDuration:""};return c.removeTransitionStyles=function(){this.css(m)},c.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},c.remove=function(){return a&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},c.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},c.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},c.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},c.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},c.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},c.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},o}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.f
vendor: 4,232 bytes, line 1302
1302izzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(a&&a.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++d;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}var a=t.console,h=t.jQuery,u=function(){},d=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var l=r.prototype;return n.extend(l,e.prototype),l.option=function(t){n.extend(this.options,t)},l._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},l._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},l.reloadItems=function(){this.items=this._itemize(this.element.children)},l._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},l._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},l.getItemElements=function(){return this.items.map(function(t){return t.element})},l.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},l._init=l.layout,l._resetLayout=function(){this.getSize()},l.getSize=function(){this.size=i(this.element)},l._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},l.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},l._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},l._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},l._getItemLayoutPosition=function(){return{x:0,y:0}},l._processLayoutQueue=function(t){t.forEach(function(t){this._positionItem(t.item,t.x,t.y,t.isInstant)},this)},l._positionItem=function(t,e,i,n){n?t.goTo(e,i):t.moveTo(e,i)},l._postLayout=function(){this.resizeContainer()},l.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},l._getContainerSize=u,l._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},l._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},l.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),h)if(this.$element=this.$element||h(this.element),e){var o=h.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},l.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},l.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},l.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.
vendor: 5,670 bytes, lines 1302-1305
1302concat(t),t.forEach(this.ignore,this))},l.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},l._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},l._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},l._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},l._manageStamp=u,l._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},l.handleEvent=n.handleEvent,l.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},l.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},l.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),l.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},l.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},l.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},l.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},l.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},l.reveal=function(t){this._emitCompleteOnItems("reveal",t),t&&t.length&&t.forEach(function(t){t.reveal()})},l.hide=function(t){this._emitCompleteOnItems("hide",t),t&&t.length&&t.forEach(function(t){t.hide()})},l.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},l.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},l.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},l.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},l.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},l.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i},r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");return i.compatOptions.fitWidth="isFitWidth",i.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0},i.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},i.prototype.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},i.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this._getColGroup(n),r=Math.min.apply(Math,o),s=o.indexOf(r),a={x:this.columnWidth*s,y:r},h=r+t.size.outerHeight,u=this.cols+1-o.length,d=0;u>d;d++)this.colYs[s+d]=h;return a},i.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++){var o=this.colYs.slice(n,n+t);e[n]=Math.max.apply(Math,o)}return e},i.prototype._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,c=a;h>=c;c++)this.colYs[c]=Math.max(d,this.colYs[c])},i.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},i.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},i.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
1303}
1304
1305AscMasonry()

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.