1/* #PRODUIRE{fond=javascripts.js} 2 md5:0a2ef70df3543de307b46371298ff0d1 */ 3 4// Menu accessible dynamique et CSS alternatives, V 2.0 (avec jquery) 5// 6// Copyright (c) 2004 Jacques PYRAT 7// https://www.pyrat.net/ 8// 9// Licensed under the LGPL license 10// http://www.gnu.org/copyleft/lesser.html 11// 12// ********************************************************************** 13// This program is distributed in the hope that it will be useful, but 14// WITHOUT ANY WARRANTY; without even the implied warranty of 15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16// ********************************************************************** 17// 18// Presets 19 20// Encapsulation pour permettre l'utilisation de jQl, cf http://permalink.gmane.org/gmane.comp.web.spip.zone/38793 21// Même si ça marche, le résultat du test jQL était un doublement du temps de chargement 22// jQuery(function(){ 23 24var jp_blankpic='plugins/auto/soyezcreateurs/v6.5.7/images/1.png'; 25var jp_onclass='menu_plus'; 26var jp_offclass='menu_minus'; 27var jp_picalt='Cliquer pour '; 28var jp_strDeplier='d\351plier : '; 29var jp_strReplier='replier : '; 30 31function jp_expinit(){ 32 // Checking for DOM compatibility 33 var jp_parentID = [ 'menu', 'sidr-main', 'sidr-navigation']; 34 if(jp_parentID){ 35 var jp_alluls = []; 36 jp_parentID.forEach(function(item, index, array) { 37 if(document.getElementById(item)){ 38 jp_alluls = Array.prototype.concat.apply(jp_alluls, document.getElementById(item).getElementsByTagName('UL')); 39 } 40 }); 41 for(i=0;i<jp_alluls.length;i++){ 42 jp_subul=jp_alluls[i]; 43 if(jp_subul.parentNode.tagName=='LI'){ 44 jp_supli=jp_subul.parentNode 45 jp_islink=jp_supli.getElementsByTagName('a')[0]; 46 if(jp_islink){ 47 jp_addimg = document.createElement('img'); 48 jp_addimg.src=jp_blankpic; 49 jp_addimg.className='node'; 50 jp_addimg.alt=''; 51 jp_addimg.onclick=function() {jp_ex(this,null);return false;}; 52 jp_supli.getElementsByTagName('A')[0].onkeypress=inputKeyHandler; 53 jp_supli.getElementsByTagName('A')[0].onfocus=function() {jp_ex(this,0);}; 54 jp_supli.insertBefore(jp_addimg,jp_supli.firstChild); 55 } 56 // Do not collapse when there is a strong element in the list. 57 jp_highlight=jp_subul.parentNode.getElementsByTagName('strong').length==0?true:false; 58 jp_disp=jp_highlight?'none':'block'; 59 var jp_picaltonoff=jp_highlight?jp_picalt+jp_strDeplier:jp_picalt+jp_strReplier; 60 jp_pic_class=jp_highlight?jp_onclass:jp_offclass; 61 // End highlight change 62 jp_childs=jp_subul.getElementsByTagName('li').length 63 jp_momimg=jp_subul.parentNode.getElementsByTagName('img')[0] 64 if(jp_momimg){ 65 jp_momimg.setAttribute('title',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('a')[0].text); 66 jp_momimg.setAttribute('alt',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('a')[0].text); 67 jp_momimg.className=jp_pic_class; 68 jp_subul.style.display=jp_disp; 69 } 70 } 71 } 72 } 73} 74 75// Collapse and Expand node. 76function jp_ex(jp_n,jp_event){ 77 jp_u=jp_n.parentNode.getElementsByTagName("ul")[0]; 78 if (!jp_u) jp_u=jp_n.parentNode.parentNode.getElementsByTagName("ul")[0];; 79 if(jp_u){ 80 if (((jp_u.style.display=='none'||jp_u.style.display=='')&&(jp_event==0||jp_event==43||jp_event==null))||((jp_u.style.display=='block')&&(jp_event==45||jp_event==null))) { 81 jp_u.style.display=jp_u.style.display=='none'||jp_u.style.display==''?'block':'none'; 82 jp_img=jp_u.parentNode.getElementsByTagName('img')[0]; 83 jp_img.className=jp_img.className.indexOf(jp_offclass)!=-1?jp_onclass:jp_offclass; 84 var jp_strAlt=jp_img.getAttribute('title'); 85 if (jp_strAlt==null) { jp_strAlt=''; } 86 if (jp_img.className.indexOf(jp_offclass)!=-1) { 87 var jp_re = new RegExp (jp_strDeplier, 'gi'); 88 var jp_strAltNew = jp_strAlt.replace(jp_re,jp_strReplier); 89 }else{ 90 var jp_re = new RegExp (jp_strReplier, 'gi'); 91 var jp_strAltNew = jp_strAlt.replace(jp_re,jp_strDeplier); 92 } 93 jp_img.setAttribute('title',jp_strAltNew); 94 jp_img.setAttribute('alt',jp_strAltNew); 95 adjustLayout(); 96 return true; 97 } else { 98 return false; 99 } 100 } 101} 102function inputKeyHandler(ev) { 103 ev = ev || event; 104 if (jp_ex(ev.target || ev.srcElement,ev.keyCode || ev.which)) { 105 ev.cancelBubble= true; 106 if (ev.stopPropagation) ev.stopPropagation(); 107 } 108} 109 110function form_disable_auto(formid) { 111 if (jQuery(formid).length > 0) { 112 jQuery(formid).attr('spellcheck','false'); 113 jQuery(formid).attr('autocapitalize','off'); 114 } 115} 116
117/* FUNCTIONS ON ALL PAGES */ 118function myInitPages() { 119 /* HOME SPECIAL FEATURE */ 120 if (jQuery('#homeSpecialFeature').length > 0) { 121 if (jQuery('.hSFItem').length>1) { initMyHomeSpecialFeature = myHomeSpecialFeature("#homeSpecialFeature",'hSFItem','hSFDecoImg','hSFDecoSpan'); } 122 } 123 if (jQuery('.sf-menu').length > 0) { 124 $(document).ready(function(){ 125 $(".sf-menu").superfish({ 126 hoverClass: 'hover', 127 delay: 800 128 }).supposition(); 129 130 }); 131 } 132 if (jQuery('#arretSurImg .mainCarousels').length > 0) { homeCarousel('.mainCarousels'); } 133 if (jQuery('#arretSurImg2 .mainCarousels2').length > 0) { homeCarousel2('.mainCarousels2'); } 134 jp_expinit(); 135 // Surligner l'evenement en cours 136 var id_anchor = location.hash.substr(1); //Get the word after the hash from the url 137 if (id_anchor) jQuery('#'+id_anchor).addClass('highlight_anchor'); // ajoute la classe highlight_anchor à l'element autour de l'ancre 138 139 // retourtop 140 jQuery(window).scroll(function () { 141 if (jQuery(this).scrollTop() > 300) { 142 jQuery('.retourtop').fadeIn(); 143 } else { 144 jQuery('.retourtop').fadeOut(); 145 } 146 }); 147 148 149 150 form_disable_auto('#formulaire_recherche'); 151 form_disable_auto('#session_nom'); 152 form_disable_auto('#session_email'); 153 form_disable_auto('#url_site'); 154} 155; 156/* BLACK TRANSPARENT BACKGROUNDS */ 157function mySpecialBackgrounds(elt,correcAmount,correcAmount2) { 158 jQuery(elt).each(function() { 159 var targetHeight = jQuery(this).parent().height(); 160 var targetWidth = jQuery(this).parent().width(); 161 jQuery(this).css({'height':targetHeight+correcAmount,'width':targetWidth+correcAmount2,'opacity':.5}); 162 }); 163} 164; 165/* HOME SPECIAL FEATURE */ 166function myHomeSpecialFeature(container,item,decoImg,decoSpan) { 167 jQuery('#'+item+'1').addClass('active'+item); 168 mySpecialBackgrounds('.'+item+' .'+decoSpan,14,10); 169 jQuery('#'+item+'1 .'+decoSpan).css("opacity", 1); 170 jQuery('.'+item+' .'+decoImg).hide(); 171 jQuery('#'+item+'1 .'+decoImg).show(); 172 173 var x = 1; 174 var maxX = jQuery('.'+item).length; 175 function myAnimate(x,maxX) { 176 if (x > maxX) { x = 1; } 177 jQuery('.'+item).removeClass('active'+item); 178 jQuery('#'+item+x).addClass('active'+item); 179 jQuery('.'+item+' .'+decoSpan).animate({"opacity": .5}, { queue:false, duration:800 }); 180 jQuery('#'+item+x+' .'+decoSpan).animate({"opacity": 1},800); 181 jQuery('.'+item+' .'+decoImg).fadeOut(800); 182 jQuery('#'+item+x+' .'+decoImg).fadeIn(800); 183 timer = setTimeout(function() { 184 if (x < maxX) { x = x+1; myAnimate(x,maxX); } 185 else if (x = maxX) { x = 1; myAnimate(x,maxX); } 186 } , 10000); 187 } 188 myAnimate(x,maxX); 189 190 jQuery('.'+item).each(function() { 191 jQuery(this).hoverIntent( 192 function() { 193 clearTimeout(timer); 194 currentItem = jQuery('.'+item).index(this)+1; 195 jQuery('.'+item).removeClass('active'+item); 196 jQuery(this).addClass('active'+item); 197 jQuery('.'+item+' .'+decoSpan+':not("#'+item+currentItem+' .'+decoSpan+'")').css("opacity", .5); 198 jQuery(this).children().children('.'+decoSpan).animate({"opacity": 1},400); 199 jQuery('.'+item+' .'+decoImg+':not("#'+item+currentItem+' .'+decoImg+'")').fadeOut(400); 200 jQuery(this).children('.'+decoImg).fadeIn(400); 201 }, 202 function() { 203 clearTimeout(timer); 204 currentItem = jQuery('.'+item).index(this)+2; 205 jQuery(this).removeClass('active'+item); 206 jQuery(this).children().children('.'+decoSpan).animate({"opacity": .5},400); 207 timer = setTimeout(function() { myAnimate(currentItem,maxX); } , 1000 ); 208 } 209 ); 210 }); 211} 212; 213 214/* HOME CYCLE */ 215function homeCarousel(elt) { 216 /* carousels internes */ 217 var elemNbr = jQuery(elt+' > li').length; 218 var myCounter = 1; 219 function onAfter(curr,next,opts) { 220 if (opts.currSlide+1 == opts.slideCount) { 221 if (myCounter < elemNbr) { 222 myCounter = myCounter+1; 223 } else if (myCounter == elemNbr) { 224 myCounter = 1; 225 } 226 227 function reloadCarousels() { 228 jQuery('.smallCarousel').stop(true,true).fadeOut(750); 229 jQuery('#sc'+myCounter+'b').stop(true,true).fadeIn(750).children('ul').cycle({ 230 //fx: 'scrollHorz', // pour transition latérale 231 fx: 'fade', 232 speed: 1500, 233 timeout: 4000, 234 pause: true, 235 startingSlide: 0, 236 after: onAfter 237 }); 238 jQuery('.mainCarousel').removeClass('active'); 239 if (myCounter == 1) { 240 jQuery('.mainCarousel:first').addClass('active'); 241 } else { 242 jQuery('.mainCarousel').eq(myCounter-1).addClass('active'); 243 } 244 } 245 jQuery('.smallCarousel').children('ul').cycle('stop');
246 var t2=setTimeout(reloadCarousels,3000); 247 } else { 248 clearTimeout(t2); 249 } 250 //alert(myCounter); 251 } 252 function onAfter2(curr,next,opts) { 253 // 254 } 255 jQuery('.smallCarousel ul').cycle({ 256 //fx: 'scrollHorz', // pour transition latérale 257 fx: 'fade', 258 speed: 1500, 259 timeout: 4000, 260 pause: true, 261 startingSlide: 0, 262 after: onAfter 263 }); 264 jQuery('.smallCarousel').hide().children('ul').cycle('pause'); 265 jQuery('#sc1b').show().children('ul').cycle('resume'); 266 /* faux carousel principal */ 267 var whatToShow = ''; 268 jQuery('.mainCarousel:first').addClass('active'); 269 jQuery(document).delegate('.mainCarousel','mouseenter focus', function() { 270 jQuery('.mainCarousel').removeClass('hover active'); 271 jQuery(this).addClass('hover active'); 272 whatToShow = jQuery(this).children().children('a').attr('id'); 273 jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle('stop'); 274 // jQuery(whatToShow).stop(true,true).fadeIn().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter2}).cycle('resume'); // avec transition latérale 275 jQuery('#'+whatToShow+'b').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter2}); 276 }).delegate('.mainCarousel','mouseleave blur', function() { 277 whatToShow = jQuery(this).children().children('a').attr('id'); 278 jQuery(this).removeClass('hover'); 279 // jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter}).cycle('pause'); // avec transition latérale 280 jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle('stop'); 281 jQuery('#'+whatToShow+'b').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter}); 282 myCounter = jQuery(this).index()+1; 283 }); 284} 285 286/* HOME CYCLE */ 287function homeCarousel2(elt) { 288 /* carousels internes */ 289 var elemNbr = jQuery(elt+' > li').length; 290 var myCounter = 1; 291 function onAfter(curr,next,opts) { 292 if (opts.currSlide+1 == opts.slideCount) { 293 if (myCounter < elemNbr) { 294 myCounter = myCounter+1; 295 } else if (myCounter == elemNbr) { 296 myCounter = 1; 297 } 298 299 function reloadCarousels() { 300 jQuery('.smallCarousel2').stop(true,true).fadeOut(750); 301 jQuery('#sc'+myCounter+'b2').stop(true,true).fadeIn(750).children('ul').cycle({ 302 //fx: 'scrollHorz', // pour transition latérale 303 fx: 'fade', 304 speed: 1500, 305 timeout: 4000, 306 pause: true, 307 startingSlide: 0, 308 after: onAfter 309 }); 310 jQuery('.mainCarousel2').removeClass('active'); 311 if (myCounter == 1) { 312 jQuery('.mainCarousel2:first').addClass('active'); 313 } else { 314 jQuery('.mainCarousel2').eq(myCounter-1).addClass('active'); 315 } 316 } 317 jQuery('.smallCarousel2').children('ul').cycle('stop'); 318 var t2=setTimeout(reloadCarousels,3000); 319 } else { 320 clearTimeout(t2); 321 } 322 //alert(myCounter); 323 } 324 function onAfter2(curr,next,opts) { 325 // 326 } 327 jQuery('.smallCarousel2 ul').cycle({ 328 //fx: 'scrollHorz', // pour transition latérale 329 fx: 'fade', 330 speed: 1500, 331 timeout: 4000, 332 pause: true, 333 startingSlide: 0, 334 after: onAfter 335 }); 336 jQuery('.smallCarousel2').hide().children('ul').cycle('pause'); 337 jQuery('#sc1b2').show().children('ul').cycle('resume'); 338 /* faux carousel principal */ 339 var whatToShow = ''; 340 jQuery('.mainCarousel2:first').addClass('active'); 341 jQuery(document).delegate('.mainCarousel2','mouseenter focus', function() { 342 jQuery('.mainCarousel2').removeClass('hover active'); 343 jQuery(this).addClass('hover active'); 344 whatToShow = jQuery(this).children().children('a').attr('id'); 345 jQuery('.smallCarousel2').stop(true,true).fadeOut().children('ul').cycle('stop'); 346 // jQuery(whatToShow).stop(true,true).fadeIn().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter2}).cycle('resume'); // avec transition latérale 347 jQuery('#'+whatToShow+'b2').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter2}); 348 }).delegate('.mainCarousel2','mouseleave blur', function() { 349 whatToShow = jQuery(this).children().children('a').attr('id'); 350 jQuery(this).removeClass('hover'); 351 // jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle({fx: 'scrollHorz',speed: 1500,timeout: 4000,pause: true,after: onAfter}).cycle('pause'); // avec transition latérale 352 jQuery('.smallCarousel2').stop(true,true).fadeOut().children('ul').cycle('stop'); 353 jQuery('#'+whatToShow+'b2').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter}); 354 myCounter = jQuery(this).index()+1; 355 }); 356} 357 358jQuery(window).ready(function() { 359 // Ceci devrait régler le problème de l'ajustement des colonne pas toujours fait 360 jQuery(document).ready(function() { 361 myInitPages(); 362 }); 363 364}); 365 366 367 368// Fin Encapsulation pour permettre l'utilisation de jQl, cf http://permalink.gmane.org/gmane.comp.web.spip.zone/38793 369//}); 370 371
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.