1(function($, window){ 2 /** 3 * Déactivation des logs Jquery Migrate 4 */ 5 jQuery.migrateMute = true; 6 7 8 /* news ticker START */ 9 //Gére la ligne de message flash de la barre d'accueil 10 $(document).on("ready", function(){ 11 $("ul.news-ticker").liScroll({travelocity: 0.1}); 12 }); 13 14 /* news ticker END */ 15 16 /* audio player START */ 17 18 /* Circle progress bar 19 ************************************************************/ 20 function easyCharts() { 21 22 $('.easyPieChart').each(function () { 23 var $this, $parent_width, $chart_size; 24 $this = $(this); 25 $parent_width = $(this).parent().width(); 26 $chart_size = $this.attr('data-barSize'); 27 if (!$this.hasClass('chart-animated')) { 28 $this.easyPieChart({ 29 animate: 3000, 30 lineCap: 'round', 31 lineWidth: $this.attr('data-lineWidth'), 32 size: $chart_size, 33 barColor: $this.attr('data-barColor'), 34 trackColor: $this.attr('data-trackColor'), 35 scaleColor: 'transparent', 36 onStep: function (value) { 37 this.$el.find('.chart-percent span').text(Math.ceil(value)); 38 } 39 }); 40 } 41 }); 42 43 } 44 easyCharts(); 45 46 /** 47 * Le theme de méganews génére des paragraphes vides 48 * Ce code sert à les supprimers dynamiquement 49 * 'thx meganews' 50 */ 51 $('body').each(function() { 52 var allhtml = $(this).html(); 53 var htmlnospaces = allhtml.replace(/\s/g, ""); 54 if ((htmlnospaces === '') || (htmlnospaces == '<p></p>')|| (htmlnospaces == '<P></P>')|| (htmlnospaces == '</P>')) { 55 $(this).remove(); 56 } 57 }); 58 59 60 // $('.flexsliderPostSection').flexslider({ 61 // animation: "slide", 62 // useCSS: false, 63 // slideshow: true, 64 // pauseOnHover: true, 65 // slideshowSpeed: 3500 66 // }); 67 68 /** 69 * Javascript implementation of Javaâs String.hashCode() method 70 * @return {string} Renvoi le hash du string 71 */ 72 String.prototype.hashCode = function() { 73 var hash = 0, i, chr, len; 74 if (this.length === 0) return hash; 75 for (i = 0, len = this.length; i < len; i++) { 76 chr = this.charCodeAt(i); 77 hash = ((hash << 5) - hash) + chr; 78 hash |= 0; // Convert to 32bit integer 79 } 80 return hash; 81 }; 82 83 if ($('body .wpb_thumbnails').length !== 0 ) { 84 $('body .wpb_thumbnails').resizeVignette({ 85 vignette: "isotope-item" 86 }); 87 } 88 89 90 if ($('.vc_span8.type1').length !== 0 ) { 91 $('.vc_span8.type1').resizeVignette({ 92 vignette: "post-grid-thumb-type3-wrapper" 93 }); 94 } 95 96 /** 97 * Resize les vignette des page de recherche 98 */ 99 if ($('.search-grid').length !== 0 ) { 100 $('.search-grid').resizeVignette({ 101 vignette: "post-details" 102 }); 103 } 104 105 /** 106 * Resize les vignette des pages catégorie 107 */ 108 if ($('.post-content-bg').length !== 0 ) { 109 $('.post-content-bg').resizeVignette({ 110 vignette: "post-details-type3" 111 }); 112 } 113 114 /** 115 * Resize les vignette des pages catégorie 116 */ 117 // if ($('body .vc_pageable-slide-wrapper').length !== 0) { 118 $('body .vc_pageable-slide-wrapper').resizeVignette({ 119 vignette: "vc_grid-item" 120 }); 121 // } 122 $image_a_la_une = $('#image_a_la_une'); 123 $(window).on('resize', function(){ 124 var small_src, large_src; 125 if ($(this).width() < 770) { 126 if ($image_a_la_une.hasClass('large') ) { 127 small_src = $image_a_la_une.data('src_resize'); 128 large_src = $image_a_la_une.attr('src'); 129 $image_a_la_une.data('src_resize', large_src); 130 $image_a_la_une.attr('src', small_src); 131 $image_a_la_une.removeClass('large').addClass('small'); 132 } 133 } 134 else{ 135 if ($image_a_la_une.hasClass('small') ) { 136 large_src = $image_a_la_une.data('src_resize'); 137 small_src = $image_a_la_une.attr('src'); 138 $image_a_la_une.data('src_resize', small_src); 139 $image_a_la_une.attr('src', large_src); 140 $image_a_la_une.removeClass('small').addClass('large'); 141 142 } 143 } 144 145 }); 146 147 $('.imprimer').on('click',function(){ 148 window.print(); 149 }); 150 151 152 153 154 155 156 157 158 /** 159 * Permet d'afficher une pop up sur le coté avec bouton de déroulement 160 * (voir base.css pour le javascript) 161 */ 162 // var feedback_open = false;
163 // // var bottom = $('.wpcf7').height() + parseInt($('.wpcf7').css('padding-top')) + 13; 164 // $('#feedback_btn').on('click', function(event){ 165 // event.preventDefault(); 166 // if (feedback_open === false) { 167 // $('#feedback_btn').addClass('active'); 168 // feedback_open = true; 169 // $('#feedback').css('right', '0'); 170 // $('#feedback .wpcf7').css('opacity', 1); 171 // } 172 // else{ 173 // $('#feedback_btn').removeClass('active'); 174 // feedback_open = false; 175 // $('#feedback').css('right', '-300px'); 176 177 178 179 // } 180 // }); 181 182 /** 183 * Permet de tester et changer l'image de background utilisé pour le header 184 */ 185 function setNightOrDayToHeader(){ 186 var date = new Date(), 187 add = 'day', 188 remove = 'night'; 189 190 if (date.getHours() >= 20 || date.getHours() <= 8) { 191 add = 'night'; 192 remove = 'day'; 193 } 194 195 $('.header-wrapper').each(function(index, el) { 196 if (!$(el).hasClass( add )) { 197 $(el).removeClass( remove ).addClass( add ); 198 } 199 }); 200 201 } 202 setNightOrDayToHeader(); 203 204 205 /** 206 * Permet d'initialisé le lazyload pour les grids owl 207 */ 208 $('.vc_grid-container').on("initialize.owl.navigation", function(){ 209 $('.owl-carousel .sije_vc_lazyload').lazyload({ 210 effect: 'fadeIn', 211 threshold: 200, 212 load: function(){ 213 $(this).removeClass('sije_vc_lazyload'); 214 setTimeout(function(){ 215 $('.owl-loaded').trigger('refresh.owl.vccarousel'); 216 }, 400); 217 } 218 }); 219 }); 220 221 /** 222 * Emule un scroll lors d'un changement de page des grids owl 223 */ 224 $('.vc_grid-container').on("translated.owl.vccarousel", function(event){ 225 $(window).scroll(); 226 }); 227 228 /** 229 * Detecte si le navigateur utiliser est IE 8 230 */ 231 function IsIE8Browser() { 232 var rv = -1; 233 var ua = navigator.userAgent; 234 var re = new RegExp("Trident\/([0-9]{1,}[\.0-9]{0,})"); 235 if (re.exec(ua) != null) { 236 rv = parseFloat(RegExp.$1); 237 } 238 return (rv == 4); 239 } 240 241 242 /** 243 * Permet de gére le lazyloading sur les images de post grid hors OWL 244 */ 245 if (IsIE8Browser()) { 246 setTimeout(function(){ 247 $('.vc_grid-container .sije_vc_lazyload').each(function(index, el){ 248 var src = $(el).data('original'); 249 $(el).attr('src', src).fadeIn(400); 250 }); 251 }, 3000); 252 } 253 else{ 254 var int_val = []; 255 $('.vc_grid-container').each(function(i, e) { 256 int_val[i] = setInterval(function(index, element){ 257 if ($('.vc_grid-container .vc_grid-item').size() !== 0) { 258 $element = $(element); 259 if (!$element.find('.owl-carousel').size()) { 260 setTimeout(function(){ 261 $('.vc_grid-container:eq('+ index +') .sije_vc_lazyload').lazyload({ 262 effect: 'fadeIn', 263 threshold: 200, 264 load: function(){ 265 // $(this).removeClass('sije_vc_lazyload'); 266 /* 267 Parfois ce lazy load s'attache au owl 268 */ 269 setTimeout(function(){ 270 $('.owl-loaded').trigger('refresh.owl.vccarousel'); 271 }, 400); 272 } 273 }); 274 $(window).scroll(); 275 }, 400); 276 } 277 clearInterval(int_val[index]); 278 } 279 }, 400, i, e); 280 }); 281 } 282 283 284// !$element.children('div').hasClass('owl-carousel') 285// 286 $(window).on("resize",function() { 287 288 $( '#tribe-events' ).find( '.tribe-events-calendar th' ).each( function() { 289 var $this = $( this ), 290 day_abbr = $this.attr( 'data-day-abbr' ), 291 day_full = $this.attr( 'title' ); 292 293 if($(window).width() < 769){ 294 $this.text( day_abbr ); 295 } 296 else{ 297 $this.text( day_full ); 298 } 299 }); 300 301 }); 302 303 304}(jQuery, window));
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.