ab47b1a355db4af04610515c1dab0371108f4fc1 max Fri Nov 5 17:31:10 2021 -0700 fixing ON/OFF thing again, wording and make window closable, refs #28324 diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c index 7caeb9b..fadb73a 100644 --- src/hg/hgHubConnect/hgHubConnect.c +++ src/hg/hgHubConnect/hgHubConnect.c @@ -439,55 +439,55 @@ "Hub error checking will always refresh the files and never use our remote file cache (see below)." "</div>\n " ); puts("</div>"); // .tabSection puts("<div class='tabSection'>"); puts("<h4>Enable Genome Browser debugging modes</h4>"); puts("<div class='help'>These apply to all connected hubs. By default, caching is activated and track load times are not shown, but you can change these settings while developing your hub:</div>"); puts("<div style='margin-left: 15px'>"); puts("<FORM ACTION='hgHubConnect#hubDeveloper' METHOD='POST' NAME='debugForm'>"); // output the udcTimeout button char *noCacheLabel = "Inactive, never cache"; char *timeout = "5"; char *cacheStatus = "ON"; -char *description = "Do not cache contents at UCSC and always load them from the source server. This means that data access is slower, but you can see the effect of changes to your files immediately on the Genome Browser."; +char *description = "The current status always caches contents at UCSC. This means that data access is faster, but you cannot see the effect of changes to your files on the Genome Browser for at least 5 minutes."; if (cartNonemptyString(cart, "udcTimeout")) { noCacheLabel = "Active, always cache"; timeout = ""; cacheStatus = "OFF"; - description = "Always cache contents at UCSC. This means that data access is faster, but you cannot see the effect of changes to your files on the Genome Browser for at least 5 minutes."; + description = "The current status does not cache contents at UCSC and always load them from the source server. This means that data access is slower, but you can see the effect of changes to your files immediately on the Genome Browser."; } printf("<b style='font-size:90%%'>File caching: %s</b> ", cacheStatus); printf("<button type='submit' name='udcTimeout' value='%s'>Change to: %s</button>", timeout, noCacheLabel); printf("<div class='help'>%s<br>", description); puts("For custom tracks, this affects only the remote formats (bigBed, bigWig, tabix, BAM, CRAM, etc), not text files (BED, PSL, etc), which are stored at UCSC.</div>"); // output the measureTiming button char *timeLabel = "Show timings"; char *timeVal = "on"; -char *timeDesc = "Shows loading time in milliseconds for each track, to help debug performance problems."; -char *timeStatus = "ON"; +char *timeDesc = "Show no timing measurements."; +char *timeStatus = "OFF"; if (cartNonemptyString(cart, "measureTiming")) { timeLabel = "Hide timings"; timeVal = ""; - timeDesc = "Hide timing measurements."; - timeStatus = "OFF"; + timeDesc = "Shows loading time in milliseconds for each track, to help debug performance problems."; + timeStatus = "ON"; } printf("<b style='font-size:90%%'>Load times: %s</b> ", timeStatus); printf("<button type='submit' name='measureTiming' value='%s'>Change to: %s</button>", timeVal, timeLabel); printf("<div class='help'>%s</div>", timeDesc); puts("</div>"); // margin-left puts("</div>"); // tabSection puts("</div>"); // #hubDeveloper jsOnEventById("click", "hubValidateButton", "makeIframe(event)"); } void printSearchAndFilterBoxes(int searchEnabled, char *hubSearchTerms, char *dbFilter) @@ -1461,31 +1461,33 @@ ); jsIncludeFile("utils.js", NULL); jsIncludeFile("jquery-ui.js", NULL); webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("ajax.js", NULL); jsIncludeFile("hgHubConnect.js", NULL); webIncludeResourceFile("hgHubConnect.css"); jsIncludeFile("jquery.cookie.js", NULL); jsIncludeFile("spectrum.min.js", NULL); // there is no color picker used anywhere on this page. why include this? } void doMiddle(struct cart *theCart) /* Write header and body of html page. */ { cart = theCart; -measureTiming = cartUsualBoolean(cart, "measureTiming", FALSE); +// hgHubConnect's own timing is tied to a special value of measureTiming, since now +// our users use measureTiming a lot more, we need to keep a special mode for us +measureTiming = sameString(cartUsualString(cart, "measureTiming", "full"), "full"); if(cgiIsOnWeb()) checkForGeoMirrorRedirect(cart); if (cartVarExists(cart, hgHubDoClear)) { doClearHub(cart); cartWebEnd(); return; } if (cartVarExists(cart, hgHubCheckUrl)) { doResetHub(cart); } @@ -1504,39 +1506,39 @@ puts("<html>"); puts("<body>"); puts("<link rel='stylesheet' href='../style/HGStyle.css' type='text/css'>"); printIncludes(); jsInline("trackData = [];\n"); char *hubUrl = cartOptionalString(cart, "validateHubUrl"); jsInline("document.body.style.margin = 0;\n"); // simulate the look and feel of a dialog window with a blue bar at the top puts("<div id='titlebar' style='background: #D9E4F8; border: 1px outset #000088; padding: 10px'>" "<span id='title' style='font-weight: bold; margin: .2em 0 .1em; color: #000088'>Hub Check</span>" "<a href='#' id='windowX' style='float: right' class='ui-dialog-titlebar-close ui-corner-all ui-state-hover' role='button'>" "<span class='ui-icon ui-icon-closethick'>close</span></a></div>"); puts("<div id='content' style='margin:10px; padding: 2px'>"); + jsOnEventByIdF("click", "windowX", "closeIframe()"); if (isEmpty(hubUrl)) printf("Please wait, loading and checking hub, this can take 15 seconds to several minutes."); else { puts("<p><button id='reloadButton'>Check again</button>"); puts(" <button id='closeButton'>Close this window</button></p>"); jsOnEventByIdF("click", "reloadButton", "reloadIframe()"); jsOnEventByIdF("click", "closeButton", "closeIframe()"); - jsOnEventByIdF("click", "windowX", "closeIframe()"); printf("<div>Finished checking %s</div>", hubUrl); doValidateNewHub(hubUrl); puts("<p>Our command line tool <a target=_blank href='https://hgdownload.soe.ucsc.edu/downloads.html#utilities_downloads'>hubCheck</a> " "can be used to obtain the same output from a Unix command line.</p>"); } puts("</div>"); // margin 10px puts("</div>"); // ui-dialog-titlebar puts("</div>"); // ui-dialog cartWebEnd(); return; } cartWebStart(cart, NULL, "%s", pageTitle);