3d3f084876b33513ffa9047d3129c71f628b6ebc
chmalee
  Wed Mar 13 16:29:59 2024 -0700
Show hgc details pages in a dialog on hgTracks. Currently under hg.conf
control , refs #33216

diff --git src/hg/js/utils.js src/hg/js/utils.js
index 6fc2364..4dd777a 100644
--- src/hg/js/utils.js
+++ src/hg/js/utils.js
@@ -4229,40 +4229,46 @@
         }
     }
 
     /* Make the ESC key hide tooltips */
     document.body.addEventListener("keyup", (ev) => {
         if (ev.keyCode === 27) {
             clearTimeout(mouseoverTimer);
             hideMouseoverText(mouseoverContainer);
             canShowNewMouseover = true;
         }
     });
 }
 
 function parseUrl(url) {
     // turn a url into some of it's components like server, query-string, etc
-    let protocol, serverName, pathInfo, queryString;
+    let protocol, serverName, pathInfo, queryString, queryArgs = {};
     let temp;
     temp = url.split("?");
     if (temp.length > 1)
         queryString = temp.slice(1).join("?");
     temp = temp[0].split("/");
     protocol = temp[0]; // "https:"
     serverName = temp[2]; // "genome-test.gi.ucsc.edu"
     pathInfo = temp.slice(3).join("/"); // "cgi-bin/hgTracks"
-    return {protocol: protocol, serverName: serverName, pathInfo: pathInfo, queryString: queryString};
+    cgi = pathInfo.startsWith("cgi-bin") ? pathInfo.split('/')[1] : "";
+    let i, s = queryString.split('&');
+    for (i = 0; i < s.length; i++) {
+        argVal = s[i].split('=');
+        queryArgs[argVal[0]] = argVal[1];
+    }
+    return {protocol: protocol, serverName: serverName, pathInfo: pathInfo, queryString: queryString, cgi: cgi, queryArgs: queryArgs};
 }
 
 function dumpCart(seconds, skipNotification) {
     // dump current cart
     let currUrl = parseUrl(window.location.href);
     logUrl = currUrl.protocol + "//" + currUrl.serverName + "/" + currUrl.pathInfo + "?hgsid=" + getHgsid() + "&_dumpCart=" + encodeURIComponent(seconds) + "&skipNotif=" + skipNotification;
     let xmlhttp = new XMLHttpRequest();
     xmlhttp.open("GET", logUrl, true);
     xmlhttp.send();  // sends request and exits this function
 }
 
 function writeToApacheLog(msg) {
     // send msg to web servers error_log
     // first need to figure out what server and CGI we are requesting:
     let currUrl = parseUrl(window.location.href);