Performed a bunch of markup fixes suggested by validator.w3.org
[citadel.git] / webcit / calendar_view.c
index 2600bfa588cad5f4d7f38d905f09d2f20634ed54..89f15392cae8773a9d01cbe6efd99ee9e38630b5 100644 (file)
@@ -1,14 +1,12 @@
 /*
- * $Id$
- *
  * Handles the HTML display of calendar items.
  *
  * Copyright (c) 1996-2010 by the citadel.org team
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -17,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "webcit.h"
@@ -190,7 +188,7 @@ void calendar_month_view_display_events(int year, int month, int day)
        time_t tt;
 
        if (GetCount(WCC->disp_cal_items) == 0) {
-               wc_printf("<br /><br /><br />\n");
+               wc_printf("<br><br><br>\n");
                return;
        }
 
@@ -288,10 +286,10 @@ void calendar_month_view_display_events(int year, int month, int day)
 
                                wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
 
-                               wc_printf("<i>%s: %s</i><br />", _("From"), Cal->from);
+                               wc_printf("<i>%s: %s</i><br>", _("From"), Cal->from);
                                wc_printf("<i>%s</i> ",          _("Summary:"));
                                escputs((char *)icalproperty_get_comment(p));
-                               wc_printf("<br />");
+                               wc_printf("<br>");
 
                                q = icalcomponent_get_first_property(
                                        Cal->cal,
@@ -299,7 +297,7 @@ void calendar_month_view_display_events(int year, int month, int day)
                                if (q) {
                                        wc_printf("<i>%s</i> ", _("Location:"));
                                        escputs((char *)icalproperty_get_comment(q));
-                                       wc_printf("<br />");
+                                       wc_printf("<br>");
                                }
 
                                /*
@@ -379,11 +377,11 @@ void calendar_month_view_display_events(int year, int month, int day)
                                if (q) {
                                        wc_printf("<i>%s</i> ", _("Notes:"));
                                        escputs((char *)icalproperty_get_comment(q));
-                                       wc_printf("<br />");
+                                       wc_printf("<br>");
                                }
 
                                wc_printf("</span><span class=\"bttbottom\"></span></span>");
-                               wc_printf("</a></font><br />\n");
+                               wc_printf("</a></font><br>\n");
 
                                if (all_day_event) {
                                        wc_printf("</td></tr></table>");
@@ -571,8 +569,7 @@ void calendar_month_view(int year, int month, int day) {
        }
 
        /* Outer table (to get the background color) */
-       wc_printf("<div class=\"fix_scrollbar_bug\">"
-               "<table class=\"calendar\"> \n <tr><td>"); 
+       wc_printf("<table class=\"calendar\"> \n <tr><td>"); 
 
        wc_printf("<table width=\"100%%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n");
 
@@ -664,8 +661,8 @@ void calendar_month_view(int year, int month, int day) {
        }
 
        wc_printf("</table>"                    /* end of inner table */
-               "</td></tr></table>"            /* end of outer table */
-               "</div>\n");
+               "</td></tr></table>\n"          /* end of outer table */
+       );
 }
 
 /*
@@ -707,8 +704,7 @@ void calendar_brief_month_view(int year, int month, int day) {
        }
 
        /* Outer table (to get the background color) */
-       wc_printf("<div class=\"fix_scrollbar_bug\">"
-               "<table width=\"100%%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" "
+       wc_printf("<table width=\"100%%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" "
                "bgcolor=#204B78><tr><td>\n");
 
        wc_printf("<table width=\"100%%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n");
@@ -787,15 +783,15 @@ void calendar_brief_month_view(int year, int month, int day) {
        }
 
        wc_printf("</table>"                    /* end of inner table */
-               "</td></tr></table>"            /* end of outer table */
-               "</div>\n");
+               "</td></tr></table>\n"          /* end of outer table */
+       );
 }
 
 /*
  * Calendar week view -- not implemented yet, this is a stub function
  */
 void calendar_week_view(int year, int month, int day) {
-       wc_printf("<center><i>week view FIXME</i></center><br />\n");
+       wc_printf("<center><i>week view FIXME</i></center><br>\n");
 }
 
 
@@ -954,16 +950,16 @@ void calendar_day_view_display_events(time_t thetime,
                                );
                                 escputs((char *) icalproperty_get_comment(p));
                                wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
-                                wc_printf("<i>%s</i><br />",      _("All day event"));
-                               wc_printf("<i>%s: %s</i><br />",  _("From"), Cal->from);
+                                wc_printf("<i>%s</i><br>",      _("All day event"));
+                               wc_printf("<i>%s: %s</i><br>",  _("From"), Cal->from);
                                 wc_printf("<i>%s</i> ",           _("Summary:"));
                                 escputs((char *) icalproperty_get_comment(p));
