b508259e8ce75a2aa1f919b8152befea99a2e1df
chmalee
  Fri Jan 27 10:31:59 2023 -0800
Prototype download track data button. An hg.conf controlled button that
allows users to download all of the track data in the current window
without leaving hgTracks, refs #30024

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 53455cf..1d50fed 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -8245,30 +8245,34 @@
 hButtonWithMsg("hgTracksConfigPage", "configure","Configure image and track selection");
 hPrintf(" ");
 
 if (!multiRegionButtonTop)
     {
     printMultiRegionButton();
     hPrintf(" ");
     }
 hButtonMaybePressed("hgt.toggleRevCmplDisp", "reverse",
                        revCmplDisp ? "Show forward strand at this location"
                                    : "Show reverse strand at this location",
                        NULL, revCmplDisp);
 hPrintf(" ");
 
 hButtonWithOnClick("hgt.setWidth", "resize", "Resize image width to browser window size", "hgTracksSetWidth()");
+
+// put the track download interface behind hg.conf control
+if (cfgOptionBooleanDefault("showDownloadUi", FALSE))
+    jsInline("var showDownloadButton = true;\n");
 }
 
 void doTrackForm(char *psOutput, struct tempName *ideoTn)
 /* Make the tracks display form with the zoom/scroll buttons and the active
  * image.  If the ideoTn parameter is not NULL, it is filled in if the
  * ideogram is created.  */
 {
 struct group *group;
 struct track *track;
 char *freezeName = NULL;
 boolean hideAll = cgiVarExists("hgt.hideAll");
 boolean hideTracks = cgiOptionalString( "hideTracks") != NULL;
 boolean defaultTracks = cgiVarExists("hgt.reset");
 boolean showedRuler = FALSE;
 boolean showTrackControls = cartUsualBoolean(cart, "trackControlsOnMain", TRUE);