1jQuery(document).ready(function ($) { 2 3 /* Gestion du placeholder pour ceux qui ne le gère pas :p */ 4 $('[placeholder]').focus(function () { 5 var input = $(this); 6 if (input.val() == input.attr('placeholder')) { 7 input.val(''); 8 input.removeClass('placeholder'); 9 } 10 }).blur(function () { 11 var input = $(this); 12 if (input.val() == '' || input.val() == input.attr('placeholder')) { 13 input.addClass('placeholder'); 14 input.val(input.attr('placeholder')); 15 } 16 }).blur(); 17 $('[placeholder]').parents('form').submit(function () { 18 $(this).find('[placeholder]').each(function () { 19 var input = $(this); 20 if (input.val() == input.attr('placeholder')) { 21 input.val(''); 22 } 23 }) 24 }); 25 26 27 28 29 30 31 /* slider Diaporama page d'accueil */ 32 33 if ($('.bloc-diaporama').length) { 34 $(".bloc-diaporama .list_items:not('.no_slide')").flexslider({ 35 animation: "slide", 36 selector: "ul > li", 37 directionNav: true, 38 //controlsContainer: $('.central '), 39 controlNav: false, 40 slideshowSpeed: 7000, 41 pauseOnHover: true, 42 start: function () { 43 $('.bloc-diaporama').addClass('started'); 44 } 45 }); 46 } 47 48 49 /* slider Diaporama page d'accueil */ 50 /* slide avec swiper plus intérésant lors du responsive*/ 51 var swiper = new Swiper('.swiper-container', { 52 53 slidesPerView: 3, 54 slidesPerColumn: 1, 55 paginationClickable: true, 56 spaceBetween: 30, 57 pagination: { 58 el: '.swiper-pagination', 59 clickable: true 60 }, 61 navigation: { 62 nextEl: '.swiper-button-next', 63 prevEl: '.swiper-button-prev' 64 }, 65 breakpoints: { 66 750: { 67 slidesPerView: 2 68 }, 69 400: { 70 slidesPerView: 1 71 } 72 }, 73 74 }); 75 76 77 var galleryTop = new Swiper('.gallery-top_slide', { 78 spaceBetween: 10, 79 slidesPerView: 1, 80 autoHeight: true, 81 pagination: { 82 el: '.swiper-pagination', 83 clickable: true 84 }, 85 autoplay: { 86 delay: 5000 87 }, 88 navigation: { 89 nextEl: '.swiper-button-next', 90 prevEl: '.swiper-button-prev' 91 }, 92 breakpoints: { 93 700: { 94 slidesPerView: 1 95 }, 96 450: { 97 slidesPerView: 1 98 } 99 } 100 }); 101 102 /* slider Diaporama page d'accueil */ 103 104 if ($('.bloc-diaporama_agenda').length) { 105 $(".bloc-diaporama_agenda .list_items:not('.no_slide')").flexslider({ 106 animation: "slide", 107 selector: "ul > li", 108 directionNav: false, 109 //controlsContainer: $('.central '), 110 controlNav: true, 111 slideshowSpeed: 7000, 112 pauseOnHover: true, 113 start: function () { 114 $('.bloc-diaporama_agenda').addClass('started'); 115 } 116 }); 117 } 118 119 120 /* ajout fancy sur images pages contenus */ 121 /* on filtre pour n'attribuer l'option fancy qu'aux images */ 122 123 /* ajout fancy sur images pages contenus */ 124 /* on filtre pour n'attribuer l'option fancy qu'aux images */ 125 126 $('#content a > img').parent('a').filter( 127 function () { 128 return !$(this).parents('.clone').length > 0; 129 } 130 ).attr('rel', 'grp'); 131 $('#content .gallery a > img').parent('a').attr('rel', 'grp_gal'); 132 $('body:not(.from-iframe) #content img').parent('a').filter( 133 function () { 134 return /(jpe?g|png|gif|bmp|webp)$/i.test(jQuery(this).attr('href')); 135 } 136 ).fancybox({ 137 'hideOnContentClick': true, 138 'transitionIn': 'elastic', 139 'transitionOut': 'elastic', 140 'titlePosition': 'inside', 141 'padding': 20 142 });
143 144 $('body:not(.from-iframe) a.img_youtube .video').parents('a.img_youtube').fancybox({ 145 'hideOnContentClick': true, 146 'transitionIn': 'elastic', 147 'transitionOut': 'elastic', 148 'titlePosition': 'inside', 149 'titleFormat': function (title, currentArray, currentIndex, currentOpts) { 150 var caption = $("a[rel=grp_gal]:eq(" + currentIndex + ")").parents('dl').find('.wp-caption-text').html(); 151 if (caption) { 152 return caption; 153 } else { 154 return title; 155 } 156 }, 157 'padding': 20, 158 'type': "iframe", 159 'width': 853, 160 'height': 480 161 }); 162 163 $('body:not(.from-iframe) .video a').parents('.video').fancybox({ 164 'hideOnContentClick': true, 165 'transitionIn': 'elastic', 166 'transitionOut': 'elastic', 167 'titlePosition': 'inside', 168 'titleFormat': function (title, currentArray, currentIndex, currentOpts) { 169 var caption = $("a[rel=grp_gal]:eq(" + currentIndex + ")").parents('dl').find('.wp-caption-text').html(); 170 if (caption) { 171 return caption; 172 } else { 173 return title; 174 } 175 }, 176 'padding': 20, 177 'type': "iframe", 178 'width': 853, 179 'height': 480 180 }); 181 182 183 184 /* Désactivation des liens 'noclick' */ 185 $('.noclick > a').on('click', function (e) { 186 e.preventDefault(); 187 }); 188 189 // Menu principal -------------------------------------------------------------- 190 // 191 // On gère le menu principal comme si on était dans tous les cas sur une tablette... 192 // on ouvre le menu au click/touch... 193 var $liens_menu = $("#access .menu > li"); 194 var classopened = "opened"; 195 $liens_menu.on('click', ' > a', function (e) { 196 if ($(this).parent().find('ul').length > 0) { 197 e.preventDefault(); 198 e.stopPropagation(); 199 var opened = $(this).parent().hasClass(classopened); 200 $liens_menu.removeClass(classopened); 201 if (!opened) { 202 $(this).parent().addClass(classopened); 203 } 204 } else { 205 $liens_menu.removeClass(classopened); 206 } 207 }); 208 $('body').on('click', function () { 209 $liens_menu.removeClass(classopened); 210 }); 211 212 /* Accessibilité : focus sur le champs de recherche */ 213 /* quand on clique sur un lien d'évitement qui doit diriger dessus... */ 214 $("a[href='#s']").on('click', function (event) { 215 event.preventDefault(); 216 $('#s').focus(); 217 }); 218 219 /* Accessibilité du Menu Principal */ 220 /* Version simplifiée - Xavier NUEL 11.02.2013 */ 221 var $menu = $('#access .menu'); 222 var $menu_cont = $('#access'); 223 var $menu_item = $menu.find('li'); 224 var classhover = "menuhover"; 225 226 /* si on perd le focus sur un élément... on vire toutes les class 'menuhover' */ 227 $menu_item.on('blur.accessibility', 'a', function () { 228 $menu_item.removeClass(classhover); 229 }); 230 /* si on prend le focus... on ajoute les class 'menuhover' sur tous les LI parents*/ 231 $menu_item.on('focus.accessibility', 'a', function () { 232 $(this).parents('li').addClass(classhover); 233 }); 234 /* supression au controle souris */ 235 $menu.find("li a").on('mouseenter mouseleave', function () { 236 /* $(this).focus(); */ /* a voir pour donner le focus à l'element survolé */ 237 $menu.find("." + classhover).removeClass(classhover); 238 }); 239 240 241 /* ouverture / fermeture du menu sur écrans réduits */ 242 $(".responsive-menu > a").on("click", function () { 243 $("body").toggleClass("open-menu"); 244 }); 245 246 // Customisation des select 247 $('select').not('.no-select2').select2(); 248 249 250 // Ajout d'ouverture en Fancy des Flipbooks 251 $('.fancy-iframe').fancybox({ 252 type: 'iframe', 253 width: '80%', 254 height: '100%', 255 hideOnOverlayClick: true 256 }); 257 258
259 /* Ajout ico Loupe sur les vignettes ... */ 260 //$('a.thumbnail').append('<div class="ico_loupe"> </div>'); 261 262 /* Ajout de scroll vers les ancres internes pour rendre la navigation plus agréable */ 263 /* $('a[href^="#"]').not('a[href="#"]').on('click.smoothscroll',function (e) { 264 e.preventDefault(); 265 var target = this.hash, 266 $target = $(target); 267 var remainingHeightUnderTarget = ($("body").height()) - ($target.offset().top); 268 var scrollPosition = $("body").height() - $(window).height(); 269 if ( remainingHeightUnderTarget < ($(window).height()) ) { 270 $('html, body').stop().animate({ 'scrollTop': scrollPosition }, 700, 'swing', function () { scrollPosition = target; }); 271 } else { 272 var dest = $target.offset().top; 273 $('html, body').stop().animate({ 'scrollTop': dest }, 700, 'swing', function () { 274 window.location.hash = target; 275 }); 276 } 277 });*/ 278 279 280 281 // Rend responsiv les vidéos en iframe... 282 $("#content").fitVids(); 283 284 /* Gestion des trackevents google analytics */ 285 286 $('[data-push-event]').on('click', function (e) { 287 var dataPush = $(this).attr('data-push-event').split(','); 288 var dataEvent = dataPush[0].trim(); 289 var dataLabel = dataPush[1].trim(); 290 _gaq.push(['_trackEvent', dataEvent, dataLabel]); 291 }); 292 293 /** ajout oki menu icone */ 294 $(".croix_menu").on('click', function () { 295 $(this).toggleClass('oki'); 296 $(".menu_picto").toggleClass('oki'); 297 }); 298 299 300 /** ajout oki plus ou moin faq service*/ 301 $(".ligne_service").on('click', function () { 302 if (($(this).hasClass('accordeon'))) { 303 } else { 304 $(".ligne_service").removeClass('accordeon'); 305 } 306 $(this).toggleClass('accordeon'); 307 308 }); 309 310 $(".slide_menu").on('click', function () { 311 $(".slide_menu").removeClass('active'); 312 $(this).addClass('active'); 313 }); 314 315 316 317 318 319 320});
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.