1/** 2 * JavaScript du thème webacademie 3 * 4 * @package Ionis 5 */ 6 7$ = jQuery.noConflict(); 8 9function onYouTubeIframeAPIReady() { 10 APP.vars.isYouTubeAPiLoaded = true; 11} 12 13function setParam(e, t, i) { 14 return e.replace(new RegExp("([?&]" + t + "(?=[=&#]|$)[^#&]*|(?=#|$))"), "&" + t + "=" + encodeURIComponent(i)).replace(/^([^?&]+)&/, "$1?") 15} 16 17function getParam(e, t) { 18 t = t || window.location.href, 19 e = e.replace(/[\[\]]/g, "\\$&"); 20 t = new RegExp("[?&]" + e + "(=([^&#]*)|&|#|$)").exec(t); 21 return t ? t[2] ? decodeURIComponent(t[2].replace(/\+/g, " ")) : "" : null 22} 23 24jQuery(document).ready(function($) { 25 APP.init(); 26}); 27 28var APP = { 29 /* ========================================================================== 30 VARIABLES 31 ========================================================================== */ 32 config: { 33 midSmallBp: 480, 34 quarterSmallBp: 600, 35 mediumBp: 768, 36 medium2Bp: 992, 37 midMediumBp: 1024, 38 quarterMediumBp: 1120 39 }, 40 41 vars: { 42 isYouTubeAPiLoaded: false, 43 isTouch: false, 44 isHistory: false, 45 isMobile: false, 46 menuOpen: false, 47 menuOpenID: false, 48 pageMenuOpen: false, 49 modalOpen: false, 50 fullpageSearchOpen: false, 51 YouTubeVideoID: '', 52 YouTubePlayer: '', 53 VimeoVideoID: '', 54 VimeoPlayer: '', 55 siteURL: 'https://' + top.location.host.toString(), 56 viewportWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0), 57 viewportHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0), 58 }, 59 60 elmts: { 61 html: $('html'), 62 body: $('body'), 63 header_menu_toggle: $('.js-header_menu_toggle'), 64 header_menu_wrapper: $('.header_menu_wrapper') 65 }, 66 67 68 /* ========================================================================== 69 INITIALIZATION 70 ========================================================================== */ 71 init: function() { 72 APP.resizeHandler(); 73 APP.featureDetection(); 74 75 APP.fullpageSearch.triggers(); 76 77 APP.navigation.triggers(); 78 APP.navigation.submenus(); 79 80 APP.pageMenu.triggers(); 81 82 APP.buttons(); 83 84 // Sirdata Click ( policy political ) 85 APP.cookiesLink(); 86 87 APP.onglets.init(); 88 APP.accordeons.init(); 89 APP.smoothScrolling.triggers(); 90 APP.backToTop(); 91 APP.modal.triggers(); 92 APP.modal.customTriggers(); 93 APP.showMore.triggers(); 94 APP.initVideoAPI(); 95 APP.modalVideo.triggers(); 96 APP.campusContact.triggers(); 97 APP.polesIonisGroup.triggers(); 98 99 APP.sliders.gutenberg(); 100 APP.sliders.timeline.chiffresCles(); 101 APP.sliders.timeline.etapes(); 102 APP.sliders.timeline.projets(); 103 APP.sliders.sliderClassique(); 104 }, 105 106 107 /** 108 * Update vars + functions on resize 109 */ 110 resizeHandler: function() { 111 $(window).resize(function() { 112 APP.vars.viewportWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 113 APP.vars.viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 114 }).resize(); 115 }, 116 117 118 /* ========================================================================== 119 UTILITIES 120 ========================================================================== */ 121 /** 122 * Feature detection 123 */ 124 featureDetection: function() { 125 // Touch 126 function is_touch_device() { 127 return (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); 128 } 129 130 if (is_touch_device()) { 131 APP.vars.isTouch = true; 132 } else { 133 APP.vars.isTouch = false; 134 } 135 136 // Add class on html if touch 137 if (APP.vars.isTouch) { 138 APP.elmts.html.addClass('touch'); 139 APP.elmts.html.removeClass('no-touch'); 140 } else { 141 APP.elmts.html.addClass('no-touch'); 142 } 143 144 // If html5 history is supported 145 if (window.history && window.history.pushState) 146 APP.vars.isHistory = true; 147 else 148 APP.vars.isHistory = false; 149 150 // If mobile 151 if (APP.elmts.body.hasClass('mobile')) 152 APP.vars.isMobile = true; 153 else 154 APP.vars.isMobile = false;
155 }, 156 157 158 /** 159 * Lien cookies footer 160 */ 161 cookiesLink: function() { 162 $('.menu-item a[href=#cookies]').click(function(event) { 163 event.preventDefault(); 164 165 if ( window.Sddan ) { 166 window.Sddan.cmp.displayUI(); 167 } 168 }); 169 }, 170 171 /** 172 * Bloc en savoir plus 173 **/ 174 showMore: { 175 triggers: function() { 176 $('.showMore_lirePlus').click(function() { 177 $(this).parent().toggleClass('is-open'); 178 }); 179 } 180 }, 181 182 /** 183 * Smooth scrolling to page anchor on click 184 **/ 185 smoothScrolling: { 186 triggers: function() { 187 $("a[href*='#']:not([href='#'])").click(function() { 188 if ( $(this).parents('.onglets_nav').length || 189 $(this).parents('.js-onglets_link').length || 190 $(this).parents('.pageMenu_menu_details').length || 191 $(this).parents('.header_main_nav_menu').length || 192 $(this).parents('.js-swiper_eventdb_nav').length || 193 $(this).parents('.js-swiper_campusMap_nav').length || 194 $(this).parents('.campusMap_nav').length || 195 $(this).hasClass('js-modal_open') ) { 196 return; 197 } 198 199 if ( 200 location.hostname == this.hostname && 201 this.pathname.replace(/^\//, "") == location.pathname.replace(/^\//, "") 202 ) { 203 var anchor = $(this.hash); 204 205 anchor = anchor.length ? anchor : $("[name=" + this.hash.slice(1) + "]"); 206 207 if ( anchor.length ) { 208 APP.smoothScrolling.animation( anchor ); 209 } 210 } 211 }); 212 }, 213 214 animation: function( anchor ){ 215 if ( anchor.length ) { 216 topCoord = anchor.offset().top; 217 218 if ( topCoord > 150 ) { 219 if ( APP.elmts.body.hasClass('single-programme') ) { 220 topCoord = topCoord - 130; 221 } else { 222 topCoord = topCoord - 90; 223 } 224 } 225 226 $("html, body").animate({ 227 scrollTop: topCoord 228 }, 800); 229 230 if ( anchor.parents('.onglets__accordeons').length ) { 231 APP.accordeons.open( anchor ); 232 } 233 } 234 } 235 }, 236 237 238 /* ========================================================================== 239 COMPONENTS 240 ========================================================================== */ 241 /** 242 * Tabs 243 */ 244 onglets: { 245 vars: { 246 containers: $('.onglets:not(.onglets__accordeons)') 247 }, 248 /** Initialisation des onglets */ 249 init: function(){ 250 if ( !APP.onglets.vars.containers.length ) { 251 return; 252 } 253 254 var hash = window.location.hash; 255 256 /** Boucle dans tous les groupes pour générer les navigation et afficher le bon onglet */ 257 APP.onglets.vars.containers.each(function(){ 258 // $this = $(this); 259 onglets = $(this).find('> .onglets_onglets > .onglets_onglet'); 260 261 /* Génère la navigation */ 262 var onglets_nav = $('<ul class="onglets_nav"></ul>'); 263 264 onglets.each(function( index ){ 265 $this_onglet = $(this); 266 267 id = $this_onglet.attr('id'); 268 titre_el = $this_onglet.find('> .onglets_onglet_titre'); 269 titre = titre_el.html(); 270 thumbnail_src = titre_el.data('onglet-thumb-src'); 271 thumbnail_src_2x = titre_el.data('onglet-thumb-src-2x'); 272 273 nav_item = '<li>'; 274 nav_item += '<a href="#' + id + '">'; 275 276 if ( thumbnail_src && thumbnail_src_2x ) { 277 nav_item += '<img src="' + thumbnail_src + '" srcset="' + thumbnail_src + ' 2x" alt="">'; 278 } 279 280 nav_item += titre; 281 nav_item += '</a>'; 282 nav_item += '</li>'; 283 onglets_nav.append($(nav_item)); 284 }); 285 286 $(this).prepend(onglets_nav); 287 288 /** Cache tous les onglets sauf celui actif */ 289 onglets.hide().removeClass('is-active'); 290 291 /* Si un hash est présent dans l'URL, vérifie si celui-ci correspond à un onglet, 292 * et si oui l'active */ 293 if ( hash ) { 294 hash_onglet = $(this).find('.onglets_onglet' + hash); 295 296 if ( hash_onglet.length ) { 297 hash_onglet.show().addClass('is-active'); 298 } else { 299 onglets.first().show().addClass('is-active'); 300 } 301 /* Si pas de hash dans l'URL, active le premier onglet */ 302 } else { 303 onglets.first().show().addClass('is-active'); 304 } 305 306 /** Gère les états actifs dans la navigation */ 307 APP.onglets.activeHandler(); 308 309 $(this).addClass('is-initialized'); 310 }); 311 312 APP.onglets.onglets(); 313 }, 314 /** Gère l'affichage d'un onglet au clic liens de navigation */ 315 onglets: function(){ 316 $('.onglets_nav li a[href^="#"], a.js-onglets_link[href^="#"], .js-onglets_link a[href*="#"]').click(function(event) { 317 event.preventDefault(); 318 319 $this = $(this); 320 parent_li = $this.parent(); 321 target = this.hash.slice(1); 322 323 if ( parent_li.hasClass('is-active') ) { 324 return; 325 } 326 327 if ( target ) { 328 container = $this.parents('.onglets'); 329 container = container.eq(0); 330 331 onglet_actif = container.find('#' + target); 332 333 /* Vérifie que l'onglet existe, si oui l'active */ 334 if ( onglet_actif.length ) { 335 container.find('> .onglets_onglets > .onglets_onglet').hide().removeClass('is-active'); 336 onglet_actif.fadeIn(300).addClass('is-active'); 337 window.location.hash = target; 338 // onglet_actif.show().addClass('is-active'); 339 /* Sinon renvoi une erreur dans la console. */ 340 } else { 341 console.log('Erreur: l\'onglet à afficher n\'existe pas'); 342 } 343 344 /** Gère les états actifs dans la navigation */ 345 APP.onglets.activeHandler(); 346 } 347 }); 348 }, 349 /** Gère les états actifs dans la navigation */ 350 activeHandler: function(){ 351 APP.onglets.vars.containers.each(function(){ 352 $this = $(this); 353 354 onglets_nav = $this.find('> .onglets_nav'); 355 onglet_actif = $this.find('> .onglets_onglets > .onglets_onglet.is-active'); 356 357 if ( onglet_actif.length ) { 358 onglet_actif_id = onglet_actif.attr('id'); 359 onglet_actif_index = onglet_actif.index(); 360 361 onglets_nav.find('li').removeClass('is-active'); 362 onglets_nav_actif = onglets_nav.find('a[href="#' + onglet_actif_id + '"]'); 363 364 onglets_nav.removeClass('onglets_nav__active-0 onglets_nav__active-1 onglets_nav__active-2 onglets_nav__active-3 onglets_nav__active-4 onglets_nav__active-5 onglets_nav__active-6 onglets_nav__active-7 onglets_nav__active-8 onglets_nav__active-9 onglets_nav__active-10'); 365 366 if ( onglets_nav_actif.length ) { 367 onglets_nav.addClass('onglets_nav__active-' + onglet_actif_index); 368 369 onglets_nav_actif.parent().addClass('is-active'); 370 } 371 } 372 }); 373 }, 374 youTubeLinks: function(){ 375 var links = $('.onglets li.youtube a'); 376 377 /* Gère la class md-trigger en fonction de la résolution afin d'activer ou 378 * désactiver la popup noire. */ 379 function youTubeLinkClass(){ 380 if ( APP.vars.viewportWidth < APP.config.quarterMediumBp ) { 381 links.removeClass('md-trigger'); 382 } else { 383 links.addClass('md-trigger'); 384 } 385 386 ModalEffects(); 387 } 388 389 $(window).smartresize(function() { 390 youTubeLinkClass(); 391 }); 392 393 youTubeLinkClass(); 394 395 /* Génération de l'iframe au click sur le lien */ 396 links.click(function(event){ 397 event.preventDefault(); 398 399 var idVideo = $(this).attr('data-id'); 400 var titleVideo = $(this).attr('data-title'); 401 var iframeVideo = '<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/' + idVideo + '" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'; 402 403 if ( $(this).hasClass('md-trigger') ) {
404 $('#title-video').html(titleVideo); 405 $('#inner-iframe').html(iframeVideo); 406 } else { 407 target = this.hash.slice(1); 408 409 if ( target ) { 410 target_container = $('#' + target + ' .video-responsive'); 411 412 if ( target_container.length ) { 413 target_container.html(iframeVideo); 414 } 415 } 416 }/* 417 418 $('#title-video').html(titleVideo) 419 $('#inner-iframe').html('<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/' + idVideo + '" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>') 420 421 console.log('test');*/ 422 }); 423 424 /* Supprime l'iframe à la fermeture de la modale */ 425 $('#modal-1 .md-close').click(function(event) { 426 $('#inner-iframe').empty(); 427 }); 428 } 429 }, 430 431 /** 432 * Accordeons 433 */ 434 accordeons: { 435 vars: { 436 containers: $('.accordeons') 437 }, 438 /** Initialisation des accordéons */ 439 init: function(){ 440 if ( !APP.accordeons.vars.containers.length ) { 441 return; 442 } 443 444 var hash = window.location.hash; 445 446 /** Boucle dans tous les groupes pour générer les navigation et afficher le bon accordéon */ 447 APP.accordeons.vars.containers.each(function(){ 448 accordeons = $(this).find('.accordeons_accordeon'); 449 450 /** Cache tous les accordéons sauf celui actif */ 451 accordeons.removeClass('is-active'); 452 accordeons.find('.accordeons_accordeon_contenu').hide(); 453 454 /* Si un hash est présent dans l'URL, vérifie si celui-ci correspond à un accordéon, 455 * et si oui l'active */ 456 if ( hash ) { 457 hash_accordeon = $(this).find('.accordeons_accordeon' + hash); 458 459 if ( hash_accordeon.length ) { 460 hash_accordeon.addClass('is-active'); 461 hash_accordeon.find('.accordeons_accordeon_contenu').show(); 462 } else { 463 if ( $(this).hasClass('accordeons__showFirst') ) { 464 accordeons.first().addClass('is-active'); 465 accordeons.first().find('.accordeons_accordeon_contenu').show(); 466 } 467 } 468 /* Si pas de hash dans l'URL, active le premier accordéon */ 469 } else { 470 if ( $(this).hasClass('accordeons__showFirst') ) { 471 accordeons.first().addClass('is-active'); 472 accordeons.first().find('.accordeons_accordeon_contenu').show(); 473 } 474 } 475 476 $(this).addClass('is-initialized'); 477 }); 478 479 APP.accordeons.accordeons(); 480 }, 481 /** Gère l'affichage d'un accordéon au clic liens de navigation */ 482 accordeons: function(){ 483 $('.accordeons .accordeons_accordeon_titre').click(function(event) { 484 event.preventDefault(); 485 486 $this = $(this); 487 $this_accordeon = $this.parent(); 488 489 APP.accordeons.open( $this_accordeon, true ); 490 }); 491 }, 492 493 open: function( accordeon, toggle ) { 494 if ( !accordeon ) { 495 console.log('Erreur: aucun hash fourni'); 496 return false; 497 } 498 499 if ( !(accordeon instanceof jQuery) ) { 500 if ( typeof accordeon === 'string' || accordeon instanceof String ) { 501 accordeon = $('#' + accordeon); 502 } else { 503 console.log('Erreur: mauvais format de donnée'); 504 return false; 505 } 506 } 507 508 if ( accordeon.length ) { 509 if ( accordeon.hasClass('is-active') ) { 510 if ( toggle ) { 511 accordeon.removeClass('is-active'); 512 accordeon.find('> .accordeons_accordeon_contenu').slideUp(200); 513 } 514 } else { 515 accordeon.addClass('is-active'); 516 accordeon.find('> .accordeons_accordeon_contenu').slideDown(200); 517 } 518 } else { 519 console.log('Erreur: l\'accordéon ciblé n\'existe pas') 520 } 521 } 522 }, 523 524 filters: { 525 filter: function(container) { 526 /* Récupère les éléments à filtrer */ 527 navigation = container.find('.js-filters_navigation'); 528 noresults = container.find('.js-filters_noresults'); 529 var current_filter = ''; 530 531 navigation.each(function() { 532 current_filter += ' ' + $(this).find('li.active a').attr('class'); 533 }) 534 535 if (!current_filter.length) { 536 return; 537 } 538 539 /* Filtre */ 540 current_filter_array = current_filter.split(' ').filter((a) => a); 541 542 items = $this.find('.js-filters_item'); 543 544 items.hide(); 545 noresults.hide(); 546 547 items_to_show = items.filter('.' + current_filter_array.join('.')); 548 549 if (items_to_show.length) { 550 items_to_show.show(); 551 } else { 552 noresults.show(); 553 } 554 }, 555 init: function() { 556 $('.js-filters_container').each(function() { 557 $this = $(this); 558 559 navigation = $this.find('.js-filters_navigation'); 560 // second_navigation = $this.find('.js-filters_second_navigation'); 561 562 var current_filter = ''; 563 564 /* Init */ 565 APP.filters.filter($this); 566 567 /* Events */ 568 navigation.find('a').click(function(event) { 569 event.preventDefault(); 570 571 $(this).parents('ul').find('li.active').removeClass('active'); 572 $(this).parent().addClass('active'); 573 574 APP.filters.filter($this); 575 }); 576 }); 577 } 578 }, 579 580 navigation: { 581 vars: { 582 header_menu: $('.header_menu'), 583 header_menu_first_li: $('.header_menu > li'), 584 header_main_nav_li: $('.header_main_nav li') 585 }, 586 triggers: function() { 587 $(document).on('click', '.js-header_menu_toggle', function(event) { 588 event.preventDefault(); 589 590 if (APP.vars.menuOpen == true) { 591 APP.navigation.close(); 592 } else { 593 APP.navigation.open(); 594 } 595 }); 596 597 $(document).on('click', '.js-header_menu_close', function(event) { 598 event.preventDefault(); 599 600 if (APP.vars.menuOpen == true) { 601 APP.navigation.close(); 602 } 603 }); 604 605 // $(document).on('click', '.header_main_nav a', function(event) { 606 // event.preventDefault(); 607 608 // menuID = $(this).parent().data('menu-item-id'); 609 610 // if ( APP.vars.menuOpen == true && APP.vars.menuOpenID == menuID ) { 611 // APP.navigation.close(); 612 // } else { 613 // APP.navigation.open( menuID ); 614 // } 615 // }); 616 617 // $(document).on('click', '.header_menu .menu-item-has-children > a[href="#"]', function(event) { 618 // event.preventDefault(); 619 620 // menuID = $(this).parent().data('menu-item-id'); 621 622 // APP.navigation.open( menuID ); 623 // }); 624 625 // Close with esc key 626 $(document).keyup(function(event) { 627 if (event.keyCode == 27) { 628 if (APP.vars.menuOpen == true) { 629 APP.navigation.close(); 630 } 631 } 632 }); 633 }, 634 635 // Open the menu 636 open: function( menuID ) { 637 if (APP.vars.menuOpen == false) { 638 APP.elmts.body.addClass('header_menu__open'); 639 640 APP.vars.menuOpen = true; 641 } 642 643 // if ( menuID ) {
644 // $('.header li').removeClass('sub-menu-open'); 645 // $('li.menu-item-' + menuID).addClass('sub-menu-open'); 646 // APP.vars.menuOpenID = menuID; 647 648 // APP.elmts.body.addClass('header_menu__subMenuOpen'); 649 // } 650 }, 651 652 // Close the menu 653 close: function() { 654 if (APP.vars.menuOpen == true) { 655 APP.elmts.body.removeClass('header_menu__open'); 656 APP.elmts.body.removeClass('header_menu__subMenuOpen'); 657 658 $('.header li').removeClass('sub-menu-open'); 659 660 APP.vars.menuOpen = false; 661 APP.vars.menuOpenID = false; 662 } 663 }, 664 665 submenus: function(){ 666 667 // -------------- BOUTON RETOUR -------------- 668 669 $( ".header_sub-menu_close" ).click(function(event) { 670 event.preventDefault(); 671 $('.header_menu > li.sub-menu-open').removeClass('sub-menu-open'); 672 $('body.header_menu__subMenuOpen').removeClass('header_menu__subMenuOpen'); 673 }); 674 675 $(document).on('click', '.header_menu > .menu-item-has-children > a[href="#"]', function(event){ 676 event.preventDefault(); 677 678 679 680 // if ( APP.vars.viewportWidth >= APP.config.medium2Bp ) { 681 // return false; 682 // } 683 684 link = $(this); 685 link_li = link.parent(); 686 687 // $('.header_menu > .menu-item-has-children > .header_menu_submenu').not(link.siblings('.header_menu_submenu')).each(function(){ 688 // $(this).slideUp(200, function(){}); 689 // link.parent().removeClass('sub-menu-open'); 690 // $(this).parent().addClass('sub-menu-closed'); 691 // }); 692 693 if ( !link_li.hasClass('sub-menu-open') ) { 694 // link.siblings('.header_menu_submenu').slideDown(200, function(){}); 695 $(".header_menu li").removeClass("sub-menu-open"); 696 link_li.addClass('sub-menu-open'); 697 APP.elmts.body.addClass('header_menu__subMenuOpen'); 698 } else { 699 // link.siblings('.header_menu_submenu').slideUp(200, function(){}); 700 APP.elmts.body.removeClass('header_menu__subMenuOpen'); 701 $(".header_menu li").removeClass("sub-menu-open"); 702 } 703 }); 704 }, 705 706 sticky: function() { 707 var header_main = $('.header_main'); 708 var header_main__clone = header_main.clone(); 709 header_main__clone.addClass('header_main__clone'); 710 header_main.after(header_main__clone); 711 712 AdjustHeader(); // Incase the user loads the page from halfway down (or something); 713 714 715 $(window).scroll(function() { 716 AdjustHeader(); 717 }); 718 719 function AdjustHeader() { 720 var distanceY = window.pageYOffset || document.documentElement.scrollTop; 721 722 if (APP.vars.viewportWidth > APP.config.medium2Bp) { 723 if (distanceY > 150) { 724 if (!APP.elmts.body.hasClass('header_main__sticky')) { 725 APP.elmts.body.addClass('header_main__sticky'); 726 } 727 } else { 728 APP.elmts.body.removeClass('header_main__sticky'); 729 } 730 } else { 731 APP.elmts.body.removeClass('header_main__sticky'); 732 } 733 734 735 /*if ($(window).scrollTop() > 170) { 736 if (!APP.elmts.body.hasClass('header_main__stickyTransition')) { 737 APP.elmts.body.addClass('header_main__stickyTransition'); 738 } 739 } else { 740 APP.elmts.body.removeClass('header_main__stickyTransition'); 741 } 742 743 744 if ($(window).scrollTop() > 280) { 745 if (!APP.elmts.body.hasClass('header_main__stickyReveal')) { 746 APP.elmts.body.addClass('header_main__stickyReveal'); 747 } 748 } else { 749 APP.elmts.body.removeClass('header_main__stickyReveal'); 750 }*/ 751 } 752 }, 753 754 campus: function() { 755 var header_campus_inner = $('.header_campus_inner'); 756 var header_campus_nav_left = $('.header_campus_nav_left'); 757 var header_campus_nav_right = $('.header_campus_nav_right'); 758 759 $(document).on('click', '.header_campus_nav', function(event) { 760 event.preventDefault(); 761 762 $this = $(this); 763 764 initial_position = header_campus_inner.scrollLeft(); 765 scroll_position = initial_position + 150; 766 767 if ( $this.hasClass('header_campus_nav_left') ) { 768 scroll_position = initial_position - 150; 769 } 770 771 header_campus_inner.animate({ 772 scrollLeft: scroll_position 773 }, 500); 774 }); 775 776 $('.header_campus_inner').scroll(function(event) { 777 $this = $(this); 778 779 scrollLeft = $this.scrollLeft(); 780 width = $this.outerWidth(); 781 scrollWidth = $this.get(0).scrollWidth; 782 783 if ( scrollWidth - scrollLeft < width + 14 ) { 784 header_campus_nav_right.addClass('is-disabled'); 785 } else { 786 header_campus_nav_right.removeClass('is-disabled'); 787 } 788 789 if ( scrollLeft < 14 ) { 790 header_campus_nav_left.addClass('is-disabled'); 791 } else { 792 header_campus_nav_left.removeClass('is-disabled'); 793 } 794 }).scroll(); 795 } 796 }, 797 798 pageMenu: { 799 triggers: function() { 800 $(document).on('click', '.js-pageMenu_toggle', function(event) { 801 event.preventDefault(); 802 803 if (APP.vars.pageMenuOpen == true) { 804 APP.pageMenu.close(); 805 } else { 806 APP.pageMenu.open(); 807 } 808 }); 809 810 // Close with esc key 811 $(document).keyup(function(event) { 812 if (event.keyCode == 27) { 813 if (APP.vars.pageMenuOpen == true) { 814 APP.pageMenu.close(); 815 } 816 817 APP.elmts.body.removeClass('pageMenu_menu_details__open'); 818 } 819 }); 820 821 $(document).on('click', '.pageMenu_menu_details > li > a[href="#"]', function(event) { 822 event.preventDefault(); 823 824 li = $(this).parent(); 825 826 APP.elmts.body.toggleClass('pageMenu_menu_details__open'); 827 }); 828 829 APP.elmts.html.click(function(event) { 830 831 if ( APP.elmts.body.hasClass('pageMenu_menu_details__open') ) { 832 target = $(event.target); 833 834 if ( !target.hasClass('pageMenu_menu_details') && target.parents('.pageMenu_menu_details').length === 0 ) { 835 APP.elmts.body.removeClass('pageMenu_menu_details__open'); 836 } 837 } 838 }); 839 }, 840 841 // Open the menu 842 open: function() { 843 if (APP.vars.pageMenuOpen == false) { 844 APP.elmts.body.addClass('pageMenu__open'); 845 846 APP.vars.pageMenuOpen = true; 847 } 848 }, 849 850 // Close the menu 851 close: function() { 852 if (APP.vars.pageMenuOpen == true) { 853 APP.elmts.body.removeClass('pageMenu__open'); 854 855 APP.vars.pageMenuOpen = false;
856 } 857 }, 858 859 // Sticky 860 sticky: function() { 861 var pageMenu = $('.pageMenu'); 862 863 if ( !pageMenu.length ) { 864 return; 865 } 866 867 var pageMenu__clone = pageMenu.clone(); 868 pageMenu__clone.addClass('pageMenu__clone'); 869 pageMenu.after(pageMenu__clone); 870 871 AdjustHeaderPageMenu(); 872 873 $(window).scroll(function() { 874 AdjustHeaderPageMenu(); 875 }); 876 877 function AdjustHeaderPageMenu() { 878 var distanceY = window.pageYOffset || document.documentElement.scrollTop; 879 880 if (APP.vars.viewportWidth > APP.config.medium2Bp) { 881 if (distanceY > pageMenu.offset().top + 80) { 882 if (!APP.elmts.body.hasClass('pageMenu__sticky')) { 883 APP.elmts.body.addClass('pageMenu__sticky'); 884 } 885 } else { 886 APP.elmts.body.removeClass('pageMenu__sticky'); 887 } 888 } else { 889 APP.elmts.body.removeClass('pageMenu__sticky'); 890 } 891 } 892 } 893 }, 894 895 fullpageSearch: { 896 triggers: function() { 897 $(document).on('click', '.js-fullpageSearch_toggle', function(event) { 898 event.preventDefault(); 899 900 if (APP.vars.fullpageSearchOpen == true) { 901 APP.fullpageSearch.close(); 902 } else { 903 APP.fullpageSearch.open(); 904 } 905 }); 906 907 $(document).on('click', '.js-fullpageSearch_open', function(event) { 908 event.preventDefault(); 909 910 if (APP.vars.fullpageSearchOpen == false) { 911 APP.fullpageSearch.open(); 912 } 913 }); 914 915 $(document).on('click', '.js-fullpageSearch_close', function(event) { 916 event.preventDefault(); 917 918 if (APP.vars.fullpageSearchOpen == true) { 919 APP.fullpageSearch.close(); 920 } 921 }); 922 923 // Close with esc key 924 $(document).keyup(function(event) { 925 if (event.keyCode == 27) { 926 if (APP.vars.fullpageSearchOpen == true) { 927 APP.fullpageSearch.close(); 928 } 929 } 930 }); 931 }, 932 933 // Open the search 934 open: function() { 935 if (APP.vars.fullpageSearchOpen == false) { 936 APP.elmts.body.addClass('fullpageSearch__open'); 937 938 $('.fullpageSearch input[type="text"]').focus(); 939 940 APP.vars.fullpageSearchOpen = true; 941 } 942 }, 943 944 // Close the search 945 close: function() { 946 if (APP.vars.fullpageSearchOpen == true) { 947 APP.elmts.body.removeClass('fullpageSearch__open'); 948 949 APP.vars.fullpageSearchOpen = false; 950 } 951 }, 952 }, 953 954 buttons: function() { 955 $('.wp-block-button__link').each(function() { 956 $this = $(this); 957 title = $this.text(); 958 959 $this.attr('data-title', title); 960 $this.wrapInner('<span></span>'); 961 $this.addClass('is-enhanced'); 962 }); 963 }, 964 965 /** 966 * Back to top button 967 */ 968 backToTop: function() { 969 if ($('.js-backToTop').length) { 970 backToTop = $('.js-backToTop'); 971 972 $(window).scroll(function() { 973 var distanceY = window.pageYOffset || document.documentElement.scrollTop; 974 975 if (distanceY > APP.vars.viewportHeight * .5) { 976 backToTop.addClass('show'); 977 } else { 978 backToTop.removeClass('show'); 979 } 980 }).scroll(); 981 } 982 }, 983 984 /** 985 * Modal 986 */ 987 modal: { 988 triggers: function() { 989 /* Open */ 990 $(document).on('click', '.js-modal_open', function(event){ 991 event.preventDefault(); 992 993 if ( this.hash != '' ) { 994 APP.modal.open(this.hash.substring(1)); 995 } 996 }); 997 998 $(document).on('click', '.js-modal_iframe_open', function(event){ 999 if ( APP.vars.viewportWidth >= APP.config.mediumBp ) { 1000 event.preventDefault(); 1001 1002 src = $(this).attr('href'); 1003 1004 iframe = $('<iframe src="' + src + '"></iframe>'); 1005 $('.js-modal#default .modal_inner_container').addClass('modal_inner_container__iframe').append(iframe); 1006 1007 APP.modal.open('default'); 1008 } 1009 }); 1010 1011 /* Close */ 1012 $(document).on('click', '.js-modal_close', function(event){ 1013 event.preventDefault(); 1014 1015 APP.modal.close(); 1016 }); 1017 1018 // CLOSE WITH ESC KEY 1019 $(document).keyup(function(event) { 1020 if ( event.keyCode == 27 ) { 1021 if ( APP.vars.modalOpen == true ) { 1022 APP.modal.close(); 1023 } 1024 } 1025 }); 1026 }, 1027 1028 customTriggers: function() { 1029 $(document).on('click', 'a[href="#demande-brochure"]', function(event){ 1030 event.preventDefault(); 1031 1032 if ( this.hash != '' ) { 1033 APP.modal.open(this.hash.substring(1)); 1034 } 1035 }); 1036 }, 1037 1038 open: function(modalID){ 1039 modalID = typeof modalID !== 'undefined' ? modalID : 'default'; 1040 1041 theModal = $('.js-modal#' + modalID); 1042 1043 if ( theModal.length ) { 1044 if ( APP.vars.modalOpen == false ) { 1045 APP.elmts.body.addClass('modalOpen'); 1046 theModal.addClass('open'); 1047 1048 APP.vars.modalOpen = true; 1049 } 1050 } else { 1051 console.log('La modal ciblée n\'existe pas'); 1052 } 1053 }, 1054 1055 close: function(){ 1056 if ( APP.vars.modalOpen == true ) { 1057 APP.elmts.body.removeClass('modalOpen'); 1058 $('.js-modal').removeClass('open'); 1059 1060 setTimeout(function(){ 1061 $('.js-modal#default, .js-modal#video').find('.modal_inner_container').empty(); 1062 }, 600); 1063 1064 APP.vars.modalOpen = false;
1065 } 1066 } 1067 }, 1068 1069 /** 1070 * Load YouTube API if needed 1071 */ 1072 initVideoAPI: function(){ 1073 if ( $('.js-inline_youtube_open, .js-modal_video_open[href*="youtube"], .js-modal_video_open[href*="youtu.be"]').length ) { 1074 if ( APP.vars.isYouTubeAPiLoaded == false ) { 1075 var tag = document.createElement('script'); 1076 1077 tag.src = "https://www.youtube.com/iframe_api"; 1078 var firstScriptTag = document.getElementsByTagName('script')[0]; 1079 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 1080 } 1081 } 1082 1083 if ( $('.js-modal_video_open[href*="vimeo"]').length ) { 1084 var tag = document.createElement('script'); 1085 1086 tag.src = "https://player.vimeo.com/api/player.js"; 1087 var firstScriptTag = document.getElementsByTagName('script')[0]; 1088 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 1089 } 1090 }, 1091 1092 /** 1093 * YouTube modal 1094 */ 1095 modalVideo: { 1096 triggers: function(){ 1097 $(document).on('click', '.js-modal_video_open', function(event){ 1098 event.preventDefault(); 1099 1100 href = $(this).attr('href'); 1101 1102 /* Vimeo */ 1103 if ( href.indexOf('vimeo') >= 0 ) { 1104 videoID = getVideoId(href); 1105 APP.vars.VimeoVideoID = videoID.id; 1106 1107 if ( APP.vars.VimeoVideoID.length ) { 1108 $(this).addClass('loading'); 1109 APP.modalVideo.createVimeoPlayer(); 1110 } 1111 /* YouTube */ 1112 } else if ( href.indexOf('youtube') >= 0 || href.indexOf('youtu.be') >= 0 ) { 1113 videoID = getVideoId(href); 1114 APP.vars.YouTubeVideoID = videoID.id; 1115 1116 if ( APP.vars.YouTubeVideoID.length ) { 1117 if ( APP.vars.isYouTubeAPiLoaded == false ) { 1118 console.log('Problème de chargement de l\'API YouTube'); 1119 } else { 1120 $(this).addClass('loading'); 1121 APP.modalVideo.createYouTubePlayer(); 1122 } 1123 } 1124 } 1125 }); 1126 }, 1127 1128 createYouTubePlayer: function(){ 1129 player_tag = $('<div class="modal_player_wrapper video-responsive"><div id="ytplayer" class="modal_player"></div>'); 1130 $('.js-modal#video').find('.modal_inner_container').append(player_tag); 1131 1132 APP.vars.YouTubePlayer = new YT.Player('ytplayer', { 1133 height: '360', 1134 width: '640', 1135 videoId: APP.vars.YouTubeVideoID, 1136 events: { 1137 'onReady': openModal() 1138 } 1139 }); 1140 1141 function openModal(){ 1142 setTimeout(function(){ 1143 theModal = $('.js-modal#video'); 1144 1145 if ( theModal.length ) { 1146 if ( APP.vars.modalOpen == false ) { 1147 APP.elmts.body.addClass('modalOpen'); 1148 theModal.addClass('open'); 1149 1150 setTimeout(function(){ 1151 $('.js-modal_video_open').removeClass('loading'); 1152 APP.vars.YouTubePlayer.playVideo(); 1153 }, 2000); 1154 1155 APP.vars.modalOpen = true; 1156 } 1157 } 1158 }, 500); 1159 } 1160 }, 1161 1162 createVimeoPlayer: function(){ 1163 player_tag = $('<div class="modal_player_wrapper video-responsive"><div id="vimeoplayer" class="modal_player"></div>'); 1164 $('.js-modal#video').find('.modal_inner_container').append(player_tag); 1165 1166 APP.vars.VimeoPlayer = new Vimeo.Player('vimeoplayer', { 1167 id: APP.vars.VimeoVideoID, 1168 width: 640 1169 }); 1170 1171 openModal(); 1172 1173 function openModal(){ 1174 setTimeout(function(){ 1175 theModal = $('.js-modal#video'); 1176 1177 if ( theModal.length ) { 1178 if ( APP.vars.modalOpen == false ) { 1179 APP.elmts.body.addClass('modalOpen'); 1180 theModal.addClass('open'); 1181 1182 setTimeout(function(){ 1183 APP.vars.VimeoPlayer.play(); 1184 $('.js-modal_video_open').removeClass('loading'); 1185 }, 1000); 1186 1187 APP.vars.modalOpen = true; 1188 } 1189 } 1190 }, 500); 1191 } 1192 } 1193 }, 1194 1195 /** 1196 * Inline video 1197 */ 1198 inlineVideo: { 1199 triggers: function(){ 1200 $(document).on('click', '.js-inline_youtube_open', function(event){ 1201 event.preventDefault(); 1202 1203 target_container = $(this).parents('.js-inlineVideo'); 1204 youTubeVideoID = $(this).data('video-id'); 1205 1206 if ( APP.vars.isYouTubeAPiLoaded == false ) { 1207 console.log('Problème de chargement de l\'API YouTube'); 1208 } else { 1209 $(this).addClass('loading'); 1210 APP.inlineVideo.createPlayer( target_container, youTubeVideoID ); 1211 } 1212 }); 1213 }, 1214 1215 createPlayer: function( container, youTubeVideoID ){ 1216 var container = container; 1217 1218 // $('html, body').css('cursor', 'progress'); 1219 1220 player_tag = $('<div id="ytinlineplayer"></div>'); 1221 container.find('.inlineVideo_video').append(player_tag); 1222 1223 var youTubePlayer = new YT.Player('ytinlineplayer', { 1224 height: '360', 1225 width: '640', 1226 videoId: youTubeVideoID, 1227 events: { 1228 'onReady': function(){ 1229 container.addClass('showytplayer'); 1230 1231 setTimeout(function(){ 1232 // $('html, body').css('cursor', 'auto'); 1233 $('.js-inline_youtube_open').removeClass('loading'); 1234 1235 youTubePlayer.playVideo(); 1236 }, 300); 1237 } 1238 } 1239 }); 1240 } 1241 }, 1242 1243 /** 1244 * Campus contact 1245 */ 1246 campusContact: { 1247 vars: {}, 1248 triggers: function(){ 1249 APP.campusContact.vars.block = $('.campusContact'); 1250 1251 if ( APP.campusContact.vars.block.length ) { 1252 APP.campusContact.vars.select = APP.campusContact.vars.block.find('select'); 1253 APP.campusContact.vars.nav = APP.campusContact.vars.block.find('.campusMap_nav'); 1254 1255 /** URL : Si l'URL contient un hash, affiche le campus correspondant */ 1256 if ( window.location.hash ) { 1257 campus = window.location.hash.substring(1); 1258 1259 APP.campusContact.filter( campus ); 1260 } 1261 1262 /** SELECT : Affiche le campus en fonction du select */ 1263 if ( APP.campusContact.vars.select.length ) { 1264 APP.campusContact.vars.select.on('change', function(){ 1265 var selectedCampus = $(this).find(":selected").val(); 1266 1267 APP.campusContact.filter( selectedCampus ); 1268 }); 1269 } 1270 1271 /** MARQUEURS : Affiche le campus en fonction du clic sur les marqueurs */ 1272 if ( APP.campusContact.vars.nav.length ) { 1273 APP.campusContact.vars.nav.find('a').on('click', function( event ){ 1274 event.preventDefault(); 1275 var clickedCampus = this.hash; 1276 1277 if ( clickedCampus ) { 1278 APP.campusContact.filter( clickedCampus.substring(1) ); 1279 } 1280 }); 1281 } 1282 } 1283 }, 1284 1285 /* Filtre le campus sélectionné via l'URL ou le select */ 1286 filter: function( campus ){ 1287 if ( campus ) { 1288 selectedCampus = APP.campusContact.vars.block.find( '.campus__' + campus ); 1289 1290 if ( selectedCampus.length ) { 1291 /** Affiche le campus sélectionné */ 1292 APP.campusContact.vars.block.find('.campusContact_panel').removeClass('is-active'); 1293 selectedCampus.addClass('is-active'); 1294 1295 /** Modifie la valeur du select */ 1296 if ( APP.campusContact.vars.select.length && APP.campusContact.vars.select.find('option[value="' + campus + '"]').length ) { 1297 APP.campusContact.vars.select.val( campus ); 1298 } 1299 1300 /** Active le bon marqueur */ 1301 selectedCampus_marker = APP.campusContact.vars.nav.find('a[href="#' + campus + '"]'); 1302 1303 if ( selectedCampus_marker.length ) { 1304 APP.campusContact.vars.nav.find('a').removeClass('is-active'); 1305 selectedCampus_marker.addClass('is-active'); 1306 } 1307 1308 return true; 1309 } else { 1310 console.log('Le campus indiqué n\'existe pas'); 1311 1312 return false;
1313 } 1314 } else { 1315 console.log('Aucun campus n\'a été sélectionné'); 1316 1317 return false; 1318 } 1319 } 1320 }, 1321 1322 /** 1323 * Filtre pôles IONIS Group 1324 */ 1325 polesIonisGroup: { 1326 vars: {}, 1327 triggers: function(){ 1328 APP.polesIonisGroup.vars.block = $('.polesIonisGroup'); 1329 1330 if ( APP.polesIonisGroup.vars.block.length ) { 1331 APP.polesIonisGroup.vars.select = APP.polesIonisGroup.vars.block.find('select'); 1332 1333 /** SELECT : Affiche le campus en fonction du select */ 1334 if ( APP.polesIonisGroup.vars.select.length ) { 1335 APP.polesIonisGroup.vars.select.on('change', function(){ 1336 var selectedPole = $(this).find(":selected").val(); 1337 1338 APP.polesIonisGroup.filter( selectedPole ); 1339 }); 1340 } 1341 } 1342 }, 1343 1344 /* Filtre le pole sélectionné via l'URL ou le select */ 1345 filter: function( pole ){ 1346 if ( pole ) { 1347 selectedPole = APP.polesIonisGroup.vars.block.find( '#' + pole ); 1348 1349 if ( selectedPole.length ) { 1350 /** Affiche le pole sélectionné */ 1351 APP.polesIonisGroup.vars.block.find('.polesIonisGroup_pole').removeClass('is-active'); 1352 selectedPole.addClass('is-active'); 1353 1354 /** Modifie la valeur du select */ 1355 if ( APP.polesIonisGroup.vars.select.length && APP.polesIonisGroup.vars.select.find('option[value="' + pole + '"]').length ) { 1356 APP.polesIonisGroup.vars.select.val( pole ); 1357 } 1358 1359 return true; 1360 } else { 1361 console.log('Le pôle indiqué n\'existe pas'); 1362 1363 return false; 1364 } 1365 } else { 1366 console.log('Aucun pôle n\'a été sélectionné'); 1367 1368 return false; 1369 } 1370 } 1371 }, 1372 1373 1374 /* ========================================================================== 1375 SLIDERS 1376 ========================================================================== */ 1377 /** 1378 * Timeline 1379 */ 1380 sliders: { 1381 needArrows: function(swiper) { 1382 if (swiper.isBeginning && swiper.isEnd) { 1383 $(swiper.$el).addClass('disabled'); 1384 $(swiper.$el).addClass('disabled'); 1385 } else { 1386 $(swiper.$el).removeClass('disabled'); 1387 $(swiper.$el).removeClass('disabled'); 1388 } 1389 }, 1390 1391 handleEnabled: function(swiper, breakpoint) { 1392 if ( !swiper.enabled ) { 1393 $(swiper.$el).addClass('swiper-disabled'); 1394 } else { 1395 $(swiper.$el).removeClass('swiper-disabled'); 1396 } 1397 }, 1398 1399 gutenberg: function() { 1400 swiper_gutenberg = $('.js-swiper_gutenberg'); 1401 1402 if ( !swiper_gutenberg.length ) { 1403 return false; 1404 } 1405 1406 swiper_gutenberg.each(function(){ 1407 var this_container = this, 1408 $this = $(this); 1409 1410 /* Récupération des variables */ 1411 slidesPerView_mobile = $this.data('slidesperview-mobile'); 1412 if ( !slidesPerView_mobile ) slidesPerView_mobile = 1; 1413 1414 slidesPerView_tablet = $this.data('slidesperview-tablet'); 1415 if ( !slidesPerView_tablet ) slidesPerView_tablet = 1; 1416 1417 slidesPerView_desktop = $this.data('slidesperview-desktop'); 1418 if ( !slidesPerView_desktop ) slidesPerView_desktop = 1; 1419 1420 slidesPerView_desktop_large = $this.data('slidesperview-desktop-large'); 1421 if ( !slidesPerView_desktop_large ) slidesPerView_desktop_large = 1; 1422 1423 destroy_breakpoint = $this.data('destroy-breakpoint'); 1424 1425 settings = { 1426 speed: 300, 1427 slidesPerView: slidesPerView_mobile, 1428 enabled: true, 1429 breakpoints: { 1430 1200: { 1431 enabled: true, 1432 slidesPerView: slidesPerView_desktop_large 1433 }, 1434 992: { 1435 enabled: true, 1436 slidesPerView: slidesPerView_desktop 1437 }, 1438 480: { 1439 enabled: true, 1440 slidesPerView: slidesPerView_tablet 1441 }, 1442 } 1443 }; 1444 1445 /** Prev/next */ 1446 prev = $this.find('.swiper-button-next'); 1447 1448 if ( prev.length ) { 1449 settings.navigation = { 1450 nextEl: $this.find('.swiper-button-next')[0], 1451 prevEl: $this.find('.swiper-button-prev')[0] 1452 } 1453 } 1454 1455 /** Pagination */ 1456 pagination = $this.find('.swiper-pagination'); 1457 1458 if ( pagination.length ) { 1459 settings.pagination = { 1460 el: $this.find('.swiper-pagination')[0], 1461 type: 'bullets', 1462 clickable: true, 1463 } 1464 } 1465 1466 /** Destroy breakpoint */ 1467 if ( destroy_breakpoint ) { 1468 switch ( destroy_breakpoint ) { 1469 case 480: 1470 settings.breakpoints[480].enabled = false;
1471 settings.breakpoints[992].enabled = false; 1472 settings.breakpoints[1200].enabled = false; 1473 break; 1474 case 992: 1475 settings.breakpoints[992].enabled = false; 1476 settings.breakpoints[1200].enabled = false; 1477 break; 1478 case 1200: 1479 settings.breakpoints[1200].enabled = false; 1480 break; 1481 } 1482 1483 settings.on = { 1484 init: function(){ 1485 APP.sliders.handleEnabled(this); 1486 }, 1487 resize: function(){ 1488 APP.sliders.handleEnabled(this); 1489 } 1490 }; 1491 } 1492 1493 swiper = new Swiper( this_container, settings ); 1494 }); 1495 }, 1496 1497 sliderClassique: function() { 1498 swiper_sliderClassique = $('sliderClassique'); 1499 swiper_sliderClassique = new Swiper(".sliderClassique", { 1500 pagination: { 1501 el: ".swiper-pagination", 1502 }, 1503 }); 1504 }, 1505 1506 timeline: { 1507 chiffresCles: function() { 1508 swiper_chiffresCles = $('.js-swiper_chiffresCles'); 1509 1510 if ( !swiper_chiffresCles.length ) { 1511 return false; 1512 } 1513 1514 swiper_chiffresCles.each(function(){ 1515 var this_container = this, 1516 $this = $(this); 1517 1518 settings_chiffresCles = { 1519 speed: 300, 1520 enabled: true, 1521 slidesPerView: 'auto', 1522 pagination: { 1523 el: $this.find('.swiper-pagination')[0], 1524 type: 'bullets', 1525 clickable: true, 1526 }, 1527 breakpoints: { 1528 1024: { 1529 enabled: false, 1530 } 1531 }, 1532 on: { 1533 init: function(){ 1534 APP.sliders.handleEnabled(this); 1535 }, 1536 resize: function(){ 1537 APP.sliders.handleEnabled(this); 1538 } 1539 } 1540 }; 1541 1542 swiper = new Swiper( this_container, settings_chiffresCles ); 1543 }); 1544 }, 1545 1546 etapes: function() { 1547 swiper_timelineEtapes = $('.js-swiper_timelineEtapes'); 1548 1549 if ( !swiper_timelineEtapes.length ) { 1550 return false; 1551 } 1552 1553 swiper_timelineEtapes.each(function(){ 1554 var this_container = this, 1555 $this = $(this); 1556 1557 settings_timelineEtapes = { 1558 speed: 300, 1559 enabled: false, 1560 effect: 'fade', 1561 slidesPerView: 1, 1562 navigation: { 1563 nextEl: $this.find('.swiper-button-next')[0], 1564 prevEl: $this.find('.swiper-button-prev')[0] 1565 }, 1566 pagination: { 1567 el: $this.find('.swiper-pagination')[0], 1568 type: 'bullets', 1569 clickable: true, 1570 }, 1571 breakpoints: { 1572 768: { 1573 enabled: true, 1574 } 1575 }, 1576 on: { 1577 init: function(){ 1578 APP.sliders.handleEnabled(this); 1579 1580 $(this.$el).addClass('swiper-active-slide-' + this.activeIndex); 1581 }, 1582 resize: function(){ 1583 APP.sliders.handleEnabled(this); 1584 }, 1585 slideChange: function(){ 1586 $(this.$el).removeClass('swiper-active-slide-0 swiper-active-slide-1 swiper-active-slide-2 swiper-active-slide-3 swiper-active-slide-4 swiper-active-slide-5 swiper-active-slide-6 swiper-active-slide-7 swiper-active-slide-8 swiper-active-slide-9 swiper-active-slide-10'); 1587 $(this.$el).addClass('swiper-active-slide-' + this.activeIndex); 1588 } 1589 } 1590 }; 1591 1592 swiper = new Swiper( this_container, settings_timelineEtapes ); 1593 }); 1594 }, 1595 1596 projets: function() { 1597 swiper_timelineProjets = $('.js-swiper_timelineProjets'); 1598 1599 if ( !swiper_timelineProjets.length ) { 1600 return false; 1601 } 1602 1603 swiper_timelineProjets.each(function(){ 1604 var this_container = this, 1605 $this = $(this); 1606 1607 /** Navigation */ 1608 settings_timelineProjets = { 1609 speed: 300, 1610 slidesPerView: 'auto', 1611 touchRatio: 0.1, 1612 navigation: { 1613 nextEl: $this.find('.swiper-button-next')[0], 1614 prevEl: $this.find('.swiper-button-prev')[0] 1615 }, 1616 pagination: { 1617 el: $this.find('.swiper-pagination')[0], 1618 type: 'bullets', 1619 clickable: true, 1620 }, 1621 breakpoints: { 1622 768: { 1623 slidesPerView: 1, 1624 } 1625 }, 1626 on: { 1627 init: function(){ 1628 APP.sliders.handleEnabled(this); 1629 1630 $(this.$el).addClass('swiper-active-slide-' + this.activeIndex); 1631 }, 1632 resize: function(){ 1633 APP.sliders.handleEnabled(this); 1634 }, 1635 slideChange: function(){ 1636 $(this.$el).removeClass('swiper-active-slide-0 swiper-active-slide-1
1636swiper-active-slide-2 swiper-active-slide-3 swiper-active-slide-4 swiper-active-slide-5 swiper-active-slide-6 swiper-active-slide-7 swiper-active-slide-8 swiper-active-slide-9 swiper-active-slide-10'); 1637 $(this.$el).addClass('swiper-active-slide-' + this.activeIndex); 1638 } 1639 } 1640 }; 1641 1642 swiper = new Swiper( this_container, settings_timelineProjets ); 1643 }); 1644 } 1645 } 1646 } 1647}; 1648 1649 1650$( ".accueilHeader_Scroll" ).click(function(event) { 1651 event.preventDefault(); 1652 $("html, body").animate({ 1653 scrollTop: 1000 1654}, 1000); 1655}); 1656 1657$(window).scroll(function() { 1658 var scroll = $(this).scrollTop(); 1659 1660 if (scroll >= 100) { 1661 $(".page-template-template_noheader .header_main").addClass("white_header"); 1662 } else { 1663 $(".page-template-template_noheader .header_main").removeClass("white_header"); 1664 } 1665});
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.