f1b861623af3f6c4ec36c745db34c3a72438ff9f angie Tue Jul 19 09:21:12 2016 -0700 Added new hg.conf setting surveyLabelImage -- if present, then hgGateway will display an <img> with the setting value as src to the right of the GO button. refs #17622 diff --git src/hg/hgGateway/hgGateway.c src/hg/hgGateway/hgGateway.c index 087da55..57d62a2 100644 --- src/hg/hgGateway/hgGateway.c +++ src/hg/hgGateway/hgGateway.c @@ -315,49 +315,55 @@ puts(WARNING_BOX_START "WARNING: This is the UCSC Genome Browser development site. " "This website is used for testing purposes only and is not intended for general public " "use. " UNDER_DEV MAIN_SITE WARNING_BOX_END); } // The visible page elements are all in ./hgGateway.html, which is transformed into a quoted .h // file containing a string constant that we #include and print here (see makefile). puts( #include "hgGateway.html.h" ); -// Set global JS variables hgsid, activeGenomes, surveyLink and surveyLabel at page load time +// Set global JS variables hgsid, activeGenomes, and survey* at page load time // We can't just use "var hgsid = " or the other scripts won't see it -- it has to be // "window.hgsid = ". puts("<script>"); printf("window.%s = '%s';\n", cartSessionVarName(), cartSessionId(cart)); puts("window.activeGenomes ="); printActiveGenomes(); puts(";"); char *surveyLink = cfgOption("survey"); -if (isNotEmpty(surveyLink)) +if (isNotEmpty(surveyLink) && !sameWord(surveyLink, "off")) { - char *surveyLabel = cfgOptionDefault("surveyLabel", "Please take our survey"); printf("window.surveyLink=\"%s\";\n", jsonStringEscape(surveyLink)); + char *surveyLabel = cfgOptionDefault("surveyLabel", "Please take our survey"); printf("window.surveyLabel=\"%s\";\n", jsonStringEscape(surveyLabel)); + char *surveyLabelImage = cfgOption("surveyLabelImage"); + if (isNotEmpty(surveyLabelImage)) + printf("window.surveyLabelImage=\"%s\";\n", jsonStringEscape(surveyLabelImage)); + else + puts("window.surveyLabelImage=null;"); } else { puts("window.surveyLink=null;"); puts("window.surveyLabel=null;"); + puts("window.surveyLabelImage=null;"); } puts("</script>"); puts("<script src=\"../js/es5-shim.4.0.3.min.js\"></script>"); puts("<script src=\"../js/es5-sham.4.0.3.min.js\"></script>"); puts("<script src=\"../js/lodash.3.10.0.compat.min.js\"></script>"); puts("<script src=\"../js/cart.js\"></script>"); webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("jquery.watermarkinput.js", NULL); jsIncludeFile("utils.js",NULL); // Phylogenetic tree .js file, produced by dbDbTaxonomy.pl: char *dbDbTree = cfgOptionDefault("hgGateway.dbDbTaxonomy", "../js/dbDbTaxonomy.js");