CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I use overlib with the calendar to show event tooltips?

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> CalendarXP F.A.Q.
View previous topic :: View next topic  
Author Message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue Feb 15, 2005 7:29 pm    Post subject: How can I use overlib with the calendar to show event tooltips? Reply with quote

The following instructions were tested with overlib 4.17.

Before starting to integrate it with calendarxp, we need to fix a bug in it first (this bug may have been fixed in overlib 4.18+) -- please find the line 1157 in the overlib.js with the following code:
Code:
top = left = -10000 + (!olNs4) ? 'px' : 0;
and change it to:
Code:
top = left = -10000 + (!olNs4 ? 'px' : 0);

Now in order to integrate it in calendarxp we need to:
  • Copy all overlib files into the same directory where the calendar engine files (iflateng.htm or ipopeng.htm) are located.
  • Load the overlib scripts from within the engine by appending the following line to the end of plugins.js file:
    Code:
    fLoadScript("overlib.js");

Finally, we have 2 ways to use overlib tooltips: (you may use either one or both)
1st) To enable overlib on a specific HTML content in a date cell, we just need to invoke overlib() as usual from the onmouseover event. e.g.
Code:
fAddEvent(2005,5,21,"agenda tooltip","alert('overlib demo')","#87ceeb","dodgerblue",null,"gold", "<div><a href='javascript:void(0);' onmouseover=\"overlib('This is a overlib tip.')\" onmouseout=\"nd()\">over here</a></div>");

2nd) To replace the default tooltip of each agenda date with overlib tip, we need to:
  1. Append the following function to the end of plugins.js:
    Code:
    function fOverLib(y,m,d) {
       var ag=fGetAgenda(y,m,d);
       if(ag&&ag[7])overlib(ag[7]);
    }
    gsDays="'<div onmouseover=fOverLib('+sCellDate+') onmouseout=nd()>'+dayNo+'</div>'";
  2. Now the 11th parameter (named "etc" as in SDK doc) of each fAddEvent call is dedicated for overlib tooltips (because we check ag[7] in above code - means the 8th param of agenda array) and you may set the 4th one to empty string to avoid overlapping with the built-in tips. e.g.
    Code:
    fAddEvent(2005,5,21,"","alert('overlib demo')","#87ceeb","dodgerblue",null,"gold", null, null, "Overlib Tooltip");

Note that if you have already used the "etc" param of fAddEvent() for other purpose, you may simply override the fAddEvent() by adding the following code to plugins.js so as to make use of ag[8].
Code:
function fAddEvent(y,m,d,message,action,bgcolor,fgcolor,bgimg,boxit,html,etc, etc2) {
   var ag=gbShareAgenda?eval(gsAgShared):__agenda;
   ag[y+"-"+m+"-"+d]=[message,fFilterNull(action),fFilterNull(bgcolor),fFilterNull(fgcolor), fFilterNull(bgimg),fFilterNull(boxit),fFilterNull(html), etc, etc2];
}

_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.


Last edited by calendarxp on Thu Mar 08, 2007 12:41 am; edited 15 times in total
Back to top
View user's profile Send private message
chrisnetonline



Joined: 24 May 2005
Posts: 13
Location: Massachusetts

PostPosted: Tue May 24, 2005 9:10 pm    Post subject: Reply with quote

I seemed to have misunderstood the overlib support. I thought you would be able to pop up the overlib when you mouse over the actual day. Is there any built in support other than the tooltip to popup information when you mouse over a day?
Back to top
View user's profile Send private message Visit poster's website
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Wed May 25, 2005 3:18 am    Post subject: Reply with quote

The previous FAQ was based on old version of overlib and not clear enough. We just updated it with detailed instructions - please try again.
_________________
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> CalendarXP F.A.Q. All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group