f9ca7382a7ca668aafe1203bce5fb5f3c311db92
Merge parents 5e0bdb4 f592c99
kate
Thu Feb 16 12:17:26 2017 -0800
Fixing merge conflit
diff --cc src/hg/lib/hui.c
index 2d81000,ec4c0ad..b60de25
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@@ -35,84 -35,93 +35,94 @@@
#include "snakeUi.h"
#include "vcfUi.h"
#include "vcf.h"
#include "errCatch.h"
#include "samAlignment.h"
#include "makeItemsItem.h"
#include "bedDetail.h"
#include "pgSnp.h"
#include "memgfx.h"
#include "trackHub.h"
#include "gtexUi.h"
#include "genbank.h"
#include "htmlPage.h"
#include "longRange.h"
#include "tagRepo.h"
+#include "barChartUi.h"
#define SMALLBUF 256
#define MAX_SUBGROUP 9
#define ADD_BUTTON_LABEL "add"
#define CLEAR_BUTTON_LABEL "clear"
#define JBUFSIZE 2048
- #define PM_BUTTON "
\n"
- #define DEF_BUTTON "
\n"
+
+ #define DEF_BUTTON "
\n"
+ #define DEF_BUTTON_JS "setCheckBoxesThatContain('%s',true,false,'%s','','%s');" \
+ "setCheckBoxesThatContain('%s',false,false,'%s','_defOff','%s');"
#define DEFAULT_BUTTON(nameOrId,anc,beg,contains) \
- printf(DEF_BUTTON,(nameOrId),(beg),(contains),(nameOrId),(beg),(contains),(anc), \
- "defaults_sm.png","default")
+ printf(DEF_BUTTON,(anc),"defaults_sm.png","default"); \
+ safef(id, sizeof id, "btn_%s", (anc)); \
+ safef(javascript, sizeof javascript, DEF_BUTTON_JS,(nameOrId),(beg),(contains),(nameOrId),(beg),(contains)); \
+ jsOnEventById("click", id, javascript);
+
+ #define PM_BUTTON "
\n"
+ #define PM_BUTTON_JS "setCheckBoxesThatContain('%s',%s,true,'%s','','%s');"
#define PLUS_BUTTON(nameOrId,anc,beg,contains) \
- printf(PM_BUTTON, (nameOrId),"true", (beg),(contains),(anc),"add_sm.gif", "+")
+ printf(PM_BUTTON, (anc), "add_sm.gif", "+"); \
+ safef(id, sizeof id, "btn_%s", (anc)); \
+ safef(javascript, sizeof javascript, PM_BUTTON_JS, (nameOrId),"true", (beg),(contains)); \
+ jsOnEventById("click", id, javascript);
#define MINUS_BUTTON(nameOrId,anc,beg,contains) \
- printf(PM_BUTTON, (nameOrId),"false",(beg),(contains),(anc),"remove_sm.gif","-")
+ printf(PM_BUTTON, (anc), "remove_sm.gif", "-"); \
+ safef(id, sizeof id, "btn_%s", (anc)); \
+ safef(javascript, sizeof javascript, PM_BUTTON_JS, (nameOrId),"false", (beg),(contains)); \
+ jsOnEventById("click", id, javascript);
boolean isEncode2(char *database)
// Return true for ENCODE2 assemblies
{
return (sameString(database, "hg18") || sameString(database, "hg19") || sameString(database, "mm9"));
}
static char *htmlStringForDownloadsLink(char *database, struct trackDb *tdb,
- char *name,boolean nameIsFile)
+ char *name,boolean nameIsFile)
// Returns an HTML string for a downloads link
{
// If has fileSortOrder, then link to new hgFileUi
if (!nameIsFile && trackDbSetting(tdb, FILE_SORT_ORDER) != NULL)
{
char * link = needMem(PATH_LEN); // 512 should be enough
safef(link,PATH_LEN,"%s",
- hgFileUiName(),database, /*cartSessionVarName(),cartSessionId(cart),*/ tdb->track, name);
- // Note the hgsid would be needed if downloads page ever saved fileSortOrder to cart.
+ hgFileUiName(),database, /*cartSessionVarName(),cartSessionId(cart),*/ tdb->track, name);
+ // Note the hgsid would be needed if downloads page ever saved fileSortOrder to cart.
return link;
}
else if (trackDbSetting(tdb, "wgEncode") != NULL && isEncode2(database)) // Downloads directory if this is ENCODE
{
const char *compositeDir = metadataFindValue(tdb, MDB_OBJ_TYPE_COMPOSITE);
if (compositeDir == NULL && tdbIsComposite(tdb))
- compositeDir = tdb->track;
+ compositeDir = tdb->track;
if (compositeDir != NULL)
- {
- struct dyString *dyLink =
- dyStringCreate("%s",
- hDownloadsServer(), database, ENCODE_DCC_DOWNLOADS, compositeDir,
- (nameIsFile?name:""), nameIsFile?"file":"files",name);
- return dyStringCannibalize(&dyLink);
- }
+ {
+ struct dyString *dyLink =
+ dyStringCreate("%s",
+ hDownloadsServer(), database, ENCODE_DCC_DOWNLOADS, compositeDir,
+ (nameIsFile?name:""), nameIsFile?"file":"files",name);
+ return dyStringCannibalize(&dyLink);
+ }
}
return NULL;
}
static boolean makeNamedDownloadsLink(char *database, struct trackDb *tdb,char *name)
// Make a downloads link (if appropriate and then returns TRUE)
{
char *htmlString = htmlStringForDownloadsLink(database,trackDbTopLevelSelfOrParent(tdb),name,FALSE);
if (htmlString == NULL)
return FALSE;
printf("%s", htmlString);
freeMem(htmlString);
return TRUE;
}
@@@ -3968,102 -4014,103 +4015,105 @@@
{
struct trackDb *tdb = tdbRef->val;
safef(htmlIdentifier, sizeof(htmlIdentifier), "%s.priority", tdb->track);
char *cartHas = cartOptionalString(cart,htmlIdentifier);
if (cartHas != NULL)
{
tdb->priority = atof(cartHas);
cartPriorities = TRUE;
}
}
slSort(tdbRefList, trackDbRefCmp);
return cartPriorities;
}
void cfgByCfgType(eCfgType cType,char *db, struct cart *cart, struct trackDb *tdb,char *prefix,
- char *title, boolean boxed)
+ char *title, boolean boxed)
// Methods for putting up type specific cfgs used by composites/subtracks in hui.c
{
// When only one subtrack, then show it's cfg settings instead of composite/view level settings
// This simplifies the UI where hgTrackUi won't have 2 levels of cfg,
// while hgTracks still supports rightClick cfg of the subtrack.
if (configurableByAjax(tdb,cType) > 0) // Only if subtrack's configurable by ajax do we
{ // consider this option
if (tdbIsComposite(tdb) // called for the composite
&& !tdbIsCompositeView(tdb->subtracks) // and there is no view level
&& slCount(tdb->subtracks) == 1) // and there is only one subtrack
- {
- tdb = tdb->subtracks; // show subtrack cfg instead
- prefix = tdb->track;
- }
+ {
+ tdb = tdb->subtracks; // show subtrack cfg instead
+ prefix = tdb->track;
+ }
else if (tdbIsSubtrack(tdb) // called with subtrack
- && tdbIsCompositeView(tdb->parent) // subtrack has view
- && differentString(prefix,tdb->track) // and this has been called FOR the view
- && slCount(tdb->parent->subtracks) == 1) // and view has only one subtrack
- prefix = tdb->track; // removes reference to view level
+ && tdbIsCompositeView(tdb->parent) // subtrack has view
+ && differentString(prefix,tdb->track) // and this has been called FOR the view
+ && slCount(tdb->parent->subtracks) == 1) // and view has only one subtrack
+ prefix = tdb->track; // removes reference to view level
}
// Cfg could be explicitly blocked, but if tdb is example subtrack
// then blocking should have occurred before we got here.
if (!tdbIsSubtrack(tdb) && trackDbSettingBlocksConfiguration(tdb,FALSE))
return;
// composite/view must pass in example subtrack
// NOTE: if subtrack types vary then there shouldn't be cfg at composite/view level!
while (tdb->subtracks)
- tdb = tdb->subtracks;
+ tdb = tdb->subtracks;
switch(cType)
{
case cfgBedScore:
- {
- char *scoreMax = trackDbSettingClosestToHome(tdb, SCORE_FILTER _MAX);
- int maxScore = (scoreMax ? sqlUnsigned(scoreMax):1000);
- scoreCfgUi(db, cart,tdb,prefix,title,maxScore,boxed);
- }
- break;
+ {
+ char *scoreMax = trackDbSettingClosestToHome(tdb, SCORE_FILTER _MAX);
+ int maxScore = (scoreMax ? sqlUnsigned(scoreMax):1000);
+ scoreCfgUi(db, cart,tdb,prefix,title,maxScore,boxed);
+
+ if(startsWith("bigBed", tdb->type))
+ labelCfgUi(db, cart, tdb);
+ }
+ break;
case cfgPeak:
- encodePeakCfgUi(cart,tdb,prefix,title,boxed);
- break;
+ encodePeakCfgUi(cart,tdb,prefix,title,boxed);
+ break;
case cfgWig: wigCfgUi(cart,tdb,prefix,title,boxed);
- break;
+ break;
case cfgWigMaf: wigMafCfgUi(cart,tdb,prefix,title,boxed, db);
- break;
- case cfgGenePred: genePredCfgUi(cart,tdb,prefix,title,boxed);
- break;
+ break;
+ case cfgGenePred: genePredCfgUi(db, cart,tdb,prefix,title,boxed);
+ break;
case cfgChain: chainCfgUi(db,cart,tdb,prefix,title,boxed, NULL);
- break;
+ break;
case cfgNetAlign: netAlignCfgUi(db,cart,tdb,prefix,title,boxed);
- break;
+ break;
case cfgBedFilt: bedFiltCfgUi(cart,tdb,prefix,title, boxed);
- break;
+ break;
case cfgBam: bamCfgUi(cart, tdb, prefix, title, boxed);
- break;
+ break;
case cfgVcf: vcfCfgUi(cart, tdb, prefix, title, boxed);
- break;
+ break;
case cfgLong: longRangeCfgUi(cart, tdb, prefix, title, boxed);
- break;
+ break;
case cfgSnake: snakeCfgUi(cart, tdb, prefix, title, boxed);
- break;
+ break;
case cfgPsl: pslCfgUi(db,cart,tdb,prefix,title,boxed);
- break;
+ break;
+ case cfgBarChart: barChartCfgUi(db,cart,tdb,prefix,title,boxed);
+ break;
default: warn("Track type is not known to multi-view composites. type is: %d ",
- cType);
- break;
+ cType);
+ break;
}
}
char *encodeRestrictionDate(char *db,struct trackDb *trackDb,boolean excludePast)
// Create a string for ENCODE restriction date of this track
// if return is not null, then free it after use
{
if (!trackDb)
return NULL;
char *date = NULL;
if (metadataForTable(db,trackDb,NULL) != NULL)
{
date = cloneString((char *)metadataFindValue(trackDb,"dateUnrestricted"));