89630712981cec39a9290afd1dae3646de4f4c44 larrym Wed Oct 19 12:35:59 2011 -0700 remove obsolete dragZooming flag diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index df075e4..05f94f4 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -111,31 +111,30 @@ /* dropdown for ruler visibility */ { "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 jsonHashElement *jsonForClient = 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. */ @@ -1696,35 +1695,30 @@ pe = round(pScale*i); we = round(wScale*i); mid = (ws + we)/2 + winStart; ns = mid-newWinWidth/2; ne = ns + newWinWidth; if (ns < 0) { ns = 0; ne -= ns; } if (ne > seqBaseCount) { ns -= (ne - seqBaseCount); ne = seqBaseCount; } - if(!dragZooming) - { - mapBoxJumpTo(hvg, ps+insideX,rulerClickY,pe-ps,rulerClickHeight,NULL, - chromName, ns, ne, message); - } } return newWinWidth; } static int doDrawRuler(struct hvGfx *hvg,int *newWinWidth,int *rulerClickHeight, int rulerHeight, int yAfterRuler, int yAfterBases, MgFont *font, int fontHeight,boolean rulerCds) /* draws the ruler. */ { int scaleBarPad = 2; int scaleBarHeight = fontHeight; int scaleBarTotalHeight = fontHeight + 2 * scaleBarPad; int titleHeight = fontHeight; int baseHeight = fontHeight; //int yAfterBases = yAfterRuler; @@ -1945,31 +1939,31 @@ struct image *theOneImg = NULL; // No need to be global, only the map needs to be global struct image *theSideImg = NULL; // Because dragScroll drags off end of image, the side label gets seen. Therefore we need 2 images!! //struct imgTrack *curImgTrack = NULL; // Make this global for now to avoid huge rewrite struct imgSlice *curSlice = NULL; // No need to be global, only the map needs to be global struct mapSet *curMap = NULL; // Make this global for now to avoid huge rewrite // Set up imgBox dimensions int sliceWidth[stMaxSliceTypes]; // Just being explicit int sliceOffsetX[stMaxSliceTypes]; int sliceHeight = 0; int sliceOffsetY = 0; char *rulerTtl = NULL; if(theImgBox) // theImgBox is a global for now to avoid huge rewrite of hgTracks. It is started // prior to this in doTrackForm() { - rulerTtl = (dragZooming?"drag select or click to zoom":"click to zoom 3x"); + rulerTtl = "drag select or click to zoom"; hPrintf("<input type='hidden' name='db' value='%s'>\n", database); hPrintf("<input type='hidden' name='c' value='%s'>\n", chromName); hPrintf("<input type='hidden' name='l' value='%d'>\n", winStart); hPrintf("<input type='hidden' name='r' value='%d'>\n", winEnd); hPrintf("<input type='hidden' name='pix' value='%d'>\n", tl.picWidth); #ifdef IMAGEv2_DRAG_SCROLL // If a portal was established, then set the global dimensions to the entire image size if(imgBoxPortalDimensions(theImgBox,&winStart,&winEnd,&(tl.picWidth),NULL,NULL,NULL,NULL,NULL)) { pixWidth = tl.picWidth; winBaseCount = winEnd - winStart; insideWidth = tl.picWidth-gfxBorder-insideX; } #endif//def IMAGEv2_DRAG_SCROLL memset((char *)sliceWidth, 0,sizeof(sliceWidth)); @@ -2515,31 +2509,32 @@ { 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("</MAP>\n"); -jsonHashAddBoolean(jsonForClient, "dragSelection", dragZooming); +// XXXX remove this after we remove dragSelection from hgTracks.js +jsonHashAddBoolean(jsonForClient, "dragSelection", TRUE); jsonHashAddBoolean(jsonForClient, "inPlaceUpdate", IN_PLACE_UPDATE); jsonHashAddNumber(jsonForClient, "rulerClickHeight", rulerClickHeight); if(newWinWidth) { jsonHashAddNumber(jsonForClient, "newWinWidth", newWinWidth); } /* Save out picture and tell html file about it. */ if(hvgSide != hvg) hvGfxClose(&hvgSide); hvGfxClose(&hvg); #ifdef SUPPORT_CONTENT_TYPE char *type = cartUsualString(cart, "hgt.contentType", "html"); @@ -2587,31 +2582,31 @@ { 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; insideWidth = tl.picWidth-gfxBorder-insideX; } #endif//def IMAGEv2_DRAG_SCROLL imgBoxFree(&theImgBox); } else { - char *titleAttr = dragZooming ? "title='click or drag mouse in base position track to zoom in'" : ""; + char *titleAttr = "title='click or drag mouse in base position track to zoom in'"; hPrintf("<IMG SRC='%s' BORDER=1 WIDTH=%d HEIGHT=%d USEMAP=#%s %s id='trackMap'", gifTn.forHtml, pixWidth, pixHeight, mapName, titleAttr); hPrintf("><BR>\n"); } flatTracksFree(&flatTracks); } static void appendLink(struct hotLink **links, char *url, char *name, char *id) { // append to list of links for later printing and/or communication with javascript client struct hotLink *link; AllocVar(link); link->name = cloneString(name); link->url = cloneString(url); link->id = cloneString(id); @@ -4986,31 +4981,31 @@ 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); hWrites("position/search "); hTextVar("position", addCommasToPos(database, position), 30); sprintLongWithCommas(buf, winEnd - winStart); - if(dragZooming && assemblySupportsGeneSuggest(database)) + if(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"); hPutc('\n'); } } @@ -5069,31 +5064,31 @@ hPrintf("move start<BR>"); #if IN_PLACE_UPDATE hButtonWithOnClick("hgt.dinkLL", " < ", "move start position to the left", "return navigateButtonClick(this);"); hTextVar("dinkL", cartUsualString(cart, "dinkL", "2.0"), 3); hButtonWithOnClick("hgt.dinkLR", " > ", "move start position to the right", "return navigateButtonClick(this);"); #else hButton("hgt.dinkLL", " < "); hTextVar("dinkL", cartUsualString(cart, "dinkL", "2.0"), 3); hButton("hgt.dinkLR", " > "); #endif hPrintf("</TD>"); hPrintf("<td width='30'> </td>\n"); #endif//ndef USE_NAVIGATION_LINKS hPrintf("<TD COLSPAN=15 style=\"white-space:normal\">"); // allow this text to wrap hWrites("Click on a feature for details. "); - hWrites(dragZooming ? "Click or drag in the base position track to zoom in. " : "Click on base position to zoom in around cursor. "); + hWrites("Click or drag in the base position track to zoom in. "); hWrites("Click side bars for track options. "); hWrites("Drag side bars or labels up or down to reorder tracks. "); #ifdef IMAGEv2_DRAG_SCROLL hWrites("Drag tracks left or right to new position. "); #endif//def IMAGEv2_DRAG_SCROLL //#if !defined(IMAGEv2_DRAG_SCROLL) && !defined(USE_NAVIGATION_LINKS) hPrintf("</TD>"); #ifndef USE_NAVIGATION_LINKS hPrintf("<td width='30'> </td>\n"); hPrintf("<TD COLSPAN=6 ALIGN=right NOWRAP>"); hPrintf("move end<BR>"); #if IN_PLACE_UPDATE hButtonWithOnClick("hgt.dinkRL", " < ", "move end position to the left", "return navigateButtonClick(this);"); hTextVar("dinkR", cartUsualString(cart, "dinkR", "2.0"), 3); hButtonWithOnClick("hgt.dinkRR", " > ", "move end position to the right", "return navigateButtonClick(this);"); @@ -5928,57 +5923,55 @@ if (hIsGisaidServer()) { validateGisaidUser(cart); } setUdcCacheDir(); int timeout = cartUsualInt(cart, "udcTimeout", 300); if (udcCacheTimeout() < timeout) udcSetCacheTimeout(timeout); initTl(); char *configPageCall = cartCgiUsualString(cart, "hgTracksConfigPage", "notSet"); -dragZooming = TRUE; - /* Do main display. */ if (cartUsualBoolean(cart, "hgt.trackImgOnly", FALSE)) { trackImgOnly = TRUE; ideogramToo = cartUsualBoolean(cart, "hgt.ideogramToo", FALSE); hideControls = TRUE; withNextItemArrows = FALSE; withNextExonArrows = FALSE; 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); - if(dragZooming && !searching) + 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"); jsIncludeFile("jquery.contextmenu.js", NULL);