1/*********************************************** 2 3Global Variables 4 5************************************************/ 6 7let screenSizeWidth = $(window).width(); 8let screenSizeHeight = $(window).height(); 9 10let isPortrait = window.matchMedia("(orientation: portrait)").matches; 11let isLandscape = window.matchMedia("(orientation: landscape)").matches; 12 13let scroll = $(window).scrollTop(); 14let body = $('body'); 15 16 17// Fonction pour le méga menu, on va faire simple pour le moment en attendant consigne accessibilités 18$('.menutop_reserver').on('click', function(){ 19 console.debug('menutop_reserver') 20 body.toggleClass('menuReserverOpened'); 21 if (body.hasClass('menuReserverOpened')) { 22 body.removeClass('menuPreparerOpened') 23 } 24 return false; 25}) 26$('.menutop_preparer').on('click', function(){ 27 console.debug('menutop_preparer') 28 body.toggleClass('menuPreparerOpened'); 29 if (body.hasClass('menuPreparerOpened')) { 30 body.removeClass('menuReserverOpened') 31 } 32 return false; 33}) 34 35 36/*************************************************** 37 38Fonction d'intitialisation des sliders 39Gestion des paramètres du slider avec des data-attributes 40 41Ex: <div class="slider" data-slick='{"slidesToShow": 4, "slidesToScroll": 4}'></div> 42 43***************************************************/ 44function initSliders() { 45 if ($(".slider").length) { 46 $(".slider").slick({ 47 titleSlider: "Carrousel des actualités" 48 }); 49 } 50 51 $(".play_pause_button").on('click', function() { 52 if ($(this).hasClass("pause")) { 53 $(this).parent() 54 .slick('slickPause') // le slider se met en pause 55 .slick('slickSetOption', 'autoplay', false); // l'autoplay est désactivé 56 $(this).removeClass("pause"); 57 $(this).addClass("play"); 58 $(this).html("Lecture"); 59 $(this).attr("title", "Activer la lecture automatique"); 60 } 61 else { 62 $(this).parent() 63 .slick('slickPlay') // le slider se met en marche 64 .slick('slickSetOption', 'autoplay', true); // l'autoplay est activé 65 $(this).removeClass("play"); 66 $(this).addClass("pause"); 67 $(this).html("Pause"); 68 $(this).attr("title", "Mettre en pause la lecture automatique"); 69 } 70 }); 71} 72 73/* Slider Actus homepage */ 74$(".actuHome").slick({ 75 titleSlider: "Carrousel des actualités", 76 infinite: false, 77 slidesToScroll: 1, 78 variableWidth: true 79}); 80var nbSlide = $('.slick-slide').length; 81$('.slide-count').append('<span>01__0'+nbSlide+'</span>'); 82var $status = $('.slide-count'); 83$('.actuHome').on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { 84 var i = (currentSlide ? currentSlide : 0) + 1; 85 $status.html('<span>0'+ i + '__0' + slick.slideCount +'</span>'); 86}); 87 88/* Slider Frise chronologique */ 89$(".list-years").slick({ 90 titleSlider: "Les années", 91 infinite: false, 92 slidesToScroll: 1, 93 slidesToShow: 1, 94 swipeToSlide: true, 95 dots: false, 96 arrows: false, 97 autoplay: false, 98 variableWidth: true, 99 /*centerMode: true,*/ 100 centerPadding: '0px' 101}); 102$(".list-frise").slick({ 103 titleSlider: "Frise chronologique", 104 infinite: false, 105 slidesToScroll: 1, 106 fade: true, 107 autoplay: false, 108 responsive: [ 109 { 110 breakpoint: 768, 111 settings: { 112 adaptiveHeight: true 113 } 114 }, 115 ] 116}); 117$('.list-frise .slick-arrow .sr-only').removeClass('sr-only'); 118$('.list-frise .slick-slide').each(function() { 119 var datayear = $(this).find('article').data('year'); 120 var datamonth = $(this).find('article').data('month'); 121 $(this).attr({"data-year": datayear, "data-month": datamonth}); 122}); 123$('.list-years .slick-slide').each(function() { 124 var datayear = $(this).find('.item-years').attr('id'); 125 $(this).attr({"data-year": datayear}); 126}); 127// Figcation de la largeur de l'actu 128if ($('.item-frise figcaption').length) { 129 var largeurItem = $('.item-frise figcaption').parent().parent().width(); 130 $('.item-frise figcaption').css({width: largeurItem+'px'}); 131}; 132 133 134setTimeout(function() { 135 yearActif(); 136 listMonth(); 137 monthActif(); 138}, 200); 139$('.list-frise').on('click', '.slick-prev', function() { 140 yearActif(); 141 listMonth() 142 monthActif(); 143}); 144$('.list-frise').on('click', '.slick-next', function() { 145 yearActif(); 146 listMonth() 147 monthActif(); 148}); 149$('.list-frise').on('swipe', function(event, slick, direction) { 150 yearActif(); 151 listMonth() 152 monthActif(); 153}); 154$('.list-years .item-years').on('click', function() { 155 var annee = $(this).attr('id'); 156 yearActif(annee);
157 var gotoslide = $('.list-frise .slick-slide[data-year="'+annee+'"]').data('slick-index'); 158 $('.list-frise').slick('slickGoTo', gotoslide); 159 listMonth() 160 monthActif(); 161}); 162$('.list-month ul li').on('click', function() { 163 if (!$(this).hasClass('nope') && !$(this).hasClass('actif')) { 164 var annee = $('.list-years .item-years.actif').attr('id'); 165 var mois = $(this).attr('id'); 166 monthActif(mois); 167 var gotoslide = $('.list-frise .slick-slide[data-year="'+annee+'"][data-month="'+mois+'"]').data('slick-index'); 168 $('.list-frise').slick('slickGoTo', gotoslide); 169 } 170}); 171 172function yearActif(annee) { 173 if (annee) { 174 var gotoyear = $('.list-years .slick-slide[data-year="'+annee+'"]').data('slick-index'); 175 $('.list-years .item-years.actif').removeClass('actif'); 176 $('.list-years .item-years#'+annee).addClass('actif'); 177 $('.list-years').slick('slickGoTo', gotoyear); 178 } else { 179 var year = $('.list-frise .slick-current').data('year'); 180 var gotoyear = $('.list-years .slick-slide[data-year="'+year+'"]').data('slick-index'); 181 $('.list-years .item-years.actif').removeClass('actif'); 182 $('.list-years .item-years#'+year).addClass('actif'); 183 $('.list-years').slick('slickGoTo', gotoyear); 184 } 185} 186function listMonth() { 187 var yearActuel = $('.list-years .item-years.actif').attr('id'); 188 $('.list-month ul li.actif').removeClass('actif'); 189 $('.list-month ul li').addClass('nope'); 190 $('.list-frise .slick-slide[data-year="'+yearActuel+'"]').each(function() { 191 var monthExist = $(this).data('month'); 192 $('.list-month ul li#'+monthExist).removeClass('nope'); 193 }); 194} 195function monthActif(mois) { 196 if (mois) { 197 $('.list-month ul li.actif').removeClass('actif'); 198 $('.list-month ul li#'+mois).addClass('actif'); 199 } else { 200 $('.list-month ul li.actif').removeClass('actif'); 201 var month = $('.list-frise .slick-current').data('month'); 202 $('.list-month ul li#'+month).addClass('actif'); 203 } 204} 205 206/*************************************************** 207 208Gallery Photo Slider 209 210***************************************************/ 211// Slick slider for prev/next thumbnails images 212$('.slideshow__slides').slick({ 213 dots: false, 214 slidesToShow: 1, 215 autoplay: false 216}); 217setTimeout(function() { 218 $('.slideshow__slides .slick-prev').prepend('<div class="prev-slick-arrow arrow-icon"><span></span></div><div class="prev-slick-img slick-thumb-nav"><img src="/prev.jpg" class="img-responsive"></div>'); 219 $('.slideshow__slides .slick-next').append('<div class="next-slick-arrow arrow-icon"><span></span></div><div class="next-slick-img slick-thumb-nav"><img src="/next.jpg" class="img-responsive"></div>'); 220 get_prev_slick_img(); 221 get_next_slick_img(); 222}, 500); 223 224$('.slideshow__slides').on('click', '.slick-prev', function() { 225 get_prev_slick_img(); 226}); 227$('.slideshow__slides').on('click', '.slick-next', function() { 228 get_next_slick_img(); 229}); 230$('.slideshow__slides').on('swipe', function(event, slick, direction) { 231 if (direction == 'left') { 232 get_prev_slick_img(); 233 } 234 else { 235 get_next_slick_img(); 236 } 237}); 238function get_prev_slick_img() { 239 // For prev img 240 var prev_slick_img = $('.slideshow__slides .slick-current').prev('.slideshow__slides .slick-slide').find('img').attr('src'); 241 $('.slideshow__slides .prev-slick-img img').attr('src', prev_slick_img); 242 $('.slideshow__slides .prev-slick-img').css('background-image', 'url(' + prev_slick_img + ')'); 243 // For next img 244 var prev_next_slick_img = $('.slideshow__slides .slick-current').next('.slideshow__slides .slick-slide').find('img').attr('src'); 245 $('.slideshow__slides .next-slick-img img').attr('src', prev_next_slick_img); 246 $('.slideshow__slides .next-slick-img').css('background-image', 'url(' + prev_next_slick_img + ')'); 247} 248function get_next_slick_img() { 249 // For next img 250 var next_slick_img = $('.slideshow__slides .slick-current').next('.slideshow__slides .slick-slide').find('img').attr('src'); 251 $('.slideshow__slides .next-slick-img img').attr('src', next_slick_img); 252 $('.slideshow__slides .next-slick-img').css('background-image', 'url(' + next_slick_img + ')'); 253 // For prev img 254 var next_prev_slick_img = $('.slideshow__slides .slick-current').prev('.slideshow__slides .slick-slide').find('img').attr('src'); 255 $('.slideshow__slides .prev-slick-img img').attr('src', next_prev_slick_img); 256 $('.slideshow__slides .prev-slick-img').css('background-image', 'url(' + next_prev_slick_img + ')'); 257} 258 259 260/*************************************************** 261 262 Fonction d'intitialisation des dropdown 263 264 ***************************************************/ 265var dropdownElementList = [].slice.call(document.querySelectorAll('.dropdown-toggle')) 266var dropdownList = dropdownElementList.map(function (dropdownToggleEl) { 267 return new bootstrap.Dropdown(dropdownToggleEl) 268}) 269 270/*************************************************** 271 272Fonction d'intitialisation de la fancybox 273 274***************************************************/ 275function initFancybox() { 276 $("[data-fancybox], .fancybox").fancybox({ 277 // Options will go here 278 }); 279} 280 281/*************************************************** 282 283Fonction d'intitialisation de la fancybox 284 285***************************************************/ 286function shareSocial() { 287 let shareBtn = $('.btn-share'); 288 //Partage social 289 let titre = $('title').text(); 290 let description = ''; 291 let keywords = ''; 292 if ($('meta[name=description]').length) { 293 description = $('meta[name=description]').attr("content"); 294 } 295 if ($('meta[name=keywords]').length) { 296 keywords = $('meta[name=keywords]').attr("content"); 297 } 298 shareBtn.on('click', function(e) { 299 let media = $(this).attr('id'); 300 if (media == "social-facebook") { 301 let facebookUrl = encodeURI("https://www.facebook.com/sharer/sharer.php?u=" + window.location.href); 302 window.open(facebookUrl, '_blank'); 303 e.preventDefault(); 304 } 305 if (media == "social-twitter") { 306 let twitterUrl = encodeURI("https://twitter.com/intent/tweet?&url=" + window.location.href + "&text=" + titre + "&hashtags=" + keywords); 307 window.open(twitterUrl, '_blank'); 308 e.preventDefault(); 309 } 310 if (media == "social-linkedin") { 311 let linkedinUrl = encodeURI("https://www.linkedin.com/shareArticle?mini=true&url=" + window.location.href + "&title=" + document.title + "&summary=" + description); 312 window.open(linkedinUrl, '_blank'); 313 e.preventDefault(); 314 } 315 if (media == "social-pinterest") { 316 let pinterestUrl = encodeURI("https://www.pinterest.com/pin/create/button/?url=" + window.location.href + "&description=" + description); 317 window.open(pinterestUrl, '_blank'); 318 e.preventDefault(); 319 } 320 }) 321} 322 323/*************************************************** 324 325Fonction de gestion des liens externes du RTE 326 327***************************************************/ 328function externalLinkHandler() { 329 330 /*Surcharge title si target blank dans RTE*/ 331 if ($('.ce-bodytext').length) { 332 $('.ce-bodytext a[target="_blank"]').each(function() { 333 var attr = $(this).attr('title'); 334 var contentA = $(this).text() 335 if (typeof attr !== typeof undefined && attr !== false) { 336 $(this).attr('title', attr + ' (nouvelle fenêtre)'); 337 } else { 338 $(this).attr('title', contentA + ' (nouvelle fenêtre)'); 339 } 340 }); 341 } 342 343 if ($('.ce-media').length) { 344 $('.ce-media a[target="_blank"]').each(function() { 345 var mediaTitle = $(this).children().attr('title'); 346 var mediaAlt = $(this).children().attr('alt') 347 if (typeof mediaTitle !== typeof undefined && mediaTitle !== false) { 348 $(this).attr('title', mediaTitle + ' (nouvelle fenêtre)'); 349 } else { 350 $(this).attr('title', mediaAlt + ' (nouvelle fenêtre)'); 351 } 352 }); 353 } 354} 355 356/*************************************************** 357 358Fonction d'appel du datepicker 359Utiliser la classe datepicker 360 361***************************************************/ 362function datepickers() { 363 // $.datepicker.setDefaults({ 364 // buttonImage: document.location.origin + "/typo3conf/ext/e_magineurs/struthof/Resources/Public/
364Images/calendar.svg" 365 // }); 366 367 // $(".datepicker").datepicker({ 368 // changeMonth: true, //this option for allowing user to select month 369 // changeYear: true, //this option for allowing user to select from year range 370 // dateFormat: "dd/mm/yy" 371 // }); 372 373 374var $button_start_stop = $( '.btn-datepicker' ), 375 $input_start_stop = $( '.datepicker' ); 376 377$button_start_stop.on( 'click', function( event ) { 378 event.preventDefault(); 379 var text = $button_start_stop.text() 380 if ( $button_start_stop.hasClass("start") ) { 381 $button_start_stop.removeClass( 'start' ) 382 $button_start_stop.addClass( 'stop' ) 383 $button_start_stop.text( 'Désactiver le calendrier' ) 384 $button_start_stop.attr('title', 'Désactiver le calendrier') 385 $input_start_stop.pickadate({ 386 labelMonthNext: 'Mois suivant', 387 labelMonthPrev: 'Mois précédent', 388 labelMonthSelect: 'Choisir un mois', 389 labelYearSelect: 'Choisir une année', 390 selectMonths: 12, 391 selectYears: 100, 392 max: new Date(((new Date()).getFullYear()), 12, 31), // Set it max to next year last day 393 format: 'dd/mm/yyyy', 394 formatSubmit: 'dd/mm/yyyy', 395 monthsFull: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], 396 weekdaysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'], 397 today: 'aujourd\'hui', 398 clear: 'effacer', 399 400 }) 401 } 402 else { 403 $button_start_stop.removeClass( 'stop' ) 404 $button_start_stop.addClass( 'start' ) 405 $button_start_stop.text( 'Activer le calendrier' ) 406 $button_start_stop.attr('title', 'Désactiver le calendrier (non accessible au clavier)') 407 $input_start_stop.pickadate( 'picker' ).stop() 408 } 409 event.stopPropagation() 410}) 411 412} 413 414/*************************************************** 415 416Fonction de gestion des formulaires 417 418***************************************************/ 419 420function formsHandlers() { 421 // Surcharge input file 422 $('.custom-file-input').on('change', function() { 423 //get the file name 424 var fileName = $(this).val(); 425 var finalName = fileName.replace('C:\\fakepath\\', " "); 426 //replace the "Choose a file" label 427 $(this).next('.custom-file-label').html(finalName); 428 }) 429 430 /*--- formulaire title --- */ 431 if ($('.tx-powermail').length > 0) { 432 title_page = document.title; 433 //title_page = document.title; 434 var boucle; 435 436 function changetitle() { 437 if ($('.parsley-errors-list li').length > 0) { 438 document.title = 'Erreur(s) sur le formulaire - ' + title_page; 439 } else { 440 document.title = title_page; 441 } 442 boucle = setTimeout(changetitle, 1000); 443 } 444 changetitle(); 445 } 446} 447 448 449/*********************************************** 450 451Menu burger : systeme de base de l'ouverture et fermeture du menu de navigation en burger 452Activation / desactivation dans initSite(); 453 454 455************************************************/ 456 457function openMenu(navigation) { 458 navigation.addClass('open'); 459 body.addClass('open-menu'); 460 $('#toggle-menu').attr('aria-expanded', 'true'); 461} 462 463function closeMenu(navigation) { 464 navigation.removeClass('open'); 465 body.removeClass('open-menu'); 466 $('#toggle-menu').attr('aria-expanded', 'false'); 467} 468 469function isMenuOpen() { 470 if (body.hasClass('open-menu')) { 471 return true; 472 } else { 473 return false; 474 } 475} 476 477function initiateMenu() { 478 let navigation = $('#menutop'); 479 $('#toggle-menu').click(function(e) { 480 if (isMenuOpen()) { 481 closeMenu(navigation); 482 } else { 483 openMenu(navigation); 484 } 485 }) 486} 487 488function homeMenuBegin() { 489 $("#site-menu > li.dropdown > a").on('click', function() { 490 if ($("#header").hasClass('homepage') && !$('body').hasClass('scrolled')) { 491 $('html, body').animate({ 492 scrollTop: $("#actus").offset().top - 80 493 }, 1000); 494 } 495 }) 496} 497/*********************************************** 498 499Bouton de scroll Top 500 501************************************************/ 502function scrollToTop() { 503 504 var speed = 750; // Durée de l'animation (en ms) 505 $('html, body').animate({ 506 scrollTop: 0 507 }, speed); 508 $("#mainContent").focus(); 509} 510 511 512function initScrollTop() { 513 let scrollTopBtn = $('#backToTop'); 514 scrollTopBtn.click(function() { 515 scrollToTop(); 516 }) 517} 518 519/*********************************************** 520Header 521************************************************/ 522function headSearch() { 523 $("button#bloc-search").on('click', function() { 524 $("#headsearch").addClass('actif').animate({ 525 opacity: 1, 526 }, 300 ); 527 }); 528 $("#headsearch .closesearch").on('click', function() { 529 $("#headsearch").removeClass('actif').css('opacity', '0'); 530 }); 531} 532 533/*********************************************** 534Homepage 535************************************************/ 536/* Positionnement de l'info vertical */ 537function infoverticalPosition() { 538 if($('#infovertical').length){ 539 var leftPos = $("#entry .container").offset().left; 540 $("#infovertical").css('left', leftPos-15+'px'); 541 } 542} 543/* Ajout du premier texte vertical */ 544var textchange = $('#fullscreen').find(".infovertical").data('text'); 545$("#infovertical .text").text(textchange); 546/* Changement du texte vertical au scroll */ 547$.fn.isInViewport = function() { 548 var elementTop = $(this).offset().top; 549 var elementMiddle = elementTop + ($("#entry").outerHeight()/2); 550 var elementBottom = elementTop + $(this).outerHeight(); 551 var viewportTop = $(window).scrollTop(); 552 var viewportBottom = viewportTop + $(window).height(); 553 return elementBottom > viewportTop && elementMiddle < viewportBottom; 554}; 555/* Progress bar vertical au scroll */ 556function progressBar() { 557 if($('#screen.homepage').length){ 558 const scroll = $(window).scrollTop(); 559 const docHeight = $(document).height(); 560 const windowHeight = $(window).height(); 561 const scrollPercent = $(window).scrollTop() / (docHeight - windowHeight) * 100; 562 $('#myBar').css({top: scrollPercent+'%'}); 563 } 564} 565 566/* Transformation ul en select*/ 567function ulToSelect() { 568 $('#entry ul').each(function() { 569 var list = $(this), select = $(document.createElement('select')).insertBefore($(this).hide()); 570 optionFirst = $(document.createElement('option')) 571 .appendTo(select) 572 .val("") 573 .html("Je suis..."); 574 575 $('>li a', this).each(function() { 576 option = $(document.createElement('option')) 577 .appendTo(select) 578 .val(this.href) 579 .html($(this).html()); 580 }); 581 list.remove(); 582 $('#entry select').change(function() { 583 window.location = $(this).val(); 584 }); 585 }); 586} 587 588// function ulLangToSelect() { 589// // return false;
590// $('.menu-langue').each(function() { 591// var list = $(this), select = $(document.createElement('select', { 592// className: 'selectLang' 593// })).insertBefore($(this).hide()); 594// 595// $('>li', this).each(function() { 596// let $a = $(this).find('a'); 597// $a.find('span').remove(); 598// if($a.length > 0){ 599// option = $(document.createElement('option')) 600// .appendTo(select) 601// .val($a.attr('href')) 602// .html($a.html()); 603// } else { 604// $(this).find('span').remove() 605// let myLiContent = $(this).html(); 606// option = $(document.createElement('option')) 607// .appendTo(select) 608// .attr('selected', 'selected') 609// .html(myLiContent); 610// } 611// 612// }); 613// list.remove(); 614// $(select).change(function() { 615// window.location = $(this).val(); 616// }); 617// }); 618// } 619 620 621 /* Largeur du menu en home juste quand on est sur la remière div en fullscreen 622 et que le menu est en bas de screen */ 623function homeMenuBottom() { 624 if ($("#header").hasClass('homepage') && !$('body').hasClass('scrolled')) { 625 $('.frame-type-menu_principal').addClass('container'); 626 } else { 627 $('.frame-type-menu_principal').removeClass('container'); 628 } 629} 630function alerte() { 631 if($("#fullscreen .alerte").length) { 632 $("#fullscreen .alerte .alerteclose").on('click', function() { 633 $("#fullscreen .alerte").fadeOut(); 634 }) 635 } 636} 637function elementIntro() { 638 if ($('#fullscreen figure.video').length) { 639 $('#fullscreen figure.video video').attr({'id': 'videofullscreen', 'loop': true, 'controls': false}) 640 $("#fullscreen > div:first-child .content-header").before("<button class='videoplay'></button>"); 641 } 642 $("button.videoplay").on('click', function() { 643 if ($(this).hasClass('active')) { 644 $(this).removeClass('active') 645 document.getElementById('videofullscreen').pause(); 646 } else { 647 $(this).addClass('active') 648 document.getElementById('videofullscreen').play(); 649 } 650 }); 651 $("#fullscreen > div:first-child .content-header").after("<button class='scrollnext'></button>"); 652 $("button.scrollnext").on('click', function() { 653 $('html, body').animate({ 654 scrollTop: $("#actus").offset().top - 80 655 }, 1000); 656 }) 657} 658function animHome() { 659 let scroll = $(window).scrollTop(); 660 let entry = $('#entry').offset(); 661 // let contentViolet = $('#contentViolet').offset(); 662 let contentWhite = $('#contentWhite').offset(); 663 if (scroll > entry.top-200) { 664 $("#entry .grid-container > .row > div").addClass('actif'); 665 } else { 666 $("#entry .grid-container > .row > div").removeClass('actif'); 667 } 668 // if (scroll > contentViolet.top-400) { 669 // $("#contentViolet .content").addClass('actif'); 670 // } else { 671 // $("#contentViolet .content").removeClass('actif'); 672 // } 673 if (scroll > contentWhite.top-400) { 674 $("#contentWhite .content").addClass('actif'); 675 } else { 676 $("#contentWhite .content").removeClass('actif'); 677 } 678} 679 680/*********************************************** 681 Carte interactive 682************************************************/ 683let widthPoi = 0; 684let heightPoi = 0; 685let elemPoi; 686function mapInteractive(){ 687 $(window).on('load', function(){ 688 if($('.list-carte').find('.poi').length){ 689 $('.list-carte').find('.poi').each(function(){ 690 $(this).appendTo($('.map-interactive')); 691 692 widthPoi = $(this).attr('data-top'); 693 heightPoi = $(this).attr('data-left'); 694 $(this).css({ 695 'top' : widthPoi+'%', 696 'left' : heightPoi+'%' 697 }); 698 $(this).delay(350).queue(function(){ 699 $(this).addClass('active'); 700 $(this).dequeue(); 701 }) 702 $(this).on('click', function() { 703 elemPoi = $(this).attr('data-link'); 704 $('.fiche-poi').fadeOut(350); 705 $('.fiche-'+elemPoi).delay(350).fadeIn(350); 706 $('.poi').find('button').removeClass('active'); 707 $(this).find('button').addClass('active'); 708 }); 709 }); 710 $('.info-bulle-carte').appendTo($('.map-interactive')); 711 } 712 }); 713 $('.close-poi').on('click', function() { 714 $('.poi').find('button').removeClass('active'); 715 $('.fiche-poi').fadeOut(350); 716 }); 717} 718 719/************************************************** 720 721Fonction d'appel global 722Pour désactiver une fonctionnalité, commenter une des fonction 723 724**************************************************/ 725function initSite() { 726 initSliders(); 727 initFancybox(); 728 datepickers(); 729 externalLinkHandler(); 730 //initiateSearchbar(); 731 initiateMenu(); 732 homeMenuBottom(); 733 infoverticalPosition(); 734 homeMenuBegin(); 735 headSearch(); 736 formsHandlers(); 737 initScrollTop(); 738 shareSocial(); 739 elementIntro(); 740 alerte(); 741 mapInteractive(); 742 if($('#entry ul').length) {ulToSelect();} 743 // ulLangToSelect(); 744} 745 746/*********************************************** 747 748Event trigger functions 749 750************************************************/ 751 752$(window).resize(function() { 753 754 /* Width and height screen update */ 755 756 screenSizeWidth = $(window).width(); 757 screenSizeHeight = $(window).height(); 758 759 isPortrait = window.matchMedia("(orientation: portrait)").matches; 760 isLandscape = window.matchMedia("(orientation: landscape)").matches; 761 762 infoverticalPosition(); 763 764}); 765 766let scrollPosition = $(window).scrollTop(); 767$(window).scroll(function() { 768 let scroll = $(window).scrollTop(); 769 if (scroll > scrollPosition) { 770 $('#backToTop').removeClass('fixed'); 771 } else { 772 $('#backToTop').addClass('fixed'); 773 } 774 scrollPosition = scroll; 775 776 if (scroll > 80) { 777 $('body, #header').addClass('scrolled'); 778 } else { 779 $('body, #header').removeClass('scrolled'); 780 $('#backToTop').removeClass('fixed'); 781 } 782 if ($(window).scrollTop() > scroll) { 783 $('body, #header').addClass('scrolled-top'); 784 $('body, #header').removeClass('scrolled-bottom'); 785 } else { 786 $('body, #header').addClass('scrolled-bottom'); 787 $('body, #header').removeClass('scrolled-top'); 788 } 789 scroll = $(window).scrollTop(); 790 791 if($('#screen.homepage').length) { 792 homeMenuBottom(); 793 progressBar(); 794 $('.changesection').each(function() { 795 var idchange = $(this).attr("id"); 796 var textchange = $(this).find(".infovertical").data('text'); 797 if ($(this).isInViewport()) { 798 if (!$("#infovertical").hasClass(idchange)) { 799 $("#infovertical").removeClass(); 800 $("#infovertical").addClass(idchange); 801 } 802 $("#infovertical .text").text(textchange); 803 } 804 }); 805 } 806 if($('#entry').length) {animHome();} 807}); 808 809 810 811/************************************************** 812 813Initiliatisation du site 814 815**************************************************/ 816initSite(); 817 818//Konami Code ! Have Fun ! 819function activateCheats() { 820 $.fancybox.open({ 821 width: '60%', 822 type: 'iframe', 823 autoPlay: true, 824 src: 'https://www.youtube.com/watch?v=u5Ho1trvlro?autoplay=1' 825 }); 826} 827 828//Email webPage 829function emailCurrentPage() { 830 window.location.href = "mailto:?subject=" + document.title + "&body=" + encodeURI(window.location.href); 831}
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.