var cs_prive=window.location.pathname.match(/\/ecrire\/$/)!=null; jQuery.fn.cs_todo=function(){return this.not('.cs_done').addClass('cs_done');}; // variable modifiable afin d'initialiser l'ouverture d'un onglet if(typeof(onglet_actif)=='undefined') var onglet_actif = ''; // variable modifiable afin de choisir la balise utilisee pour les onglets if(typeof(onglets_balise)=='undefined') var onglets_balise = 'h2'; // fonction pour montrer un contenu jQuery.fn.montre_onglet = function( selector ) { // click sur un titre if(this.is('.onglets_titre')) { var contenu = '#' + this[0].id.replace(/titre/,'contenu'); var bloc = this.parent().parent(); bloc.children('.selected').removeClass('selected').end() .children('.onglets_liste').children('.selected').removeClass('selected'); jQuery(contenu).addClass('selected'); this.addClass('selected'); } // click sur un titre if(this.is('.onglets_contenu')) { var titre = this[0].id.replace(/contenu/,'titre'); jQuery('#'+titre).montre_onglet(); } return this; }; // compatibilite Ajax : ajouter "this" a "jQuery" pour mieux localiser les actions function onglets_init() { var cs_bloc = jQuery('div.onglets_bloc_initial', this); if(cs_bloc.length) { cs_bloc.prepend('
') .children('.onglets_contenu').each(function(i) { this.id = 'onglets_contenu_' + i; jQuery(this).parent().children('.onglets_liste').append( '<'+onglets_balise+' id="'+'onglets_titre_' + i + '" class="onglets_titre">' + this.firstChild.innerHTML + '' ); }) .children(onglets_balise).remove(); jQuery('div.onglets_liste', this).each(function() { this.firstChild.className += ' selected'; this.nextSibling.className += ' selected'; }); jQuery(onglets_balise+'.onglets_titre', this).hover( function(){ jQuery(this).addClass('hover') },function(){ jQuery(this).removeClass('hover') } ); jQuery('div.onglets_bloc_initial', this) .attr('class','onglets_bloc').each(function(i) {this.id = 'ongl_'+i;}); // clic du titre... jQuery(onglets_balise+'.onglets_titre', this).click(function(e) { jQuery(this).montre_onglet(); return false; }); // clic des , au cas ou... jQuery(onglets_balise+'.onglets_titre a', this).click(function(e){ jQuery(this).parents(onglets_balise).click(); if (e.stopPropagation) e.stopPropagation(); e.cancelBubble = true; return false; }); // activation d'onglet(s) grace a l'url var onglet_get = get_onglet(window.location); if(onglet_get && (this==document)) clic_onglet(onglet_get); // clic vers une note dans un onglet jQuery('.spip_note['+cs_sel_jQuery+'name^=nb], .spip_note['+cs_sel_jQuery+'id^=nb]').each(function(i) { jQuery(this).click(function(e){ var href = this.href.substring(this.href.lastIndexOf("#")); jQuery(href).parents('.onglets_contenu').eq(0).montre_onglet(); return true; }); }); } } function clic_onglet(liste) { var onglets = liste.split(','); for (var i=0; i[(#EVAL{test_espace_prive()}|non)function soft_scroller_init() { if(typeof jQuery.localScroll=="function") jQuery.localScroll({hash: true, onAfter:function(anchor,settings){jQuery(anchor).focus();}}); }] if (window.jQuery) jQuery.fn.jc_ajouter_parent = function(color, padding, margin) { color = ((typeof color=='undefined') || (color==''))?'':(' background-color:'+color+';'); if ((typeof padding=='undefined') || (padding=='')) padding = '4px'; if ((typeof margin=='undefined') || (margin=='')) margin = '4px 0'; return this.wrap('
<\/div>'); }; var cs_init = function() { onglets_init.apply(this); cs_sommaire_init.apply(this); [(#EVAL{test_espace_prive()}|non)soft_scroller_init.apply(this);] [(#EVAL{test_espace_prive()}|non)if(typeof jcorner_init=="function") jcorner_init.apply(this);] } if(typeof onAjaxLoad=='function') onAjaxLoad(cs_init); if(window.jQuery) { var cs_sel_jQuery=typeof jQuery(document).selector=='undefined'?'@':''; var cs_CookiePlugin="#CHEMIN{javascript/jquery.cookie.js}"; jQuery(document).ready(function(){ if(jQuery("div.cs_sommaire").length) { // s'il y a un sommaire, on cache la navigation haute sur les pages jQuery("div.decoupe_haut").css("display", "none"); // utilisation des cookies pour conserver l'etat du sommaire si on quitte la page if(cs_CookiePlugin) jQuery.getScript(cs_CookiePlugin, cs_sommaire_cookie); } cs_init.apply(document); }); } if(typeof jQuery.fn.prop !== 'function') jQuery.fn.prop=function(name, value){ if (typeof value === 'undefined') return this.attr(name); else return this.attr(name, value); };