e47907296621d97a9d893556b3fb78ad4cbcc14b angie Fri Jun 14 11:19:21 2013 -0700 Libifying a javascript trick to detect that the back button has been pressed, and reload the page to redraw with the latest cart vars. refs #6152 diff --git src/hg/lib/jsHelper.c src/hg/lib/jsHelper.c index 9bbe544..07f834f 100644 --- src/hg/lib/jsHelper.c +++ src/hg/lib/jsHelper.c @@ -466,30 +466,53 @@ void jsBeginCollapsibleSection(struct cart *cart, char *track, char *section, char *sectionTitle, boolean isOpenDefault) /* Make the hidden input, collapse/expand button and needed for utils.js's * setTableRowVisibility(). Caller needs to have already created a and . */ { jsBeginCollapsibleSectionFontSize(cart, track, section, sectionTitle, isOpenDefault, "larger"); } void jsEndCollapsibleSection() /* End the collapsible . */ { puts(""); } +void jsReloadOnBackButton(struct cart *cart) +/* Add some javascript to detect that the back button (or reload) has been pressed, + * and to resubmit in that case to redraw the page with the latest cart contents. */ +// __detectback trick from +// http://siphon9.net/loune/2009/07/detecting-the-back-or-refresh-button-click/ +// Yes, I know this along with every other inline \n", cgiScriptName(), cartSidUrlString(cart)); +} + static struct jsonElement *newJsonElement(jsonElementType type) // generic constructor for a jsonElement; callers fill in the appropriate value { struct jsonElement *ele; AllocVar(ele); ele->type = type; return ele; } struct jsonElement *newJsonString(char *str) { struct jsonElement *ele = newJsonElement(jsonString); ele->val.jeString = cloneString(str); return ele; }