d3a76238ad2afe6e89ba72b5b51a7bc1c12192aa braney Wed Aug 16 14:18:32 2017 -0700 improve event handling diff --git src/hg/hgCollection/hgCollection.c src/hg/hgCollection/hgCollection.c index a610281..daf66d8 100644 --- src/hg/hgCollection/hgCollection.c +++ src/hg/hgCollection/hgCollection.c @@ -117,32 +117,32 @@ userString = "viewType='track'"; } else { //prefix = "coll_"; if (tdb->parent && tdb->subtracks) userString = "class='nodrop' viewType='view'"; else userString = "class='nodrop' viewType='track'"; } //userString = "viewType='track data-jstree='{'icon':'images/folderC.png'}''"; #define IMAKECOLOR_32(r,g,b) ( ((unsigned int)b<<0) | ((unsigned int)g << 8) | ((unsigned int)r << 16)) -jsInlineF("
  • %s", tdb->shortLabel, tdb->longLabel,IMAKECOLOR_32(tdb->colorR,tdb->colorG,tdb->colorB), hStringFromTv(tdb->visibility), prefix, trackHubSkipHubName(tdb->track), userString, folder ? "folder" : "file", tdb->shortLabel ); -jsInlineF("%s", tdb->longLabel); +jsInlineF("
  • %s", tdb->shortLabel, tdb->longLabel,IMAKECOLOR_32(tdb->colorR,tdb->colorG,tdb->colorB), hStringFromTv(tdb->visibility), prefix, trackHubSkipHubName(tdb->track), userString, tdb->shortLabel ); +jsInlineF(" (%s)", tdb->longLabel); if (tdb->subtracks) { struct trackDb *subTdb; jsInlineF(""); } jsInlineF("
  • "); } static void outHubHeader(FILE *f, char *db, char *hubName) @@ -229,90 +229,89 @@ boolean vis; if (cartVis != NULL) vis = differentString(cartVis, "hide"); else if (tdbIsSuperTrack(tdb->parent)) vis = tdb->parent->isShow; else vis = tdb->parent->visibility != tvHide; return vis; } void addVisibleTracks() // add the visible tracks table rows { -printf("All VisibleAll the tracks visible in hgTracks\n"); +printf("All VisibleAll the tracks visible in hgTracks\n"); struct trackDb *tdb; for(tdb = fullTrackList; tdb; tdb = tdb->next) { if (isParentVisible(tdb) && isSubtrackVisible(tdb)) { printGroup("visible", tdb, FALSE, FALSE); } } } void doTable() // output the tree table { char *hubName = hubNameFromUrl(getHubName(database)); struct grp *curGroup; for(curGroup = fullGroupList; curGroup; curGroup = curGroup->next) { if ((hubName != NULL) && sameString(curGroup->name, hubName)) break; } if (curGroup != NULL) { // print out all the tracks in this group struct trackDb *tdb; jsInlineF("$('#collection').append(\""); for(tdb = fullTrackList; tdb; tdb = tdb->next) { if (sameString(tdb->grp, hubName)) { - //jsInlineF("
  • %s
  • ", tdb->track, tdb->shortLabel); jsInlineF("
    ", trackHubSkipHubName(tdb->track), tdb->shortLabel); jsInlineF("
    "); } } jsInlineF("\");\n"); // print out all the tracks in this group jsInlineF("$('#collections').append(\""); for(tdb = fullTrackList; tdb; tdb = tdb->next) { if (sameString(tdb->grp, hubName)) { - jsInlineF("
  • %s
  • ", trackHubSkipHubName(tdb->track),trackHubSkipHubName(tdb->track), tdb->shortLabel); + jsInlineF("
  • %s
  • ", trackHubSkipHubName(tdb->track),trackHubSkipHubName(tdb->track), tdb->shortLabel); //printGroup("collections", tdb, TRUE, TRUE); } } jsInlineF("\");\n"); } //addVisibleTracks(); jsInlineF("$('#tracks').append(\""); for(curGroup = fullGroupList; curGroup; curGroup = curGroup->next) { if ((hubName != NULL) && sameString(curGroup->name, hubName)) continue; jsInlineF(""); } jsInlineF("\");\n"); @@ -446,32 +445,35 @@ fprintf(f, "\n"); } static void outComposite(FILE *f, struct track *collection) // output a composite header for user composite { char *parent = collection->name; char *shortLabel = collection->shortLabel; char *longLabel = collection->longLabel; fprintf(f,"track %s\n\ shortLabel %s\n\ compositeTrack on\n\ aggregate none\n\ longLabel %s\n\ %s on\n\ +\tcolor %ld,%ld,%ld \n\ type wig \n\ -visibility full\n\n", parent, shortLabel, longLabel, CUSTOM_COMPOSITE_SETTING); +visibility full\n\n", parent, shortLabel, longLabel, CUSTOM_COMPOSITE_SETTING, + 0xff& (collection->color >> 16),0xff& (collection->color >> 8),0xff& (collection->color)); + } int snakePalette2[] = { 0x1f77b4, 0xaec7e8, 0xff7f0e, 0xffbb78, 0x2ca02c, 0x98df8a, 0xd62728, 0xff9896, 0x9467bd, 0xc5b0d5, 0x8c564b, 0xc49c94, 0xe377c2, 0xf7b6d2, 0x7f7f7f, 0xc7c7c7, 0xbcbd22, 0xdbdb8d, 0x17becf, 0x9edae5 }; static char *skipColl(char *str) { if (startsWith("coll_", str)) return &str[5]; return str; } static void outView(FILE *f, struct sqlConnection *conn, char *db, struct track *view, char *parent, struct hash *nameHash, struct hash *collectionNameHash)