PageSourceSearch

https://parisandco.fr/wp-content/themes/estato/js/misc.js?ver=6.8.10

js parisandco.fr collected 2026-10-04 13:26:30 UTC 15,976 bytes, 460 lines download raw bytes

1'use strict';
2
3window.onunload = function(){};
4
5window.boldthemes_loaded = false;
6
7(function( $ ) {
8
9	function boldthemes_video_resize() {
10		$( 'iframe' ).not( '.twitter-tweet' ).each(function() {
11			if ( ! $( this ).parent().hasClass( 'boldPhotoBox' ) ) {
12				$( this ).css( 'width', '100%' );
13				$( this ).css( 'height', $( this ).width() * 9 / 16 );
14			}
15		});
16		
17		$( 'embed' ).each(function() {
18			if ( ! $( this ).parent().hasClass( 'boldPhotoBox' ) ) {
19				$( this ).css( 'width', '100%' );
20				$( this ).css( 'height', $( this ).width() * 9 / 16 );
21			}
22		});	
23	}
24	
25	jQuery.fn.isOnScreen = function() {
26		var element = this.get( 0 );
27		if ( element == undefined ) return false;
28		var bounds = element.getBoundingClientRect();
29		return bounds.top + 75 < window.innerHeight && bounds.bottom > 0;
30	}
31
32	$( document ).ready(function() {
33			
34		boldthemes_video_resize();
35		
36		/* position on screen */
37
38		$( '.btSidebar select, select.orderby, .wpcf7-form select' ).fancySelect().on( 'change.fs', function() {
39			$( this ).trigger( 'change.$' );
40		});
41		
42		if ( $( '.btGhost' ).length > 0 ) {
43			$( 'body' ).append( $( '.btGhost' ) );
44			$( 'body' ).addClass( 'btHasGhost' );
45		}
46		
47		$( '.btQuoteSlider' ).wrap( '<div class="btQuoteWrapper"></div>' );
48
49		$( '.btHasGhost .btGhostSliderThumb a' ).on( 'click', function( e ) {
50			e.preventDefault();
51			$( '.single-portfolio .btGhost' ).removeClass( 'btRemoveGhost' );
52			$( '.btHasGhost .btGhostSliderThumb' ).removeClass( 'btMarkedImage' );
53			boldthemes_disable_scroll();
54			$( '.btGhost .slick-slider' ).slick( 'slickGoTo', $( this ).closest( '.btGhostSliderThumb' ).data( 'order-num' ) );
55		});
56		
57		if ( $( window ).scrollTop() > 0 || $( 'html' ).hasClass( 'no-csstransforms3d' ) ) {
58			$( '.btGhost' ).addClass( 'btRemoveGhost' );
59		}
60		
61		window.boldthemes_theme_loaded = false;
62		
63		window.boldthemes_disable_scroll = function() {
64			window.onmousewheel = document.onmousewheel = function() {
65				if ( window.boldthemes_theme_loaded ) {
66					$( '.btCloseGhost' ).trigger( 'click' );
67				}
68				if ( ! window.boldthemes_theme_loaded || ! window.boldthemes_theme_allow_scroll ) {
69					return false;
70				}
71			};
72			$( window ).on( 'DOMMouseScroll', function( e ) {
73				if ( window.boldthemes_theme_loaded ) {
74					$( '.btCloseGhost' ).trigger( 'click' );
75				}			
76				if ( ! window.boldthemes_theme_loaded || ! window.boldthemes_theme_allow_scroll ) {
77					e.preventDefault();
78				}
79			});		
80		}
81		
82		window.boldthemes_enable_scroll = function() {
83			window.onmousewheel = document.onmousewheel = null;
84		}
85		
86		var articleWithGhost = $( '.btPostOverlay' ).length > 0;
87		
88		if ( $( '.btRemoveGhost' ).length == 0 && $( '.btGhost' ).length > 0  ) {
89			window.boldthemes_theme_allow_scroll = false;
90			boldthemes_disable_scroll();
91		}
92
93		$( '.wpcf7-date' ).on( 'change', function() {
94			$( this ).addClass( 'placeholderclass' );
95		});
96		
97	});
98
99	$( window ).load(function() {
100		window.boldthemes_theme_loaded = true;
101		
102		// remove preloader
103		$( '#btPreloader' ).addClass( 'removePreloader' );
104		
105		// trigger custom load event
106		setTimeout( function() { $( window ).trigger( 'btload' ); window.boldthemes_loaded = true; }, 1000 );
107		
108	});
109
110	$( window ).resize(function() {
111		boldthemes_video_resize();
112	});
113
114	/* Animate classic elements */
115
116	function btAnimateRows() {
117		var $elems = $( 'body:not(.btPageTransitions) .rowItem.animate:not(.animated), .headline .animate, article.animate' ).not( '.slided .animate' );
118		$elems.each(function() {
119			var $elm = $( this );
120			if ( 
121			( $elm.isOnScreen() && ! $( 'body' ).hasClass( 'impress-enabled' ) ) ||
122			( $elm.isOnScreen() && $( 'body' ).hasClass( 'impress-enabled' ) && $elm.closest( '.boldSection' ).hasClass( 'active' ) )
123			) {
124				$elm.addClass( 'animated' );
125			}
126		});
127	}
128
129	if ( ! $( 'body' ).hasClass( 'impress-enabled' ) ) {
130		$( window ).scroll(function() {
131			btAnimateRows();
132		});
133	}	
134
135	$( window ).on( 'btload', function() {
136		btAnimateRows();
137		
138		// autoplay
139		if ( $( 'li.btAnimNavNext' ).length && $( 'body' ).data( 'autoplay' ) > 0 ) {
140			window.boldthemes_autoplay_interval = setInterval( function(){ $( 'li.btAnimNavNext' ).trigger( 'click' ); }, $( 'body' ).data( 'autoplay' ) );
141		}		
142	});
143	
144	$( window ).on( 'boldthemes_section_animation_out', function( e, el ) {
145		$( el ).find( '.rowItem.animated' ).removeClass( 'animated' );
146	});
147	
148	$( window ).on( 'boldthemes_section_animation_end', function( e, el ) {
149		$( el ).find( '.rowItem.animate' ).addClass( 'animated' );
150	});		
151
152	$( document ).ready(function() {
153
154		var doc = document.documentElement;
155		doc.setAttribute('data-useragent', navigator.userAgent);
156
157		// basic functions
158
159		if ( ! String.prototype.startsWith ) {
160			String.prototype.startsWith = function(searchString, position) {
161				position = position || 0;
162				return this.lastIndexOf(searchString, position) === position;
163			};
164		}
165
166		if ( ! String.prototype.endsWith ) {
167			String.prototype.endsWith = function(searchString, position) {
168				var subjectString = this.toString();
169				if (position === undefined || position > subjectString.length) {
170					position = subjectString.length;
171				}
172				position -= searchString.length;
173				var lastIndex = subjectString.indexOf(searchString, position);
174				return lastIndex !== -1 && lastIndex === position;
175			};
176		}
177
178		/* scroll handlers */
179
180		function scrollPage() {
181			var fromTop = $( this ).scrollTop();
182			$( '.btCloseGhost' ).trigger( 'click' );
183		}
184
185		function scrollPageTo( val ) {
186			val = parseInt( val );
187			$( 'body, html' ).animate({ scrollTop: val + 'px' }, 500 );
188		}
189
190		function scrollPageToId(id) {
191			if ( $( id ).length == 0 ) return false;
192			var topOffset = $( id ).offset().top;
193			if ( window.btStickyEnabled && topOffset > window.btStickyOffset ) {
194				topOffset -= $( '.mainHeader' ).height();
195				
196			}
197			$( 'html, body' ).animate({ scrollTop: topOffset }, 500);
198		}
199
200		/* init scroll listener */
201
202		window.addEventListener( 'scroll', scrollPage );
203	 	
204		// delay click to allow on page leave screen
205
206		$( document ).on( 'click', 'a', function() {
207			if ( ! $( this ).hasClass( 'lightbox' ) && ! $( this ).hasClass( 'add_to_cart_button' ) ) {
208				var href = $( this ).attr( 'href' );
209				if ( href !== undefined ) {
210					if ( location.href == href || ( location.href.split( '#' )[0] != href.split( '#' )[0] && ! href.startsWith( '#' ) && ! href.startsWith( 'mailto' ) ) ) {
211						if ( $( this ).attr( 'target' ) != '_blank' && ! href.endsWith( '#respond' ) ) {
212							if ( $( '#btPreloader' ).length ) {
213								$( '#btPreloader' ).removeClass( 'removePreloader' );
214								setTimeout( function() { window.location = href }, 1500 );
215								return false;
216							}
217						}
218					} else if ( href != "#" && ! href.startsWith( 'mailto' ) ) {
219						if ( $( this ).parent().parent().attr('class') != 'tabsHeader' ) scrollPageToId( href );
220						return false;
221					}
222				}
223			}
224		});
225
226		// Vertical alignment fix
227
228		$( '.rowItem.btMiddleVertical, .rowItem.btBottomVertical, .rowItem.btTopVertical' ).parent().addClass( 'btTableRow' );
229
230		/* Footer widgets count and column set */
231
232		$( '#boldSiteFooterWidgetsRow' ).children().addClass( 'rowItem col-md-' + 12 / $( '#boldSiteFooterWidgetsRow' ).children().length + ' col-sm-12' );
233
234		// Gallery slider info bar toggler
235
236		$( '.btGetInfo' ).on( 'click', function () {
237			$(this).toggleClass( 'on' ).next().toggleClass( 'open' );
238			return false;
239		});	
240
241		// Close gallery slider
242
243		$( '.btCloseGhost' ).on( 'click', function () {
244			if ( ! $( '.btGhost' ).hasClass( 'btRemoveGhost' ) ) {
245				$( '.btGhost' ).addClass( 'btRemoveGhost' );
246				$( window ).trigger( 'resize' );
247				var pos = $( this ).parent().find( '.slick-slider' ).first().slick( 'slickCurrentSlide' );
248				var num_slides = $( this ).parent().find( '.slick-slider' ).find( '.slick-slide' ).length;
249				var thumbs = $( '.btGridGallery' ).first().find( '.btGhostSliderThumb' );
250				if ( thumbs.length > 0 ) {
251					var num_thumbs = thumbs.length;
252					if ( num_slides > num_thumbs && pos > 0 ) {
253						$( thumbs[ pos - 1 ] ).addClass( 'btMarkedImage' );
254						$( 'html, body' ).animate({
255							scrollTop: $( thumbs[ pos - 1 ] ).offset().top + $( thumbs[ pos - 1 ] ).height() * .5 - window.innerHeight * 0.5
256						}, 0 );
257					} else if ( num_slides == num_thumbs ) {
258						$( thumbs[ pos ] ).addClass( 'btMarkedImage' );
259						$( 'html, body' ).animate({
260							scrollTop: $( thumbs[ pos ] ).offset().top + $( thumbs[ pos ] ).height() * .5 - window.innerHeight * 0.5
261						}, 0 );
262					}
263				}
264				setTimeout( function() { window.boldthemes_theme_allow_scroll = true; $( '.btMarkedImage' ).removeClass( 'btMarkedImage' ) }, 800 );
265				return false;
266			}
267		});
268		
269		// magnific-popup grid gallery
270		
271		$( '.tilesWall.lightbox' ).each(function() {
272			$( this ).find( 'a' ).magnificPopup({
273				type: 'image',
274				// other options
275				gallery:{
276					enabled:true
277				},
278				closeMarkup:'<button class="mfp-close" type="button"><i class="mfp-close-icn">&times;</i></button>',
279				image: {
280					titleSrc: 'data-title'
281				},
282				closeBtnInside:false		
283			});
284		});
285		
286		if ( window.boldthemes_anim_selector ) {
287		
288			$( window ).on( 'btload', function() {
289				$( '.btPageWrap' ).append( '<div id="btAnimSelector" class="btDarkSkin"><select id="btFwdAnim"></select><select id="btBckAnim"></select></div>' );
290				
291				var anim = [];
292				
293				anim[1] = 'Move to left | from right';
294				anim[2] = 'Move to right | from left';
295				anim[3] = 'Move to top | from bottom';
296				anim[4] = 'Move to bottom | from top';
297				anim[5] = 'Fade | from right';
298				anim[6] = 'Fade | from left';
299				anim[7] = 'Fade | from bottom';
300				anim[8] = 'Fade | from top';
301				anim[9] = 'Fade left | Fade right';
302				anim[10] = 'Fade right | Fade left';
303				anim[11] = 'Fade top | Fade bottom';
304				anim[12] = 'Fade bottom | Fade top';
305				anim[13] = 'Different easing | from right';
306				anim[14] = 'Different easing | from left';
307				anim[15] = 'Different easing | from bottom';
308				anim[16] = 'Different easing | from top';
309				anim[17] = 'Scale down | from right';
310				anim[18] = 'Scale down | from left';
311				anim[19] = 'Scale down | from bottom';
312				anim[20] = 'Scale down | from top';
313				anim[21] = 'Scale down | scale down';
314				anim[22] = 'Scale up | scale up';
315				anim[23] = 'Move to left | scale up';
316				anim[24] = 'Move to right | scale up';
317				anim[25] = 'Move to top | scale up';
318				anim[26] = 'Move to bottom | scale up';
319				anim[27] = 'Scale down | scale up';
320				anim[28] = 'Glue left | from right';
321				anim[29] = 'Glue right | from left';
322				anim[30] = 'Glue bottom | from top';
323				anim[31] = 'Glue top | from bottom';
324				anim[32] = 'Flip right';
325				anim[33] = 'Flip left';
326				anim[34] = 'Flip top';
327				anim[35] = 'Flip bottom';
328				anim[36] = 'Rotate fall';
329				anim[37] = 'Rotate newspaper';
330				anim[38] = 'Push left | from right';
331				anim[39] = 'Push right | from left';
332				anim[40] = 'Push top | from bottom';
333				anim[41] = 'Push bottom | from top';
334				anim[42] = 'Push left | pull right';
335				anim[43] = 'Push right | pull left';
336				anim[44] = 'Push top | pull bottom';
337				anim[45] = 'Push bottom | pull top';
338				anim[46] = 'Fold left | from right';
339				anim[47] = 'Fold right | from left';
340				anim[48] = 'Fold top | from bottom';
341				anim[49] = 'Fold bottom | from top';
342				anim[50] = 'Move to right | unfold left';
343				anim[51] = 'Move to left | unfold right';
344				anim[52] = 'Move to bottom | unfold top';
345				anim[53] = 'Move to top | unfold bottom';
346				anim[54] = 'Room to left';
347				anim[55] = 'Room to right';
348				anim[56] = 'Room to top';
349				anim[57] = 'Room to bottom';
350				anim[58] = 'Cube to left';
351				anim[59] = 'Cube to right';
352				anim[60] = 'Cube to top';
353				anim[61] = 'Cube to bottom';
354				anim[62] = 'Carousel to left';
355				anim[63] = 'Carousel to right';
356				anim[64] = 'Carousel to top';
357				anim[65] = 'Carousel to bottom';
358				anim[66] = 'Sides';
359				
360				if ( $('body.btHalfPage').length ) {
361					var titleLeft = 'Select left animation';
362					var titleRight = 'Select right animation';
363				} else {
364					var titleLeft = 'Select forward animation';
365					var titleRight = 'Select backward animation';				
366				}
367				
368				$( '#btAnimSelector #btFwdAnim' ).append( '<option value="">' + titleLeft + '</option>' );
369				$( '#btAnimSelector #btBckAnim' ).append( '<option value="">' + titleRight + '</option>' );
370				
371				for ( var i = 1; i < anim.length; i++ ) {
372					$( '#btAnimSelector #btFwdAnim' ).append( '<option value="' + i + '">' + anim[ i ] + '</option>' );
373					$( '#btAnimSelector #btBckAnim' ).append( '<option value="' + i + '">' + anim[ i ] + '</option>' );
374				}
375				
376				$( '#btAnimSelector #btFwdAnim' ).on( 'change', function( e ) {
377					var val = $( this ).val();
378					var $pages = $( 'section.btSectionTransitions' );
379					$pages.each( function() {
380						$( this ).data( 'animation', val );
381					});
382					$( '.btAnimNavNext' ).trigger( 'click' );
383				});
384				
385				$( '#btAnimSelector #btBckAnim' ).on( 'change', function( e ) {
386					var val = $( this ).val();
387					var $pages = $( 'section.btSectionTransitions' );
388					$pages.each( function() {
389						$( this ).data( 'animation-back', val );
390					});
391					$( '.btAnimNavPrev' ).trigger( 'click' );
392				});
393
394				$( '#btAnimSelector select' ).fancySelect().on('change.fs', function() {
395					$(this).trigger('change.$');
396				});
397
398				setTimeout( function() { $( 'body' ).addClass( 'btShowAnimSelector' ); }, 10 );
399			});
400		
401		}
402
403		// Info over Google map slide
404		$('.btInfoPaneToggler').on( 'click', function(){
405			$(this).parent().parent().toggleClass('closed');
406		});
407
408	});
409	
410	
411	
412})( jQuery );
413
414function boldthemes_swipedetect( el, callback ) {
415  
416    var touchsurface = el,
417    swipedir,
418    startX,
419    startY,
420    distX,
421    distY,
422    threshold = 150, //required min distance traveled to be considered swipe
423    restraint = 100, // maximum distance allowed at the same time in perpendicular direction
424    allowedTime = 300, // maximum time allowed to travel that distance
425    elapsedTime,
426    startTime,
427    handleswipe = callback || function( swipedir ) {}
428  
429    touchsurface.addEventListener( 'touchstart', function( e ) {
430        var touchobj = e.changedTouches[0];
431        swipedir = 'none';
432        //dist = 0;
433        startX = touchobj.pageX;
434        startY = touchobj.pageY;
435        startTime = new Date().getTime(); // record time when finger first makes contact with surface
436        //e.preventDefault();
437    }, false );
438  
439    touchsurface.addEventListener( 'touchmove', function( e ) {
440       // e.preventDefault(); // prevent scrolling when inside DIV
441    }, false );
442  
443    touchsurface.addEventListener( 'touchend', function( e ) {
444        var touchobj = e.changedTouches[0];
445        distX = touchobj.pageX - startX;// get horizontal dist traveled by finger while in contact with surface
446        distY = touchobj.pageY - startY; // get vertical dist traveled by finger while in contact with surface
447
448        elapsedTime = new Date().getTime() - startTime; // get time elapsed
449        if ( elapsedTime <= allowedTime ) { // first condition for awipe met
450            if ( Math.abs( distX ) >= threshold && Math.abs( distY ) <= restraint ) { // 2nd condition for horizontal swipe met
451                swipedir = ( distX < 0 ) ? 'left' : 'right'; // if dist traveled is negative, it indicates left swipe
452            } else if ( Math.abs( distY ) >= threshold && Math.abs( distX ) <= restraint ) { // 2nd condition for vertical swipe met
453                swipedir = ( distY < 0 ) ? 'up' : 'down'; // if dist traveled is negative, it indicates up swipe
454            }
455        }
456
457        handleswipe( swipedir );
458        //e.preventDefault();
459    }, false );
460}

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.