Subversion Repositories Sites.tela-botanica.org

Compare Revisions

Ignore whitespace Rev 611 → Rev 612

/trunk/sites/accueil/generique/scripts/accueilv5.js
New file
0,0 → 1,99
/**
* Script JQuery du site
*
* @author Grégoire Duché <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
 
var url_service_jrest = "http://162.38.234.3/jrest_tela/TelaUtilisateurs";
$(document).ready(function() {
/**
* Ajout de contenus : inscrits, connectés, et boutons précédents et suivants
* */
// On ajoute les champs Inscrits et connectés uniquement si JS obtient une réponse du service
$.getJSON(url_service_jrest,
function(data){
var nbInscrits = data[0];
var nbVisiteurs = data[1];
$("#zone-menu-haut ul").prepend('<li class="vert" id="connectes"> Visiteurs : <span class="gris">' + nbVisiteurs + '</span></li>');
$("#zone-menu-haut ul").prepend('<li class="vert" id="inscrits"> Inscrits : <span class="gris">' + nbInscrits + '</span></li>');
});
/**
* Gestion des effets graphiques sur bandeau
* *
TODO : supprimer les lignes ci-dessous
$(".motsclefs").mouseover(function() {
//Changer la couleur du titre.
$(this).addClass("grisclair");
$(this).children("h3").children("span").addClass("grisfonce");
});
$(".motsclefs").mouseout(function() {
//Changer la couleur du titre.
$(this).addClass("grisfonce");
$(this).removeClass("grisclair");
$(this).children("h3").children("span").removeClass("grisfonce");
$(this).children("h3").children("span").addClass("grisclair");
});*/
$("#bandeauProjets").addClass("overflow-hidden");
$("#bandeauProjets").css("height", "100px");
$("#bandeauProjets ul").addClass("overflow-hidden");
$("#bandeauProjets ul").css("width", "9000px");
/********************************************************************************
* Gestion des projets - menu defilant *
********************************************************************************/
/* Ajout à la volée des boutons suivant et précédent pour le menu défilant */
$("#bandeauProjets").append("<div id='boutonPrecedent'>&nbsp;</div>");
$("#bandeauProjets").append("<div id='boutonSuivant'>&nbsp;</div>");
/* Variables pour le défilement*/
var position = 0;
var increment = 269;
$("#boutonSuivant").click(function() {
//Un clic sur le bouton "Projet suivant" doit défiler la liste des projets
var ul = $(this).parent().children("ul");
var nbLi = ($(ul).children("li").size())-3;
if (position/increment < nbLi) {
position += increment;
$(ul).animate({marginLeft: '-' + position}, 400, function() {});
}
});
$("#boutonPrecedent").click(function() {
//Un clic sur le bouton "Projet suivant" doit défiler la liste des projets
if (position>0) {
position -= increment;
var ul = $(this).parent().children("ul");
$(ul).animate({marginLeft: '-' + position}, 400, function() {});
}
});
if (navigator.appName=='Microsoft Internet Explorer') {
$("#zone-titre").css("font-family", "optima2");
$(".motsclefs").css("font-family", "Helveticaneue2");
}
}
);
 
/**
* Vider le champ recherche lorsqu'on clique dessus.
* */
//TODO : mettre les versions EN...
function saisieChampRecherche(objet) {
if (objet.value=="Rechercher dans le site") {
objet.value = "";
}
}
/trunk/sites/accueil/generique/scripts/csshover3.htc
New file
0,0 → 1,12
<public:attach event="ondocumentready" onevent="CSSHover()" />
<script>
/**
* Whatever:hover - V3.11
* http://www.xs4all.nl/~peterned/
*
* Copyright (c) 2009 Peter Nederlof
* Licensed under the LGPL license
* http://creativecommons.org/licenses/LGPL/2.1
*/
window.CSSHover=(function(){var m=/(^|\s)((([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active|focus))/i;var n=/(.*?)\:(hover|active|focus)/i;var o=/[^:]+:([a-z\-]+).*/i;var p=/(\.([a-z0-9_\-]+):[a-z]+)|(:[a-z]+)/gi;var q=/\.([a-z0-9_\-]*on(hover|active|focus))/i;var s=/msie (5|6|7)/i;var t=/backcompat/i;var u={index:0,list:['text-kashida','text-kashida-space','text-justify'],get:function(){return this.list[(this.index++)%this.list.length]}};var v=function(c){return c.replace(/-(.)/mg,function(a,b){return b.toUpperCase()})};var w={elements:[],callbacks:{},init:function(){if(!s.test(navigator.userAgent)&&!t.test(window.document.compatMode)){return}var a=window.document.styleSheets,l=a.length;for(var i=0;i<l;i++){this.parseStylesheet(a[i])}},parseStylesheet:function(a){if(a.imports){try{var b=a.imports;var l=b.length;for(var i=0;i<l;i++){this.parseStylesheet(a.imports[i])}}catch(securityException){}}try{var c=a.rules;var r=c.length;for(var j=0;j<r;j++){this.parseCSSRule(c[j],a)}}catch(someException){}},parseCSSRule:function(a,b){var c=a.selectorText;if(m.test(c)){var d=a.style.cssText;var e=n.exec(c)[1];var f=c.replace(o,'on$1');var g=c.replace(p,'.$2'+f);var h=q.exec(g)[1];var i=e+h;if(!this.callbacks[i]){var j=u.get();var k=v(j);b.addRule(e,j+':expression(CSSHover(this, "'+f+'", "'+h+'", "'+k+'"))');this.callbacks[i]=true}b.addRule(g,d)}},patch:function(a,b,c,d){try{var f=a.parentNode.currentStyle[d];a.style[d]=f}catch(e){a.runtimeStyle[d]=''}if(!a.csshover){a.csshover=[]}if(!a.csshover[c]){a.csshover[c]=true;var g=new CSSHoverElement(a,b,c);this.elements.push(g)}return b},unload:function(){try{var l=this.elements.length;for(var i=0;i<l;i++){this.elements[i].unload()}this.elements=[];this.callbacks={}}catch(e){}}};var x={onhover:{activator:'onmouseenter',deactivator:'onmouseleave'},onactive:{activator:'onmousedown',deactivator:'onmouseup'},onfocus:{activator:'onfocus',deactivator:'onblur'}};function CSSHoverElement(a,b,c){this.node=a;this.type=b;var d=new RegExp('(^|\\s)'+c+'(\\s|$)','g');this.activator=function(){a.className+=' '+c};this.deactivator=function(){a.className=a.className.replace(d,' ')};a.attachEvent(x[b].activator,this.activator);a.attachEvent(x[b].deactivator,this.deactivator)}CSSHoverElement.prototype={unload:function(){this.node.detachEvent(x[this.type].activator,this.activator);this.node.detachEvent(x[this.type].deactivator,this.deactivator);this.activator=null;this.deactivator=null;this.node=null;this.type=null}};window.attachEvent('onbeforeunload',function(){w.unload()});return function(a,b,c,d){if(a){return w.patch(a,b,c,d)}else{w.init()}}})();
</script>