09f26ed9a7dcc52b03b4d3e5b2f97c5177cd9334 max Mon Sep 21 06:00:40 2026 -0700 Drop the ${hgsid} trackDb variable; add session ids to links in the browser instead A description page's links can carry the session id without the page itself holding one. addHgsidToLinks() in utils.js walks the rendered page and appends hgsid to every that stays on this host and points into the same cgi-bin directory: a relative CGI link gets one, a static .html, a link to another host, a mailto and a plain #anchor do not, and a link that already names a session is left alone. hgc and hgTrackUi call it through a new jsAddHgsidToLinks(), and hgTracks.js calls it on the track description popup once the ajax content is in. A link written with a literal $hgsid is rewritten rather than skipped, so the description pages already deployed in the GenArk hubs work again. hVarSubst no longer knows about hgsid: it is out of the trackDb variable list, so hVarSubstTrackDbHtml is a hub-only pass again and needs no cart, and hVarSubstWithCart and webIncludeHelpFileSubst, which existed only to resolve it, are gone. The variable is taken out of the trackDb README and out of the twenty-odd description pages that used it. refs #38380 diff --git src/hg/inc/web.h src/hg/inc/web.h index 0e8e29b58fe..e4e152e44ab 100644 --- src/hg/inc/web.h +++ src/hg/inc/web.h @@ -1,410 +1,405 @@ /* web.c - some functions to output HTML code */ /* Copyright (C) 2014 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #ifndef WEB_H #define WEB_H #include "cart.h" #include "dbDb.h" void webSetStyle(char *style); /* set a style to add to the header */ void webStartText(); /* output the head for a text page */ void webStart(struct cart *theCart, char *db, char* format,...) /* output a CGI and HTML header with the given title in printf format */ #if defined(__GNUC__) __attribute__((format(printf, 3, 4))) #endif ; void webStartHeader(struct cart *theCart, char *db, char *header, char* format,...) /* output a CGI and HTML header with the given title in printf format */ #if defined(__GNUC__) __attribute__((format(printf, 4, 5))) #endif ; void webStartWrapper(struct cart *theCart, char *db, char *format, va_list args, boolean withHttpHeader, boolean withLogo); /* output a CGI and HTML header with the given title in printf format */ void webStartWrapperDetailedArgs(struct cart *theCart, char *db, char *headerText, char *format, va_list args, boolean withHttpHeader, boolean withLogo, boolean skipSectionHeader, boolean withHtmlHeader); /* output a CGI and HTML header with the given title in printf format with * quite a few options. See also next: */ void webStartWrapperDetailedNoArgs(struct cart *theCart, char *db, char *headerText, char *format, boolean withHttpHeader, boolean withLogo, boolean skipSectionHeader, boolean withHtmlHeader); /* output a CGI and HTML header with the given title in printf format with * quite a few options. Same as above without va_list args */ void webPragmasEtc(); /* Print out stuff that tells people not to cache us, and that we use the * usual character set and scripting langauge. (Normally done by webStartWrap) */ void webCirmPragmasEtc(); /* Print out stuff similar to webPragmasEtc (don't cache us, character set, etc.), but * use values appropriate for a more modern website (like CIRM). */ void webStartSectionTables(); /* Put up start of nepharious table layout stuff. (Normally done by webStartWrap). */ void webFirstSection(char *title); /* Put up the first section (normally done by webStartWrap). */ void webNewHiddenSection(char* format, ...) /* create a new hidden section on the web page */ #if defined(__GNUC__) __attribute__((format(printf, 1, 2))) #endif ; void webNewSection(char* format, ...) /* create a new section on the web page */ #if defined(__GNUC__) __attribute__((format(printf, 1, 2))) #endif ; void webNewEmptySection(); /* create a new section on the web page to maintain table layout */ void webNewSectionHeaderStart(); /* Start a new collapsible section on the web page, with +- control. Allows use of jsBeginCollapsibleSection() */ void webNewSectionHeaderEnd(); /* Properly close header of collapsible section on web page */ void webEnd(); /* output the footer of the HTML page */ void webEndExtra(char *footer); /* output the footer of the HTML page with extra endText as desired */ void webEndSection(); /* Close down a section */ void webEndSectionTables(); /* Finish with section tables (but don't do /BODY /HTML lik * webEnd does. */ void webStartGbNoBanner(struct cart *cart, char *db, char *title); /* Start HTML with new header and footer design by jWest, but no banner */ void webEndGb(); /* End HTML that was started with webStartJWest. */ void webStartJWest(struct cart *cart, char *db, char *title); /* Start HTML with new banner design by jWest (with modifications). */ void webEndJWest(); /* End HTML that was started with webStartJWest/ */ void webVaWarn(char *format, va_list args); /* Warning handler that closes off web page. */ boolean webGotWarnings(); /* Return TRUE if webVaWarn has been called. */ void webAbortNoHttpHeader(char* title, char* format, ...) /* an abort function that outputs a error page. No http header output. */ #if defined(__GNUC__) __attribute__((format(printf, 2, 3))) #endif ; void webAbort(char* title, char* format, ...) /* an abort function that outputs a error page */ #if defined(__GNUC__) __attribute__((format(printf, 2, 3))) #endif ; void printCladeListHtml(char *genome, char *event, char *javascript); /* Make an HTML select input listing the clades. */ void printGenomeListHtml(char *db, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list * containing a list of the possible genomes to choose from. * param db - a database whose genome will be the default genome. * If NULL, no default selection. * param event e.g. "change" * javascript - Optional (can be NULL) onEvent javascript. */ void printBlatGenomeListHtml(char *db, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list * containing a list of the possible genomes to choose from. * param db - a database whose genome will be the default genome. * If NULL, no default selection. * param event e.g. "change" * javascript - Optional (can be NULL) onEvent javascript. */ void printLiftOverGenomeList(char *customOrgCgiName, char *db, struct dbDb *dbList, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list * containing a list of the possible genomes to choose from. * Databases in dbList do not have to exist. * param db - a database whose genome will be the default genome. * If NULL, no default selection. * param event e.g. "change" * javascript - Optional (can be NULL) onEvent javascript. */ void printSomeGenomeListHtmlNamed(char *customOrgCgiName, char *db, struct dbDb *dbList, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list * containing a list of the possible genomes to choose from. * param db - a database whose genome will be the default genome. * If NULL, no default selection. * param event e.g. "change" * javascript - Optional (can be NULL) onEvent javascript. */ void printSomeGenomeListHtml(char *db, struct dbDb *dbList, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list * containing a list of the possible genomes to choose from. * param db - a database whose genome will be the default genome. * If NULL, no default selection. * param event e.g. "change" * javascript - Optional (can be NULL) onEvent javascript. */ void printGenomeListForCladeHtml(char *db, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list containing * a list of the possible genomes from selOrganism's clade to choose from. * selOrganism is the default for the select. */ void webPushErrHandlers(); /* Push warn and abort handler for errAbort(). */ void webPushErrHandlersCartDb(struct cart *cart, char *db); /* Push warn and abort handler for errAbort(); save cart and db for use in handlers. */ void webPopErrHandlers(); /* Pop warn and abort handler for errAbort(). */ void printAssemblyListHtml(char *db, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list containing a list of the possible assemblies to choose from. param curDb - The assembly (the database name) to choose as selected. If NULL, no default selection. */ void printAssemblyListHtmlExtra(char *db, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list containing a list of the possible assemblies to choose from. param curDb - The assembly (the database name) to choose as selected. If NULL, no default selection. param javascript - The javascript text for the select box */ void printSomeAssemblyListHtml(char *db, struct dbDb *dbList, char *event, char *javascript); /* Find all assemblies from the list that are active, and print * HTML to render dropdown list * param db - default assembly. If NULL, no default selection */ void printSomeAssemblyListHtmlNamed(char *name, char *db, struct dbDb *dbList, char *onChangeText); /* Find all assemblies from the list that are active, and print * HTML to render dropdown list * param db - default assembly. If NULL, no default selection */ void printAllAssemblyListHtmlParm(char *db, struct dbDb *dbList, char *dbCgi, bool allowInactive, char *event, char *javascript); /* Prints to stdout the HTML to render a dropdown list containing the list * of assemblies for the current genome to choose from. By default, * this includes only active assemblies with a database (with the * exception of the default assembly, which will be included even * if it isn't active). * param db - The default assembly (the database name) to choose as selected. * If NULL, no default selection. * param allowInactive - if set, print all assemblies for this genome, * even if they're inactive or have no database */ void printSomeAssemblyListHtmlParm(char *db, struct dbDb *dbList, char *dbCgi, char *event, char *javascript); /* Find all the assemblies from the list that are active. Prints to stdout the HTML to render a dropdown list containing the list of the possible assemblies to choose from. param db - The default assembly (the database name) to choose as selected. If NULL, no default selection. */ void printBlatAssemblyListHtml(char *curDb); /* Prints to stdout the HTML to render a dropdown list containing a list of the possible assemblies to choose from that have blat servers available. param curDb - The assembly (the database name) to choose as selected. If NULL, no default selection. */ char *getCurrentGenomeLabel(char *db); /* Construct a label from dbDb (or dbDb related for an assembly hub) for the currently * selected genome */ void printGenomeSearchBar(char *id, char *placeholder, char *classStr, boolean withSearchButton, char *labelText, char *labelClassStr); /* Prints an input text box that can be used to search for any genome. * param withSearchButton - controls if there is a button next to the bar * to manually fire the search * param classStr - if desired, a custom class name or string can be used * otherwise the default styling of 'genomeSearchBarDefault' is applied via HGStyle.css * param labelText - If not empty, put up a