You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

479 lines
19 KiB

#CACHE{24*3600,cache-client}
#HTTP_HEADER{Content-Type: text/javascript; charset=iso-8859-1}
// Menu accessible dynamique et CSS alternatives, V 2.0 (avec jquery)
//
// Copyright (c) 2004 Jacques PYRAT
// https://www.pyrat.net/
//
// Licensed under the LGPL license
// http://www.gnu.org/copyleft/lesser.html
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
//
// Presets
// Encapsulation pour permettre l'utilisation de jQl, cf http://permalink.gmane.org/gmane.comp.web.spip.zone/38793
// Même si ça marche, le résultat du test jQL était un doublement du temps de chargement
// jQuery(function(){
var jp_blankpic='#CHEMIN{images/1.gif}';
var jp_onclass='menu_plus';
var jp_offclass='menu_minus';
var jp_picalt='<:soyezcreateurs:menu_picalt:>';
var jp_strDeplier='<:soyezcreateurs:menu_deplier:>';
var jp_strReplier='<:soyezcreateurs:menu_replier:>';
var jp_parentID='menu';
// Checking for DOM compatibility
if (document.getElementById && document.createTextNode && document.createElement){jp_canDOM=true}
function jp_expinit(){
if (jp_canDOM){
if(jp_parentID && document.getElementById(jp_parentID)){
jp_alluls=document.getElementById(jp_parentID).getElementsByTagName('UL');
jp_alllis=document.getElementById(jp_parentID).getElementsByTagName('LI');
for(i=0;i<jp_alluls.length;i++){
jp_subul=jp_alluls[i];
if(jp_subul.parentNode.tagName=='LI'){
jp_supli=jp_subul.parentNode
jp_islink=jp_supli.getElementsByTagName('a')[0];
if(jp_islink){
jp_addimg = document.createElement('img');
jp_addimg.src=jp_blankpic;
jp_addimg.className='node';
jp_addimg.alt='';
jp_addimg.onclick=function() {jp_ex(this,null);return false;};
jp_supli.getElementsByTagName('A')[0].onkeypress=inputKeyHandler;
jp_supli.getElementsByTagName('A')[0].onfocus=function() {jp_ex(this,0);};
jp_supli.insertBefore(jp_addimg,jp_supli.firstChild);
}
// Do not collapse when there is a strong element in the list.
jp_highlight=jp_subul.parentNode.getElementsByTagName('strong').length==0?true:false;
jp_disp=jp_highlight?'none':'block';
var jp_picaltonoff=jp_highlight?jp_picalt+jp_strDeplier:jp_picalt+jp_strReplier;
jp_pic_class=jp_highlight?jp_onclass:jp_offclass;
// End highlight change
jp_childs=jp_subul.getElementsByTagName('li').length
jp_momimg=jp_subul.parentNode.getElementsByTagName('img')[0]
if(jp_momimg){
jp_momimg.setAttribute('title',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('a')[0].text);
jp_momimg.setAttribute('alt',jp_picaltonoff+jp_subul.parentNode.getElementsByTagName('a')[0].text);
jp_momimg.className=jp_pic_class;
jp_subul.style.display=jp_disp;
}
}
}
}
}
}
// Collapse and Expand node.
function jp_ex(jp_n,jp_event){
if(jp_canDOM){
jp_u=jp_n.parentNode.getElementsByTagName("ul")[0];
if (!jp_u) jp_u=jp_n.parentNode.parentNode.getElementsByTagName("ul")[0];;
if(jp_u){
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))) {
jp_u.style.display=jp_u.style.display=='none'||jp_u.style.display==''?'block':'none';
jp_img=jp_u.parentNode.getElementsByTagName('img')[0];
jp_img.className=jp_img.className.indexOf(jp_offclass)!=-1?jp_onclass:jp_offclass;
var jp_strAlt=jp_img.getAttribute('title');
if (jp_strAlt==null) { jp_strAlt=''; }
if (jp_img.className.indexOf(jp_offclass)!=-1) {
var jp_re = new RegExp (jp_strDeplier, 'gi');
var jp_strAltNew = jp_strAlt.replace(jp_re,jp_strReplier);
}else{
var jp_re = new RegExp (jp_strReplier, 'gi');
var jp_strAltNew = jp_strAlt.replace(jp_re,jp_strDeplier);
}
jp_img.setAttribute('title',jp_strAltNew);
jp_img.setAttribute('alt',jp_strAltNew);
adjustLayout();
return true;
} else {
return false;
}
}
}
}
function inputKeyHandler(ev) {
ev = ev || event;
if (jp_ex(ev.target || ev.srcElement,ev.keyCode || ev.which)) {
ev.cancelBubble= true;
if (ev.stopPropagation) ev.stopPropagation();
}
}
function adjustLayout() {
/* Remettre la taille à auto pour trouver l'eventuelle nouvelle hauteur !*/
jQuery("div.equilibre").css({'height': 'auto'});
/*******************************************CAS N°1********************************************************************/
/*Nav, Contenu et Extra alignes top (Layout 1 a 22)*/
var tnotstackable =0;
tnotstackable = parseInt(jQuery("div.notstackable")[0].offsetTop);
tlaststackable = parseInt(jQuery("div.laststackable")[0].offsetTop);
if (tnotstackable==tlaststackable) {
var h=0;
jQuery("div.equilibre").each(function(){ h=Math.max(h,this.offsetHeight); }).css({'min-height': h+'px'});
jQuery("div.equilibre").css({'height': parseInt(jQuery("div.equilibre")[0].offsetHeight)});
/*alert("Cas 1");*/
}
else {
/*********************************************CAS 2*********************************************************************/
/* Navigation et Extra sont empiles (Layout 23 a 26 et 33 et 34)*/
leftlaststackable = parseInt(jQuery("div.laststackable")[0].offsetLeft);
leftnavigation = parseInt(jQuery("div#navigation")[0].offsetLeft);
largeurnavigation = parseInt(jQuery("div#navigation")[0].offsetWidth);
largeurextra = parseInt(jQuery("div.laststackable")[0].offsetWidth);
if ((leftlaststackable == leftnavigation) && (largeurextra == largeurnavigation)) {
var hstacked = 0;
jQuery("div.stackable").each(function(){ hstacked+=parseInt(this.offsetHeight); });
var hnotstackable = 0;
hnotstackable = parseInt(jQuery("div.notstackable")[0].offsetHeight);
if (hnotstackable>hstacked) {
jQuery("div.laststackable").css({'min-height': hnotstackable + parseInt(jQuery("div.laststackable")[0].offsetHeight) - hstacked+'px'});
jQuery("div.notstackable").css({'min-height': hnotstackable+'px'});
/*alert("Cas 2");*/
}
else {
jQuery("div.notstackable").css({'min-height': hstacked+'px'});
};
}
else {
/**********************************************CAS 3*******************************************************************/
/* Navigation et Extra meme Top et differents de Contenu (Layout 27-28-39-40)*/
tlaststackable = parseInt(jQuery("div.laststackable")[0].offsetTop);
tstackable = parseInt(jQuery("div.stackable")[0].offsetTop);
if (tstackable==tlaststackable){
var h=0;
jQuery("div.stackable").each(function(){ h=Math.max(h,this.offsetHeight); }).css({'min-height': h+'px'});
/*alert("Cas 3");*/
}
else {
/**********************************************CAS 4*******************************************************************/
/* Navigation et Contenu meme alignement Top (Layout 35 et 36)*/
largeurcontenu = parseInt(jQuery("div.notstackable")[0].offsetWidth);
if (largeurcontenu==largeurextra) {
hstackable = (hauteurcontenu = parseInt(jQuery("div.notstackable")[0].offsetHeight)) + (hauteurext = parseInt(jQuery("div.laststackable")[0].offsetHeight));
hnavigation = parseInt(jQuery("div#navigation")[0].offsetHeight);
if(hstackable < hnavigation) {
jQuery("div.notstackable").css({'min-height': (hnavigation - hauteurext)+'px'});
}
else {
jQuery("div#navigation").css({'min-height': hstackable+'px'});
}
/*alert("Cas 4");*/
}
else {
/**********************************************CAS 5*******************************************************************/
/* Navigation et Contenu meme alignement Top (Layout 29 a 32 et 37 et 38)*/
hstackable = (hauteurcontenu = parseInt(jQuery("div.notstackable")[0].offsetHeight));
hnavigation = parseInt(jQuery("div#navigation")[0].offsetHeight);
if(hstackable > hnavigation) {
jQuery("div#navigation").css({'min-height': hstackable+'px'});
}
else {
jQuery("div.notstackable").css({'min-height': hnavigation+'px'});
}
/*alert("Cas 5");*/
}
}
}
}
}
;
function form_disable_auto(formid) {
if (jQuery(formid).size() > 0) {
jQuery(formid).attr('autocorrect','off');
jQuery(formid).attr('autocapitalize','off');
}
}
/* FUNCTIONS ON ALL PAGES */
function myInitPages() {
/* HOME SPECIAL FEATURE */
if (jQuery('#homeSpecialFeature').size() > 0) {
if (jQuery('.hSFItem').size()>1) { initMyHomeSpecialFeature = myHomeSpecialFeature("#homeSpecialFeature",'hSFItem','hSFDecoImg','hSFDecoSpan'); }
}
if (jQuery('.sf-menu').size() > 0) {
$(document).ready(function(){
$(".sf-menu").superfish({
hoverClass: 'hover',
delay: 800
}).supposition();
});
}
if (jQuery('#arretSurImg .mainCarousels').size() > 0) { homeCarousel('.mainCarousels'); }
if (jQuery('#arretSurImg2 .mainCarousels2').size() > 0) { homeCarousel2('.mainCarousels2'); }
[(#CONFIG{soyezcreateurs_layout/menuderoulant,replie}|=={replie}|oui)jp_expinit();]
// Surligner l'evenement en cours
var id_anchor = location.hash.substr(1); //Get the word after the hash from the url
if (id_anchor) jQuery('#'+id_anchor).addClass('highlight_anchor'); // ajoute la classe highlight_anchor à l'element autour de l'ancre
;
[(#CONFIG{soyezcreateurs/native_tooltips}|=={on}|non)
jQuery(function() { jQuery( document ).tooltip({
track: true,
items: '\[title\]:not(.crayon-icones *, .formulaire_crayon *, a span, a img, .postListItem *)',
show: {
delay: #CONFIG{soyezcreateurs/tooltip_delay,1000}
}
});
});
]
jQuery(".escapelinks").one("focus", "a", function() { jQuery(".escapelinks").removeClass("escapelinks"); } );
form_disable_auto('#formulaire_recherche');
form_disable_auto('#session_nom');
form_disable_auto('#session_email');
form_disable_auto('#url_site');
}
;
function myInitLayout() {
if (CanceladjustLayout != true) {
adjustLayout();
jQuery("body").resize(
function () {
adjustLayout();
}
);
if (CancelMonitorTextSize != true) {
jQuery.em.element = jQuery('<div />').css({ left: '-100em',
position: 'absolute',
width: '100em' })
.prependTo('div.texte')[0];
jQuery('div.texte').bind('emchange', function(e, cur, prev) { adjustLayout(); });
}
onAjaxLoad(adjustLayout); // Merci Marcimat sur IRC !
}
;
}
;
/* BLACK TRANSPARENT BACKGROUNDS */
function mySpecialBackgrounds(elt,correcAmount,correcAmount2) {
jQuery(elt).each(function() {
var targetHeight = jQuery(this).parent().height();
var targetWidth = jQuery(this).parent().width();
jQuery(this).css({'height':targetHeight+correcAmount,'width':targetWidth+correcAmount2,'opacity':.5});
});
}
;
/* HOME SPECIAL FEATURE */
function myHomeSpecialFeature(container,item,decoImg,decoSpan) {
jQuery('#'+item+'1').addClass('active'+item);
mySpecialBackgrounds('.'+item+' .'+decoSpan,14,10);
jQuery('#'+item+'1 .'+decoSpan).css("opacity", 1);
jQuery('.'+item+' .'+decoImg).hide();
jQuery('#'+item+'1 .'+decoImg).show();
var x = 1;
var maxX = jQuery('.'+item).size();
function myAnimate(x,maxX) {
if (x > maxX) { x = 1; }
jQuery('.'+item).removeClass('active'+item);
jQuery('#'+item+x).addClass('active'+item);
jQuery('.'+item+' .'+decoSpan).animate({"opacity": .5}, { queue:false, duration:800 });
jQuery('#'+item+x+' .'+decoSpan).animate({"opacity": 1},800);
jQuery('.'+item+' .'+decoImg).fadeOut(800);
jQuery('#'+item+x+' .'+decoImg).fadeIn(800);
timer = setTimeout(function() {
if (x < maxX) { x = x+1; myAnimate(x,maxX); }
else if (x = maxX) { x = 1; myAnimate(x,maxX); }
} , #CONFIG{soyezcreateurs/vitesse_slider,10000} );
}
myAnimate(x,maxX);
jQuery('.'+item).each(function() {
jQuery(this).hoverIntent(
function() {
clearTimeout(timer);
currentItem = jQuery('.'+item).index(this)+1;
jQuery('.'+item).removeClass('active'+item);
jQuery(this).addClass('active'+item);
jQuery('.'+item+' .'+decoSpan+':not("#'+item+currentItem+' .'+decoSpan+'")').css("opacity", .5);
jQuery(this).children().children('.'+decoSpan).animate({"opacity": 1},400);
jQuery('.'+item+' .'+decoImg+':not("#'+item+currentItem+' .'+decoImg+'")').fadeOut(400);
jQuery(this).children('.'+decoImg).fadeIn(400);
},
function() {
clearTimeout(timer);
currentItem = jQuery('.'+item).index(this)+2;
jQuery(this).removeClass('active'+item);
jQuery(this).children().children('.'+decoSpan).animate({"opacity": .5},400);
timer = setTimeout(function() { myAnimate(currentItem,maxX); } , 1000 );
}
);
});
}
;
/* HOME CYCLE */
function homeCarousel(elt) {
/* carousels internes */
var elemNbr = jQuery(elt+' > li').size();
var myCounter = 1;
function onAfter(curr,next,opts) {
if (opts.currSlide+1 == opts.slideCount) {
if (myCounter < elemNbr) {
myCounter = myCounter+1;
} else if (myCounter == elemNbr) {
myCounter = 1;
}
function reloadCarousels() {
jQuery('.smallCarousel').stop(true,true).fadeOut(750);
jQuery('#sc'+myCounter+'b').stop(true,true).fadeIn(750).children('ul').cycle({
//fx: 'scrollHorz', // pour transition latérale
fx: 'fade',
speed: 1500,
timeout: 4000,
pause: true,
startingSlide: 0,
after: onAfter
});
jQuery('.mainCarousel').removeClass('active');
if (myCounter == 1) {
jQuery('.mainCarousel:first').addClass('active');
} else {
jQuery('.mainCarousel').eq(myCounter-1).addClass('active');
}
}
jQuery('.smallCarousel').children('ul').cycle('stop');
var t2=setTimeout(reloadCarousels,3000);
} else {
clearTimeout(t2);
}
//alert(myCounter);
}
function onAfter2(curr,next,opts) {
//
}
jQuery('.smallCarousel ul').cycle({
//fx: 'scrollHorz', // pour transition latérale
fx: 'fade',
speed: 1500,
timeout: 4000,
pause: true,
startingSlide: 0,
after: onAfter
});
jQuery('.smallCarousel').hide().children('ul').cycle('pause');
jQuery('#sc1b').show().children('ul').cycle('resume');
/* faux carousel principal */
var whatToShow = '';
jQuery('.mainCarousel:first').addClass('active');
jQuery(document).delegate('.mainCarousel','mouseenter focus', function() {
jQuery('.mainCarousel').removeClass('hover active');
jQuery(this).addClass('hover active');
whatToShow = jQuery(this).children('h2').children('a').attr('id');
jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle('stop');
// 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
jQuery('#'+whatToShow+'b').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter2});
}).delegate('.mainCarousel','mouseleave blur', function() {
whatToShow = jQuery(this).children('h2').children('a').attr('id');
jQuery(this).removeClass('hover');
// 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
jQuery('.smallCarousel').stop(true,true).fadeOut().children('ul').cycle('stop');
jQuery('#'+whatToShow+'b').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter});
myCounter = jQuery(this).index()+1;
});
}
/* HOME CYCLE */
function homeCarousel2(elt) {
/* carousels internes */
var elemNbr = jQuery(elt+' > li').size();
var myCounter = 1;
function onAfter(curr,next,opts) {
if (opts.currSlide+1 == opts.slideCount) {
if (myCounter < elemNbr) {
myCounter = myCounter+1;
} else if (myCounter == elemNbr) {
myCounter = 1;
}
function reloadCarousels() {
jQuery('.smallCarousel2').stop(true,true).fadeOut(750);
jQuery('#sc'+myCounter+'b2').stop(true,true).fadeIn(750).children('ul').cycle({
//fx: 'scrollHorz', // pour transition latérale
fx: 'fade',
speed: 1500,
timeout: 4000,
pause: true,
startingSlide: 0,
after: onAfter
});
jQuery('.mainCarousel2').removeClass('active');
if (myCounter == 1) {
jQuery('.mainCarousel2:first').addClass('active');
} else {
jQuery('.mainCarousel2').eq(myCounter-1).addClass('active');
}
}
jQuery('.smallCarousel2').children('ul').cycle('stop');
var t2=setTimeout(reloadCarousels,3000);
} else {
clearTimeout(t2);
}
//alert(myCounter);
}
function onAfter2(curr,next,opts) {
//
}
jQuery('.smallCarousel2 ul').cycle({
//fx: 'scrollHorz', // pour transition latérale
fx: 'fade',
speed: 1500,
timeout: 4000,
pause: true,
startingSlide: 0,
after: onAfter
});
jQuery('.smallCarousel2').hide().children('ul').cycle('pause');
jQuery('#sc1b2').show().children('ul').cycle('resume');
/* faux carousel principal */
var whatToShow = '';
jQuery('.mainCarousel2:first').addClass('active');
jQuery(document).delegate('.mainCarousel2','mouseenter focus', function() {
jQuery('.mainCarousel2').removeClass('hover active');
jQuery(this).addClass('hover active');
whatToShow = jQuery(this).children('h2').children('a').attr('id');
jQuery('.smallCarousel2').stop(true,true).fadeOut().children('ul').cycle('stop');
// 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
jQuery('#'+whatToShow+'b2').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter2});
}).delegate('.mainCarousel2','mouseleave blur', function() {
whatToShow = jQuery(this).children('h2').children('a').attr('id');
jQuery(this).removeClass('hover');
// 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
jQuery('.smallCarousel2').stop(true,true).fadeOut().children('ul').cycle('stop');
jQuery('#'+whatToShow+'b2').stop(true,true).fadeIn().children('ul').cycle({fx: 'fade',speed: 1500,timeout: 4000,pause: true,startingSlide: 0,after: onAfter});
myCounter = jQuery(this).index()+1;
});
}
jQuery(document).ready(function() {
myInitPages();
// Ceci devrait régler le problème de l'ajustement des colonne pas toujours fait
jQuery(window).on('load',function() {
myInitLayout();
});
[(#VAL{newtabpdf}|in_any{#CONFIG{soyezcreateurs/affichagelistedocuments,#ARRAY{0,enbas}}}|oui)
jQuery("a\[href$='.pdf'\]").prop("target", "_blank").prop("rel", "noopener");
]
});
[(#CHEMIN{images/sc_javascript_perso.js.html}|?{'/* Complément personnalisé du JS */'})
[(#INCLURE{fond=images/sc_javascript_perso.js})]
]
// Fin Encapsulation pour permettre l'utilisation de jQl, cf http://permalink.gmane.org/gmane.comp.web.spip.zone/38793
//});
[(#CHEMIN{js/soyezcreateurs_perso.js}|?{'/* Surcharge eventuelle */'})
[(#INCLURE{#CHEMIN{js/soyezcreateurs_perso.js}|liens_absolus}|compacte{js})]
]