1f0b23fe45c8fd5c2a6e2416dbc864f8f6cbf9ab gperez2 Sun May 4 22:13:34 2025 -0700 Edits to hgGateway.c and hgGateway.js following Jairo's code review feedback, #35591 diff --git src/hg/hgGateway/hgGateway.c src/hg/hgGateway/hgGateway.c index e5cd235920a..861baac32c0 100644 --- src/hg/hgGateway/hgGateway.c +++ src/hg/hgGateway/hgGateway.c @@ -21,31 +21,30 @@ #include "htmshell.h" #include "hubConnect.h" #include "hui.h" #include "jsHelper.h" #include "jsonParse.h" #include "obscure.h" // for readInGulp #include "regexHelper.h" #include "suggest.h" #include "trackHub.h" #include "web.h" #include "botDelay.h" #include "genark.h" #include "assemblyList.h" #include - /* Global Variables */ struct cart *cart = NULL; /* CGI and other variables */ struct hash *oldVars = NULL; /* Old contents of cart before it was updated by CGI */ static boolean issueBotWarning = FALSE; static int measureTiming = 0; static long enteredMainTime = 0; #define SEARCH_TERM "hggw_term" static char *maybeGetDescriptionText(char *db) /* Slurp the description.html file for db into a string (if possible, don't die if * we can't read it) and return it. */ { struct errCatch *errCatch = errCatchNew(); @@ -400,38 +399,39 @@ webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("jquery.watermarkinput.js", NULL); jsIncludeFile("autocompleteCat.js",NULL); jsIncludeFile("utils.js",NULL); // Phylogenetic tree .js file, produced by dbDbTaxonomy.pl: char *defaultDbDbTree = webTimeStampedLinkToResource("dbDbTaxonomy.js", FALSE); char *dbDbTree = cfgOptionDefault("hgGateway.dbDbTaxonomy", defaultDbDbTree); if (isNotEmpty(dbDbTree)) printf("\n", dbDbTree); // Main JS for hgGateway: jsIncludeFile("hgGateway.js", NULL); -// Shepherd.js CSS - fine to load this synchronously +if (cfgOptionBooleanDefault("showTutorial", TRUE)) + { puts(""); + puts(""); + jsIncludeFile("gatewayTutorial.js", NULL); -// Shepherd.js script (load async + defer) -puts(""); - -// Load Gateway tutorial -puts(""); + if (sameOk(cgiOptionalString("startTutorial"), "true")) + jsInline("var startTutorialOnLoad = true;"); + } #define TIMING_WARNING_BOX_START "
" \ "
" #define TIMING_WARNING_BOX_END "
" if (measureTiming) { printf("%selapsed time %ld ms (%d ms bottleneck)%s\n", TIMING_WARNING_BOX_START, clock1000() - enteredMainTime, botDelayMillis, TIMING_WARNING_BOX_END); } webIncludeFile("inc/jWestFooter.html"); cartFlushHubWarnings(); webEndJWest();