a4ed1e0d2c39286d95a53d98db4b0bdc51836260 Merge parents 7ab9bea 3c4e793 larrym Wed Jul 25 15:20:22 2012 -0700 resolve merge conflict with master diff --cc src/hg/hgTracks/imageV2.c index 68fa26f,a2f91b8..79cdc7d --- src/hg/hgTracks/imageV2.c +++ src/hg/hgTracks/imageV2.c @@@ -1679,246 -1724,262 +1724,259 @@@ hPrintf(" ondrag='{return false;}'"); hPrintf(">"); } else { int height = slice->height; // Adjustment for centerLabel Conditional if (imgTrack->centerLabelSeen == clNotSeen && (slice->type == stSide || slice->type == stButton)) { struct imgSlice *centerSlice = imgTrackSliceGetByType(imgTrack,stCenter); if (centerSlice != NULL) height -= centerSlice->height; } hPrintf("
",trackName,(slice->link == NULL?"inset ":"")); + hPrintf(" width:9px; display:none;' class='%s %sbtn btnN'>", + trackName,(slice->link == NULL ? "inset " : "")); } else hPrintf("width:%dpx;'>",slice->width); } } // FF does not support newline code and '...' looks bad without newlines #define NEWLINE_ENCODED " " #define NEWLINE_NOT_SUPPORTED " - " #define NEWLINE_TO_USE(browser) ((browser) == btFF ? NEWLINE_NOT_SUPPORTED : NEWLINE_ENCODED) #define ELLIPSIS_TO_USE(browser) ((browser) == btFF ? "" : "...") - static void sliceAndMapDraw(struct imgBox *imgBox,struct imgTrack *imgTrack,enum sliceType sliceType,char *name,boolean scrollHandle) - /* writes a slice of an image and any assocated image map as HTML */ + static void sliceAndMapDraw(struct imgBox *imgBox,struct imgTrack *imgTrack, + enum sliceType sliceType,char *name,boolean scrollHandle) + // writes a slice of an image and any assocated image map as HTML { - if(imgBox==NULL || imgTrack==NULL) + if (imgBox==NULL || imgTrack==NULL) return; struct imgSlice *slice = imgTrackSliceGetByType(imgTrack,sliceType); - if(slice==NULL || slice->height == 0) + if (slice==NULL || slice->height == 0) return; boolean useMap=FALSE; int offsetX=slice->offsetX; int offsetY=slice->offsetY; int height = slice->height; int width=slice->width; - if(slice->parentImg) + if (slice->parentImg) { // Adjustment for centerLabel Conditional if (imgTrack->centerLabelSeen == clNotSeen && (sliceType == stSide || sliceType == stButton)) { struct imgSlice *centerSlice = imgTrackSliceGetByType(imgTrack,stCenter); if (centerSlice != NULL) { height -= centerSlice->height; offsetY += centerSlice->height; } } // Adjustment for portal - if(imgBox->showPortal && imgBox->basesPerPixel > 0 + if (imgBox->showPortal && imgBox->basesPerPixel > 0 && (sliceType==stData || sliceType==stCenter)) { offsetX += (imgBox->portalStart - imgBox->chromStart) / imgBox->basesPerPixel; width=imgBox->portalWidth; } hPrintf(" "); } void imageBoxDraw(struct imgBox *imgBox) - /* writes a entire imgBox including all tracksas HTML */ + // writes a entire imgBox including all tracksas HTML { - if(imgBox->imgTracks == NULL) // Not an error to have an empty image + if (imgBox->imgTracks == NULL) // Not an error to have an empty image return; imgBoxDropEmpties(imgBox); boolean verbose = (hIsPrivateHost()); // Warnings for hgwdev only - if(!imgBoxIsComplete(imgBox,verbose)) // dorps empties as okay + if (!imgBoxIsComplete(imgBox,verbose)) // dorps empties as okay return; char name[256]; imgBoxTracksNormalizeOrder(imgBox); - //if(verbose) + //if (verbose) // imgBoxShow(NULL,imgBox,0); - hPrintf("\n"); // DANGER FF interprets '--' as end of comment, not '-->' + hPrintf("\n"); + // DANGER FF interprets '--' as end of comment, not '-->' jsIncludeFile("jquery.tablednd.js", NULL); - if(imgBox->bgImg) + if (imgBox->bgImg) { int offset = 0; - if(imgBox->showSideLabel && imgBox->plusStrand) + if (imgBox->showSideLabel && imgBox->plusStrand) { struct imgSlice *slice = imgTrackSliceGetByType(imgBox->imgTracks,stData); - if(slice) + if (slice) offset = (slice->offsetX * -1); // This works because the ruler has a slice - } + } hPrintf("\n"); } - if(imgBox->showPortal) + if (imgBox->showPortal) { // Let js code know what's up int chromSize = hChromSize(database, chromName); jsonObjectAdd(jsonForClient,"chromStart", newJsonNumber( 1)); jsonObjectAdd(jsonForClient,"chromEnd", newJsonNumber(chromSize)); jsonObjectAdd(jsonForClient,"imgBoxPortal", newJsonBoolean(TRUE)); - jsonObjectAdd(jsonForClient,"imgBoxWidth", newJsonNumber(imgBox->width - imgBox->sideLabelWidth)); + jsonObjectAdd(jsonForClient,"imgBoxWidth", newJsonNumber(imgBox->width-imgBox->sideLabelWidth)); jsonObjectAdd(jsonForClient,"imgBoxPortalStart", newJsonNumber(imgBox->portalStart)); jsonObjectAdd(jsonForClient,"imgBoxPortalEnd", newJsonNumber(imgBox->portalEnd)); jsonObjectAdd(jsonForClient,"imgBoxPortalWidth", newJsonNumber(imgBox->portalWidth)); - jsonObjectAdd(jsonForClient,"imgBoxLeftLabel", newJsonNumber(imgBox->plusStrand ? imgBox->sideLabelWidth : 0)); - jsonObjectAdd(jsonForClient,"imgBoxPortalOffsetX", newJsonNumber((long) ((imgBox->portalStart - imgBox->chromStart) / imgBox->basesPerPixel))); + jsonObjectAdd(jsonForClient,"imgBoxLeftLabel", newJsonNumber(imgBox->plusStrand ? + imgBox->sideLabelWidth : 0)); + jsonObjectAdd(jsonForClient,"imgBoxPortalOffsetX", + newJsonNumber((long)( (imgBox->portalStart - imgBox->chromStart) + / imgBox->basesPerPixel))); jsonObjectAdd(jsonForClient,"imgBoxBasesPerPixel", newJsonDouble(imgBox->basesPerPixel)); } else jsonObjectAdd(jsonForClient,"imgBoxPortal", newJsonBoolean(FALSE)); -hPrintf("\n",name,(imgTrack->reorderable?" class='dragHandle'":"")); + hPrintf(" | \n",name,(imgTrack->reorderable ? " class='dragHandle'" : "")); sliceAndMapDraw(imgBox,imgTrack,stButton,name,FALSE); hPrintf(" | \n"); // leftLabel safef(name,sizeof(name),"side_%s",trackName); if (imgTrack->reorderable) - hPrintf("\n",name,attributeEncode(imgTrack->tdb->longLabel),newLine); + hPrintf(" | \n", + name,attributeEncode(imgTrack->tdb->longLabel),newLine); else hPrintf(" | \n",name); sliceAndMapDraw(imgBox,imgTrack,stSide,name,FALSE); hPrintf(" | \n"); } // Main/Data image region - hPrintf("\n", trackName, imgBox->width); + hPrintf(" | \n", trackName, imgBox->width); // centerLabel - if(imgTrack->hasCenterLabel) + if (imgTrack->hasCenterLabel) { safef(name, sizeof(name), "center_%s", trackName); sliceAndMapDraw(imgBox,imgTrack,stCenter,name,TRUE); hPrintf("\n"); } // data image safef(name, sizeof(name), "data_%s", trackName); sliceAndMapDraw(imgBox,imgTrack,stData,name,(imgTrack->order>0)); hPrintf(" | \n"); - if(imgBox->showSideLabel && !imgTrack->plusStrand) + if (imgBox->showSideLabel && !imgTrack->plusStrand) { // rightLabel safef(name, sizeof(name), "side_%s", trackName); if (imgTrack->reorderable) - hPrintf("\n",name,attributeEncode(imgTrack->tdb->longLabel),newLine); + hPrintf(" | \n", + name,attributeEncode(imgTrack->tdb->longLabel),newLine); else hPrintf(" | \n",name); sliceAndMapDraw(imgBox,imgTrack,stSide,name,FALSE); hPrintf(" | \n"); // button safef(name, sizeof(name), "btn_%s", trackName); - hPrintf("\n",name,(imgTrack->reorderable?" class='dragHandle'":"")); + hPrintf(" | \n",name,(imgTrack->reorderable ? " class='dragHandle'" : "")); sliceAndMapDraw(imgBox,imgTrack,stButton, name,FALSE); hPrintf(" | \n"); } hPrintf("