PageSourceSearch

https://www.horse-ball.org/media/js/scripts_hb.js?1790408180

js horse-ball.org collected 2026-09-26 07:37:05 UTC 62,584 bytes, 2,068 lines download raw bytes

1"use strict";
2
3$.fn.selectpicker.Constructor.BootstrapVersion = '4';
4
5$('[data-toggle="popover"]').popover();
6
7//$(".paroller").paroller({ factor: 0.3});
8
9			///////////////// fixed menu on scroll for desktop
10			  /*
11				$(window).scroll(function(){  
12				if ($(window).width() > 992) {
13					$('nav').addClass("fixed-top");
14					 if ($(this).scrollTop() > 0) {
15						$('nav').addClass("fixed-top");
16						// add padding top to show content behind navbar
17						//$('body').css('padding-top', $('.navbar').outerHeight() + 'px');
18					  }else{
19						//$('nav').removeClass("fixed-top");
20						 // remove padding top from body
21						//$('body').css('padding-top', '0');
22					  }   
23				} else {
24						$('nav').removeClass("fixed-top");
25				}// end if
26			  });
27			*/
28
29			/*
30			var $sticky = $('#mainNav');
31			$sticky.hcSticky({
32			  stickTo: 'body',
33			  top: 0,
34			  responsive: {
35				980: {
36				  disable: true
37				}	
38			  }
39			});
40
41			$sticky.hcSticky('update', {
42			  //top: 20
43			});			
44			*/
45			$('.simple-marquee-container').SimpleMarquee({
46				hover: true,
47				velocity: 0.1,
48			});
49			$(window).on('resize', function(){
50				$('.simple-marquee-container').SimpleMarquee({
51					hover: true,
52					velocity: 0.1,
53				});
54			});		
55
56			$('.my-news-ticker').AcmeTicker({  
57				type:'horizontal',/*vertical/horizontal/Marquee/type*/
58				direction: 'right',/*up/down/left/right*/
59				autoplay:6000,
60				speed:300,/*true/false/number*/ /*For vertical/horizontal 600*//*For marquee 0.05*//*For typewriter 50*/
61				controls: {
62					prev: $('.acme-news-ticker-prev'),/*Can be used for vertical/horizontal/typewriter*//*not work for marquee*/
63					next: $('.acme-news-ticker-next'),/*Can be used for vertical/horizontal/typewriter*//*not work for marquee*/
64					toggle: $('.acme-news-ticker-pause')/*Can be used for vertical/horizontal/marquee/typewriter*/
65				}	
66				/*
67				type:'horizontal',
68				direction: 'right',
69				controls: {  
70					prev: $('.acme-news-ticker-prev'),
71					toggle: $('.acme-news-ticker-pause'),
72					next: $('.acme-news-ticker-next')
73				} 
74				*/
75			});  
76
77			/*
78			const $dropdown = $(".dropdown");
79			const $dropdownToggle = $(".dropdown-toggle");
80			const $dropdownMenu = $(".dropdown-menu");
81			const showClass = "show";
82
83			$(window).on("load resize", function() {
84			  if (this.matchMedia("(min-width: 768px)").matches) {
85				$dropdown.hover(
86				  function() {
87					const $this = $(this);
88					$this.addClass(showClass);
89					$this.find($dropdownToggle).attr("aria-expanded", "true");
90					$this.find($dropdownMenu).addClass(showClass);
91				  },
92				  function() {
93					const $this = $(this);
94					$this.removeClass(showClass);
95					$this.find($dropdownToggle).attr("aria-expanded", "false");
96					$this.find($dropdownMenu).removeClass(showClass);
97				  }
98				);
99			  } else {
100				$dropdown.off("mouseenter mouseleave");
101			  }
102			});			
103			*/
104			$('#main-menu').smartmenus();
105			  var $mainMenuState = $('#main-menu-state');
106			  if ($mainMenuState.length) {
107				// animate mobile menu
108				$mainMenuState.change(function(e) {
109				  var $menu = $('#main-menu');
110				  if (this.checked) {
111					$menu.hide().slideDown(250, function() { $menu.css('display', ''); });
112				  } else {
113					$menu.show().slideUp(250, function() { $menu.css('display', ''); });
114				  }
115				});
116				// hide mobile menu beforeunload
117				$(window).on('beforeunload unload', function() {
118				  if ($mainMenuState[0].checked) {
119					$mainMenuState[0].click();
120				  }
121				});
122			  }
123/*			
124var mySwiper = new Swiper('.swiper-container', {
125  // Optional parameters
126  //direction: 'vertical',
127  loop: true,
128
129  // If we need pagination
130  pagination: {
131    el: '.swiper-pagination',
132  },
133
134  // Navigation arrows
135  navigation: {
136    nextEl: '.swiper-button-next',
137    prevEl: '.swiper-button-prev',
138  },
139
140  // And if we need scrollbar
141  scrollbar: {
142    //el: '.swiper-scrollbar',
143  },
144})			
145*/	
146
147
148if ($('#image-slider').length > 0) {
149	new Splide( '#image-slider', {
150		lazyLoad: true,
151		perPage: 2,
152		type   : 'loop',
153		arrows : false,
154		rewind : true,
155		autoWidth: false,
156		autoHeight: true,
157		gap    : '1rem',
158		autoplay	: true,
159		breakpoints: {
160			'768': {
161				perPage: 2,
162				gap    : '1rem',
163			},
164			'480': {
165				perPage: 1,
166				gap    : '1rem',
167			},
168		}	
169	} ).mount();
170}
171if ($('#splidevideo').length > 0) {
172	new Splide( '#splidevideo', {
173		video: {
174			//autoplay: true,
175			mute    : true,
176		},
177		playerOptions: {
178		  youtube: {
179			cc_lang_pref: 'jpn',
180		  },
181		  vimeo: {
182			byline: false,
183		  },
184		  htmlVideo: {
185			playsinline: false,
186		  },
187		}		
188	}).mount( window.splide.Extensions );
189}
190
191
192if ($('#primary-slider').length > 0) {
193	document.addEventListener( 'DOMContentLoaded', function () {
194		var secondarySlider = new Splide( '#secondary-slider', {
195			lazyLoad: true,
196			fixedWidth  : 100,
197			height      : 100,
198			gap         : 2,
199			arrows     : false,
200			cover       : true,
201			isNavigation: true,
202			focus       : 'center',
203			autoplay	: true,
204			breakpoints : {
205				'600': {
206					fixedWidth: 60,
207					height    : 60,
208				}
209			},
210		} ).mount();
211
212		var primarySlider = new Splide( '#primary-slider', {
213			type       : 'fade',
214			heightRatio: 0.6,
215			pagination : false,
216			arrows     : false,
217			cover      : true,
218		} ); // do not call mount() here.
219
220		primarySlider.sync( secondarySlider ).mount();
221	} );
222}
223
224if ($('.swiper-container').length > 0) {
225	var swiper = new Swiper('.swiper-container', {
226		  lazy: true,
227		  slidesPerView: 2,
228		  slidesPerGroup: 2,
229		  spaceBetween: 5,
230		  grabCursor: true,
231		  loop: true,		
232		  autoplay: {
233			delay: 3500,
234			disableOnInteraction: true,
235		  },
236		  pagination: {
237			el: '.swiper-pagination',
238			clickable: true,
239		  },
240		  breakpoints: {
241			640: {
242			  slidesPerView: 3,
243			  spaceBetween: 5,
244			},
245			768: {
246			  slidesPerView: 3,
247			  spaceBetween: 5,
248			},
249			1024: {
250			  slidesPerView: 5,
251			  spaceBetween: 10,
252			},
253			1224: {
254			  slidesPerView: 6,
255			  spaceBetween: 10,
256			},
257		  }		
258    });
259			
260		$(".swiper-container").hover(function() {
261			(this).swiper.autoplay.stop();
262		}, function() {
263			//(this).swiper.autoplay.start();
264		});
265}
266			/*
267			var mySwiper = new Swiper('.swiper-container', {
268			  // Optional parameters
269			  //direction: 'vertical',
270				loop: true,
271				spaceBetween: 0,
272				//autoHeight: true,
273				
274				autoplay: {
275					delay: 3000,
276				},
277
278			  // If we need pagination
279			  pagination: {
280				el: '.swiper-pagination',
281			  },
282
283			  // Navigation arrows
284			  navigation: {
285				nextEl: '.swiper-button-next',
286				prevEl: '.swiper-button-prev',
287			  },
288
289			  // And if we need scrollbar
290			  scrollbar: {
291				el: '.swiper-scrollbar',
292			  },
293			})		
294		  $('.masthead').on('mouseenter', function(e){
295			mySwiper.autoplay.stop();
296			//mySwiper.stopAutoplay();
297		  })
298		  $('.masthead').on('mouseleave', function(e){
299			mySwiper.autoplay.start();
300			//mySwiper.startAutoplay();
301		  })
302		$(window).resize(function(){
303
304		  mySwiper.update();
305		})
306		$(window).trigger("resize")		
307		*/
308		$('#carouselExampleIndicators').hover(function() {
309			//$(this).carousel('pause'); // Fait bugger sur Mobile !
310		}, function() {
311			//$(this).carousel('cycle'); // Fait bugger sur Mobile !
312		});
313
314
315	/* Gestion des cookies 
316    var optionsC = {
317			cookieTypes: [
318                {
319                    type: 'Audience',
320                    value: 'analytics',
321                    description: 'Cookies relatifs aux visites, navigateur, etc'
322                }
323            ],
324        title: 'Cookies',
325        message: 'Nous utilisons des cookies afin d\'assurer le bon fonctionnement de notre site, réaliser des mesures d\'audience et d\'analyser notre trafic. Pour en savoir plus, consultez notre ',
326        delay: 50,
327        expires: 365,
328        link: 'https://www.horse-ball.org/share/Conditions_Generales_Utilisation.pdf',
329        onAccept: function(){
330
331		},
332        //uncheckBoxes: false,
333		advancedBtnLabel: 'Configurer', //Configurer 
334        acceptBtnLabel: 'Acceptez les cookies',
335        moreInfoLabel: 'politique de gestion des cookies',
336        cookieTypesTitle: 'Sélectionnez les cookies que vous acceptez.',
337        fixedCookieTypeLabel: 'Techniques',
338        fixedCookieTypeDesc: 'Essentiels au bon fonctionnement du site.'
339    };
340
341    $('body').ihavecookies(optionsC);
342	if ($.fn.ihavecookies.preference('analytics') === true) {
343		//console.log('This should run because marketing is accepted.');
344	}
345	$('#ihavecookiesBtn').on('click', function(){
346		$('body').ihavecookies(optionsC, 'reinit');
347	});
348	*/
349	
350	//$.tablesorter.defaults.widgets = ['zebra'];
351	$(".hbtable").tablesorter({
352		theme : "default",
353		onRenderHeader: function(index) {
354		  // the TH content is wrapped with a div.tablesorter-header-inner by default, so just add the new class
355		  //$(this).find('div').addClass('roundedCorners header' + index );
356		}	
357	});
358
359
360
361		$.scrollUp({
362			scrollName: 'scrollUp', // Element ID
363			scrollDistance: 400, // Distance from top/bottom before showing element (px)
364			scrollFrom: 'top', // 'top' or 'bottom'
365			scrollSpeed: 300, // Speed back to top (ms)
366			easingType: 'linear', // Scroll to top easing (see http://easings.net/)
367			animation: 'fade', // Fade, slide, none
368			animationSpeed: 200, // Animation speed (ms)
369			scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object
370			scrollTarget: false, // Set a custom target element for scrolling to. Can be element or number
371			scrollText: 'Scroll to top', // Text for element, can contain HTML
372			scrollTitle: false, // Set a custom <a> title if required.
373			scrollImg: true, // Set true to use image
374			activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
375			zIndex: 2147483647 // Z-Index for the overlay
376		});
377
378
379// Add the following code if you want the name of the file appear on select
380$(".custom-file-input").on("change", function() {
381  var fileName = $(this).val().split("\\").pop();
382  $(this).siblings(".custom-file-label").addClass("selected").html(fileName);
383});	
384
385
386$("#formCommentaire").on("submit", function (e) {
387	/*
388	$.alert({
389		title: '<i class="fas fa-hand-point-right"></i>',
390		content: 'Juste un test !!!',
391		animateFromElement: false,
392		animation: 'top',
393		backgroundDismiss: false,
394		buttons: {
395			ok: {
396				text: 'OK'
397			}
398		}
399	});
400	*/
401    var postData = new FormData(this);
402    var formURL = $(this).attr("action");
403    $.ajax({
404        url: formURL,
405        type: "POST",
406        data: postData,
407        dataType: "json",
408        processData: false,
409        contentType: false,
410        success: function (data, textStatus, jqXHR) {
411			$("#formCommentaire").trigger('reset');
412            $.alert({
413                title: '<i class="fas fa-hand-point-right"></i>',
414                content: data.msg,
415                animateFromElement: false,
416                animation: 'top',
417                backgroundDismiss: false,
418                buttons: {
419                    ok: {
420                        text: 'OK',
421						action: function () {
422								var uri = getQueryVariable("rub");
423								if ( uri ) window.location = window.location.href.split("?")[0] + '?rub=' + uri;
424								else window.location = window.location.href.split("?")[0];
425							//$("#formCommentaire").trigger('reset');
426						}
427                    }
428                }
429            });
430        },
431        statusCode: {
432            500: function (jqXHR, status, error) {
433                $.alert({
434                    title: (jqXHR.responseJSON.extra != 'false') ? jqXHR.responseJSON.extra : '<i class="fas fa-exclamation-triangle"></i>',
435                    content: jqXHR.responseJSON.msg,
436                    animateFromElement: false,
437                    animation: 'top',
438                    backgroundDismiss: false,
439                    buttons: {
440                        ok: {
441                            text: 'OK'
442                        }
443                    }
444                });
445            }
446        }
447    });
448    e.preventDefault();
449});
450
451function getQueryVariable(variable)
452{
453       var query = window.location.search.substring(1);
454       var vars = query.split("&");
455       for (var i=0;i<vars.length;i++) {
456               var pair = vars[i].split("=");
457               if(pair[0] == variable){return pair[1];}
458       }
459       return(false);
460}
461
462$("#formLogin").on("submit", function (e) {
463    var postData = new FormData(this);
464    var formURL = $(this).attr("action");
465    $.ajax({
466        url: formURL,
467        type: "POST",
468        data: postData,
469        dataType: "json",
470        processData: false,
471        contentType: false,
472        success: function (data, textStatus, jqXHR) {
473			$("#formLogin").trigger('reset');
474			$form_modal.removeClass('is-visible');
475            $.alert({
476                title: '<i class="fas fa-hand-point-right"></i>',
477                content: data.msg,
478                animateFromElement: false,
479                animation: 'top',
480                backgroundDismiss: false,
481                buttons: {
482                    ok: {
483                        text: 'OK',
484						action: function () {
485							/*
486							// Assuming "?post=1234&action=edit"
487							var urlParams = new URLSearchParams(window.location.search);
488							console.log(urlParams.has('post')); // true
489							console.log(urlParams.get('action')); // "edit"
490							console.log(urlParams.getAll('action')); // ["edit"]
491							console.log(urlParams.toString()); // "?post=1234&action=edit"
492							console.log(urlParams.append('active', '1')); // "?post=1234&action=edit&active=1"
493							*/
494							if (/(webstore)/i.test(window.location.href)) {
495								window.location.href = "index.php";
496							} else {
497								var uri = getQueryVariable("rub");
498								if ( uri ) window.location = window.location.href.split("?")[0] + '?rub=' + uri;
499								else window.location = window.location.href.split("?")[0];
500								//window.location.reload(false);
501							}							
502							//window.location.reload(false);
503							//window.location.href = window.location.href;
504							//$("#formCommentaire").trigger('reset');
505						}
506                    }
507                }
508            });
509        },
510        statusCode: {
511            500: function (jqXHR, status, error) {
512                $.alert({
513                    title: (jqXHR.responseJSON.extra != 'false') ? jqXHR.responseJSON.extra : '<i class="fas fa-exclamation-triangle"></i>',
514                    content: jqXHR.responseJSON.msg,
515                    animateFromElement: false,
516                    animation: 'top',
517                    backgroundDismiss: false,
518                    buttons: {
519                        ok: {
520                            text: 'OK'
521                        }
522                    }
523                });
524            }
525        }
526    });
527    e.preventDefault();
528});
529
530$("#formLost").on("submit", function (e) {
531    var postData = new FormData(this);
532    var formURL = $(this).attr("action");
533    $.ajax({
534        url: formURL,
535        type: "POST",
536        data: postData,
537        dataType: "json",
538        processData: false,
539        contentType: false,
540        success: function (data, textStatus, jqXHR) {
541			$("#formLost").trigger('reset');
542			$form_modal.removeClass('is-visible');
543            $.alert({
544                title: '<i class="fas fa-hand-point-right"></i>',
545                content: data.msg,
546                animateFromElement: false,
547                animation: 'top',
548                backgroundDismiss: false,
549                buttons: {
550                    ok: {
551                        text: 'OK',
552						action: function () {
553							//$("#formCommentaire").trigger('reset');
554						}
555                    }
556                }
557            });
558        },
559        statusCode: {
560            500: function (jqXHR, status, error) {
561                $.alert({
562                    title: (jqXHR.responseJSON.extra != 'false') ? jqXHR.responseJSON.extra : '<i class="fas fa-exclamation-triangle"></i>',
563                    content: jqXHR.responseJSON.msg,
564                    animateFromElement: false,
565                    animation: 'top',
566                    backgroundDismiss: false,
567                    buttons: {
568                        ok: {
569                            text: 'OK'
570                        }
571                    }
572                });
573            }
574        }
575    });
576    e.preventDefault();
577});
578
579$("#formRegister").on("submit", function (e) {
580    var postData = new FormData(this);
581    var formURL = $(this).attr("action");
582    $.ajax({
583        url: formURL,
584        type: "POST",
585        data: postData,
586        dataType: "json",
587        processData: false,
588        contentType: false,
589        success: function (data, textStatus, jqXHR) {
590			$("#formRegister").trigger('reset');
591			$form_modal.removeClass('is-visible');
592            $.alert({
593                title: '<i class="fas fa-hand-point-right"></i>',
594                content: data.msg,
595                animateFromElement: false,
596                animation: 'top',
597                backgroundDismiss: false,
598                buttons: {
599                    ok: {
600                        text: 'OK',
601						action: function () {
602							//window.location.reload(false);
603							//$("#formCommentaire").trigger('reset');
604						}
605                    }
606                }
607            });
608        },
609        statusCode: {
610            500: function (jqXHR, status, error) {
611                $.alert({
612                    title: (jqXHR.responseJSON.extra != 'false') ? jqXHR.responseJSON.extra : '<i class="fas fa-exclamation-triangle"></i>',
613                    content: jqXHR.responseJSON.msg,
614                    animateFromElement: false,
615                    animation: 'top',
616                    backgroundDismiss: false,
617                    buttons: {
618                        ok: {
619                            text: 'OK'
620                        }
621                    }
622                });
623            }
624        }
625    });
626    e.preventDefault();
627});
628
629	var $form_modal = $('.cd-user-modal'),
630		$form_login = $form_modal.find('#cd-login'),
631		$form_signup = $form_modal.find('#cd-signup'),
632		$form_forgot_password = $form_modal.find('#cd-reset-password'),
633		$form_modal_tab = $('.cd-switcher'),
634		$tab_login = $form_modal_tab.children('li').eq(0).children('a'),
635		$tab_signup = $form_modal_tab.children('li').eq(1).children('a'),
636		$forgot_password_link = $form_login.find('.cd-form-bottom-message a'),
637		$back_to_login_link = $form_forgot_password.find('.cd-form-bottom-message a'),
638		$main_nav = $('nav li.logUsers'), 
639		$main_log = $('.LogCon'), 
640		$main_sig = $('.LogSig'); 
641
642	//open modal
643	$main_nav.on('click', function(event){
644
645		if( $(event.target).is($main_nav) ) {
646			// on mobile open the submenu
647			$(this).children('ul').toggleClass('is-visible');
648		} else {
649			// on mobile close submenu
650			$main_nav.children('ul').removeClass('is-visible');
651			//show modal layer
652			$form_modal.addClass('is-visible');	
653			//show the selected form
654			( $(event.target).is('.cd-signup') ) ? signup_selected() : login_selected();
655		}
656
657	});
658
659	//open modal
660	$main_log.on('click', function(event){
661			//show modal layer
662			$form_modal.addClass('is-visible');	
663			//show the selected form
664			//signup_selected();
665			( $(event.target).is('.cd-signup') ) ? signup_selected() : login_selected();
666	});
667	//open modal
668	$main_sig.on('click', function(event){
669			//show modal layer
670			$form_modal.addClass('is-visible');	
671			//show the selected form
672			//signup_selected();
673			( $(event.target).is('.cd-signup') ) ? login_selected() : signup_selected();
674	});
675
676	//close modal
677	$('.cd-user-modal').on('click', function(event){
678		if( $(event.target).is($form_modal) || $(event.target).is('.cd-close-form') ) {
679			//$form_modal.removeClass('is-visible');
680		}	
681	});
682	$('.cd-close-form').on('click', function(event){
683			$form_modal.removeClass('is-visible');
684	});
685	//close modal when clicking the esc keyboard button
686	$(document).keyup(function(event){
687    	if(event.which=='27'){
688    		$form_modal.removeClass('is-visible');
689	    }
690    });
691
692	//switch from a tab to another
693	$form_modal_tab.on('click', function(event) {
694		event.preventDefault();
695		( $(event.target).is( $tab_login ) ) ? login_selected() : signup_selected();
696	});
697
698	//hide or show password
699	$('.hide-password').on('click', function(){
700		var $this= $(this),
701			$password_field = $this.prev('input');
702		
703		( 'password' == $password_field.attr('type') ) ? $password_field.attr('type', 'text') : $password_field.attr('type', 'password');
704		( 'Masquer' == $this.text() ) ? $this.text('Voir') : $this.text('Masquer');
705		//focus and move cursor to the end of input field
706		$password_field.putCursorAtEnd();
707	});
708
709	//show forgot-password form 
710	$forgot_password_link.on('click', function(event){
711		event.preventDefault();
712		forgot_password_selected();
713	});
714
715	//back to login from the forgot-password form
716	$back_to_login_link.on('click', function(event){
717		event.preventDefault();
718		login_selected();
719	});
720
721	function login_selected(){
722		$form_login.addClass('is-selected');
723		$form_signup.removeClass('is-selected');
724		$form_forgot_password.removeClass('is-selected');
725		$tab_login.addClass('selected');
726		$tab_signup.removeClass('selected');
727	}
728
729	function signup_selected(){
730		$form_login.removeClass('is-selected');
731		$form_signup.addClass('is-selected');
732		$form_forgot_password.removeClass('is-selected');
733		$tab_login.removeClass('selected');
734		$tab_signup.addClass('selected');
735	}
736
737	function forgot_password_selected(){
738		$form_login.removeClass('is-selected');
739		$form_signup.removeClass('is-selected');
740		$form_forgot_password.addClass('is-selected');
741	}		
742
743	Toast.setMaxCount(3);
744	Toast.setPlacement(TOAST_PLACEMENT.MIDDLE_RIGHT); // MIDDLE_CENTER
745	Toast.setTheme(TOAST_THEME.DARK);
746	Toast.enableTimers(false);
747	//Toast.configure(2, TOAST_PLACEMENT.MIDDLE_RIGHT, TOAST_THEME.DARK, false);
748	$('.testToast').on('click', function(event){
749		var $this = $(this);
750        Toast.create("Webstore", '"' + $(this).data('produit') + '" ajouté à votre panier', TOAST_STATUS.SUCCESS, 4000);
751	});
752
753	function update(idpanier, qty, rub, option) {
754		/*
755		$('body,html').animate({
756			scrollTop : $("body").offset().top
757		}, 300);
758		*/
759		$('#linkPanier').removeClass('animate__animated animate__flash');
760		$.ajax({
761			type : "GET",
762			url : "../v1_include/v4_session_boutique.inc.php",
763			data : "panier=true&idpanier=" + idpanier + "&qty=" + qty + "&rub=" + rub + "&option=" + option,
764			dataType: 'json', 
765			success : function (data) {
766				//$("#msg").html(data.msg);
767				//response = JSON.parse(data);
768				$('#panierArticle').html(data.extra);
769				Toast.create("Webstore", data.msg, TOAST_STATUS.SUCCESS, 7000);
770				//Toast.create("Webstore", 'Article ajouté à votre panier', TOAST_STATUS.SUCCESS, 4000);
771				$('#linkPanier').addClass('animate__animated animate__flash');
772				$('body,html').animate({
773					scrollTop : $("#linkPanier").offset().top - 150
774				}, 300);
775				/*
776				$('.menuPrice').removeClass('animated shake').addClass('animated shake');
777				var wait = window.setTimeout( function(){
778					$('.menuPrice').removeClass('animated shake')},
779					1300
780				);
781				*/
782			}
783		});
784	}
785
786
787	$('.elSelect').change(function () {
788		var $this = $(this);
789		var $children = $this.children('option:selected');
790		var panier = $children.attr('data-panier');
791		var idpanier = $children.attr('data-idpanier');
792		var qty = $children.attr('data-qty');
793		var option = $children.attr('data-option');
794		//console.log(panier+'|'+idpanier+'|'+qty+'|'+option);
795		$.ajax({
796			//async : false,
797			//processData : false,
798			type : 'get',
799			url : "../v1_include/v4_session_boutique.inc.php",
800			data : "panier=true&idpanier=" + idpanier + "&qty=" + qty + "&option=" + option,
801			dataType: 'json', 
802			success : function (data) {
803				$('body,html').animate({
804					scrollTop : $("#linkPanier").offset().top - 150
805				}, 300);				 
806			},
807			error : function (xhr, ajaxOptions, thrownError) {
808			},
809			 complete: function(){
810				location.href = 'boutique.php';
811				//location.reload();
812			}			
813		});
814	});
815
816	$('.elSelectOneEuro').on('click', function(e){
817		var $this = $(this);
818		var panier = $this.attr('data-panier');
819		var idpanier =$this.attr('data-idpanier');
820		var qty = $this.attr('data-qty');
821		var option = $this.attr('data-option');
822		$.ajax({
823			type : 'get',
824			url : "../v1_include/v4_session_boutique.inc.php",
825			data : "panier=true&idpanier=" + idpanier + "&qty=" + qty + "&option=" + option,
826			dataType: 'json', 
827			success : function (data) {
828				$('body,html').animate({
829					scrollTop : $("#linkPanier").offset().top - 150
830				}, 300);				 
831			},
832			error : function (xhr, ajaxOptions, thrownError) {
833			},
834			 complete: function(){
835				location.href = 'boutique.php';
836				//location.reload();
837			}			
838		});
839	});
840
841
842
843	$('.delRow').click(function () {
844		var $this = $(this);
845		var panier = $this.attr('data-panier');
846		var idpanier =$this.attr('data-idpanier');
847		var qty = $this.attr('data-qty');
848		var option = $this.attr('data-option');
849		$.ajax({
850			type : "GET",
851			url : "../v1_include/v4_session_boutique.inc.php",
852			data : "panier=true&idpanier=" + idpanier + "&qty=" + qty + "&option=" + option,
853			dataType: 'json', 
854			success : function (data) {
855				$("#totalTTC").html('<strong>/</strong>');
856				$('tr.del' + idpanier).fadeToggle();
857				//$("#msg").html(data.msg);
858			},
859			error : function (xhr, ajaxOptions, thrownError) {
860				/*
861				alert(xhr.status);
862				alert(thrownError);
863				*/
864			},
865			 complete: function(){
866				location.href = 'boutique.php';
867				//location.reload();
868			}			
869		});
870	});
871
872function delRow (idpanier, qty, option) {
873		$.ajax({
874			//async : false,
875			//processData : false,
876			type : 'get',
877			url : "../v1_include/v4_session_boutique.inc.php",
878			data : "panier=true&idpanier=" + idpanier + "&qty=" + qty + "&option=" + option,
879			dataType: 'json', 
880			success : function (data) {
881				$('tr.del' + idpanier).fadeToggle();
882				//$("#msg").html(data.msg);
883			},
884			error : function (xhr, ajaxOptions, thrownError) {
885				/*
886				alert(xhr.status);
887				alert(thrownError);
888				*/
889			},
890			 complete: function(){
891				location.href = 'boutique.php';
892				//location.reload();
893			}			
894		});
895	}
896	
897		function LivraisonSame(formulaire) {
898			if(formulaire.livraison.checked == true) {
899				formulaire.Lsociete.value = formulaire.Fsociete.value;
900				formulaire.Lnom.value = formulaire.Fnom.value;
901				formulaire.Lprenom.value = formulaire.Fprenom.value;
902				formulaire.Ladresse.value = formulaire.Fadresse.value;
903				formulaire.Lcp.value = formulaire.Fcp.value;
904				formulaire.Lville.value = formulaire.Fville.value;
905				formulaire.Lpays.value = formulaire.Fpays.value;
906				formulaire.Ltel.value = formulaire.Ftel.value;
907					$("#msgCoutTotal").html('&nbsp;');
908					$("input[name='typeLivraison']").prop('checked', false); // Unchecks it
909			}
910			if(formulaire.livraison.checked == false) {
911				// null
912				formulaire.Lsociete.value = '';
913				formulaire.Lnom.value = '';
914				formulaire.Lprenom.value = '';
915				formulaire.Ladresse.value = '';
916				formulaire.Lcp.value = '';
917				formulaire.Lville.value = '';
918				formulaire.Lpays.value = '';
919				formulaire.Ltel.value = '';
920			}
921		}		
922	
923		$('#menuBoutique').dcAccordion({
924			//eventType: 'hover',
925			autoClose: false,
926			saveState: true,
927			disableLink: true,
928			menuClose: true,
929			speed: 150,
930			showCount: false
931		});		
932
933
934	$('.addAdrUsers').on('click', function(e){
935			var el = $(this);
936			var id = el.data('id');
937			var token = el.data('token');
938		
939			$.confirm({
940				title: '<i class="fas fa-user"></i> Mon profil' ,
941				content: 'url:https://www.horse-ball.org/media/inc/_form_adr_perso.inc.php?token=' 
941+ token + '&id=' + id ,
942				animateFromElement: false,
943				animation: 'top',
944				theme: 'light',
945				columnClass: 'large',
946				buttons: {
947					formSubmit: {
948						text: 'Valider',
949						btnClass: 'btn-primary',
950						action: function () {
951							console.log(this.$content.find('#jesuis').val());
952							var jesuis = this.$content.find('#jesuis').val();
953							var ste_nom = this.$content.find('#ste_nom').val();
954							var ste_tva_intra = this.$content.find('#ste_tva_intra').val();
955							var nom = this.$content.find('#nom').val();
956							var prenom = this.$content.find('#prenom').val();
957							var mobile = this.$content.find('#mobile').val();
958							var adresse = this.$content.find('#adresse').val();
959							var adresse_suite = this.$content.find('#adresse_suite').val();
960							var cp = this.$content.find('#cp').val();
961							var ville = this.$content.find('#ville').val();
962							var pays = this.$content.find('#pays').val();
963							var date_naissance = this.$content.find('#date_naissance').val();
964							var pass = this.$content.find('#pass').val();
965							var email = this.$content.find('#email').val();
966							var note = this.$content.find('#note').val();
967							//if ( !Array.isArray(jesuis) ) {
968							//if ( typeof jesuis !== 'undefined' && jesuis.length > 3 ) {
969							if (Array.isArray(jesuis) && jesuis.length) {
970								if (jesuis.length > 3) {
971									$.alert({
972										title: '<i class="fas fa-exclamation-circle"></i> Erreur',
973										content: 'Maximum 3 entrées pour Vous êtes !',
974										animateFromElement: false,
975										animation: 'top',
976										theme: 'dark',
977										//type: 'green',
978										//columnClass: 'large',
979										backgroundDismiss: true
980									});
981									return false;
982								}
983							} else {
984									$.alert({
985										title: '<i class="fas fa-exclamation-circle"></i> Erreur',
986										content: 'Tous les champs marqués * sont obligatoires !',
987										animateFromElement: false,
988										animation: 'top',
989										theme: 'dark',
990										//type: 'green',
991										//columnClass: 'large',
992										backgroundDismiss: true
993									});
994									return false;
995							}
996							if( !nom || !prenom || !mobile || !adresse || !cp || !ville || !pays || !date_naissance || !/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{3,7}$/im.test(mobile) ){
997								//$.alert('Tous les champs (sauf adresse suite) sont obligatoires !');
998								$.alert({
999									title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1000									content: 'Tous les champs marqués * sont obligatoires !',
1001									animateFromElement: false,
1002									animation: 'top',
1003									theme: 'dark',
1004									//type: 'green',
1005									//columnClass: 'large',
1006									backgroundDismiss: true
1007								});
1008								return false;
1009							}
1010							if( pass && !/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*?&]{8,}$/.test(pass) ){
1011								//$.alert('Tous les champs (sauf adresse suite) sont obligatoires !');
1012								$.alert({
1013									title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1014									content: 'Mot de passe : au moins 8 caractères avec au moins 1 lettre majuscule et 1 chiffre.',
1015									animateFromElement: false,
1016									animation: 'top',
1017									theme: 'dark',
1018									//type: 'green',
1019									//columnClass: 'large',
1020									backgroundDismiss: true
1021								});
1022								return false;
1023							}
1024							if( email && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(email) ){
1025								//$.alert('Tous les champs (sauf adresse suite) sont obligatoires !');
1026								$.alert({
1027									title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1028									content: 'Email invalide !',
1029									animateFromElement: false,
1030									animation: 'top',
1031									theme: 'dark',
1032									//type: 'green',
1033									//columnClass: 'large',
1034									backgroundDismiss: true
1035								});
1036								return false;
1037							}
1038										$.ajax({
1039											url: 'https://www.horse-ball.org/media/inc/_action.inc.php', //formURL,
1040											type: "POST",
1041											//data: postData,
1042											data: { 
1043												addAdrUsers : 'true', 
1044												id : id, 
1045												token : token, 
1046												jesuis : jesuis, //JSON.stringify(jesuis), 
1047												ste_nom : ste_nom, 
1048												ste_tva_intra : ste_tva_intra, 
1049												nom : nom, 
1050												prenom : prenom, 
1051												mobile : mobile, 
1052												adresse : adresse, 
1053												adresse_suite : adresse_suite, 
1054												cp : cp, 
1055												ville : ville, 
1056												pays : pays, 
1057												date_naissance : date_naissance,
1058												pass : pass, 
1059												email : email, 
1060												note : note 
1061											},
1062											dataType: "json",
1063											//processData: false, // avec FormData seulement
1064											//contentType: false,// avec FormData seulement
1065											success: function(data, textStatus, jqXHR) {
1066												$.alert({
1067													title: '<i class="fas fa-check"></i> Mon profil',
1068													content: data.msg,
1069													animateFromElement: false,
1070													animation: 'top',
1071													theme: 'light',
1072													//type: 'green',
1073													//columnClass: 'large',
1074													backgroundDismiss: true,
1075													buttons: {
1076														ok: {
1077															text: 'OK',
1078															action: function () {
1079																if (/(media)/i.test(window.location.href)) {
1080																	var uri = getQueryVariable("rub");
1081																	if ( uri ) window.location = window.location.href.split("?")[0] + '?rub=' + uri;
1082																	//else window.location = window.location.href.split("?")[0];
1083																	//window.location.reload(false);
1084																} 						
1085															}
1086														}
1087													}
1088												});
1089											},
1090											statusCode: {
1091												500: function(jqXHR, status, error) {
1092													$.alert({
1093														title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1094														content: jqXHR.responseJSON.msg,
1095														animateFromElement: false,
1096														animation: 'top',
1097														theme: 'light',
1098														//type: 'red',
1099														backgroundDismiss: true,
1100														buttons: {
1101															ok: {
1102																text: 'OK'
1103															}
1104														}
1105													});
1106												}
1107											  }					
1108										});
1109							
1110						}
1111					},
1112					annuler: function () {
1113						//close
1114					},
1115				},
1116				onOpen: function () {
1117					// after the modal is displayed.
1118					//alert('onOpen');
1119				},				
1120				onOpenBefore: function () {
1121					// before the modal is displayed.
1122					//$('.selectpicker').selectpicker();
1123				},				
1124				onContentReady: function () {
1125					var momentFormat = 'DD-MM-YYYY';
1126					var arrayInputMask = [];
1127					$('.dateMask').each(function(index, element){
1128						var currencyMask = new IMask(
1129						element,
1130					  {
1131						  mask: Date,
1132						  pattern: momentFormat,
1133						  lazy: true,
1134						  min: new Date(1930, 0, 1),
1135						  max: new Date(2029, 0, 1),
1136
1137						  format: function (date) {
1138							return moment(date).format(momentFormat);
1139						  },
1140						  parse: function (str) {
1141							return moment(str, momentFormat);
1142						  },
1143
1144						  blocks: {
1145							YYYY: {
1146							  mask: IMask.MaskedRange,
1147							  from: 1930,
1148							  to: 2029
1149							},
1150							MM: {
1151							  mask: IMask.MaskedRange,
1152							  from: 1,
1153							  to: 12
1154							},
1155							DD: {
1156							  mask: IMask.MaskedRange,
1157							  from: 1,
1158							  to: 31
1159							}
1160						  }
1161					  });
1162						arrayInputMask.push(currencyMask);
1163					});
1164					//$('.toCheckbox').selectToCheckbox();
1165					$('.selectpicker').selectpicker({maxOptions:3, size:6});
1166					$('.btn.dropdown-toggle.btn-light').css( "padding", ".7em" );
1167					///*
1168					// bind to events
1169					var jc = this;
1170					this.$content.find('#formAddAdrUsers').on('submit', function (e) {
1171						// if the user submits the form by pressing enter in the field.
1172						e.preventDefault();
1173						jc.$$formSubmit.trigger('click'); // reference the button and click it
1174					});
1175					//*/
1176				}
1177			});
1178	});
1179
1180
1181	$('.clear').on('click', function(e){
1182		document.getElementById('fileImg').value = "";
1183		document.getElementById('filePdf').value = "";		
1184	});
1185
1186	$('.addEvenement').on('click', function(e){
1187			var el = $(this);
1188			var id = el.data('id');
1189			var token = el.data('token');
1190		
1191			$.confirm({
1192				title: '<i class="fas fa-calendar-day"></i> Mes évènements' ,
1193				content: 'url:https://www.horse-ball.org/media/inc/_form_evenement.inc.php?token=' 
1193+ token + '&id=' + id ,
1194				animateFromElement: false,
1195				animation: 'top',
1196				theme: 'light',
1197				columnClass: 'large',
1198				buttons: {
1199					formSubmit: {
1200						text: 'Envoyer',
1201						btnClass: 'btn-primary',
1202						action: function () {
1203							//console.log(this.$content.find('#type_epreuve').val());
1204							var type_epreuve = this.$content.find('#type_epreuve').val();
1205							var evenement = this.$content.find('#evenement').val();
1206							var date_debut = this.$content.find('#date_debut').val();
1207							var date_fin = this.$content.find('#date_fin').val();
1208							//if ( !Array.isArray(type_epreuve) ) {
1209							//if ( typeof type_epreuve !== 'undefined' && type_epreuve.length > 3 ) {
1210							if (Array.isArray(type_epreuve) && type_epreuve.length) {
1211								if (type_epreuve.length > 3) {
1212									$.alert({
1213										title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1214										content: 'Maximum 3 entrées pour type / Epreuve !',
1215										animateFromElement: false,
1216										animation: 'top',
1217										theme: 'dark',
1218										//type: 'green',
1219										//columnClass: 'large',
1220										backgroundDismiss: true
1221									});
1222									return false;
1223								}
1224							} else {
1225									$.alert({
1226										title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1227										content: 'Tous les champs marqués * sont obligatoires !',
1228										animateFromElement: false,
1229										animation: 'top',
1230										theme: 'dark',
1231										//type: 'green',
1232										//columnClass: 'large',
1233										backgroundDismiss: true
1234									});
1235									return false;
1236							}
1237							if( !evenement || !date_debut || !date_fin ){
1238								//$.alert('Tous les champs (sauf adresse suite) sont obligatoires !');
1239								$.alert({
1240									title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1241									content: 'Tous les champs marqués * sont obligatoires !',
1242									animateFromElement: false,
1243									animation: 'top',
1244									theme: 'dark',
1245									//type: 'green',
1246									//columnClass: 'large',
1247									backgroundDismiss: true
1248								});
1249								return false;
1250							}
1251							
1252							var myForm = document.getElementById('formEvenement');
1253							var formData = new FormData(myForm);
1254							
1255							formData.append('addEvenement', true);
1256							formData.append('type_epreuve', JSON.stringify(type_epreuve));
1257							for (var i = 0; i < type_epreuve.length; i++) {
1258								formData.append('type[]', type_epreuve[i]);
1259							}
1260							
1261							if( document.getElementById("fileImg").files.length !== 0 ){
1262								var files = $('#fileImg')[0].files;
1263								const fileSize = $("#fileImg")[0].files[0].size;
1264								//console.log(fileSize); return false;
1265								if (fileSize > 2097151 ) { //if (fileSize > 1) { 1048576
1266									alert('Fichier inférieur à 2 MiB');
1267									$('#fileImg')[0].val(''); //for clearing with Jquery
1268									return false;
1269								}							
1270								if( files.length > 0 ){
1271										   formData.append('fileImg', files[0]);
1272								}
1273							}
1274							if( document.getElementById("filePdf").files.length !== 0 ){
1275								var files1 = $('#filePdf')[0].files;
1276								const fileSize1 = $("#filePdf")[0].files[0].size;
1277								//console.log(fileSize); return false;
1278								if (fileSize1 > 3145728 ) { //if (fileSize > 1) { 1048576
1279									alert('Fichier inférieur à 3 MiB');
1280									$('#filePdf')[0].val(''); //for clearing with Jquery
1281									return false;
1282								}							
1283								if( files1.length > 0 ){
1284										   formData.append('filePdf', files1[0]);
1285								}
1286							}
1287							$.LoadingOverlay("show");
1288							
1289										$.ajax({
1290											url: 'https://www.horse-ball.org/media/inc/_action.inc.php', //formURL,
1291											type: "POST",
1292											data: formData,
1293											/*
1294											data: { 
1295												addEvenement : 'true', 
1296												id : id, 
1297												token : token, 
1298												type_epreuve : type_epreuve, 
1299												evenement : evenement, 
1300												date_debut : date_debut, 
1301												date_fin : date_fin 
1302											},
1303											*/
1304											dataType: "json",
1305											processData: false, // avec FormData seulement
1306											contentType: false,// avec FormData seulement
1307											success: function(data, textStatus, jqXHR) {
1308												$.LoadingOverlay("hide");
1309												$.alert({
1310													title: '<i class="fas fa-check"></i> Mes évènements',
1311													content: data.msg,
1312													animateFromElement: false,
1313													animation: 'top',
1314													theme: 'light',
1315													//type: 'green',
1316													//columnClass: 'large',
1317													backgroundDismiss: true,
1318													buttons: {
1319														ok: {
1320															text: 'OK',
1321															action: function () {
1322																if (/(media)/i.test(window.location.href)) {
1323																	var uri = getQueryVariable("rub");
1324																	if ( uri ) window.location = window.location.href.split("?")[0] + '?rub=' + uri;
1325																	//else window.location = window.location.href.split("?")[0];
1326																	//window.location.reload(false);
1327																} 						
1328															}
1329														}
1330													}
1331												});
1332											},
1333											statusCode: {
1334												500: function(jqXHR, status, error) {
1335													$.LoadingOverlay("hide");
1336													$.alert({
1337														title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1338														content: jqXHR.responseJSON.msg,
1339														animateFromElement: false,
1340														animation: 'top',
1341														theme: 'light',
1342														//type: 'red',
1343														backgroundDismiss: true,
1344														buttons: {
1345															ok: {
1346																text: 'OK'
1347															}
1348														}
1349													});
1350												}
1351											  }					
1352										});
1353							
1354						}
1355					},
1356					annuler: function () {
1357						//close
1358					},
1359				},
1360				onOpen: function () {
1361					// after the modal is displayed.
1362					//alert('onOpen');
1363				},				
1364				onOpenBefore: function () {
1365					// before the modal is displayed.
1366					//$('.selectpicker').selectpicker();
1367				},				
1368				onContentReady: function () {
1369					$("#fileImg").fileinput({
1370							language: "fr",
1371							showPreview: false, 
1372							showUpload: false,
1373							//browseLabel: 'Fichier',
1374							//removeLabel: 'Effacer', 
1375							browseClass: 'btn btn-primary btn-sm my-small-btn', // btn-sm
1376							removeClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1377							cancelClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1378							pauseClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1379							uploadClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1380							maxFileSize: 2048, 
1381							maxFileCount: 1, 
1382							allowedFileExtensions: ["jpg", "jpeg"],
1383							//elErrorContainer: '#errorBlock'
1384						}).on('filebatchselected', function(event, files) {
1385							//console.log(files[0].name);
1386							//if (!/^[a-z0-9_\-\.]+$/i.test(files[0].name)) { $('#file').fileinput('clear'); }
1387							//return;
1388						});		
1389					$("#filePdf").fileinput({
1390							language: "fr",
1391							showPreview: false, 
1392							showUpload: false,
1393							//browseLabel: 'Fichier',
1394							//removeLabel: 'Effacer', 
1395							browseClass: 'btn btn-primary btn-sm my-small-btn', // btn-sm
1396							removeClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1397							cancelClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1398							pauseClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1399							uploadClass: 'btn btn-default btn-secondary btn-sm my-small-btn', // btn-sm
1400							maxFileSize: 3072, 
1401							maxFileCount: 1, 
1402							allowedFileExtensions: ["pdf"],
1403							//elErrorContainer: '#errorBlock'
1404						}).on('filebatchselected', function(event, files) {
1405							//console.log(files[0].name);
1406							//if (!/^[a-z0-9_\-\.]+$/i.test(files[0].name)) { $('#file').fileinput('clear'); }
1407							//return;
1408						});		
1409					
1410						//$("div").find(".kv-fileinput-caption").addClass('form-control-sm');
1411						$("div").find(".btn-file").addClass('btn-sm');
1412					
1413					// Referneces
1414					var control1 = $("#fileImg"),
1415						control2 = $("#filePdf"),
1416						clearBn = $("#clear");
1417
1418					// Setup the clear functionality
1419					clearBn.on("click", function(){
1420						control1.replaceWith( control1.val('').clone( true ) );
1421						control2.replaceWith( control2.val('').clone( true ) );
1422					});
1423					
1424					// Add the following code if you want the name of the file appear on select
1425					$(".custom-file-input").on("change", function() {
1426					  var fileName = $(this).val().split("\\").pop();
1427					  $(this).siblings(".custom-file-label").addClass("selected").html(fileName);
1428					});	
1429
1430					$('.selectpicker').selectpicker({maxOptions:3, size:6});
1431					$('.btn.dropdown-toggle.btn-light').css( "padding", ".7em" );
1432					///*
1433					// bind to events
1434					var jc = this;
1435					this.$content.find('#formEvenement').on('submit', function (e) {
1436						// if the user submits the form by pressing enter in the field.
1437						e.preventDefault();
1438						jc.$$formSubmit.trigger('click'); // reference the button and click it
1439					});
1440					//*/
1441				}
1442			});
1443	});
1444
1445	$('.addAdrBoutique').on('click', function(e){
1446			var el = $(this);
1447			var id = el.data('id');
1448			var token = el.data('token');
1449		
1450			$.confirm({
1451				title: '<i class="fas fa-shipping-fast"></i> Mes adresses' ,
1452				content: 'url:https://www.horse-ball.org/media/inc/_form_adr_boutique.inc.php?token=' + token + '&id=' + id ,
1453				animateFromElement: false,
1454				animation: 'top',
1455				theme: 'light',
1456				columnClass: 'xlarge',
1457				buttons: {
1458					formSubmit: {
1459						text: 'Enregistrer',
1460						btnClass: 'btn-primary',
1461						action: function () {
1462							var Lnom = this.$content.find('#Lnom').val();
1463							var Lprenom = this.$content.find('#Lprenom').val();
1464							var Ladresse = this.$content.find('#Ladresse').val();
1465							var Lcp = this.$content.find('#Lcp').val();
1466							var Lville = this.$content.find('#Lville').val();
1467							var Lpays = this.$content.find('#Lpays').val();
1468							var Ltel = this.$content.find('#Ltel').val();
1469							var Lsociete = this.$content.find('#Lsociete').val();
1470							
1471							var Fnom = this.$content.find('#Fnom').val();
1472							var Fprenom = this.$content.find('#Fprenom').val();
1473							var Fadresse = this.$content.find('#Fadresse').val();
1474							var Fcp = this.$content.find('#Fcp').val();
1475							var Fville = this.$content.find('#Fville').val();
1476							var Fpays = this.$content.find('#Fpays').val();
1477							var Ftel = this.$content.find('#Ftel').val();
1478							var tvaintra = this.$content.find('#tvaintra').val();
1479							var Fsociete = this.$content.find('#Fsociete').val();
1480							if( !Lnom || 
1481							   !Lprenom || 
1482							   !Ladresse || 
1483							   !Lcp || 
1484							   !Lville || 
1485							   !Lpays || 
1486							   !Ltel || 
1487							   !Fnom || 
1488							   !Fprenom ||
1489							   !Fadresse ||
1490							   !Fcp ||
1491							   !Fville ||
1492							   !Fpays ||
1493							   !Ftel 
1494							  ){
1495								//$.alert('Tous les champs (sauf adresse suite) sont obligatoires !');
1496								$.alert({
1497									title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1498									content: 'Tous les champs avec une * sont obligatoires !',
1499									animateFromElement: false,
1500									animation: 'top',
1501									theme: 'dark',
1502									//type: 'green',
1503									//columnClass: 'large',
1504									backgroundDismiss: true
1505								});
1506								return false;
1507							}
1508										$.ajax({
1509											url: 'https://www.horse-ball.org/media/inc/_action.inc.php', //formURL,
1510											type: "POST",
1511											//data: postData,
1512											data: { 
1513												addAdrBoutique : 'true', 
1514												id : id, 
1515												token : token, 
1516												Lnom : Lnom, 
1517												Lprenom : Lprenom, 
1518												Ladresse : Ladresse, 
1519												Lcp : Lcp, 
1520												Lville : Lville, 
1521												Lpays : Lpays, 
1522												Ltel : Ltel, 
1523												Lsociete : Lsociete, 
1524												
1525												Fnom : Fnom, 
1526												Fprenom : Fprenom, 
1527												Fadresse : Fadresse, 
1528												Fcp : Fcp, 
1529												Fville : Fville, 
1530												Fpays : Fpays, 
1531												Ftel : Ftel, 
1532												tvaintra : tvaintra, 
1533												Fsociete : Fsociete, 
1534											},
1535											dataType: "json",
1536											//processData: false, // avec FormData seulement
1537											//contentType: false,// avec FormData seulement
1538											success: function(data, textStatus, jqXHR) {
1539												$.alert({
1540													title: '<i class="fas fa-check"></i> Mes adresses',
1541													content: data.msg,
1542													animateFromElement: false,
1543													animation: 'top',
1544													theme: 'light',
1545													//type: 'green',
1546													//columnClass: 'large',
1547													backgroundDismiss: true,
1548													buttons: {
1549														ok: {
1550															text: 'OK'
1551														}
1552													}
1553												});
1554											},
1555											statusCode: {
1556												500: function(jqXHR, status, error) {
1557													$.alert({
1558														title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1559														content: jqXHR.responseJSON.msg,
1560														animateFromElement: false,
1561														animation: 'top',
1562														theme: 'light',
1563														//type: 'red',
1564														backgroundDismiss: true,
1565														buttons: {
1566															ok: {
1567																text: 'OK'
1568															}
1569														}
1570													});
1571												}
1572											  }					
1573										});
1574							
1575						}
1576					},
1577					annuler: function () {
1578						//close
1579					},
1580				},
1581				onOpen: function () {
1582					// after the modal is displayed.
1583					//alert('onOpen');
1584				},				
1585				onOpenBefore: function () {
1586					// before the modal is displayed.
1587					//$('.selectpicker').selectpicker();
1588				},				
1589				onContentReady: function () {
1590					//$('.selectpicker').selectpicker('refresh');
1591					///*
1592					// bind to events
1593					var jc = this;
1594					this.$content.find('#formAddAdrBoutique').on('submit', function (e) {
1595						// if the user submits the form by pressing enter in the field.
1596						e.preventDefault();
1597						jc.$$formSubmit.trigger('click'); // reference the button and click it
1598					});
1599					//*/
1600				}
1601			});
1602	});
1603
1604	$('.addProfilPlayer').on('click', function(e){
1605			var el = $(this);
1606			var id = el.data('id');
1607			var token = el.data('token');
1608		
1609			$.confirm({
1610				title: '<i class="fas fa-user"></i> Personnaliser ma fiche joueur' ,
1611				content: 'url:https://www.horse-ball.org/media/inc/_form_profil_player.inc.php?token=' + token + '&id=' + id ,
1612				animateFromElement: false,
1613				animation: 'top',
1614				theme: 'light',
1615				columnClass: 'large',
1616				buttons: {
1617					formSubmit: {
1618						text: 'Enregistrer',
1619						btnClass: 'btn-primary',
1620						action: function () {
1621									    var postData = new FormData($('#formAddProfilPlayer')[0]);
1622										postData.append('addProfilPlayer', 'true');
1623										postData.append('id_player', id);
1624										postData.append('token', token);
1625										/*
1626										$.alert({
1627											title: '<i class="fas fa-check"></i> Joueur test !!!',
1628											content: 'Juste un test !',
1629											animateFromElement: false,
1630											animation: 'top',
1631											theme: 'light',
1632											//type: 'green',
1633											//columnClass: 'large',
1634											backgroundDismiss: true,
1635											buttons: {
1636												ok: {
1637													text: 'OK'
1638												}
1639											}
1640										});
1641										*/
1642										
1643										$.ajax({
1644											url: 'https://www.horse-ball.org/media/inc/_action.inc.php', //formURL,
1645											type: "POST",
1646											data: postData,
1647											/*
1648											data: { 
1649												addProfilPlayer : 'true', 
1650												id : id, 
1651												token : token, 
1652											},
1653											*/
1654											dataType: "json",
1655											processData: false, // avec FormData seulement
1656											contentType: false,// avec FormData seulement
1657											success: function(data, textStatus, jqXHR) {
1658												$.alert({
1659													title: '<i class="fas fa-check"></i> Personnaliser ma fiche joueur',
1660													content: data.msg,
1661													animateFromElement: false,
1662													animation: 'top',
1663													theme: 'light',
1664													//type: 'green',
1665													//columnClass: 'large',
1666													backgroundDismiss: true,
1667													buttons: {
1668														ok: {
1669															text: 'OK'
1670														}
1671													}
1672												});
1673											},
1674											statusCode: {
1675												500: function(jqXHR, status, error) {
1676													$.alert({
1677														title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1678														content: jqXHR.responseJSON.msg,
1679														animateFromElement: false,
1680
1681														animation: 'top',
1682														theme: 'light',
1683														//type: 'red',
1684														backgroundDismiss: true,
1685														buttons: {
1686															ok: {
1687																text: 'OK'
1688															}
1689														}
1690													});
1691												}
1692											  }					
1693										});
1694										
1695						}
1696					},
1697					annuler: function () {
1698						//close
1699					},
1700				},
1701				onOpen: function () {
1702					// after the modal is displayed.
1703					//alert('onOpen');
1704				},				
1705				onOpenBefore: function () {
1706					// before the modal is displayed.
1707					//$('.selectpicker').selectpicker();
1708				},				
1709				onContentReady: function () {
1710						// Add the following code if you want the name of the file appear on select
1711						$(".custom-file-input").on("change", function() {
1712						  var fileName = $(this).val().split("\\").pop();
1713						  $(this).siblings(".custom-file-label").addClass("selected").html(fileName);
1714						});	
1715						//$('.selectpicker').selectpicker('refresh');
1716						///*
1717						// bind to events
1718						var jc = this;
1719						this.$content.find('#formAddProfilPlayer').on('submit', function (e) {
1720							// if the user submits the form by pressing enter in the field.
1721							e.preventDefault();
1722							jc.$$formSubmit.trigger('click'); // reference the button and click it
1723						});
1724						//*/
1725				}
1726			});
1727	});
1728
1729	//$('.suppProfilPlayer').on('click', function(e){
1730	$(document).on('click', '.suppProfilPlayer', function(e){
1731			var el = $(this);
1732			var id = el.data('id');
1733			var token = el.data('token');
1734		
1735			$.ajax({
1736				url: 'https://www.horse-ball.org/media/inc/_action.inc.php', //formURL,
1737				type: "POST",
1738				data: { 
1739					suppProfilPlayer : 'true', 
1740					id : id, 
1741					token : token, 
1742				},
1743				dataType: "json",
1744				//processData: false, // avec FormData seulement
1745				//contentType: false,// avec FormData seulement
1746				success: function(data, textStatus, jqXHR) {
1747					$.alert({
1748						title: '<i class="fas fa-check"></i> Info',
1749						content: data.msg,
1750						animateFromElement: false,
1751						animation: 'top',
1752						theme: 'light',
1753						//type: 'green',
1754						//columnClass: 'large',
1755						backgroundDismiss: true,
1756						buttons: {
1757							ok: {
1758								text: 'OK'
1759							}
1760						}
1761					});
1762				},
1763				statusCode: {
1764					500: function(jqXHR, status, error) {
1765						$.alert({
1766							title: '<i class="fas fa-exclamation-circle"></i> Erreur',
1767							content: jqXHR.responseJSON.msg,
1768							animateFromElement: false,
1769
1770							animation: 'top',
1771							theme: 'light',
1772							//type: 'red',
1773							backgroundDismiss: true,
1774							buttons: {
1775								ok: {
1776									text: 'OK'
1777								}
1778							}
1779						});
1780					}
1781				  }					
1782			});
1783	});
1784
1785	$('.outputCde').on('click', function(e){
1786			var el = $(this);
1787			var id = el.data('id');
1788			var token = el.data('token');
1789
1790			$.confirm({
1791				animateFromElement: false,
1792				animation: 'top',
1793				theme: 'light',
1794				columnClass: 'large',
1795				buttons: {
1796					ok: {
1797						text: 'ok',
1798						btnClass: 'btn-primary',
1799						action: function(){
1800						}
1801					},
1802					/*
1803					fermer: function () {
1804					}
1805					*/
1806				},			
1807				content: function () {
1808					var self = this;
1809					return $.ajax({
1810						url: 'https://www.horse-ball.org/media/inc/_form_commande.inc.php',
1811						data: {id : id, token : token},
1812						dataType: 'json',
1813						method: 'post'
1814					}).done(function (response, textStatus, jqXHR) {
1815						//var json = $.parseJSON(response);
1816						//console.log(response.msg);
1817						//self.setContent('Description: ' + response.description);
1818						//self.setContentAppend('<br>Version: ' + response.version);
1819						//self.setTitle(response.name);
1820						self.setTitle('<i class="fas fa-receipt"></i> Mes commandes');
1821						self.setContent(response.msg);
1822					}).fail(function(){
1823						self.setTitle('<i class="fas fa-exclamation-circle"></i> Erreur');
1824						self.setContent('Une erreur s\'est produite !');
1825					});
1826				}
1827			});		
1828	});
1829			
1830		$('.adrRecuperer').on('click', function(e){
1831			var el = $(this);
1832			var id = el.data('id');
1833			var token = el.data('token');
1834			
1835			$.post( "https://www.horse-ball.org/media/inc/_action.inc.php", { outputAdr: "true", id: id, token: token }, function( data ) {
1836				$("#msgCoutTotal").html('&nbsp;');
1837				$("input[name='typeLivraison']").prop('checked', false);
1838				
1839				Object.keys(data).forEach(function(key) {
1840				  $('#'+key).val(data[key]);
1841				  //console.log('Key : ' + key + ', Value : ' + data[key])
1842				});		
1843			}, "json");			
1844		});
1845			
1846	var menuMembre = new BootstrapMenu('.menuMembre', {
1847	  menuEvent: 'click', // default value, can be omitted
1848	  menuSource: 'element',
1849	  menuPosition: 'belowLeft', // default value, can be omitted		
1850	  actions: [
1851		  {
1852		  name: 'Coordonnée',
1853		  onClick: function() {
1854			//$('.addAdrUsers').trigger('click');
1855			//Toast.create("HB", 'Test 1', TOAST_STATUS.SUCCESS, 7000);
1856		  }
1857		}, 
1858		  {
1859		  name: 'Test 2',
1860		  onClick: function() {
1861			//Toast.create("HB", 'Test 2', TOAST_STATUS.SUCCESS, 7000);
1862		  }
1863		}
1864	  ]
1865	});
1866
1867
1868			/*
1869		   var $sticky = $('#Bmenu');
1870			$sticky.hcSticky({
1871			  stickTo: 'body',
1872			  top: 64,
1873			  responsive: {
1874				980: {
1875				  disable: false
1876				},	
1877				640: {
1878				  top: 0
1879				}	
1880			  }
1881			});
1882			*/
1883if ($('#hb-main-nav').length > 0) {
1884
1885          // call our plugin
1886          var Nav = new hcOffcanvasNav('#hb-main-nav', {
1887            disableAt: false,
1888            customToggle: '.HBtoggle',
1889            levelSpacing: 20,
1890			width: 330,
1891            navTitle: 'WebStore',
1892            levelTitles: true,
1893            levelTitleAsBack: true,
1894            pushContent: '#container',
1895            //labelClose: false,
1896			insertClose: false,
1897			levelOpen: 'expand' , //'expand',
1898			closeOpenLevels: false,
1899			closeActiveLevel: false,
1900			closeOnClick: true,
1901			//activeToggleClass : 'active',
1902			//expanded: true
1903			ariaLabels: {
1904			  open:     'Ouvrir Menu',
1905			  close:    'Fermer Menu',
1906			  submenu:  'Sous menu'
1907			}			  
1908          });
1909	
1910		//Nav.open(1, 2); // Nav.open(1, 0); = 0 level 1er niveau
1911
1912		/*
1913		Nav.on('open.level', (e, settings) => {
1914		  localStorage.setItem('NavLevel', e.data.currentLevel); //console.log(e.data.currentLevel);
1915		  localStorage.setItem('NavIndex', e.data.currentIndex); //console.log(e.data.currentIndex);
1916		});
1917		*/
1918		/*
1919		$('i.openMyMenu').on('click', function(e){
1920			var el = $(this);
1921			var sub = el.data('sub');
1922			var niveau = el.data('niveau');
1923			//Nav.update(true);
1924			//Nav.open(0.0);
1925			Nav.open(sub, niveau);
1926			e.preventDefault();
1927			return false;
1928		});
1929		*/
1930}
1931
1932	var momentFormat = 'DD-MM-YYYY';
1933	var arrayInputMask = [];
1934	$('.dateMask').each(function(index, element){
1935		var currencyMask = new IMask(
1936		element,
1937	  {
1938		  mask: Date,
1939		  pattern: momentFormat,
1940		  lazy: false,
1941		  min: new Date(1940, 0, 1),
1942		  max: new Date(2040, 0, 1),
1943
1944		  format: function (date) {
1945			return moment(date).format(momentFormat);
1946		  },
1947		  parse: function (str) {
1948			return moment(str, momentFormat);
1949		  },
1950
1951		  blocks: {
1952			YYYY: {
1953			  mask: IMask.MaskedRange,
1954			  from: 1940,
1955			  to: 2040
1956			},
1957			MM: {
1958			  mask: IMask.MaskedRange,
1959			  from: 1,
1960			  to: 12
1961			},
1962			DD: {
1963			  mask: IMask.MaskedRange,
1964			  from: 1,
1965			  to: 31
1966			}
1967		  }
1968	  });
1969		arrayInputMask.push(currencyMask);
1970	});
1971
1972
1973	/* When the user clicks on the button, 
1974	toggle between hiding and showing the dropdown content */
1975	function myFunction() {
1976	  document.getElementById("myDropdown").classList.toggle("show");
1977	}
1978
1979	// Close the dropdown if the user clicks outside of it
1980	window.onclick = function(event) {
1981	  if (!event.target.matches('.dropbtn')) {
1982		var dropdowns = document.getElementsByClassName("dropdownUser-content");
1983		var i;
1984		for (i = 0; i < dropdowns.length; i++) {
1985		  var openDropdown = dropdowns[i];
1986		  if (openDropdown.classList.contains('show')) {
1987			openDropdown.classList.remove('show');
1988		  }
1989		}
1990	  }
1991	};
1992
1993if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
1994	//$("#logoSwitch").attr("src", "https://www.horse-ball.org/media/assets/img/WHBO_NOIR.png");
1995	$('a.dropdown-toggle').on('click', function () {
1996		var id = $(this).data('id');
1997		$('body,html').animate({
1998			scrollTop : $(".menu-large").offset().top - 60
1999		}, 300);
2000		//console.log(id);
2001	});	
2002}
2003	
2004
2005   $('#commentaire').on("cut copy paste",function(e) {
2006      e.preventDefault();
2007   });
2008
2009
2010
2011
2012  /**
2013   * forEach implementation for Objects/NodeLists/Arrays, automatic type loops and context options
2014   *
2015   * @private
2016   * @author Todd Motto
2017   * @link https://github.com/toddmotto/foreach
2018   * @param {Array|Object|NodeList} collection - Collection of items to iterate, could be an Array, Object or NodeList
2019   * @callback requestCallback      callback   - Callback function for each iteration.
2020   * @param {Array|Object|NodeList}
2020 scope=null - Object/NodeList/Array that forEach is iterating over, to use as the this value when executing callback.
2021   * @returns {}
2022   */
2023    var forEach=function(t,o,r){if("[object Object]"===Object.prototype.toString.call(t))for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.call(r,t[c],c,t);else for(var e=0,l=t.length;l>e;e++)o.call(r,t[e],e,t)};
2024
2025    var hamburgers = document.querySelectorAll(".hamburger");
2026    if (hamburgers.length > 0) {
2027      forEach(hamburgers, function(hamburger) {
2028        hamburger.addEventListener("click", function() {
2029          this.classList.toggle("is-active");
2030        }, false);
2031      });
2032    }
2033
2034/*
2035$(document).ajaxSend(function(event, jqxhr, settings){
2036    $.LoadingOverlay("show");
2037});
2038*/
2039
2040
2041// Referneces
2042var control1 = $("#fileImg"),
2043	control2 = $("#filePdf"),
2044    clearBn = $("#clear");
2045
2046// Setup the clear functionality
2047clearBn.on("click", function(){
2048    control1.replaceWith( control1.val('').clone( true ) );
2049    control2.replaceWith( control2.val('').clone( true ) );
2050});
2051
2052//quicklink.listen();
2053
2054window.addEventListener('load', () =>{
2055	//quicklink.listen();
2056	quicklink.listen({
2057		el: document.getElementById('carouselExampleIndicators')
2058	});  
2059});
2060
2061
2062var lazyLoadInstance = new LazyLoad({
2063  // Your custom settings go here
2064});		
2065
2066
2067				
2068

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.