From: Art Cancro Date: Fri, 10 Oct 2008 19:22:08 +0000 (+0000) Subject: Moved some calendar view javascript out to the trailing block. X-Git-Tag: v7.86~1862 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=f2bbf8ff5d9896beb2f800587ba441f90f2cc3cc Moved some calendar view javascript out to the trailing block. Also noticed that the previous/next month buttons in the mini calendar are now broken. We need to fix this. --- diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index 411f79778..73fd4669c 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -47,11 +47,11 @@ void embeddable_mini_calendar(int year, int month, char *urlformat) localtime_r(&thetime, &tm); } - /** Determine previous and next months ... for links */ + /* Determine previous and next months ... for links */ previous_month = thetime - (time_t)864000L; /* back 10 days */ next_month = thetime + (time_t)(31L * 86400L); /* ahead 31 days */ - /** Now back up until we're on the user's preferred start day */ + /* Now back up until we're on the user's preferred start day */ localtime_r(&thetime, &tm); while (tm.tm_wday != weekstart) { thetime = thetime - (time_t)86400; /* go back 24 hours */ @@ -90,13 +90,13 @@ void embeddable_mini_calendar(int year, int month, char *urlformat) wprintf("\n"); - /** Now do 35 or 42 days */ + /* Now do 35 or 42 days */ for (i = 0; i < 42; ++i) { localtime_r(&thetime, &tm); if (i < 35) { - /** Before displaying Sunday, start a new row */ + /* Before displaying Sunday, start a new row */ if ((i % 7) == 0) { wprintf(""); } @@ -110,17 +110,17 @@ void embeddable_mini_calendar(int year, int month, char *urlformat) wprintf(" "); } - /** After displaying one week, end the row */ + /* After displaying one week, end the row */ if ((i % 7) == 6) { wprintf("\n"); } } - thetime += (time_t)86400; /** ahead 24 hours */ + thetime += (time_t)86400; /* ahead 24 hours */ } - wprintf("" /** end of inner table */ + wprintf("" /* end of inner table */ "\n"); /* javascript for previous and next month */ @@ -143,8 +143,8 @@ void embeddable_mini_calendar(int year, int month, char *urlformat) } -/** - * \brief ajax embedder for the above mini calendar +/* + * ajax embedder for the above mini calendar */ void ajax_mini_calendar(void) { char urlformat[256]; @@ -162,9 +162,8 @@ void ajax_mini_calendar(void) { } -/** - * \brief Display one day of a whole month view of a calendar - * \param thetime the month we want to see +/* + * Display one day of a whole month view of a calendar */ void calendar_month_view_display_events(int year, int month, int day) { @@ -192,7 +191,7 @@ void calendar_month_view_display_events(int year, int month, int day) return; } - /** + /* * Create an imaginary event which spans the 24 hours of today. Any events which * overlap with this one take place at least partially in this day. We have to * convert it from a struct tm in order to make it UTC. @@ -215,7 +214,7 @@ void calendar_month_view_display_events(int year, int month, int day) today_end_t = icaltime_from_timet_with_zone(mktime(&ending_tm), 0, icaltimezone_get_utc_timezone()); today_end_t.is_utc = 1; - /** + /* * Now loop through our list of events to see which ones occur today. */ Pos = GetNewHashPos(); @@ -247,7 +246,7 @@ void calendar_month_view_display_events(int year, int month, int day) show_event = ical_ctdl_is_overlap(t, end_t, today_start_t, today_end_t); } - /** + /* * If we determined that this event occurs today, then display it. */ if (show_event) { @@ -283,7 +282,7 @@ void calendar_month_view_display_events(int year, int month, int day) wprintf("
"); } - /** + /* * Only show start/end times if we're actually looking at the VEVENT * component. Otherwise it shows bogus dates for e.g. timezones */ @@ -310,7 +309,7 @@ void calendar_month_view_display_events(int year, int month, int day) wprintf("%s %s
", _("Starting date/time:"), buf); - /** + /* * Embed the 'show end date/time' loop inside here so it * only executes if this is NOT an all day event. */ @@ -353,9 +352,8 @@ void calendar_month_view_display_events(int year, int month, int day) } -/** - * \brief Display one day of a whole month view of a calendar - * \param thetime the month we want to see +/* + * Display one day of a whole month view of a calendar */ void calendar_month_view_brief_events(time_t thetime, const char *daycolor) { long hklen; @@ -590,7 +588,7 @@ void calendar_month_view(int year, int month, int day) { tm.tm_mday, tm.tm_mday); - /** put the data here, stupid */ + /* put the data here, stupid */ calendar_month_view_display_events( tm.tm_year + 1900, tm.tm_mon + 1, @@ -624,9 +622,8 @@ void calendar_month_view(int year, int month, int day) { * being rendered. See http://www.shaftek.org/blog/archives/000212.html * for more information. */ - wprintf("\n" + StrBufAppendPrintf(WC->trailing_javascript, + " setTimeout(\"btt_enableTooltips('inner_month')\", 1); \n" ); } @@ -745,11 +742,11 @@ void calendar_brief_month_view(int year, int month, int day) { wprintf("\n"); } - thetime += (time_t)86400; /** ahead 24 hours */ + thetime += (time_t)86400; /* ahead 24 hours */ } - wprintf("" /** end of inner table */ - "" /** end of outer table */ + wprintf("" /* end of inner table */ + "" /* end of outer table */ "\n"); } @@ -1197,9 +1194,9 @@ void calendar_day_view(int year, int month, int day) { wprintf(""); - wprintf(""); /** end extra on the middle */ + wprintf(""); /* end extra on the middle */ - wprintf(""); /** begin stuff-on-the-right */ + wprintf(""); /* begin stuff-on-the-right */ /* Begin todays-date-with-left-and-right-arrows */ wprintf("\n"); - wprintf(""); /** end stuff-on-the-right */ + wprintf(""); /* end stuff-on-the-right */ - wprintf("
" /** end of inner table */ + wprintf("" /* end of inner table */ ""); - wprintf("\n" + StrBufAppendPrintf(WC->trailing_javascript, + " setTimeout(\"btt_enableTooltips('inner_day')\", 1); \n" ); } diff --git a/webcit/static/t/trailing.html b/webcit/static/t/trailing.html index f2901ef3e..f5c32b746 100644 --- a/webcit/static/t/trailing.html +++ b/webcit/static/t/trailing.html @@ -2,11 +2,11 @@