078fcca1d679a770b100f71cfcd514b412f1e88d kent Thu Jan 28 17:50:06 2021 -0800 Commenting and cleaning up code. Making it only show 10 things in a facet by default. diff --git src/hg/hgFacetedBars/hgFacetedBars.c src/hg/hgFacetedBars/hgFacetedBars.c index 9509be2..613821d 100644 --- src/hg/hgFacetedBars/hgFacetedBars.c +++ src/hg/hgFacetedBars/hgFacetedBars.c @@ -13,108 +13,111 @@ #include "udc.h" #include "knetUdc.h" #include "genbank.h" #include "tablesTables.h" /* Global Variables */ struct cart *cart; /* CGI and other variables */ struct hash *oldVars = NULL; char *database = NULL; char *genome = NULL; void doBody() { struct sqlConnection *conn = sqlConnect(database); struct hash *emptyHash = hashNew(0); + +/* Write out html to pull in the other files we use. */ webIncludeResourceFile("facets.css"); printf("\t\t"); printf("\t\t\n" "\n" "\t\t\n" "\t\t\n" "\n" "\t\t\n" "\t\t\n" ); - +/* Working within a form we save context */ printf("
\n"); hashFree(&emptyHash); sqlDisconnect(&conn); } void doMiddle(struct cart *theCart) /* Set up globals and make web page */ { +/* Set some major global variable and attach us to current genome and DB. */ cart = theCart; getDbAndGenome(cart, &database, &genome, oldVars); initGenbankTableNames(database); +/* Set udcTimeout from cart */ int timeout = cartUsualInt(cart, "udcTimeout", 300); if (udcCacheTimeout() < timeout) udcSetCacheTimeout(timeout); knetUdcInstall(); +/* Wrap http/html text around main routine */ htmStart(stdout, "hgFacetedBars"); - doBody(); - htmEnd(stdout); - -#ifdef OLD -cartWebStart(cart, database, "A stand alone to show a faceted barchart selection."); -printf("Your code goes here...."); -cartWebEnd(); -#endif /* OLD */ } /* Null terminated list of CGI Variables we don't want to save * permanently. */ char *excludeVars[] = {"Submit", "submit", NULL,}; int main(int argc, char *argv[]) /* Process command line. */ { cgiSpoof(&argc, argv); cartEmptyShell(doMiddle, hUserCookie(), excludeVars, oldVars); return 0; }