07ab0d206a206790c538f2a85d3429318de0f5a3 larrym Wed Nov 16 17:52:46 2011 -0800 work on merging gene suggest into position search (#5933); currently only on in larrym's tree diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 1d1c9d9..a609b11 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -65,33 +65,36 @@ * Because the browser is a central program, most of it's 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.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", "hgt.collapseGroups", "hgt.expandGroups", "hgt.suggest", "hgt.jump", "hgt.refresh", "hgt.setWidth", "hgt.trackImgOnly", "hgt.ideogramToo", "hgt.trackNameFilter", "hgt.imageV1", "hgt.suggestTrack", "hgt.setWidth", TRACK_SEARCH, TRACK_SEARCH_ADD_ROW, TRACK_SEARCH_DEL_ROW, TRACK_SEARCH_PAGER, - "hgt.contentType", + "hgt.contentType", "hgt.positionInput", NULL }; +// MERGE_GENE_SUGGEST is used for work on redmine #5933 +// #define MERGE_GENE_SUGGEST + /* These variables persist from one incarnation of this program to the * next - living mostly in the cart. */ boolean baseShowPos; /* TRUE if should display full position at top of base track */ boolean baseShowAsm; /* TRUE if should display assembly info at top of base track */ boolean baseShowScaleBar; /* TRUE if should display scale bar at very top of base track */ boolean baseShowRuler; /* TRUE if should display the basic ruler in the base track (default) */ char *baseTitle = NULL; /* Title it should display top of base track (optional)*/ static char *userSeqString = NULL; /* User sequence .fa/.psl file. */ /* These variables are set by getPositionFromCustomTracks() at the very * beginning of tracksDisplay(), and then used by loadCustomTracks(). */ char *ctFileName = NULL; /* Custom track file. */ struct customTrack *ctList = NULL; /* Custom tracks. */ boolean hasCustomTracks = FALSE; /* whether any custom tracks are for this db*/ struct slName *browserLines = NULL; /* Custom track "browser" lines. */ @@ -4989,44 +4992,57 @@ /* Make line that says position. */ { char buf[256]; char *survey = cfgOptionEnv("HGDB_SURVEY", "survey"); char *surveyLabel = cfgOptionEnv("HGDB_SURVEY_LABEL", "surveyLabel"); char *javascript = "onchange=\"document.location = '/cgi-bin/hgTracks?db=' + document.TrackForm.db.options[document.TrackForm.db.selectedIndex].value;\""; if (containsStringNoCase(database, "zoo")) { hPuts("Organism "); printAssemblyListHtmlExtra(database, javascript); } sprintf(buf, "%s:%d-%d", chromName, winStart+1, winEnd); position = cloneString(buf); +#ifdef MERGE_GENE_SUGGEST + hPrintf("  %s", addCommasToPos(database, position)); + hPrintf("\n", buf); + sprintLongWithCommas(buf, winEnd - winStart); + hPrintf(" %s bp. ", buf); + hPrintf("\n"); + hWrites(" "); + hButtonWithOnClick("hgt.jump", "go", NULL, "imageV2.jumpButtonOnClick()"); + jsonHashAddBoolean(jsonForClient, "assemblySupportsGeneSuggest", assemblySupportsGeneSuggest(database)); + if(assemblySupportsGeneSuggest(database)) + hPrintf("\n", assemblyGeneSuggestTrack(database)); +#else hWrites("position/search "); hTextVar("position", addCommasToPos(database, position), 30); sprintLongWithCommas(buf, winEnd - winStart); if(assemblySupportsGeneSuggest(database)) hPrintf(" gene " "\n" "\n", assemblyGeneSuggestTrack(database) ); hWrites(" "); hButtonWithOnClick("hgt.jump", "jump", NULL, "imageV2.jumpButtonOnClick()"); hOnClickButton(clearButtonJavascript,"clear"); hPrintf(" size %s bp. ", buf); hWrites(" "); hButton("hgTracksConfigPage", "configure"); +#endif if (survey && differentWord(survey, "off")) hPrintf("  %s\n", survey, surveyLabel ? surveyLabel : "Take survey"); hPutc('\n'); } } /* Make chromsome ideogram gif and map. */ makeChromIdeoImage(&trackList, psOutput, ideoTn); #ifdef USE_NAVIGATION_LINKS hPrintf("\n",tl.picWidth);//min(tl.picWidth, 800)); hPrintf("
<<<\n"); hPrintf("<<\n"); hPrintf("<\n"); @@ -5958,30 +5974,33 @@ hgFindMatches = NULL; // XXXX necessary ??? } jsonForClient = newJsonHash(newHash(8)); jsonHashAddString(jsonForClient, "cgiVersion", CGI_VERSION); boolean searching = differentString(cartUsualString(cart, TRACK_SEARCH,"0"), "0"); if(!trackImgOnly) { // Write out includes for css and js files hWrites(commonCssStyles()); jsIncludeFile("jquery.js", NULL); jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("utils.js", NULL); jsIncludeFile("ajax.js", NULL); +#ifdef MERGE_GENE_SUGGEST + jsIncludeFile("jquery.watermarkinput.js", NULL); +#endif if(!searching) { jsIncludeFile("jquery.imgareaselect.js", NULL); } jsIncludeFile("autocomplete.js", NULL); jsIncludeFile("hgTracks.js", NULL); #ifdef LOWELAB jsIncludeFile("lowetooltip.js", NULL); #endif webIncludeResourceFile("jquery-ui.css"); if (!searching) // NOT doing search { webIncludeResourceFile("jquery.contextmenu.css");