6a13f35fee8b9e5551d6d582814488c516ac5ab3
angie
  Mon Apr 23 09:06:25 2012 -0700
Feature #1652 (Variant Annotation Tool): First draft of UI: mostactions trigger an ajax call that sends a JSON description of the
query (and what changed); the response is a JSON description of one
or more page sections, with new HTML content to reflect the change.
There is a lot of code lifted verbatim from hgTables that I intend
to libify when the dust settles a bit (search for "verbatim").
Things that work: group -> track -> table selection; reordering
updates notion of which source is primary (needed for filters);
removed sections are reset, and newly displayed sections always appear
at bottom; all buttons do something, even if it's not yet useful.  :)
To do: query execution, position input, output format change handling,
output field selection, and filters.

diff --git src/hg/lib/web.c src/hg/lib/web.c
index 0e4eb1a..24d24dc 100644
--- src/hg/lib/web.c
+++ src/hg/lib/web.c
@@ -425,30 +425,31 @@
 	    "<li>Take me back to <a href=\"%s\">%s</a>"
 	    "</li>"
 	    "</ul>"
 	    "</div>"
 	    "</TD></TR>\n"
 	    , domain, newUri, source );
 	}
     }
 
 if(!skipSectionHeader)
 /* this HTML must be in calling code if skipSectionHeader is TRUE */
     {
     puts(        // TODO: Replace nested tables with CSS (difficulty is that tables are closed elsewhere)
          "<!-- +++++++++++++++++++++ CONTENT TABLES +++++++++++++++++++ -->" "\n"
          "<TR><TD COLSPAN=3>\n"
+	 "<div id=firstSection>"
          "      <!--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"
          "     <div class='subheadingBar'><div class='windowSize' id='sectTtl'>"
          );
     htmlTextOut(textOutBuf);
 
     puts(
          "     </div></div>\n"
          "     <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' CELLPADDING=0><TR><TH HEIGHT=10></TH></TR>\n"
          "     <TR><TD WIDTH=10>&nbsp;</TD><TD>\n\n"
          );
     };
 webPushErrHandlers();
 /* set the flag */
@@ -525,39 +526,41 @@
 webStartWrapperGatewayHeader(theCart, db, headerText, format, args, TRUE, TRUE,
 			     FALSE);
 va_end(args);
 }
 
 static void webEndSection()
 /* Close down a section */
 {
 puts(
     "" "\n"
     "	</TD><TD WIDTH=15></TD></TR></TABLE>" "\n"
 //    "<BR>"
     "	</TD></TR></TABLE>" "\n"
     "	</TD></TR></TABLE>" "\n"
     "	" );
+puts("</div>");
 }
 
 void webNewSection(char* format, ...)
 /* create a new section on the web page */
 {
 va_list args;
 va_start(args, format);
 
 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"
     "     <div class='subheadingBar' class='windowSize'>"
 );
 
 vprintf(format, args);
 
 puts(
     "     </div>\n"
     "     <TABLE BGCOLOR='#" HG_COL_INSIDE "' WIDTH='100%' CELLPADDING=0><TR><TH HEIGHT=10></TH></TR>\n"
     "     <TR><TD WIDTH=10>&nbsp;</TD><TD>\n\n"