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; i<len; i++) paddedLabel[i+1] = label[i]; } +#ifdef IN_PLACE_UPDATE +hButtonWithOnClick(var, paddedLabel, NULL, "return navigateButtonClick(this);"); +#else hButton(var, paddedLabel); +#endif } void limitSuperTrackVis(struct track *track) /* Limit track visibility by supertrack parent */ { if(tdbIsSuperTrackChild(track->tdb)) { 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("<CENTER>\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("</B></span><BR>\n"); /* This is a clear submit button that browsers will use by default when enter is pressed in position box. */ hPrintf("<INPUT TYPE=IMAGE BORDER=0 NAME=\"hgt.dummyEnterButton\" src=\"../images/DOT.gif\">"); /* 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("<div style='height:1em;'></div>\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(" <a title='click for help on gene search box' target='_blank' href='../goldenPath/help/geneSearchBox.html'>gene</a> " "<input type='text' size='8' name='hgt.suggest' id='suggest'>\n" "<input type='hidden' name='hgt.suggestTrack' id='suggestTrack' value='%s'>\n", assemblyGeneSuggestTrack(database) ); hWrites(" "); hButtonWithOnClick("hgt.jump", "jump", NULL, "jumpButtonOnClick()"); hOnClickButton(clearButtonJavascript,"clear"); hPrintf(" size <span id='size'>%s</span> bp. ", buf); hWrites(" "); hButton("hgTracksConfigPage", "configure"); if (survey && differentWord(survey, "off")) hPrintf(" <span style='background-color:yellow;'><A HREF='%s' TARGET=_BLANK><EM><B>%s</EM></B></A></span>\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("<TABLE BORDER=0 CELLPADDING=0 width='%d'><tr style='font-size:small;'>\n",tl.picWidth);//min(tl.picWidth, 800)); hPrintf("<td width='40' align='left'><a href='?hgt.left3=1' title='move 95% to the left'><<<</a>\n"); hPrintf("<td width='30' align='left'><a href='?hgt.left2=1' title='move 47.5% to the left'><<</a>\n"); #ifdef IMAGEv2_DRAG_SCROLL if(!advancedJavascriptFeaturesEnabled(cart)) #endif//def IMAGEv2_DRAG_SCROLL hPrintf("<td width='20' align='left'><a href='?hgt.left1=1' title='move 10% to the left'><</a>\n");