81a8a460976bafc57a2df88a99e47431e2258245 kate Fri Jul 31 11:50:52 2020 -0700 Add hg.conf variable 'browser.recTrackSetsDetectChangge' to control whether recommended track sets features attempts to detect changes in the session. refs #25601 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index c6dc8f5..9899a5a 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -61,32 +61,30 @@ #include "errCatch.h" #include "iupac.h" #include "botDelay.h" #include "chromInfo.h" #include "extTools.h" #include "basicBed.h" #include "customFactory.h" #include "genbank.h" #include "bigWarn.h" #include "wigCommon.h" #include "knetUdc.h" #include "hex.h" #include <openssl/sha.h> #include "customComposite.h" -boolean isSessChanged = FALSE; - //#include "bed3Sources.h" /* Other than submit and Submit all these vars should start with hgt. * to avoid weeding things out of other program's namespaces. * Because the browser is a central program, most of its cart * variables are not hgt. qualified. It's a good idea if other * program's unique variables be qualified with a prefix though. */ char *excludeVars[] = { "submit", "Submit", "dirty", "hgt.reset", "hgt.in1", "hgt.in2", "hgt.in3", "hgt.inBase", "hgt.out1", "hgt.out2", "hgt.out3", "hgt.out4", "hgt.left1", "hgt.left2", "hgt.left3", "hgt.right1", "hgt.right2", "hgt.right3", "hgt.dinkLL", "hgt.dinkLR", "hgt.dinkRL", "hgt.dinkRR", "hgt.tui", "hgt.hideAll", "hgt.visAllFromCt", "hgt.psOutput", "hideControls", "hgt.toggleRevCmplDisp", @@ -8468,32 +8466,33 @@ } } hPrintf("</B></SPAN>"); // Disable recommended track set panel when changing tracks, session, database char *sessionLabel = cartOptionalString(cart, hgsOtherUserSessionLabel); char *oldDb = hashFindVal(oldVars, "db"); if (defaultTracks || hideAll || (oldDb && differentString(database, oldDb)) || (sessionLabel && sameString(sessionLabel, "off"))) cartRemove(cart, hgsOtherUserSessionLabel); sessionLabel = cartOptionalString(cart, hgsOtherUserSessionLabel); if (sessionLabel) { char *panel = "recTrackSetsPanel"; + boolean isSessChanged = FALSE; + if (recTrackSetsChangeDetectEnabled()) isSessChanged = hasSessionChanged(); - struct dyString *hoverText = dyStringNew(0); dyStringPrintf(hoverText, "Your browser is displaying the %s track set%s. " " Click to change to another.", sessionLabel, isSessChanged ? ", with changes (added or removed tracks) you have requested" : ""); // TODO: cleanup layout tweaking for FF on IE10 hPrintf(" "); hPrintf("<span id='spacer' style='display: inline; padding-left: 10px;' > </span>"); hPrintf("<span id='%s' class='gbSessionLabelPanel' style='display: inline-block;' title='%s'>", panel, dyStringCannibalize(&hoverText)); hPrintf("<span id='recTrackSetLabel' class='gbSessionLabelText gbSessionChangeIndicator %s' " "style='margin-right: 3px;'>%s</span>", isSessChanged ? "gbSessionChanged" : "", sessionLabel); hPrintf("<i id='removeSessionPanel' title='Close' class='fa fa-remove' "