PageSourceSearch

https://www.visegradgroup.eu/site/design2/js/site.js?ts=1712736906

js visegradgroup.eu collected 2026-09-24 18:15:29 UTC 14,607 bytes, 491 lines download raw bytes

1
2function vGSite(options) {
3	this.initialize(options);
4}
5
6vGSite.prototype = {
7	// Constructor
8	initialize: function(options) {
9		this.init();
10	},
11
12	init: function() {
13		// Oldal scrollbar szélessége
14		vGSite.setStyleScrollbarWidthVariable();
15
16		// document.body.style.setProperty('--SCROLL', window.pageYOffset / (document.body.offsetHeight - window.innerHeight));
17
18		// Head - scroll, crumb menu
19		var temp = $jq('#header_container');
20		for(var i=0;i<temp.length;i++) {
21			var temp2 = new siteHeader({'rootObject': temp[i]});
22		}
23
24		$jq('.initDatePicker').datepicker({});
25	}
26}
27
28vGSite.findBootstrapEnvironment = function() {
29	var envs = ['xs', 'sm', 'md', 'lg'];
30
31	var $el = $jq('<div>');
32	$el.appendTo($jq('body'));
33
34	for (var i = envs.length - 1; i >= 0; i--) {
35		var env = envs[i];
36
37		$el.addClass('hidden-'+env);
38		if ($el.is(':hidden')) {
39			$el.remove();
40			return env;
41		}
42	}
43
44	$el.remove();
45}
46
47vGSite.getScrollbarWidth = function() {
48	var out = 0;
49
50	var container = document.createElement('div');
51	document.body.appendChild(container);
52	container.style.overflow = 'scroll';
53
54	var inner = document.createElement('div');
55	container.appendChild(inner);
56
57	out = container.offsetWidth - inner.offsetWidth;
58	document.body.removeChild(container);
59
60	return out;
61}
62
63vGSite.setStyleScrollbarWidthVariable = function() {
64	var scrollbarWidth = vGSite.getScrollbarWidth();
65	document.documentElement.style.setProperty('--SCROLLBAR-WIDTH', scrollbarWidth+'px');
66}
67
68
69cookie = {
70	create: function(name, value, days) {
71		if (days) {
72			var date = new Date();
73			date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
74			var expires = "; expires=" + date.toGMTString();
75		}
76		else {
77			expires = "";
78		}
79		document.cookie = name + "=" + value + expires + "; path=/";
80	},
81
82	read: function(name) {
83		var nameEQ = name + "=";
84		var ca = document.cookie.split(';');
85		for (var i=0;i < ca.length;i++) {
86			var c = ca[i];
87			while (c.charAt(0)==' ') {
88				c = c.substring(1,c.length);
89			}
90			if (c.indexOf(nameEQ) == 0) {
91				return c.substring(nameEQ.length,c.length);
92			}
93		}
94		return false;
95	}
96}
97
98
99
100
101function siteHeader(options) {
102	this.initialize(options);
103}
104
105siteHeader.prototype = {
106	// Constructor
107	initialize: function(options) {
108		// Opciók
109		// ----------------------------------------
110		this.options = options || { };
111
112		this.containerObject = (typeof options.rootObject!='undefined' ? options.rootObject : null);
113		if ( this.containerObject==null ) return false;
114
115		// Esemény kezelők
116		var cO = this;
117
118		this.windowResizeHandler = function(event) { cO.windowResize(event); };
119		this.windowScrollHandler = function(event) { cO.windowScroll(event); };
120
121		// Init
122		// ----------------------------------------
123		this.init();
124
125		// Kezelő objektum ráfűzése az eredeti szerkesztőre (így bármikor elérhető) (globális változó helyettesítő)
126		this.containerObject.siteHeaderAPI = this;
127	},
128
129	// Destruktor
130	remove: function() {
131		this.reInit();
132		
133		try {
134			delete this.containerObject['siteHeaderAPI'];
135		} catch (Ev) {
136			this.containerObject.removeAttribute('siteHeaderAPI');
137		}
138	},
139
140	init: function() {
141		this.ShowTop = true;
142
143		this.rootObject = $jq(this.containerObject);
144
145		this.resizeHelper();
146
147		$jq(window).resize(this.windowResizeHandler);
148		$jq(window).scroll(this.windowScrollHandler);
149	},
150
151	reInit: function() {
152		$jq(window).off();
153	},
154
155	windowResize: function(event) {
156		this.resizeHelper();
157	},
158
159	windowScroll: function(event) {
160		this.scrollHelper();
161	},
162
163	resizeHelper: function() {
164		// Böngésző méret
165		this.clientCHeight = $jq(window).height();
166
167		// Folderpath bal margó állítása
168		var contentMargin = parseInt( $jq(this.rootObject).find('.viewTop .homeIcon + .container').offset().left ,10);
169		if ( Number.isNaN(contentMargin) ) contentMargin = 0;
170
171		var homeIconMargin = parseInt( $jq(this.rootObject).find('.viewTop .homeIcon').offset().left ,10);
172		if ( Number.isNaN(homeIconMargin) ) homeIconMargin = 0;
173
174		var homeIconWidth = parseInt( $jq(this.rootObject).find('.viewTop .homeIcon').outerWidth() ,10);
175		if ( Number.isNaN(homeIconWidth) ) homeIconWidth = 0;
176
177		var newMargin = (homeIconMargin + homeIconWidth + 5) - contentMargin;
178		if ( newMargin<0 ) newMargin = 0;
179
180		document.documentElement.style.setProperty('--FOLDERPATH-MARGIN', newMargin+'px');
181
182		this.scrollHelper();
183	},
184
185	scrollHelper: function() {
186		// Fejléc design váltás
187		var scroll = $jq(window).scrollTop();
188		//if ( scroll > (this.clientCHeight * 1.5) ) {
189		if ( scroll > 40 ) {
190			this.ShowTop = false;
191
192			$jq(this.rootObject).find('.viewTop').addClass('hideAnimate');
193			$jq(this.rootObject).find('.viewScrolling').addClass('showAnimate');
194		} else if ( scroll < 20 ) {
195			this.ShowTop = true;
196
197			$jq(this.rootObject).find('.viewTop').removeClass('hideAnimate');
198			$jq(this.rootObject).find('.viewScrolling').removeClass('showAnimate');
199		}
200	},
201
202	a: 1
203}
204
205
206// Onload
207if (window.addEventListener) {
208	window.addEventListener("load", vGSiteOnLoad, false);
209} else if (window.attachEvent) {
210	window.attachEvent("onload", vGSiteOnLoad);
211}
212
213function vGSiteOnLoad() {
214	new vGSite();
215	kbSlideshowOnLoad();
216	imageLightboxOnLoad();
217}
218
219
220
221
222
223
224/**
225 * See: http://www.css-101.org/articles/ken-burns_effect/css-transition.php
226 */
227
228/**
229 * The idea is to cycle through the images to apply the "fx" class to them every n seconds. 
230 * We can't simply set and remove that class though, because that would make the previous image move back into its original position while the new one fades in. 
231 * We need to keep the class on two images at a time (the two that are involved with the transition).
232 */
233
234function kbSlideshowOnLoad() {
235	if (0 < $jq(".newsimageScrollerContainer .slideshow img").length) {
236
237		// this calls the kenBurns function every 4 seconds
238		// you can increase or decrease this value to get different effects
239		window.setInterval(kenBurns, 10000);
240
241		// the third variable is to keep track of where we are in the loop
242		// if it is set to 1 (instead of 0) it is because the first image is styled when the page loads
243		var images          = $jq(".newsimageScrollerContainer .slideshow img"),
244				numberOfImages  = images.length,
245				i               = 1;
246
247		// we set the 'fx' class on the first image when the page loads
248		images[0].className = "fx";
249		$jq(".newsimageScrollerContainer .slideshow .mainslideshowtitle").html(images[0].alt);
250
251		function kenBurns() {
252			if(i==numberOfImages){ i = 0;}
253			images[i].className = "fx";
254			$jq(".newsimageScrollerContainer .slideshow .mainslideshowtitle").html(images[i].alt);
255
256			// we can't remove the class from the previous element or we'd get a bouncing effect so we clean up the one before last
257			// (there must be a smarter way to do this though)
258			if(i===0){ images[numberOfImages-2].className = "";}
259			if(i===1){ images[numberOfImages-1].className = "";}
260			if(i>1){ images[i-2].className = "";}
261			i++;
262
263		}
264	}
265}
266
267
268
269
270
271// image lightbox
272function imageLightboxOnLoad() {
273	if (0 < $jq(".imagelightboxgallery a.imagelightboxgalleryitem").length) {
274		$jq(function() {
275			$jq('a.imagelightboxgalleryitem').imageLightbox();
276		});
277
278		$jq( function()
279		{
280			var
281				// ACTIVITY INDICATOR
282				activityIndicatorOn = function()
283				{
284					$jq( '<div id="imagelightbox-loading"><div></div></div>' ).appendTo( 'body' );
285				},
286				activityIndicatorOff = function()
287				{
288					$jq( '#imagelightbox-loading' ).remove();
289				},
290
291				// OVERLAY
292				overlayOn = function()
293				{
294					$jq( '<div id="imagelightbox-overlay"></div>' ).appendTo( 'body' );
295				},
296				overlayOff = function()
297				{
298					$jq( '#imagelightbox-overlay' ).remove();
299				},
300
301				// CLOSE BUTTON
302				closeButtonOn = function( instance )
303				{
304					$jq( '<button type="button" id="imagelightbox-close" title="Close"></button>' ).appendTo( 'body' ).on( 'click touchend', function(){ $jq( this ).remove(); instance.quitImageLightbox(); return false; });
305				},
306				closeButtonOff = function()
307				{
308					$jq( '#imagelightbox-close' ).remove();
309				},
310
311				// CAPTION
312				captionOn = function()
313				{
314					var description = $jq( 'a[href="' + $jq( '#imagelightbox' ).attr( 'src' ) + '"] img' ).attr( 'alt' );
315					if( description.length > 0 )
316						$jq( '<div id="imagelightbox-caption">' + description + '</div>' ).appendTo( 'body' );
317				},
318				captionOff = function()
319				{
320					$jq( '#imagelightbox-caption' ).remove();
321				},
322
323				// NAVIGATION
324				navigationOn = function( instance, selector )
325				{
326					var images = $jq( selector );
327					if( images.length )
328					{
329						var nav = $jq( '<div id="imagelightbox-nav"></div>' );
330						for( var i = 0; i < images.length; i++ )
331							nav.append( '<button type="button"></button>' );
332
333						nav.appendTo( 'body' );
334						nav.on( 'click touchend', function(){ return false; });
335
336						var navItems = nav.find( 'button' );
337						navItems.on( 'click touchend', function()
338						{
339							var $this = $jq( this );
340							if( images.eq( $this.index() ).attr( 'href' ) != $jq( '#imagelightbox' ).attr( 'src' ) )
341								instance.switchImageLightbox( $this.index() );
342
343							navItems.removeClass( 'active' );
344							navItems.eq( $this.index() ).addClass( 'active' );
345
346							return false;
347						})
348						.on( 'touchend', function(){ return false; });
349					}
350				},
351				navigationUpdate = function( selector )
352				{
353					var items = $jq( '#imagelightbox-nav button' );
354					items.removeClass( 'active' );
355					items.eq( $jq( selector ).filter( '[href="' + $jq( '#imagelightbox' ).attr( 'src' ) + '"]' ).index( selector ) ).addClass( 'active' );
356				},
357				navigationOff = function()
358				{
359					$jq( '#imagelightbox-nav' ).remove();
360				},
361
362				// ARROWS
363				arrowsOn = function( instance, selector )
364				{
365					var $arrows = $jq( '<button type="button" class="imagelightbox-arrow imagelightbox-arrow-left"></button><button type="button" class="imagelightbox-arrow imagelightbox-arrow-right"></button>' );
366
367					$arrows.appendTo( 'body' );
368
369					$arrows.on( 'click touchend', function( e )
370					{
371						e.preventDefault();
372
373						var $this	= $jq( this ),
374							$target	= $jq( selector + '[href="' + $jq( '#imagelightbox' ).attr( 'src' ) + '"]' ),
375							index	= $target.index( selector );
376
377						if( $this.hasClass( 'imagelightbox-arrow-left' ) )
378						{
379							index = index - 1;
380							if( !$jq( selector ).eq( index ).length )
381								index = $jq( selector ).length;
382						}
383						else
384						{
385							index = index + 1;
386							if( !$jq( selector ).eq( index ).length )
387								index = 0;
388						}
389
390						instance.switchImageLightbox( index );
391						return false;
392					});
393				},
394				arrowsOff = function()
395				{
396					$jq( '.imagelightbox-arrow' ).remove();
397				};
398
399			//	WITH ACTIVITY INDICATION
400			$jq( 'a[data-imagelightbox="a"]' ).imageLightbox(
401			{
402				onLoadStart:	function() { activityIndicatorOn(); },
403				onLoadEnd:		function() { activityIndicatorOff(); },
404				onEnd:	 		function() { activityIndicatorOff(); }
405			});
406
407			//	WITH OVERLAY & ACTIVITY INDICATION
408			$jq( 'a[data-imagelightbox="b"]' ).imageLightbox(
409			{
410				onStart: 	 function() { overlayOn(); },
411				onEnd:	 	 function() { overlayOff(); activityIndicatorOff(); },
412				onLoadStart: function() { activityIndicatorOn(); },
413				onLoadEnd:	 function() { activityIndicatorOff(); }
414			});
415
416			//	WITH "CLOSE" BUTTON & ACTIVITY INDICATION
417			var instanceC = $jq( 'a[data-imagelightbox="c"]' ).imageLightbox(
418				{
419					quitOnDocClick:	false,
420					onStart:		function() { closeButtonOn( instanceC ); },
421					onEnd:			function() { closeButtonOff(); activityIndicatorOff(); },
422					onLoadStart: 	function() { activityIndicatorOn(); },
423					onLoadEnd:	 	function() { activityIndicatorOff(); }
424				});
425
426			//	WITH CAPTION & ACTIVITY INDICATION
427			$jq( 'a[data-imagelightbox="d"]' ).imageLightbox(
428			{
429				onLoadStart: function() { captionOff(); activityIndicatorOn(); },
430				onLoadEnd:	 function() { captionOn(); activityIndicatorOff(); },
431				onEnd:		 function() { captionOff(); activityIndicatorOff(); }
432			});
433
434			//	WITH ARROWS & ACTIVITY INDICATION
435			var selectorG = 'a[data-imagelightbox="g"]';
436			var instanceG = $jq( selectorG ).imageLightbox(
437				{
438					onStart:		function(){ arrowsOn( instanceG, selectorG ); },
439					onEnd:			function(){ arrowsOff(); activityIndicatorOff(); },
440					onLoadStart: 	function(){ activityIndicatorOn(); },
441					onLoadEnd:	 	function(){ $jq( '.imagelightbox-arrow' ).css( 'display', 'block' ); activityIndicatorOff(); }
442				});
443
444			//	WITH NAVIGATION & ACTIVITY INDICATION
445			var selectorE = 'a[data-imagelightbox="e"]';
446			var instanceE = $jq( selectorE ).imageLightbox(
447				{
448					onStart:	 function() { navigationOn( instanceE, selectorE ); },
449					onEnd:		 function() { navigationOff(); activityIndicatorOff(); },
450					onLoadStart: function() { activityIndicatorOn(); },
451					onLoadEnd:	 function() { navigationUpdate( selectorE ); activityIndicatorOff(); }
452				});
453
454			//	ALL COMBINED
455			var selectorF = 'a[data-imagelightbox="f"]';
456			var instanceF = $jq( selectorF ).imageLightbox(
457				{
458					onStart:		function() { overlayOn(); closeButtonOn( instanceF ); arrowsOn( instanceF, selectorF ); },
459					onEnd:			function() { overlayOff(); captionOff(); closeButtonOff(); arrowsOff(); activityIndicatorOff(); },
460					onLoadStart: 	function() { captionOff(); activityIndicatorOn(); },
461					onLoadEnd:	 	function() { captionOn(); activityIndicatorOff(); $jq( '.imagelightbox-arrow' ).css( 'display', 'block' ); }
462				});
463
464			//	DYNAMICALLY ADDED ITEMS
465			var instanceH = $jq( 'a[data-imagelightbox="h"]' ).imageLightbox(
466				{
467					quitOnDocClick:	false,
468					onStart:		function() { closeButtonOn( instanceH ); },
469					onEnd:			function() { closeButtonOff(); activityIndicatorOff(); },
470					onLoadStart: 	function() { activityIndicatorOn(); },
471					onLoadEnd:	 	function() { activityIndicatorOff(); }
472				});
473
474			$jq( '.js--add-dynamic ' ).on( 'click', function( e )
475			{
476				e.preventDefault();
477				var items = $jq( '.js--dynamic-items' );
478				instanceH.addToImageLightbox( items.find( 'a' ) );
479				$jq( '.js--dynamic-place' ).append( items.find( 'li' ).detach() );
480				$jq( this ).remove();
481				items.remove();
482			});
483
484		});
485
486	}
487}
488
489
490
491

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.