2 * This file is part of NOALYSS.
4 * NOALYSS is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * NOALYSS is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with NOALYSS; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * \brief create the infobulle, the internalization is not yet implemented
23 echo Icon_Action::infobulle(x);
27var posX=0,posY=0,offsetX=10,offsetY=10;
28document.onmousemove=getPosition;
30function showBulle(p_ctl){
31 var d=document.getElementById('bulle');
32 var viewport = document.viewport.getDimensions();
33 if ( posX+offsetX > viewport.width-d.getWidth()) { posX-=d.getWidth()+20;}
34 if ( posY+offsetY > viewport.height-d.getHeight()-20) { posY-=d.getHeight()+20}
35 d.innerHTML=content[p_ctl];
36 d.style.top=posY+offsetY+"px";
37 d.style.left=posX+offsetX-10+"px";
38 d.style.visibility="visible";
40function getPosition(e)
44 posX=event.x+document.body.scrollLeft;
45 posY=event.y+document.body.scrollTop;
53function hideBulle(p_ctl)
55 var d=document.getElementById('bulle');
56 d.style.visibility="hidden";
58function displayBulle(p_comment) {
59 var d=document.getElementById('bulle');
60 var viewport = document.viewport.getDimensions();
61 d.innerHTML=p_comment;
62 if ( posX+offsetX > viewport.width-d.getWidth()) { posX-=d.getWidth()+20;}
63 if ( posY+offsetY > viewport.height-d.getHeight()-20) { posY-=d.getHeight()+20}
64 d.style.top=posY+offsetY+"px";
65 d.style.left=posX+offsetX+"px";
66 d.style.visibility="visible";
72 * @see select_box.class.php
74function displaySelectBox(p_name) {
77 if (! document.getElementById("select_box_content"+p_name) ) {
79 newDiv=new Element("div");
80 newDiv.id="select_box_content"+p_name;
81 document.body.appendChild(newDiv);
82 newDiv.addClassName("select_box");
83 $("select_box_content"+p_name).onmouseleave=function() {
85 var newDiv=$("select_box_content"+p_name);
86 newDiv.setStyle({display:"none"});
92 newDiv=document.getElementById("select_box_content"+p_name);
94 newDiv.innerHTML=$("select_box"+p_name).innerHTML;
95 var viewport = document.viewport.getDimensions();
97 if ( posY+offsetY+ newDiv.getHeight() > window.innerHeight -3) {
98 locPosY-=newDiv.getHeight()+20
100 newDiv.style.top=locPosY+"px";
102 newDiv.style.left=document.getElementById(p_name+"_bt").offsetLeft+"px";
103 newDiv.setStyle({display:"block",position:"absolute","z-index":999});
105 if ( $("search_"+p_name+"_list") ) {
106 var sTmp = newDiv.innerHTML;
107 var regex=new RegExp(p_name+"_list","g");
108 sTmp = sTmp.replace(regex,p_name+"_t_list");
109 newDiv.innerHTML=sTmp;
110 $("search_"+p_name+"_t_list").focus();