e3bf2345348955e44ee5d7d5be325162f0b4475f chmalee Tue Aug 29 09:24:13 2023 -0700 Fix notification box setup for udcTimeout messages, refs #32045 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 2810209..0d4eb56 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -10995,38 +10995,36 @@ // Add region only if it is not already in the existing highlight setting. char *alreadyIn = strstr(existing, newHighlight); int len = strlen(newHighlight); if (! (alreadyIn && (alreadyIn[len] == '|' || alreadyIn[len] == '\0'))) { struct dyString *dy = dyStringCreate("%s|%s", newHighlight, existing); cartSetString(cart, "highlight", dy->string); } } else cartSetString(cart, "highlight", newHighlight); cartRemove(cart, "addHighlight"); } } -void notify (char *msg) +void notify (char *msg, char *msgId) /* print a message into a hidden DIV tag, and call Javascript to move the DIV under the * tableHeaderForm element and un-hide it. Less obtrusive than a warn() message but still hard to miss. */ { -puts("<div style='display:none' id='notifBox'>"); -puts(msg); -puts("</div>"); -jsInline("notifBoxShow();\n"); +jsInlineF("notifBoxSetup(\"hgTracks\", \"%s\", \"%s\");\n", msgId, msg); +jsInlineF("notifBoxShow(\"hgTracks\", \"%s\");\n", msgId); } extern boolean issueBotWarning; void doMiddle(struct cart *theCart) /* Print the body of an html file. */ { cart = theCart; measureTiming = hPrintStatus() && isNotEmpty(cartOptionalString(cart, "measureTiming")); if (measureTiming) measureTime("Startup (bottleneck delay %d ms, not applied if under %d) ", botDelayMillis, hgBotDelayCurrWarnMs()) ; char *mouseOverEnabled = cfgOptionDefault("mouseOverEnabled", "on"); if (sameWordOk(mouseOverEnabled, "on")) { @@ -11314,31 +11312,31 @@ dyStringPrintf(dy, "window.mouseOverEnabled=false;\n"); } jsInline(dy->string); dyStringFree(&dy); if (measureTiming) measureTime("Time at end of doMiddle, next up cart write"); if (cartOptionalString(cart, "udcTimeout")) { char buf[5000]; safef(buf, sizeof(buf), "A hub refresh (udcTimeout) setting is active. " "This is useful when developing hubs, but it reduces " "performance. To clear the setting, click " "<A HREF='hgTracks?hgsid=%s|url|&udcTimeout=[]'>here</A>.",cartSessionId(cart)); - notify(buf); + notify(buf, "udcTimeout"); } #ifdef DEBUG if (cdsQueryCache != NULL) cacheTwoBitRangesPrintStats(cdsQueryCache, stderr); #endif /* DEBUG */ } void labelTrackAsFilteredNumber(struct track *tg, unsigned numOut) /* add text to track long label to indicate filter is active */ { tg->longLabel = labelAsFilteredNumber(tg->longLabel, numOut); } void labelTrackAsFiltered(struct track *tg) /* add text to track long label to indicate filter is active */