2f73d7595b0e37b159e9c9355f8e99512bf37e81
max
  Wed Sep 10 08:33:03 2025 -0700
Merging Jim Robinsons code into the kent tree. Due to whitespace changes in his IDE, I'm merging this manually.
The original code is at https://github.com/igvteam/ucsc_dev/. changes up to 48816bc are included.
Also adding an API call to get the 2bit file and code to use it.

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index a724f2aee1d..d71bc43be43 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -8616,32 +8616,41 @@
     {
     printMultiRegionButton();
     hPrintf(" ");
     }
 hButtonMaybePressed("hgt.toggleRevCmplDisp", "Reverse",
                        revCmplDisp ? "Show forward strand at this location - keyboard shortcut: r, then v"
                                    : "Show reverse strand at this location - keyboard shortcut: r, then v",
                        NULL, revCmplDisp);
 hPrintf(" ");
 
 hButtonWithOnClick("hgt.setWidth", "Resize", "Resize image width to browser window size - keyboard shortcut: r, then s", "hgTracksSetWidth()");
 
 // put the track download interface behind hg.conf control
 if (cfgOptionBooleanDefault("showDownloadUi", TRUE))
     jsInline("var showDownloadButton = true;\n");
+
+// remove the hg.conf option once this feature is released
+if (cfgOptionBooleanDefault("showIgv", FALSE))
+    {
+    puts(" <button id='hgtIgv' type='button' "
+            "title='Add an IGV.js window below the UCSC Browser, to open files from "
+            "your local harddisk or server' >Add IGV Tracks</button>");
+    //jsInline("document.getElementById('hgtIgv').addEventListener('click', onIgvClick);");
     }
 
+}
 
 #ifdef NOTNOW
 static void printAliases(char *name)
 /* Print out the aliases for this sequence. */
 {
 struct slName *names = chromAliasFindAliases(name);
 
 printf("<div id='aliases'><a title='");
 for(;names; names = names->next)
     printf("%s;",names->name);
 printf("'>Aliases</a></div>");
 }
 #endif
 
 
@@ -11523,30 +11532,37 @@
     jsIncludeFile("jquery.watermarkinput.js", NULL);
     if(!searching)
         {
         jsIncludeFile("jquery.history.js", NULL);
         jsIncludeFile("jquery.imgareaselect.js", NULL);
         }
     jsIncludeFile("autocomplete.js", NULL);
     jsIncludeFile("es5-shim.4.0.3.min.js", NULL);
     jsIncludeFile("es5-sham.4.0.3.min.js", NULL);
     jsIncludeFile("lodash.3.10.0.compat.min.js", NULL);
     jsIncludeFile("autocompleteCat.js", NULL);
     jsIncludeFile("hgTracks.js", NULL);
     jsIncludeFile("hui.js", NULL);
     jsIncludeFile("spectrum.min.js", NULL);
 
+    // remove the hg.conf option once this feature is released
+    if (cfgOptionBooleanDefault("showIgv", FALSE))
+        {
+        jsIncludeFile("igv.min.js", NULL);
+        jsIncludeFile("igvFileHelper.js", NULL);
+        }
+
 #ifdef LOWELAB
     jsIncludeFile("lowetooltip.js", NULL);
 #endif///def LOWELAB
 
     webIncludeResourceFile("spectrum.min.css");
     webIncludeResourceFile("jquery-ui.css");
     if (enableMouseOver)
       webIncludeResourceFile("mouseOver.css");
 
     if (!searching)     // NOT doing search
         {
         webIncludeResourceFile("jquery.contextmenu.css");
         jsIncludeFile("jquery.contextmenu.js", NULL);
         webIncludeResourceFile("ui.dropdownchecklist.css");
         jsIncludeFile("ui.dropdownchecklist.js", NULL);