-                                wc_printf("<br />");
+                                wc_printf("<br>");
                                q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
                                 if (q) {
                                         wc_printf("<i>%s</i> ", _("Location:"));
                                         escputs((char *)icalproperty_get_comment(q));
-                                        wc_printf("<br />");
+                                        wc_printf("<br>");
                                }
                                if (!icaltime_compare(t, end_t)) { /* one day only */
                                        webcit_fmt_date(buf, 256, event_tt, DATEFMT_LOCALEDATE);
@@ -979,7 +975,7 @@ void calendar_day_view_display_events(time_t thetime,
                                 if (q) {
                                         wc_printf("<i>%s</i> ", _("Notes:"));
                                         escputs((char *)icalproperty_get_comment(q));
-                                        wc_printf("<br />");
+                                        wc_printf("<br>");
                                 }
                                wc_printf("</span><span class=\"bttbottom\"></span></span>");
                                 wc_printf("</a> <span>(");
@@ -998,16 +994,16 @@ void calendar_day_view_display_events(time_t thetime,
                                );
                                escputs((char *) icalproperty_get_comment(p));
                                wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
-                                wc_printf("<i>%s</i><br />",     _("Ongoing event"));
-                               wc_printf("<i>%s: %s</i><br />", _("From"), Cal->from);
+                                wc_printf("<i>%s</i><br>",     _("Ongoing event"));
+                               wc_printf("<i>%s: %s</i><br>", _("From"), Cal->from);
                                 wc_printf("<i>%s</i> ",          _("Summary:"));
                                 escputs((char *) icalproperty_get_comment(p));
-                                wc_printf("<br />");
+                                wc_printf("<br>");
                                 q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
                                 if (q) {
                                         wc_printf("<i>%s</i> ", _("Location:"));
                                         escputs((char *)icalproperty_get_comment(q));
-                                        wc_printf("<br />");
+                                        wc_printf("<br>");
                                                                }
                                 webcit_fmt_date(buf, 256, event_tt, DATEFMT_BRIEF);
                                 wc_printf("<i>%s</i> %s<br>", _("Starting date/time:"), buf);
@@ -1017,7 +1013,7 @@ void calendar_day_view_display_events(time_t thetime,
                                 if (q) {
                                         wc_printf("<i>%s</i> ", _("Notes:"));
                                         escputs((char *)icalproperty_get_comment(q));
-                                        wc_printf("<br />");
+                                        wc_printf("<br>");
                                 }
                                 wc_printf("</span><span class=\"bttbottom\"></span></span>");
                                wc_printf("</a> <span>(");
@@ -1080,15 +1076,15 @@ void calendar_day_view_display_events(time_t thetime,
                                );
                                escputs((char *) icalproperty_get_comment(p));
                                wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
-                               wc_printf("<i>%s: %s</i><br />", _("From"), Cal->from);
+                               wc_printf("<i>%s: %s</i><br>", _("From"), Cal->from);
                                 wc_printf("<i>%s</i> ",          _("Summary:"));
                                 escputs((char *) icalproperty_get_comment(p));
-                                wc_printf("<br />");
+                                wc_printf("<br>");
                                 q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
                                 if (q) {
                                         wc_printf("<i>%s</i> ", _("Location:"));
                                         escputs((char *)icalproperty_get_comment(q));
-                                        wc_printf("<br />");
+                                        wc_printf("<br>");
                                                                }
                                if (!icaltime_compare(t, end_t)) { /* one day only */
                                        webcit_fmt_date(buf, 256, event_tt, DATEFMT_BRIEF);
@@ -1104,7 +1100,7 @@ void calendar_day_view_display_events(time_t thetime,
                                 if (q) {
                                         wc_printf("<i>%s</i> ", _("Notes:"));
                                         escputs((char *)icalproperty_get_comment(q));
-                                        wc_printf("<br />");
+                                        wc_printf("<br>");
                                 }
                                wc_printf("</span><span class=\"bttbottom\"></span></span>");
                                wc_printf("</a></dd>\n");
@@ -1165,8 +1161,6 @@ void calendar_day_view(int year, int month, int day) {
        ++tomorrow.day;
        tomorrow = icaltime_normalize(tomorrow);
 
-       wc_printf("<div class=\"fix_scrollbar_bug\">");
-
        /* Inner table (the real one) */
        wc_printf("<table class=\"calendar\" id=\"inner_day\"><tr> \n");
 
@@ -1305,10 +1299,10 @@ void calendar_day_view(int year, int month, int day) {
 
        wc_strftime(d_str, sizeof d_str,
                "<td align=\"center\">"
-               "<font size='+2'>%A</font><br />"
-               "<font size='+2'>%B</font><br />"
-               "<font size='+3'>%d</font><br />"
-               "<font size='+2'>%Y</font><br />"
+               "<font size='+2'>%A</font><br>"
+               "<font size='+2'>%B</font><br>"
+               "<font size='+3'>%d</font><br>"
+               "<font size='+2'>%Y</font><br>"
                "</td>",
                &d_tm
                );
@@ -1326,13 +1320,11 @@ void calendar_day_view(int year, int month, int day) {
        /* End todays-date-with-left-and-right-arrows */
 
        /* Embed a mini month calendar in this space */
-       wc_printf("<br />\n");
+       wc_printf("<br>\n");
        embeddable_mini_calendar(year, month);
 
        wc_printf("</td></tr>");                        /* end stuff-on-the-right */
-
-       wc_printf("</table>"                    /* end of inner table */
-               "</div>");
+       wc_printf("</table>\n");                        /* end of inner table */
 }
 
 
@@ -1427,7 +1419,7 @@ int calendar_summary_view(void) {
                                        if (!all_day_event) {
                                                wc_printf(" (%s)", timestring);
                                        }
-                                       wc_printf("</a><br />\n");
+                                       wc_printf("</a><br>\n");
                                        ++num_displayed;
                                }
                        }