/** * by jim thunderbird --- dynamic event calendar */ function calendar_go_next(){ $('div#block-event-0 div.content').html(''); var link = $(this).attr('name'); $.ajax({ type: "POST", url: "index.php?q=" + link, data: "op=ajax", cache: false, success: function(msg){ $('div#block-event-0 div.content').html(msg); /* super important */ calendar_load_event_handlers(); } }); } function calendar_go_prev(){ $('div#block-event-0 div.content').html(''); var link = $(this).attr('name'); $.ajax({ type: "POST", url: "index.php?q=" + link, data: "op=ajax", cache: false, success: function(msg){ $('div#block-event-0 div.content').html(msg); /* super important */ calendar_load_event_handlers(); } }); } function calendar_show_events_of_curday(){ $('div#block-event-0 div.content div.event-of-the-day').html(''); var link = $(this).attr('name'); $.ajax({ type: "POST", url: "index.php?q=" + link, data: "op=ajax", cache: false, success: function(msg){ $('div#block-event-0 div.content div.event-of-the-day').html(msg); /* super important */ calendar_load_event_handlers(); } }); } function calendar_show_cursor_on_link(){ $(this).attr('style','cursor:pointer'); } function calendar_load_event_handlers(){ $('div.event-calendar div.month-view span.next a').click(calendar_go_next); $('div.event-calendar div.month-view span.prev a').click(calendar_go_prev); $('div.event-calendar div.month-view table tr td a.eventlink').click(calendar_show_events_of_curday); $('div.event-calendar div.month-view span.next a').bind('mouseover',calendar_show_cursor_on_link); $('div.event-calendar div.month-view span.prev a').bind('mouseover',calendar_show_cursor_on_link); $('div.event-calendar div.month-view table tr td a.eventlink').bind('mouseover',calendar_show_cursor_on_link); } $(document).ready(function(){ calendar_load_event_handlers(); });