2c4c9d5fee670cac2d67fd57cac606c4d619a1e6 hiram Thu Sep 14 11:00:37 2017 -0700 rework code to eliminate complicated double nested div elements refs #20094 diff --git src/hg/lib/web.c src/hg/lib/web.c index 91069cf..7b31f41 100644 --- src/hg/lib/web.c +++ src/hg/lib/web.c @@ -363,78 +363,72 @@ " <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" " <div class='subheadingBar'><div class='windowSize' id='sectTtl'>" ); htmlTextOut(title); puts(" </div></div>\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" ); } -void webNewSectionHeaderStart(boolean hasTitle) +void webNewSectionHeaderStart() /* Start the header for a new section on the web page. * May be used to maintain table layout without a proper section header */ { webEndSection(); puts("<div>"); puts("<!-- +++++++++++++++++++++ START NEW SECTION +++++++++++++++++++ -->"); 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"); -if (hasTitle) - puts("<div class='subheadingBar'><div class='windowSize'>"); -else - puts("<div>"); +puts("<div class='subheadingBar'>"); } -void webNewSectionHeaderEnd(boolean hasTitle) +void webNewSectionHeaderEnd() /* Properly close header of collapsible section on web page */ { -if (hasTitle) - puts(" </div></div>\n"); -else - puts(" </div>\n"); -puts(" <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' CELLPADDING=0>" +puts(" </div>\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"); } void webNewSection(char* format, ...) /* create a new section on the web page */ { va_list args; va_start(args, format); -webNewSectionHeaderStart(TRUE); +webNewSectionHeaderStart(); vprintf(format, args); -webNewSectionHeaderEnd(TRUE); +webNewSectionHeaderEnd(); va_end(args); } void webNewEmptySection() /* create a new section on the web page to maintain table layout */ { -webNewSectionHeaderStart(FALSE); -webNewSectionHeaderEnd(FALSE); +webNewSectionHeaderStart(); +webNewSectionHeaderEnd(); } void webEndSectionTables() /* Finish with section tables (but don't do /BODY /HTML like * webEnd does. */ { webEndSection(); puts("</TD></TR></TABLE>\n"); } void webEnd() /* output the footer of the HTML page */ { if(!webInTextMode) {