1// Hack IE + Edge pour la propriété Object-fit en CSS 2 3if (!Modernizr.objectfit) { 4 $('.link-content-wrapper').each(function () { 5 var $container = $(this), 6 imgUrl = $container.find('img').prop('src'); 7 if (imgUrl) { 8 $container 9 .css('backgroundImage', 'url(' + imgUrl + ')') 10 .addClass('compat-object-fit'); 11 } 12 }); 13} 14 15// Fonction pour l'ouverture d'une lightbox à l'ancienne depuis les liens Gelore 16 17function MM_openBrWindow(theURL, winName, features) { //v2.0 18 window.open(theURL, winName, features); 19} 20 21$(document).ready(function ($) { 22 if(window.location.hash != '' && $(window.location.hash).length<1){ 23 //fallback pour les hash type panel-122132-0 24 var n= window.location.hash.split('-').slice(-2); 25 var hash='#link-'+n[0]+'-'+n[1]; 26 var fallback=$(hash).closest('.panel').children('.panel-collapse'); 27 fallback.collapse('show'); 28 var parent=$(hash).parents('.panel-group').first() 29 if(parent) { 30 parent.collapse('show'); 31 $(hash).parents('.panel-collapse').first().collapse('show'); 32 } 33 $(document).TCScroll({action: 'scrollTo', element: fallback.parent()}); 34 } 35 //log search keyword 36 $('#search').on('change',function () { 37 var s=$('#search').val().trim(); 38 if(s) 39 navigator.sendBeacon(window.location.href.split('?')[0]+"?qfb="+s); 40 }); 41 $('a:contains(\'Accès direct\')').replaceWith(function () { 42 return "<h4>Accès direct</h4>"; 43 }); 44 45 46 $(document).on('change','[aria-controls^="tx_datatables"]',function () { 47 if($(this).val()) 48 navigator.sendBeacon(window.location.href.split('?')[0]+"?dat="+$(this).val()); 49 }); 50 51 // Ajouter des class à la liste Accès direct 52 53 /** 54 * Ouverture des liens externes et liens vers des fichiers dans un nouvel onglet, même si le rédacteur ne l'a pas spécifié 55 */ 56 $(".sf-mega-section-direct ul li").eq(0).addClass("direct-0"); 57 $(".sf-mega-section-direct ul li").eq(1).addClass("direct-1"); 58 $(".sf-mega-section-direct ul li").eq(2).addClass("direct-2"); 59 $(".sf-mega-section-direct ul li").eq(3).addClass("direct-3"); 60 $(".sf-mega-section-direct ul li").eq(4).addClass("direct-4"); 61 $(".sf-mega-section-direct ul li").eq(5).addClass("direct-5"); 62 $(".sf-mega-section-direct ul li").eq(6).addClass("direct-6"); 63 $(".sf-mega-section-direct ul li").eq(7).addClass("direct-7"); 64 $(".sf-mega-section-direct ul li").eq(8).addClass("direct-8"); 65 $(".sf-mega-section-direct ul li").eq(9).addClass("direct-9"); 66 $(".sf-mega-section-direct ul li").eq(10).addClass("direct-10"); 67 $(".sf-mega-section-direct ul li").eq(11).addClass("direct-11"); 68 $(".sf-mega-section-direct ul li").eq(12).addClass("direct-12"); 69 $(".sf-mega-section-direct ul li").eq(13).addClass("direct-13"); 70 $(".sf-mega-section-direct ul li").eq(14).addClass("direct-14"); 71 $(".sf-mega-section-direct ul li").eq(15).addClass("direct-15"); 72 $(".sf-mega-section-direct ul li").eq(16).addClass("direct-16"); 73 $(".sf-mega-section-direct ul li").eq(17).addClass("direct-17"); 74 $(".sf-mega-section-direct ul li").eq(18).addClass("direct-18"); 75 $(".sf-mega-section-direct ul li").eq(19).addClass("direct-19"); 76 $(".sf-mega-section-direct ul li").eq(20).addClass("direct-20"); 77 $(".sf-mega-section-direct ul li").eq(21).addClass("direct-21"); 78 $(".sf-mega-section-direct ul li").eq(22).addClass("direct-22"); 79 $(".sf-mega-section-direct ul li").eq(23).addClass("direct-23"); 80 $(".sf-mega-section-direct ul li").eq(24).addClass("direct-24"); 81 $(".sf-mega-section-direct ul li").eq(25).addClass("direct-25"); 82 83 84 85 86 $('.content-image-button').click(function () { 87 $(this).next('.content-image-more-content').toggle(); 88 }); 89 90 /* JE SUIS, JE VEUX, PAGE D'ACCUEIL */ 91 92 $('.je-suis').click(function () { 93 $(this).removeClass('profile-inactif').addClass('profile-actif'); 94 $('.je-veux').removeClass('.profile-actif').addClass('profile-inactif'); 95 $('.suis').removeClass('.profile-inactif-wrapper').addClass('profile-actif-wrapper'); 96 $('.veux').hide(); 97 $('.suis').show(); 98 99 }); 100 $('.je-veux').click(function () { 101 $(this).removeClass('profile-inactif').addClass('profile-actif'); 102 $('.je-suis').removeClass('.profile-actif').addClass('profile-inactif'); 103 $('.veux').show(); 104 $('.suis').hide(); 105 106 }); 107 108 $('.je-suis-mobile').click(function () { 109 $(this).removeClass('profile-inactif').addClass('profile-actif'); 110 $('.je-veux').removeClass('.profile-actif').addClass('profile-inactif'); 111 $('.suis').removeClass('.profile-inactif-wrapper').addClass('profile-actif-wrapper'); 112 $('.je-veux-mobile').hide(); 113 $('.je-suis-mobile').show(); 114 115 }); 116 $('.je-veux-mobile').click(function () { 117 $(this).removeClass('profile-inactif').addClass('profile-actif'); 118 $('.je-suis').removeClass('.profile-actif').addClass('profile-inactif'); 119 $('.je-veux-mobile').show(); 120 $('.je-suis-mobile').hide(); 121 122 }); 123 124 /* FONCTIONS DES 2 BOUTONS NAVIGATION EN HAUT */ 125 126 $('.btn-top-recherche').hover(function () { 127 topRecherche(); 128 129 }); 130 $('.btn-top-recherche').click(function () { 131 topRecherche(); 132 }); 133
134 function topRecherche(){ 135 $('.header-top-recherche-wrapper').toggle(true); 136 $('.header-recherche-wrapper').toggle(false); 137 $('.btn-recherche').removeClass('front'); 138 } 139 140 141 $('.btn-recherche').hover(function () { 142 recherche(); 143 }); 144 $('.btn-recherche').click(function () { 145 recherche(); 146 }); 147 function recherche() { 148 $('.header-recherche-wrapper').toggle(true); 149 $('#search').focus(); 150 $('.header-top-recherche-wrapper').toggle(false); 151 $(this).addClass('front'); 152 } 153 $('.header-top-recherche-wrapper').hover(function () { 154 }, function () { 155 $(this).toggle(false); 156 }); 157 158 $('.header-top-recherche').hover(function () { 159 }, function () { 160 $('.header-top-recherche-wrapper').toggle(false); 161 $('.header-recherche-wrapper').toggle(false); 162 }); 163 164 165 166 $('.header-recherche-wrapper').hover(function () { 167 }, function () { 168 $(this).toggle(false); 169 }); 170 171 /** Gestion du menu mobile **/ 172 $('#mobile-menu').mmenu({ 173 offCanvas: { 174 position: "right" 175 }, 176 }); 177 178 /**$('.header-recherche-wrapper').click(function(){ 179 $(this).hide(); 180 }); 181 $('.header-top-recherche-wrapper').click(function(){ 182 $(this).hide(); 183 }); 184 */ 185 /** 186 * Gestion de lightbox (pour les images de contenu et de news) 187 * @type {lightBoxManager} 188 */ 189 var lightBoxManager = function () { 190 $.extend(true, $.magnificPopup.defaults, { 191 tClose: 'Fermer (Esc)', // Alt text on close button 192 tLoading: 'Chargement...', // Text that is displayed during loading. Can contain %curr% and %total% keys 193 gallery: { 194 tPrev: 'Précédent (touche \'Flèche gauche du clavier\')', // Alt text on left arrow 195 tNext: 'Suivant (touche \'Flèche droite du clavier\')', // Alt text on right arrow 196 tCounter: '%curr% sur %total%' // Markup for "1 of 7" counter 197 }, 198 image: { 199 tError: '<a href="%url%">L\'image</a> ne peut pas être chargée.' // Error message when image could not be loaded 200 }, 201 ajax: { 202 tError: '<a href="%url%">Le contenu</a> ne peut pas être chargé.' // Error message when ajax request failed 203 } 204 }); 205 206 /** 207 * Fait une "galerie" avec toutes les images a 208 */ 209 function initGallery() { 210 $('.tx-genericgallery-pi1').each(function () { 211 var element = $(this); 212 213 element.magnificPopup({ 214 delegate: 'a', 215 type: 'image', 216 tLoading: 'Loading image #%curr%...', 217 mainClass: 'mfp-img-mobile', 218 gallery: { 219 enabled: true, 220 navigateByImgClick: true, 221 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 222 }, 223 image: { 224 titleSrc: function (item) { 225 return item.el.attr('title'); 226 } 227 }, 228 zoom: { 229 enabled: false, 230 duration: 100, 231 easing: 'ease-in-out' 232 233 } 234 }); 235 236 }); 237 238 } 239 240 function initSingle() { 241 $('.tt-content').magnificPopup({ 242 delegate: 'a', // child items selector, by clicking on it popup will open 243 type: 'image' 244 // other options 245 }); 246 } 247 248 return { 249 init: function () { 250 initGallery(); 251 252 } 253 } 254 }(); 255 256 /** 257 * Accordéons Bootstrap: surcharge de fonctionnalités 258 */ 259 var accordionManager = function () { 260 return { 261 init: function () { 262 263 $('.panel-collapse').on('shown.bs.collapse', function () { 264 $(this).prev('.panel-heading').closest('.panel').addClass("active"); 265 }); 266 267 $('.panel-collapse').on('hidden.bs.collapse', function (e) { 268 var el=$(this); 269 if(!el.hasClass('in')) 270 el.prev('.panel-heading').closest('.panel').removeClass("active"); 271 }); 272 } 273 } 274 }(); 275 276 /** 277 * Gestion des trackings des liens externes 278 * @type {{init}} 279 */ 280 var externalTracking = function () { 281 return { 282 init: function () { 283 var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i; 284 285 if (typeof ga != 'undefined') { 286 $('a').on('click', function () { 287 var el = $(this); 288 var track = true; 289 var href = (typeof(el.attr('href')) != 'undefined') ? el.attr('href') : ""; 290 var isThisDomain = href.match(document.domain.split('.').reverse()[1] + '.' + document.domain.split('.').reverse()[0]); 291 if (!href.match(/^javascript:/i)) { 292 var elEv = []; 293 if (href.match(/^mailto\:/i)) { 294 elEv.category = "email"; 295 elEv.action = "click"; 296 elEv.label = href.replace(/^mailto\:/i, ''); 297 elEv.loc = href; 298 } 299 else if (href.match(filetypes)) { 300 var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined; 301 elEv.category = "download"; 302 elEv.action = "click-" + extension[0]; 303 elEv.label = href.replace(/ /g, "-"); 304 elEv.loc = baseHref + href; 305 } 306 else if (href.match(/^https?\:/i) && !isThisDomain) { 307 elEv.category = "external"; 308 elEv.action = "click"; 309 elEv.label = href.replace(/^https?\:\/\//i, ''); 310 elEv.loc = href; 311 } 312 else if (href.match(/^tel\:/i)) { 313 elEv.category = "telephone"; 314 elEv.action = "click"; 315 elEv.label = href.replace(/^tel\:/i, ''); 316 elEv.loc = href; 317 } 318 else track = false;
319 320 if (track) { 321 ga('send', 'event', elEv.category.toLowerCase(), elEv.action.toLowerCase(), elEv.label.toLowerCase(), elEv.value); 322 if (el.attr('target') == undefined || el.attr('target').toLowerCase() != '_blank') { 323 setTimeout(function () { 324 location.href = elEv.loc; 325 }, 400); 326 return false; 327 } 328 } 329 } 330 }); 331 } 332 } 333 } 334 }(); 335 336 /** 337 * Gestion des labels des formulaire 338 */ 339 /*var floatLabels = function() { 340 return { 341 init: function() { 342 if ($('.tx-powermail').length > 0) { 343 $('input, textarea').filter(':not(.hidden)').each(function() { 344 var $field = $(this); 345 346 if ($field.attr('required')) { 347 $field.attr('placeholder', $field.attr('placeholder') + '*'); 348 } 349 350 $field.floatlabel({ 351 slideInput: false, 352 labelEndTop: '-16px', 353 paddingOffset: '0' 354 }); 355 }); 356 } 357 } 358 } 359 }();*/ 360 var toTopManager; 361 362 toTopManager = function () { 363 364 return { 365 init: function () { 366 /* TO TOP */ 367 $('.toTop').affix({ 368 offset: { 369 top: function () { 370 return (this.top = $('header').outerHeight(true) - $('.menuBar').outerHeight(true)) 371 } 372 } 373 }); 374 375 $('.toTop').click(function () { 376 $('body,html').animate({scrollTop: 0}, 500); 377 }); 378 } 379 } 380 381 }(); 382 383 // Galeries d'images Royal Slider 384 if ($('.royalSlider').length > 0) { 385 $('.royalSlider').TCTtiSlider(); 386 } 387 388 toTopManager.init(); 389 externalTracking.init(); 390 lightBoxManager.init(); 391 accordionManager.init(); 392 //floatLabels.init(); 393 $.jReject(); 394 395 //openlinkInNewTab.init(); 396 397 setTimeout(function () { 398 $.ElementAnchorScroll(); 399 }, 1000); 400 401 // Parsley error class overrides for Bootstrap 402 window.Parsley.on('field:error', function () { 403 this.$element.closest('.powermail_field').addClass('has-error'); 404 }); 405 window.Parsley.on('field:success', function () { 406 this.$element.closest('.powermail_field').removeClass('has-error'); 407 }); 408 409 /** 410 * Pour les listes de fichiers à télécharger (filelist de TYPO3) 411 */ 412 if($('.uploads').length>0) { 413 $('.uploads').DataTable({ 414 // Tri par date 415 order: [[1, "desc"]], 416 pagingType: "numbers", 417 bInfo: false, 418 stateSave: false, 419 sDom: '<"H"lfrp>t<"F"ip>', 420 421 language: { 422 processing: "Traitement en cours...", 423 search: "Rechercher :", 424 lengthMenu: "Afficher _MENU_ éléments", 425 info: "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments", 426 infoEmpty: "Affichage de l'élement 0 à 0 sur 0 éléments", 427 infoFiltered: "(filtré de _MAX_ éléments au total)", 428 infoPostFix: "", 429 loadingRecords: "Chargement en cours...", 430 zeroRecords: "Aucun élément à afficher", 431 emptyTable: "Aucune donnée disponible dans le tableau", 432 paginate: { 433 first: "Premier", 434 previous: "Précédent", 435 next: "Suivant", 436 last: "Dernier" 437 }, 438 aria: { 439 sortAscending: ": activer pour trier la colonne par ordre croissant", 440 sortDescending: ": activer pour trier la colonne par ordre décroissant" 441 } 442 } 443 }); 444 } 445 /** 446 * Validation-client des formulaires standards TYPO3 447 */ 448 $('.csc-mailform form').parsley(); 449 450 // affiche le panel après soumission sans ajax 451 if($('.powermail_message_error').length){ 452 $('.powermail_message_error').parents('.panel-collapse').removeClass('collapse'); 453 $('.powermail_message_error').parents('.content-image-more-content').css('display',"block"); 454 $(document).TCScroll({action: 'scrollTo', element: $('.powermail_message_error').first()}); 455 } 456 457 458 //a11y 459 // enter to open menu 460 $('li.has-sub').on('keypress',function(e) { 461 if(e.which == 13) { 462 $(this).find('a').first().focus(); 463 } 464 }) 465 // escape to go back to menubar 466 $('.sf-mega').on('keyup', '*',function(e) { 467 if(e.which == 27) { 468 var p=$(this).parents('.sf-mega').parent().focus(); 469 } 470 }) 471 $('#menu-toggle button').append('<span style="display:none">Accès au menu mobile</span>'); 472});
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.