6c004e6b0e3f5d92292ce74d812c64369c6c7a05 larrym Thu Jul 14 15:10:19 2011 -0700 add IN_PLACE_UPDATE code (currently on live in larrym's tree diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index bcdc8e0..fd8256b 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -4020,31 +4020,35 @@ /* truncate */ /* or maybe errabort ? */ label[3] = 0; len = 4; } if (len % 2 != 0) paddedLabel[3] = 0; if (len == strlen(paddedLabel)) strcpy(paddedLabel, label); else { int i; for (i=0; itdb)) { assert(track->tdb->parent != NULL); if (sameString("hide", cartUsualString(cart, track->tdb->parent->track, track->tdb->parent->isShow ? "show" : "hide"))) track->visibility = tvHide; } } struct track *rFindTrackWithTable(char *tableName, struct track *trackList) @@ -4746,31 +4750,36 @@ #ifdef IMAGEv2_DRAG_SCROLL if(theImgBox) { // If a portal was established, then set the global dimensions back to the portal size if(imgBoxPortalDimensions(theImgBox,NULL,NULL,NULL,NULL,&winStart,&winEnd,&(tl.picWidth),NULL)) { winBaseCount = winEnd - winStart; insideWidth = tl.picWidth-gfxBorder-insideX; } } #endif//def IMAGEv2_DRAG_SCROLL /* Center everything from now on. */ hPrintf("
\n"); -if(trackImgOnly) +// info for drag selection javascript +jsAddNumber(jsVarsHash, "winStart", winStart); +jsAddNumber(jsVarsHash, "winEnd", winEnd); +jsAddString(jsVarsHash, "chromName", chromName); + +if(trackImgOnly && !ideogramToo) { struct track *ideoTrack = chromIdeoTrack(trackList); if (ideoTrack) { ideoTrack->limitedVisSet = TRUE; ideoTrack->limitedVis = tvHide; /* Don't draw in main gif. */ } makeActiveImage(trackList, psOutput); fflush(stdout); return; // bail out b/c we are done } if (!hideControls) { @@ -4801,36 +4810,45 @@ if (stringIn(database, freezeName)) hPrintf("%s %s on %s %s Assembly", organization, browserName, organism, freezeName); else hPrintf("%s %s on %s %s Assembly (%s)", organization, browserName, organism, freezeName, database); } } hPrintf("
\n"); /* 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 "); +#ifdef IN_PLACE_UPDATE + hButtonWithOnClick("hgt.left3", "<<<", "move 95% to the left", "return navigateButtonClick(this);"); + hButtonWithOnClick("hgt.left2", " <<", "move 47.5% to the left", "return navigateButtonClick(this);"); + hButtonWithOnClick("hgt.left1", " < ", "move 10% to the left", "return navigateButtonClick(this);"); + hButtonWithOnClick("hgt.right1", " > ", "move 10% to the right", "return navigateButtonClick(this);"); + hButtonWithOnClick("hgt.right2", ">> ", "move 47.5% to the right", "return navigateButtonClick(this);"); + hButtonWithOnClick("hgt.right3", ">>>", "move 95% to the right", "return navigateButtonClick(this);"); +#else hButtonWithMsg("hgt.left3", "<<<", "move 95% to the left"); hButtonWithMsg("hgt.left2", " <<", "move 47.5% to the left"); hButtonWithMsg("hgt.left1", " < ", "move 10% to the left"); hButtonWithMsg("hgt.right1", " > ", "move 10% to the right"); hButtonWithMsg("hgt.right2", ">> ", "move 47.5% to the right"); hButtonWithMsg("hgt.right3", ">>>", "move 95% to the right"); +#endif hWrites(" zoom in "); /* use button maker that determines padding, so we can share constants */ topButton("hgt.in1", ZOOM_1PT5X); topButton("hgt.in2", ZOOM_3X); topButton("hgt.in3", ZOOM_10X); topButton("hgt.inBase", ZOOM_BASE); hWrites(" zoom out "); topButton("hgt.out1", ZOOM_1PT5X); topButton("hgt.out2", ZOOM_3X); topButton("hgt.out3", ZOOM_10X); hWrites("
\n"); #endif//ndef USE_NAVIGATION_LINKS if (showTrackControls) { @@ -4876,34 +4894,30 @@ hTextVar("position", addCommasToPos(database, position), 30); sprintLongWithCommas(buf, winEnd - winStart); if(dragZooming && assemblySupportsGeneSuggest(database)) hPrintf(" gene " "\n" "\n", assemblyGeneSuggestTrack(database) ); hWrites(" "); hButtonWithOnClick("hgt.jump", "jump", NULL, "jumpButtonOnClick()"); hOnClickButton(clearButtonJavascript,"clear"); hPrintf(" size %s bp. ", buf); hWrites(" "); hButton("hgTracksConfigPage", "configure"); if (survey && differentWord(survey, "off")) hPrintf("  %s\n", survey, surveyLabel ? surveyLabel : "Take survey"); - // info for drag selection javascript - jsAddNumber(jsVarsHash, "winStart", winStart); - jsAddNumber(jsVarsHash, "winEnd", winEnd); - jsAddString(jsVarsHash, "chromName", chromName); 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"); #ifdef IMAGEv2_DRAG_SCROLL if(!advancedJavascriptFeaturesEnabled(cart)) #endif//def IMAGEv2_DRAG_SCROLL hPrintf("<\n");