0b8725960bf37ad6f82163177238c75ff2a2f3b5
larrym
Wed Nov 16 14:19:20 2011 -0800
use attributeEncode instead of htmlEncode in title attributes (e.g. allow encoded unicode)
diff --git src/hg/hgTracks/imageV2.c src/hg/hgTracks/imageV2.c
index 5c8095c..348343a 100644
--- src/hg/hgTracks/imageV2.c
+++ src/hg/hgTracks/imageV2.c
@@ -1634,61 +1634,61 @@
}
else if(item->linkVar != NULL)
{
if(skipToSpaces(item->linkVar))
hPrintf(" HREF=%s",item->linkVar);
else if(startsWith("/cgi-bin/hgGene", item->linkVar)) // redmine #4151
hPrintf(" HREF='..%s'",item->linkVar); // FIXME: Chin should get rid of this special case!
else
hPrintf(" HREF='%s'",item->linkVar);
hPrintf(" class='area'");
}
else
warn("map item has no url!");
if(item->title != NULL && strlen(item->title) > 0)
- hPrintf(" TITLE='%s'", htmlEncode(item->title) );
+ hPrintf(" TITLE='%s'", attributeEncode(item->title) );
if(item->id != NULL)
hPrintf(" id='%s'", item->id);
hPrintf(">" );
}
hPrintf("\n");
return TRUE;
}
static void imageDraw(struct imgBox *imgBox,struct imgTrack *imgTrack,struct imgSlice *slice,char *name,int offsetX,int offsetY,boolean useMap)
/* writes an image as HTML */
{
if(slice->parentImg && slice->parentImg->file != NULL)
{
hPrintf(" parentImg->file,offsetX,offsetY);
// Problem: dragScroll beyond left shows ugly leftLabel!
// Tried clip:rect() but this only works with position:absolute!
// May need to split image betweeen side label and data!!! That is a big change.
if(useMap)
hPrintf(" usemap='#map_%s'",name);
hPrintf(" class='sliceImg %s",sliceTypeToClass(slice->type));
if(slice->type==stData && imgBox->showPortal)
hPrintf(" panImg'");
else
hPrintf("'");
if(slice->title != NULL)
- hPrintf(" title='%s'", htmlEncode(slice->title) ); // Adds slice wide title
+ hPrintf(" title='%s'", attributeEncode(slice->title) ); // Adds slice wide title
else if(slice->parentImg->title != NULL)
- hPrintf("' title='%s'", htmlEncode(slice->parentImg->title) );// Adds image wide title
+ hPrintf("' title='%s'", attributeEncode(slice->parentImg->title) );// Adds image wide title
if(slice->type==stData || slice->type==stCenter)
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;
}
@@ -1770,37 +1770,37 @@
{ // This fake link ensures a mouse-over title is seen but not heard
hPrintf("link) != NULL)
hPrintf(" link);
else
hPrintf(" link);
if (slice->title != NULL)
{
if (sliceType == stButton)
{
enum browserType browser = cgiClientBrowser(NULL,NULL,NULL);
char *newLine = NEWLINE_TO_USE(browser);
char *ellipsis = ELLIPSIS_TO_USE(browser);
if(imgTrack->reorderable)
- hPrintf(" TITLE='%s%sclick or right click to configure%s%sdrag to reorder%s'",htmlEncode(slice->title), newLine,
+ hPrintf(" TITLE='%s%sclick or right click to configure%s%sdrag to reorder%s'",attributeEncode(slice->title), newLine,
ellipsis, newLine,(tdbIsCompositeChild(imgTrack->tdb)?" highlighted subtracks":"") );
else
- hPrintf(" TITLE='%s%sclick or right click to configure%s'",htmlEncode(slice->title), newLine, ellipsis);
+ hPrintf(" TITLE='%s%sclick or right click to configure%s'",attributeEncode(slice->title), newLine, ellipsis);
}
else
- hPrintf(" TITLE='Click for:
%s'", htmlEncode(slice->title) );
+ hPrintf(" TITLE='Click for:
%s'", attributeEncode(slice->title) );
}
hPrintf(">\n" );
}
imageDraw(imgBox,imgTrack,slice,name,offsetX,offsetY,useMap);
if(slice->link != NULL)
hPrintf("");
if(slice->parentImg)
hPrintf("");
}
void imageBoxDraw(struct imgBox *imgBox)
/* writes a entire imgBox including all tracksas HTML */
{
@@ -1874,61 +1874,61 @@
hPrintf("