05e67c59a20a5d00b810a981aef3b00c5bef82e1 max Fri Sep 20 06:03:18 2024 -0700 more features to hubtools: search in both parent and subdirs, better docs diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index dad0f84..a02985e 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -8568,30 +8568,57 @@ #ifdef NOTNOW static void printAliases(char *name) /* Print out the aliases for this sequence. */ { struct slName *names = chromAliasFindAliases(name); printf("
Aliases
"); } #endif +void printGlobalTrackControls() { + +puts(""); +puts(""); +puts(""); +hPrintf("\n"); +hDisconnectCentral(&conn); +puts(""); + +jsInline("$(document).ready(function() { $('#hubSelect').selectize()});\n"); +} static void paraLoadTimeoutFunc(int sig) // signal handler for alarm timeout. Tell parallel loads to stop by errAborts // in udcRead { udcReadStopMessage("Parallel read timeout message"); alarm(0); // disable the alarm } unsigned getParaLoadTimeout() // get the parallel load timeout in milliseconds if any { char *cfg = cfgOption("paraLoadTimeout"); if (cfg == NULL) @@ -9219,30 +9246,39 @@ hPrintf("", panel, dyStringCannibalize(&hoverText)); hPrintf("%s", isSessChanged ? "gbSessionChanged" : "", sessionLabel); hPrintf(""); hPrintf(""); jsOnEventById("click", "recTrackSetLabel", "showRecTrackSetsPopup(); return false;"); jsOnEventById("click", "removeSessionPanel", "removeSessionPanel(); return false;"); } hPrintf("
\n"); + char* lastHgvsDb = cartOptionalString(cart, "lastHgvsDb"); + if (lastHgvsDb) + { + char* lastHgvsPos = cartOptionalString(cart, "lastHgvsPos"); + char* lastHgvsTerm = cartOptionalString(cart, "lastHgvsTerm"); + if (lastHgvsPos && lastHgvsTerm) + printf("Variant in Focus: %s, %s
", lastHgvsPos, lastHgvsTerm); + } + /* This is a clear submit button that browsers will use by default when enter is pressed in position box. */ hPrintf(""); /* Put up scroll and zoom controls. */ #ifndef USE_NAVIGATION_LINKS hWrites("Move "); hButtonWithOnClick("hgt.left3", "<<<", "Move 95% to the left", "return imageV2.navigateButtonClick(this);"); hButtonWithOnClick("hgt.left2", " <<", "Move 47.5% to the left", "return imageV2.navigateButtonClick(this);"); hButtonWithOnClick("hgt.left1", " < ", "Move 10% to the left", "return imageV2.navigateButtonClick(this);"); hButtonWithOnClick("hgt.right1", " > ", "Move 10% to the right", "return imageV2.navigateButtonClick(this);"); hButtonWithOnClick("hgt.right2", ">> ", "Move 47.5% to the right", "return imageV2.navigateButtonClick(this);"); @@ -9550,30 +9586,33 @@ hButtonWithOnClick("hgt.collapseGroups", "Collapse all", "Collapse all track groups", "return vis.expandAllGroups(false)"); hPrintf(""); hPrintf("\n", MAX_CONTROL_COLUMNS - 2); printShortcutButtons(cart, hasCustomTracks, revCmplDisp, multiRegionButtonTop); hPrintf("\n"); hPrintf(""); hButtonWithOnClick("hgt.expandGroups", "Expand all", "Expand all track groups", "return vis.expandAllGroups(true)"); hPrintf(""); + if (cfgOptionBooleanDefault("newTrackControls", FALSE)) + printGlobalTrackControls(); + cg = startControlGrid(MAX_CONTROL_COLUMNS, "left"); struct hash *superHash = hashNew(8); for (group = groupList; group != NULL; group = group->next) { if ((group->trackList == NULL) && (group->errMessage == NULL)) continue; struct trackRef *tr; /* check if group section should be displayed */ char *otherState; char *indicator; char *indicatorImg; boolean isOpen = !isCollapsedGroup(group); collapseGroupGoodies(isOpen, TRUE, &indicatorImg, @@ -9947,56 +9986,84 @@ void handlePostscript() /* Deal with Postscript output. */ { struct tempName psTn, ideoPsTn; char *pdfFile = NULL, *ideoPdfFile = NULL; ZeroVar(&ideoPsTn); trashDirFile(&psTn, "hgt", "hgt", ".eps"); if(!trackImgOnly) { printMenuBar(); printf("
\n"); printf("

