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
20 * create the infobulle, the internalization is not yet implemented
24 echo Icon_Action::infobulle(x);
28var posX=0,posY=0,offsetX=10,offsetY=10;
29document.onmousemove=getPosition;
31function showBulle(p_ctl){
32 var d=document.getElementById('bulle');
33 var viewport = document.viewport.getDimensions();
34 if ( posX+offsetX > viewport.width-d.getWidth()) { posX-=d.getWidth()+20;}
35 if ( posY+offsetY > viewport.height-d.getHeight()-20) { posY-=d.getHeight()+20}
36 d.innerHTML=content[p_ctl];
37 d.style.top=posY+offsetY+"px";
38 d.style.left=posX+offsetX-10+"px";
39 d.style.visibility="visible";
41function getPosition(e)
45 posX=event.x+document.body.scrollLeft;
46 posY=event.y+document.body.scrollTop;
54function hideBulle(p_ctl)
56 var d=document.getElementById('bulle');
57 d.style.visibility="hidden";
59function displayBulle(p_comment) {
60 var d=document.getElementById('bulle');
61 var viewport = document.viewport.getDimensions();
62 d.innerHTML=p_comment;
63 if ( posX+offsetX > viewport.width-d.getWidth()) { posX-=d.getWidth()+20;}
64 if ( posY+offsetY > viewport.height-d.getHeight()-20) { posY-=d.getHeight()+20}
65 d.style.top=posY+offsetY+"px";
66 d.style.left=posX+offsetX+"px";
67 d.style.visibility="visible";
73 * @see select_box.class.php
75function displaySelectBox(p_name) {
78 if (! document.getElementById("select_box_content"+p_name) ) {
80 newDiv=new Element("div");
81 newDiv.id="select_box_content"+p_name;
82 document.body.appendChild(newDiv);
83 newDiv.addClassName("select_box");
84 $("select_box_content"+p_name).onmouseleave=function() {
86 var newDiv=$("select_box_content"+p_name);
87 newDiv.setStyle({display:"none"});
93 newDiv=document.getElementById("select_box_content"+p_name);
95 newDiv.innerHTML=$("select_box"+p_name).innerHTML;
96 var viewport = document.viewport.getDimensions();
98 if ( posY+offsetY+ newDiv.getHeight() > window.innerHeight -3) {
99 locPosY-=newDiv.getHeight()+20
101 newDiv.style.top=locPosY+"px";
103 newDiv.style.left=document.getElementById(p_name+"_bt").offsetLeft+"px";
104 newDiv.setStyle({display:"block",position:"absolute","z-index":999});
106 if ( $("search_"+p_name+"_list") ) {
107 var sTmp = newDiv.innerHTML;
108 var regex=new RegExp(p_name+"_list","g");
109 sTmp = sTmp.replace(regex,p_name+"_t_list");
110 newDiv.innerHTML=sTmp;
111 $("search_"+p_name+"_t_list").focus();