PageSourceSearch

https://www.vichy.pl/resources/int-fr/VichyMag/js/retro-compatibil…?versionAOX=2026_316_1052_347_0922221032

js vichy.pl collected 2026-09-24 23:49:59 UTC 4,647 bytes, 92 lines download raw bytes

1/* /////////////////////////////////////////////////////
2 *
3 *	RETRO COMPATIBILITE VICHY 2015
4 *
5 * ////////////////////////////////////////////////// */
6/* --------------------------------------------------
7 * initMatchMedia
8 * ----------------------------------------------- */
9function initMatchMedia(){function c(){for(var c=0;c<b.length;c++){var d=window.matchMedia(b[c].query).matches;d&&!b[c].matched?(b[c].matched=!0,a.addClass(b[c].cssClass)):!d&&b[c].matched&&(b[c].matched=!1,a.removeClass(b[c].cssClass))}}var a=jQueryObject("html"),b=[{query:"(max-width:1024px)",matched:!1,cssClass:"max-width-1024"},{query:"(max-width:960px)",matched:!1,cssClass:"max-width-960"},{query:"(max-width:768px)",matched:!1,cssClass:"max-width-768"},{query:"(max-width:640px)",matched:!1,cssClass:"max-width-640 mobile"},{query:"(max-width:480px)",matched:!1,cssClass:"max-width-480"},{query:"(max-width:320px)",matched:!1,cssClass:"max-width-320"}];jQueryObject(window).on("resize",jQueryObject.aox.throttle(c, 16)),c()}
10/* --------------------------------------------------
11 * responsiveEqualHeight
12 * ----------------------------------------------- */
13function responsiveEqualHeight(a,b,c){function g(){if(!c)return void e.height("auto").equalHeight(b);var a=1==jQueryObject(c).length;!a&&f&&(f=!1),c&&f||e.height("auto").equalHeight(b),a&&!f&&(e.height("auto"),f=!0)}"string"==typeof b&&(c=b,b={});var d=jQueryObject(window),e=a instanceof jQuery?a:jQueryObject(a),f=!1;0!=e.length&&(g(),d.on("resize",jQueryObject.aox.throttle(g, 16)))}
14/* --------------------------------------------------
15 * SET THRESHOLD CALLBACK
16 * ----------------------------------------------- */
17function setThresholdCallback(a){function g(){var a=f();(a&&!e||!a&&e)&&(e=!e,c.onSwitch(),e?c.onUnderThreshold():c.onOverThreshold())}var b={threshold:".max-width-640",onSwitch:function(){},onUnderThreshold:function(){},onOverThreshold:function(){}},c=jQuery.extend({},b,a),d=jQueryObject(window),e=!1,f="string"==typeof c.threshold?function(){return 1==jQueryObject(c.threshold).length}:function(){return d.width()<=c.threshold};g(),jQueryObject(window).on("resize",jQueryObject.aox.throttle(g, 16))}
18/* --------------------------------------------------
19 * scrollToTarget
20 * ----------------------------------------------- */
21function scrollToTarget( id, callback )
22{
23	var $anchor = id instanceof jQuery ? id : jQueryObject( '#'+id.replace('#','') ),
24		start	= 0,
25		speed	= 0,
26		top		= 0,
27		j		= 0,
28		delta	= 64,
29		element	= ['.fr .obj_inner-nav']; // header
30
31	if( $anchor.length != 1 ) return false;
32	
33	for( var i=0; i<element.length; i++ )
34	{
35		var $el = jQueryObject( element[i] );
36		
37		if( $el.length >= 1 )
38			$el.each(function(i){ delta = delta + $el.eq(i).outerHeight(); });	
39	}
40	
41	top		= $anchor.offset().top;
42	start 	= jQueryObject(window).scrollTop();
43	speed 	= Math.max(Math.abs(Math.round(( top - start ) / 4)), 250);
44	
45	if(start == 0) return;
46	
47	jQueryObject('html,body')
48		.animate({scrollTop: top - delta }, speed, function()
49		{
50			if( jQuery.isFunction(callback) && j++ == 0 ) callback( $anchor );
51		});		
52}
53/* --------------------------------------------------
54 * NEW 2016
55 * ----------------------------------------------- */
56function getScrollListener()
57{
58	var $window 	= jQueryObject(window),
59		$html		= jQueryObject('html'),
60		hasClass 	= false;
61	
62	function scrollListener(){
63		var scrollTop = $window.scrollTop();
64		
65		if(!hasClass && scrollTop > 0)
66		{
67			hasClass = true;
68			$html.addClass('header-vichymag-is-pinned');
69		}
70		else if(hasClass && scrollTop == 0)
71		{
72			hasClass = false;
73			$html.removeClass('header-vichymag-is-pinned');
74		}
75	}
76	scrollListener();
77	
78	return scrollListener;
79}
80/* --------------------------------------------------
81 * switchElements
82 * ----------------------------------------------- */
83function switchElements(n,t,i,o,c){function e(){f[p]({opacity:0},250,function(){y&&(y=!1,f.css({display:"none"}),u())})}function u(){s.css({display:"block",opacity:0}
83),"function"==typeof o&&o(),s[p]({opacity:1},250,function(){a&&(a=!1,"function"==typeof c&&c())})}var f=n instanceof jQuery?n:jQueryObject(n),s=t instanceof jQuery?t:jQueryObject(t),y=!0,a=!0,p=jQuery.support.transition?"transit":"animate";"function"==typeof i&&i(),0!=f.length?e():0!=s.length&&u()}
84/* --------------------------------------------------
85 * common call
86 * ----------------------------------------------- */
87jQueryObject(document).ready(function()
88{
89	initMatchMedia();
90	// 2016
91	jQueryObject(window).on('scroll', jQuery.aox.throttle(getScrollListener()));
92});

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.