PDF Output

\n"); - printf("PDF images can be printed with Acrobat Reader " + printf("

PDF images can be printed with Acrobat Reader " "and edited by many drawing programs such as Adobe " - "Illustrator or Inkscape.
"); + "Illustrator or Inkscape.

"); + printf("

Preview

\n"); } + +// user can land at this page from hgTracks, which doesn't set the special variables, or from this page, which sets the special variables +boolean doShowGuides = cartUsualBoolean(cart, "guidelines", TRUE); + +if (cgiVarExists("guidelines_off")) + doShowGuides = FALSE; + +char *guideVal = ""; +if (!doShowGuides) + guideVal = "&guidelines_off=1"; + +printf("

\n", cartSessionVarName(), cartSessionId(cart), guideVal); + +puts("

"); +puts("

\n"); + +char *guideAttr = ""; +if (!doShowGuides) + guideAttr = " checked"; + +//printf("doShowGuides %d, guideVal %s guideAttr %s", doShowGuides, guideVal, guideAttr); + +//if (cartCgiUsualBoolean(cart, "PdfNoGuides", FALSE)) + //cartSetString(cart, "guidelines", "off"); + +printf("
\n", guideAttr); +puts(""); +puts(""); +puts("

\n"); + doTrackForm(psTn.forCgi, &ideoPsTn); +//if (cgiBoolean("PdfNoGuides")) + //cartSetString(cart, "guidelines", "on"); + pdfFile = convertEpsToPdf(psTn.forCgi); +char *svgFile = convertPdfToSvg(pdfFile); + if (strlen(ideoPsTn.forCgi)) ideoPdfFile = convertEpsToPdf(ideoPsTn.forCgi); if (pdfFile != NULL) { - printf("\n"); + printf("\n", ideoPdfFile); freez(&pdfFile); freez(&ideoPdfFile); - printf("EPS (PostScript) output has been discontinued in pursuit of additional features\n"); - printf("that are not PostScript-compatible. If you require PostScript output for your\n"); - printf("workflow, please reach out to us\n"); - printf("and let us know what your needs are - we may be able to help.\n"); - // see redmine #1077 printf("
Tips for producing quality images for publication:
\n"); printf("\n"); printf("
\n"); } @@ -10014,30 +10081,34 @@ if (sameWord(s, "full") || sameWord(s, "on")) rulerMode = tvFull; else if (sameWord(s, "dense")) rulerMode = tvDense; else rulerMode = tvHide; } void setLayoutGlobals() /* Figure out basic dimensions of display. */ { withIdeogram = cartUsualBoolean(cart, "ideogram", TRUE); withLeftLabels = cartUsualBoolean(cart, "leftLabels", TRUE); withCenterLabels = cartUsualBoolean(cart, "centerLabels", TRUE); withGuidelines = cartUsualBoolean(cart, "guidelines", TRUE); + +if (cgiVarExists("guidelines_off")) + withGuidelines = FALSE; + if (!cartUsualBoolean(cart, "hgt.imageV1", FALSE)) { withNextItemArrows = cartUsualBoolean(cart, "nextItemArrows", FALSE); withNextExonArrows = cartUsualBoolean(cart, "nextExonArrows", TRUE); } withExonNumbers = cartUsualBoolean(cart, "exonNumbers", TRUE); emAltHighlight = cartUsualBoolean(cart, "emAltHighlight", FALSE); revCmplDisp = cartUsualBooleanDb(cart, database, REV_CMPL_DISP, FALSE); emPadding = cartUsualInt(cart, "emPadding", emPadding); gmPadding = cartUsualInt(cart, "gmPadding", gmPadding); withPriorityOverride = cartUsualBoolean(cart, configPriorityOverride, FALSE); fullInsideX = trackOffsetX(); fullInsideWidth = tl.picWidth-gfxBorder-fullInsideX; } @@ -10176,47 +10247,74 @@ safef(cartVar, sizeof cartVar, "%s.%s:%ld-%ld#%s", h->db, MULTI_REGION_VIRTUAL_CHROM_NAME, virtStart, virtEnd, h->hexColor); cartSetString(cart, "highlight", cartVar); } else { // erase the highlight cartvar if it has no overlap with the new virt chrom cartRemove(cart, "highlight"); } } } static void setupTimeWarning() /* add javascript that outputs a warning message if page takes too long to load */ { -char *maxTimeStr = cfgOption("warnSeconds"); +char *maxTimeStr = cfgOptionDefault("warnSeconds", 0); if (!maxTimeStr) return; - double maxTime = atof(maxTimeStr); + +// this is the code that will be run if document.ready ever fires, so most of the page completes +// and the javascript inline \n"); } void tracksDisplay() /* Put up main tracks display. This routine handles zooming and * scrolling. */ { +setupTimeWarning(); +fflush(stdout); + char titleVar[256]; char *oldPosition = cartUsualString(cart, "oldPosition", ""); boolean findNearest = cartUsualBoolean(cart, "findNearest", FALSE); cartRemove(cart, "findNearest"); boolean positionIsVirt = FALSE; position = getPositionFromCustomTracks(); if (NULL == position) { position = cartGetPosition(cart, database, &lastDbPosCart); if (sameOk(cgiOptionalString("position"), "lastDbPos")) { restoreSavedVirtPosition(); } if (startsWith(OLD_MULTI_REGION_CHROM, position)) @@ -10685,31 +10783,30 @@ cartSetDbPosition(cart, database, lastDbPosCart); if (cartUsualBoolean(cart, "hgt.psOutput", FALSE)) handlePostscript(); else doTrackForm(NULL, NULL); boolean gotExtTools = extToolsEnabled(); setupHotkeys(gotExtTools); if (gotExtTools) printExtMenuData(chromName); if (recTrackSetsEnabled()) printRecTrackSets(); if (exportedDataHubsEnabled()) printExportedDataHubs(database); -setupTimeWarning(); } static void chromInfoTotalRow(int count, long long total, boolean hasAlias) /* Make table row with total number of sequences and size from chromInfo. */ { cgiSimpleTableRowStart(); cgiSimpleTableFieldStart(); printf("Total: %d", count); cgiTableFieldEnd(); cgiTableFieldStartAlignRight(); printLongWithCommas(stdout, total); puts("  "); cgiTableFieldEnd(); if (hasAlias) { @@ -11456,35 +11553,37 @@ jsIncludeFile("ajax.js", NULL); jsIncludeFile("jquery.watermarkinput.js", NULL); if(!searching) { jsIncludeFile("jquery.history.js", NULL); jsIncludeFile("jquery.imgareaselect.js", NULL); } jsIncludeFile("autocomplete.js", NULL); jsIncludeFile("es5-shim.4.0.3.min.js", NULL); jsIncludeFile("es5-sham.4.0.3.min.js", NULL); jsIncludeFile("lodash.3.10.0.compat.min.js", NULL); jsIncludeFile("autocompleteCat.js", NULL); jsIncludeFile("hgTracks.js", NULL); jsIncludeFile("hui.js", NULL); jsIncludeFile("spectrum.min.js", NULL); + jsIncludeFile("selectize.min.js", NULL); #ifdef LOWELAB jsIncludeFile("lowetooltip.js", NULL); #endif///def LOWELAB + webIncludeResourceFile("selectize.default.min.css"); webIncludeResourceFile("spectrum.min.css"); webIncludeResourceFile("jquery-ui.css"); if (enableMouseOver) webIncludeResourceFile("mouseOver.css"); if (!searching) // NOT doing search { webIncludeResourceFile("jquery.contextmenu.css"); jsIncludeFile("jquery.contextmenu.js", NULL); webIncludeResourceFile("ui.dropdownchecklist.css"); jsIncludeFile("ui.dropdownchecklist.js", NULL); jsIncludeFile("ddcl.js", NULL); if (cfgOptionBooleanDefault("showTutorial", TRUE)) { puts("");