63 lines
2.2 KiB
JavaScript
Executable File
63 lines
2.2 KiB
JavaScript
Executable File
function setBoxStyle(hour,y_value,cc,id)
|
|
{
|
|
var x=findPosX(document.getElementById("table_day"));
|
|
var y=findPosY(document.getElementById("hour"+hour)); //by id
|
|
//y=y+y_value+184;
|
|
y=y+y_value-1;
|
|
x=x+cc+32;
|
|
document.getElementById("activity"+id).style.position="absolute";
|
|
document.getElementById("activity"+id).style.left=x+"px";
|
|
document.getElementById("activity"+id).style.top=y+"px";
|
|
}
|
|
function resizeHours(hour,hour_height)
|
|
{
|
|
if (document.getElementById("hour"+hour))
|
|
document.getElementById("hour"+hour).style.height=hour_height+"px";
|
|
}
|
|
function getHourPosition(hour,t)
|
|
{
|
|
var v;
|
|
var r=t.rows;
|
|
for(i=0;i<hour;i++)
|
|
{
|
|
v=v+r[i].height;
|
|
}
|
|
return v;
|
|
}
|
|
function showdescriptionCalendar(title,desc,object,pos)
|
|
{
|
|
var minus;
|
|
if(pos==1)minus=340;
|
|
else minus=0;
|
|
var posy=findPosY(object)-33;
|
|
var posx=findPosX(object)+15-minus;
|
|
var div=document.createElement("div");
|
|
|
|
desc=desc.replace("<","<");
|
|
desc=desc.replace(">",">");
|
|
desc=desc.replace(""",'"');
|
|
desc=desc.replace("´","'");
|
|
|
|
div.style.display="inline";
|
|
div.style.background="#ffffff";
|
|
div.style.position="absolute";
|
|
div.style.top = posy+"px";
|
|
if(posx<0){posx=posx-posx};
|
|
div.style.left = posx+"px";
|
|
div.id="desc";
|
|
|
|
|
|
div.innerHTML='<table bgcolor="#cccccc" class="olBgClass" border="0" cellpadding="1" cellspacing="1"><tbody><tr><td><table class="olCgClass" border="0" cellpadding="2" cellspacing="0" width="100%"><tbody><tr><td class="olCgClass" width="100%">'+title+'</td><td align="right"><a href="javascript:hidedescriptionCalendar();" title="Click to Close" onClick="javascript:hidedescription();" class="olCloseFontClass"><img src="themes/Sugar/images/close_inline.gif" border="0"></a></td></tr></tbody></table><table class="olFgClass" border="0" cellpadding="2" cellspacing="0" width="100%"><tbody><tr><td class="olFgClass" valign="top" background="#ffffff">'+desc+'<br></td></tr></tbody></table></td></tr></tbody></table>';
|
|
|
|
document.body.appendChild(div);
|
|
//alert(posy+" "+posx);
|
|
//moveDiv(div,posy,posx);
|
|
}
|
|
function hidedescriptionCalendar()
|
|
{
|
|
if(document.getElementById("desc"))
|
|
{
|
|
document.getElementById("desc").style.display="none";
|
|
document.body.removeChild(document.getElementById("desc"));
|
|
}
|
|
} |