8a3891b32fa630eddb3808ab704836d5c9e1ffe8 larrym Sun Jul 10 20:58:40 2011 -0700 move javascript globals from hiddens to an object diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 9c1bb2f..115ea12 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -92,30 +92,31 @@ "hide", "dense", "full" }; char *protDbName; /* Name of proteome database for this genome. */ #define MAX_CONTROL_COLUMNS 6 #define LOW 1 #define MEDIUM 2 #define BRIGHT 3 #define MAXCHAINS 50000000 boolean hgDebug = FALSE; /* Activate debugging code. Set to true by hgDebug=on in command line*/ int imagePixelHeight = 0; boolean dragZooming = TRUE; struct hash *oldVars = NULL; +struct hash *jsVarsHash = NULL; boolean hideControls = FALSE; /* Hide all controls? */ boolean trackImgOnly = FALSE; /* caller wants just the track image and track table html */ boolean ideogramToo = FALSE; /* caller wants the ideoGram (when requesting just one track) */ /* Structure returned from findGenomePos. * We use this to to expand any tracks to full * that were found to contain the searched-upon * position string */ struct hgPositions *hgp = NULL; /* Other global variables. */ struct trackHub *hubList = NULL; /* List of all relevant hubs. */ struct group *groupList = NULL; /* List of all tracks. */ char *browserName; /* Test, preview, or public browser */ @@ -2455,38 +2456,39 @@ { if(theImgBox) { // Set imgTrack in case any map items will be set sliceHeight = trackPlusLabelHeight(track, fontHeight); sliceOffsetY = y; curImgTrack = imgBoxTrackFind(theImgBox,track->tdb,NULL); } y = doTrackMap(track, hvg, y, fontHeight, trackPastTabX, trackPastTabWidth); } } /* Finish map. */ hPrintf("\n"); -hPrintf("\n", dragZooming ? 1 : 0); +jsAddBoolean(jsVarsHash, "dragSelection", dragZooming); + if(rulerClickHeight) { - hPrintf("\n", rulerClickHeight); + jsAddNumber(jsVarsHash, "rulerClickHeight", rulerClickHeight); } if(newWinWidth) { - hPrintf("\n", newWinWidth); + jsAddNumber(jsVarsHash, "newWinWidth", newWinWidth); } /* Save out picture and tell html file about it. */ if(hvgSide != hvg) hvGfxClose(&hvgSide); hvGfxClose(&hvg); if(theImgBox) { imageBoxDraw(theImgBox); #ifdef IMAGEv2_DRAG_SCROLL // 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)) { pixWidth = tl.picWidth; winBaseCount = winEnd - winStart; @@ -4542,32 +4544,33 @@ zoomedToBaseLevel = (winBaseCount <= insideWidth / tl.mWidth); zoomedToCodonLevel = (ceil(winBaseCount/3) * tl.mWidth) <= insideWidth; zoomedToCdsColorLevel = (winBaseCount <= insideWidth*3); if (psOutput != NULL) { hPrintDisable(); hideControls = TRUE; withNextItemArrows = FALSE; withNextExonArrows = FALSE; hgFindMatches = NULL; } /* Tell browser where to go when they click on image. */ hPrintf("