515b0b20ea8069cc1892817c3a82aacbe9db9c68
larrym
  Wed Aug 4 11:27:59 2010 -0700
add support for ajax option (serves up stripped down html)
diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c
index 389b0cc..fe6a947 100644
--- src/hg/hgTrackUi/hgTrackUi.c
+++ src/hg/hgTrackUi/hgTrackUi.c
@@ -2409,7 +2409,7 @@
 }
 
 
-void trackUi(struct trackDb *tdb, struct customTrack *ct)
+void trackUi(struct trackDb *tdb, struct customTrack *ct, boolean ajax)
 /* Put up track-specific user interface. */
 {
 jsIncludeFile("jquery.js", NULL);
@@ -2442,6 +2442,9 @@
 #ifdef BIG_UI_NAV_LINKS
 printf("<B style='font-family:serif; font-size:200%%;'>%s%s</B>\n", tdb->longLabel, tdbIsSuper(tdb) ? " Tracks" : "");
 #else///ifndef BIG_UI_NAV_LINKS
+if(ajax)
+    printf("<p><b>%s%s</b></p>\n", tdb->longLabel, tdbIsSuper(tdb) ? " Tracks" : "");
+else
 printf("<H1>%s%s</H1>\n", tdb->longLabel, tdbIsSuper(tdb) ? " Tracks" : "");
 #endif///ndef BIG_UI_NAV_LINKS
 
@@ -2563,6 +2566,10 @@
 	hFreeConn(&conn);
 	}
     }
+
+if(ajax)
+    return;
+
 if (tdb->html != NULL && tdb->html[0] != 0)
     {
     htmlHorizontalLine();
@@ -2679,13 +2686,19 @@
         }
     }
 char *title = (tdbIsSuper(tdb) ? "Super-track Settings" : "Track Settings");
+if(cartOptionalString(cart, "ajax"))
+    // html is going to be used w/n a dialog in hgTracks.js so serve up stripped down html
+    trackUi(tdb, ct, TRUE);
+else
+    {
 cartWebStart(cart, database, "%s %s", tdb->shortLabel, title);
-trackUi(tdb, ct);
+    trackUi(tdb, ct, FALSE);
 printf("<BR>\n");
 webEnd();
 }
+}
 
-char *excludeVars[] = { "submit", "Submit", "g", NULL,};
+char *excludeVars[] = { "submit", "Submit", "g", NULL, "ajax", NULL,};
 
 int main(int argc, char *argv[])
 /* Process command line. */