aab4f66a2aca5293f3536cc1d1438b17d2b09dfd tdreszer Thu May 5 16:14:15 2011 -0700 A large set of tiny changes. These fix a lot of discrepencies with bgcolor and font color declarations which were tripping up docttype 4.01. diff --git src/hg/lib/web.c src/hg/lib/web.c index ddc0b4d..b2ad53c 100644 --- src/hg/lib/web.c +++ src/hg/lib/web.c @@ -568,47 +568,66 @@ puts(" class=\"topbar\">"); puts(" Help</A> "); } } puts("</font></TD>" "\n" " </TR></TABLE>" "\n" "</TD></TR></TABLE>" "\n" "</TD></TR> " "\n" "" "\n" ); #endif///def TOO_TIMID_FOR_CURRENT_HTML_STANDARDS if(!skipSectionHeader) /* this HTML must be in calling code if skipSectionHeader is TRUE */ { +#ifndef TOO_TIMID_FOR_CURRENT_HTML_STANDARDS + puts( // TODO: Replace nested tables with CSS (difficulty is that tables are closed elsewhere) + "<!-- +++++++++++++++++++++ CONTENT TABLES +++++++++++++++++++ -->" "\n" + "<TR><TD COLSPAN=3>\n" + " <!--outer table is for border purposes-->\n" + " <TABLE WIDTH='100%' BGCOLOR='#" HG_COL_BORDER "' BORDER='0' CELLSPACING='0' CELLPADDING='1'><TR><TD>\n" + " <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='0'><TR><TD>\n" + " <TABLE BGCOLOR='#" HG_COL_HEADER "' BACKGROUND='../images/hr.gif' WIDTH='100%'><TR><TD class='windowSize'>\n" + " <B style='font-size: medium;' id='sectTtl'> " + ); + htmlTextOut(textOutBuf); + + puts( + "</b></TD><TD></TD></TR></TABLE>\n" + " <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' CELLPADDING=0><TR><TH HEIGHT=10></TH></TR>\n" + " <TR><TD WIDTH=10> </TD><TD>\n\n" + ); +#else///ifdef TOO_TIMID_FOR_CURRENT_HTML_STANDARDS puts( "<!-- +++++++++++++++++++++ CONTENT TABLES +++++++++++++++++++ -->" "\n" "<TR><TD COLSPAN=3> " "\n" " <!--outer table is for border purposes-->" "\n" " <TABLE WIDTH=\"100%\" BGCOLOR=\"#"HG_COL_BORDER"\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"1\"><TR><TD> " "\n" " <TABLE BGCOLOR=\"#"HG_COL_INSIDE"\" WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\"><TR><TD> " "\n" " <TABLE BGCOLOR=\"#"HG_COL_HEADER"\" BACKGROUND=\"../images/hr.gif\" WIDTH=\"100%\"><TR><TD class='windowSize'>" "\n" " <FONT SIZE=\"4\" id='sectTtl'><b> " ); htmlTextOut(textOutBuf); puts( "</b></FONT></TD><TD></TD></TR></TABLE>" "\n" " <TABLE BGCOLOR=\"#"HG_COL_INSIDE"\" WIDTH=\"100%\" CELLPADDING=0><TR><TH HEIGHT=10></TH></TR>" "\n" " <TR><TD WIDTH=10> </TD><TD>" "\n" " " "\n" ); +#endif///def TOO_TIMID_FOR_CURRENT_HTML_STANDARDS }; webPushErrHandlers(); /* set the flag */ webHeadAlreadyOutputed = TRUE; } /* static void webStartWrapperDetailedInternal() */ void webStartWrapperDetailedArgs(struct cart *theCart, char *db, char *headerText, char *format, va_list args, boolean withHttpHeader, boolean withLogo, boolean skipSectionHeader, boolean withHtmlHeader) /* output a CGI and HTML header with the given title in printf format */ { char textOutBuf[1024]; va_list argscp; @@ -684,48 +703,67 @@ " </TD><TD WIDTH=15></TD></TR></TABLE>" "\n" // "<BR>" " </TD></TR></TABLE>" "\n" " </TD></TR></TABLE>" "\n" " " ); } void webNewSection(char* format, ...) /* create a new section on the web page */ { va_list args; va_start(args, format); webEndSection(); puts("<!-- +++++++++++++++++++++ START NEW SECTION +++++++++++++++++++ -->"); +#ifndef TOO_TIMID_FOR_CURRENT_HTML_STANDARDS +puts( // TODO: Replace nested tables with CSS (difficulty is that tables are closed elsewhere) + "<BR>\n\n" + " <!--outer table is for border purposes-->\n" + " <TABLE WIDTH='100%' BGCOLOR='#" HG_COL_BORDER "' BORDER='0' CELLSPACING='0' CELLPADDING='1'><TR><TD>\n" + " <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' BORDER='0' CELLSPACING='0' CELLPADDING='0'><TR><TD>\n" + " <TABLE BGCOLOR='#" HG_COL_HEADER "' BACKGROUND='../images/hr.gif' WIDTH='100%'><TR><TD>\n" + " <b style='font-size:medium;'> " +); + +vprintf(format, args); + +puts( + " </b></TD></TR></TABLE>\n" + " <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' CELLPADDING=0><TR><TH HEIGHT=10></TH></TR>\n" + " <TR><TD WIDTH=10> </TD><TD>\n\n" +); +#else///ifdef TOO_TIMID_FOR_CURRENT_HTML_STANDARDS puts( "<BR>" "\n" "" "\n" " <!--outer table is for border purposes-->" "\n" " <TABLE WIDTH=\"100%\" BGCOLOR=\"#"HG_COL_BORDER"\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"1\"><TR><TD> " "\n" " <TABLE BGCOLOR=\"#"HG_COL_INSIDE"\" WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\"><TR><TD> " "\n" " <TABLE BGCOLOR=\"#"HG_COL_HEADER"\" BACKGROUND=\"../images/hr.gif\" WIDTH=\"100%\"><TR><TD>" "\n" " <FONT SIZE=\"4\"><b> " ); vprintf(format, args); puts( " </b></FONT></TD></TR></TABLE>" "\n" " <TABLE BGCOLOR=\"#"HG_COL_INSIDE"\" WIDTH=\"100%\" CELLPADDING=0><TR><TH HEIGHT=10></TH></TR>" "\n" " <TR><TD WIDTH=10> </TD><TD>" "\n" "" "\n" ); +#endif///def TOO_TIMID_FOR_CURRENT_HTML_STANDARDS va_end(args); } void webEndSectionTables() /* Finish with section tables (but don't do /BODY /HTML lik * webEnd does. */ { webEndSection(); puts("</TD></TR></TABLE>\n"); } void webEnd() /* output the footer of the HTML page */ { @@ -1287,67 +1325,67 @@ } void webIncludeHelpFile(char *fileRoot, boolean addHorizLine) /* Given a help file root name (e.g. "hgPcrResult" or "cutters"), * print out the contents of the file. If addHorizLine, print out an * <HR> first. */ { if (addHorizLine) htmlHorizontalLine(); webIncludeFile(hHelpFile(fileRoot)); } void webPrintLinkTableStart() /* Print link table start in our colors. */ { -printf("<TABLE><TR><TD BGCOLOR=#888888>\n"); +printf("<TABLE><TR><TD BGCOLOR='#888888'>\n"); printf("<TABLE CELLSPACING=1 CELLPADDING=3><TR>\n"); } void webPrintLinkTableEnd() /* Print link table end in our colors. */ { printf("</TR></TABLE>\n"); printf("</TD></TR></TABLE>\n"); } void webPrintLinkOutCellStart() /* Print link cell that goes out of our site. End with * webPrintLinkTableEnd. */ { -printf("<TD BGCOLOR=\"#"HG_COL_LOCAL_TABLE"\">"); +printf("<TD BGCOLOR='#" HG_COL_LOCAL_TABLE "'>"); } void webPrintWideCellStart(int colSpan, char *bgColorRgb) /* Print link multi-column cell start in our colors. */ { -printf("<TD BGCOLOR=\"#%s\"", bgColorRgb); +printf("<TD BGCOLOR='#%s'", bgColorRgb); if (colSpan > 1) printf(" COLSPAN=%d", colSpan); printf(">"); } void webPrintLinkCellStart() /* Print link cell start in our colors. */ { webPrintWideCellStart(1, HG_COL_TABLE); } void webPrintLinkCellRightStart() /* Print right-justified cell start in our colors. */ { -printf("<TD BGCOLOR=\"#"HG_COL_TABLE"\" ALIGN=\"right\">"); +printf("<TD BGCOLOR='#"HG_COL_TABLE"' ALIGN='right'>"); } void webPrintLinkCellEnd() /* Print link cell end in our colors. */ { printf("</TD>"); } void webPrintLinkCell(char *link) /* Print link cell in our colors, if links is null, print empty cell */ { webPrintLinkCellStart(); if (link != NULL) puts(link); webPrintLinkCellEnd(); @@ -1360,43 +1398,43 @@ printf("%d", val); webPrintLinkCellEnd(); } void webPrintDoubleCell(double val) /* Print right-justified cell in our colors with two digits to right of decimal. */ { webPrintLinkCellRightStart(); printf("%4.2f", val); webPrintLinkCellEnd(); } void webPrintWideLabelCell(char *label, int colSpan) /* Print label cell over multiple columns in our colors. */ { -printf("<TD BGCOLOR=\"#"HG_COL_TABLE_LABEL"\""); +printf("<TD BGCOLOR='#"HG_COL_TABLE_LABEL"'"); if (colSpan > 1) printf(" COLSPAN=%d", colSpan); -printf("><FONT COLOR=\"#FFFFFF\"><B>%s</B></FONT></TD>", label); +printf("><span style='color:#FFFFFF;'><B>%s</B></spanT></TD>", label); } void webPrintWideCenteredLabelCell(char *label, int colSpan) /* Print label cell over multiple columns in our colors and centered. */ { -printf("<TD BGCOLOR=\"#"HG_COL_TABLE_LABEL"\""); +printf("<TD BGCOLOR='#" HG_COL_TABLE_LABEL "'"); if (colSpan > 1) printf(" COLSPAN=%d", colSpan); -printf("><CENTER><FONT COLOR=\"#FFFFFF\"><B>%s</B></FONT></CENTER></TD>", label); +printf("><CENTER><span style='color:#FFFFFF;'><B>%s</B></span></CENTER></TD>", label); } void webPrintLabelCell(char *label) /* Print label cell in our colors. */ { webPrintWideLabelCell(label, 1); } void webPrintLinkTableNewRow() /* start a new row */ { printf("</TR>\n<TR>"); } void finishPartialTable(int rowIx, int itemPos, int maxPerRow,