Xin Calendar 2 Example: Customizable foot links
Besides the "default" ones, we can also add some customized user foot links to the calendar foot bar.
XC2 introduces four array variables for this purpose:
These variables can be found in the config script (config/xc2_default.js), and by default they are empty.
The xcFootButtons array contains the display text for the user foot links, we can specify static values or function handlers that will return some values. For example:
function weather_icon() { return "<img src='http://www.myweather.com/weather_icon.cgi'>"; } xcFootButtons = ["Home", weather_icon];
The xcFootButtonSwitch is just like the xcFootTagSwitch, these two arrays will be combined to sort out the order for default foot links and user foot links. For example:
xcFootTagSwitch = [2, 0, 0, 0, 0, 0, 0, 0]; ... xcFootButtonSwitch = [1, 3];
The xcFootButtonLinks array is where we define the function handlers for the user foot links. For a function handler specified in the xcFootButtonLinks array, the function will be called when its user foot link is clicked. The function should expect four parameters to be passed. For example:
function open_home(cal_target_field, cal_ref_field, cal_default_date, last_date_picked) { window.open("http://www.yxscripts.com"); } function open_weather() { } xcFootButtonLinks = [open_home, open_weather];
[Xin Calendar 2 Mods] [Back to index page]
# # #