29 |
jpm |
1 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
2 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
3 |
// | Javascript version 1.5 |
|
|
|
4 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
5 |
// | Copyright (C) Tela Botanica (accueil@tela-botanica.org), 2005. |
|
|
|
6 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
7 |
// | This file is part of Chorologie. |
|
|
|
8 |
// | |
|
|
|
9 |
// | Foobar is free software; you can redistribute it and/or modify |
|
|
|
10 |
// | it under the terms of the GNU General Public License as published by |
|
|
|
11 |
// | the Free Software Foundation; either version 2 of the License, or |
|
|
|
12 |
// | (at your option) any later version. |
|
|
|
13 |
// | |
|
|
|
14 |
// | Foobar is distributed in the hope that it will be useful, |
|
|
|
15 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
16 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
17 |
// | GNU General Public License for more details. |
|
|
|
18 |
// | |
|
|
|
19 |
// | You should have received a copy of the GNU General Public License |
|
|
|
20 |
// | along with Foobar; if not, write to the Free Software |
|
|
|
21 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
22 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
23 |
// CVS : $Id: echoro.js,v 1.1 2005-05-19 07:37:47 jpm Exp $
|
|
|
24 |
/**
|
|
|
25 |
* Contient le code javascript.
|
|
|
26 |
*
|
|
|
27 |
*
|
|
|
28 |
*@package eFlore
|
|
|
29 |
*@subpackage Chorologie
|
|
|
30 |
//Auteur original :
|
|
|
31 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
32 |
//Autres auteurs :
|
|
|
33 |
*@author Aucun
|
|
|
34 |
*@copyright Tela-Botanica 2000-2005
|
|
|
35 |
*@version $Revision: 1.1 $ $Date: 2005-05-19 07:37:47 $
|
|
|
36 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
37 |
*/
|
|
|
38 |
|
|
|
39 |
//D'autres scripts sur http://www.toutjavascript.com
|
|
|
40 |
//Si vous utilisez ce script, merci de m'avertir ! < webmaster@toutjavascript.com >
|
|
|
41 |
//Auteur original :Olivier Hondermarck <webmaster@toutjavascript.com>
|
|
|
42 |
//Modifs compatibilité Netscape 6/Mozilla : Cédric Lamalle 09/2001 <cedric@cpac.embrapa.br>
|
|
|
43 |
//Correction Mac IE5 (Merci Fred)
|
|
|
44 |
var IB=new Object;
|
|
|
45 |
var posX=0;
|
|
|
46 |
var posY=0;
|
|
|
47 |
var xOffset=10;
|
|
|
48 |
var yOffset=10;
|
|
|
49 |
|
|
|
50 |
function AffBulle(texte)
|
|
|
51 |
{
|
|
|
52 |
contenu='<table border="0" cellspacing="0" cellpadding="'+IB.NbPixel+'"><tr bgcolor="'+IB.ColContour+'"><td><table border="0" cellpadding="2" cellspacing="0" bgcolor="'+IB.ColFond+'"><tr><td style="color:'+IB.ColTexte+';">'+texte+'</td></tr></table></td></tr></table> ';
|
|
|
53 |
|
|
|
54 |
var finalPosX=posX-xOffset;
|
|
|
55 |
|
|
|
56 |
if (finalPosX<0) {
|
|
|
57 |
finalPosX=0;
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
if (document.getElementById) {
|
|
|
61 |
document.getElementById('bulle').innerHTML=contenu;
|
|
|
62 |
document.getElementById('bulle').style.top=posY+yOffset+'px';
|
|
|
63 |
document.getElementById('bulle').style.left=finalPosX+'px';
|
|
|
64 |
document.getElementById('bulle').style.zIndex=100;
|
|
|
65 |
document.getElementById('bulle').style.visibility="visible";
|
|
|
66 |
//Nous vérifions que nous utilisons bien IE ou Mozilla pour supprimer les valeurs tiltes de images fournissant les infos bulles d'aides.
|
|
|
67 |
//Cela pourrait être amélioré en vérifiant aussi les liens car l'aide pourrait être donnée par l'intermédiaire de lien.
|
|
|
68 |
//alert(navigator.appName);
|
|
|
69 |
if (document.images.length) {
|
|
|
70 |
//if (navigator.appName == 'Netscape' || navigator.appName == 'Microsoft Internet Explorer') {
|
|
|
71 |
for(i=1; i<document.images.length; i++) {
|
|
|
72 |
var nom = 'echoro_info_0'+i;
|
|
|
73 |
if (document.images[nom] != null ) {
|
|
|
74 |
document.images[nom].title = "";
|
|
|
75 |
}
|
|
|
76 |
}
|
|
|
77 |
}
|
|
|
78 |
}
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
function getMousePos(e)
|
|
|
82 |
{
|
|
|
83 |
if (document.getElementById) {
|
|
|
84 |
posX=e.pageX;
|
|
|
85 |
posY=e.pageY;
|
|
|
86 |
}
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
function HideBulle()
|
|
|
90 |
{
|
|
|
91 |
if (document.getElementById) {
|
|
|
92 |
document.getElementById('bulle').style.visibility = 'hidden';
|
|
|
93 |
}
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
function InitBulle(ColTexte,ColFond,ColContour,NbPixel)
|
|
|
97 |
{
|
|
|
98 |
IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;
|
|
|
99 |
if (document.getElementById) {
|
|
|
100 |
document.onmousemove = getMousePos;
|
|
|
101 |
document.write('<div id="bulle" style="position:absolute;top:0;left:0;visibility:hidden;"></div>');
|
|
|
102 |
}
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
//// InitBulle(couleur de texte, couleur de fond, couleur de contour, taille contour);
|
|
|
106 |
InitBulle("navy","#FFCC66","orange", 1);
|
|
|
107 |
|
|
|
108 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
109 |
*
|
|
|
110 |
* $Log: not supported by cvs2svn $
|
|
|
111 |
*
|
|
|
112 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
113 |
*/
|