aab4f66a2aca5293f3536cc1d1438b17d2b09dfd
tdreszer
Thu May 5 16:14:15 2011 -0700
A large set of tiny changes. These fix a lot of discrepencies with bgcolor and font color declarations which were tripping up docttype 4.01.
diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c
index 5e487ba..54f72e5 100644
--- src/hg/hgTracks/config.c
+++ src/hg/hgTracks/config.c
@@ -1,575 +1,575 @@
/* config - put up track and display configuration page. */
#include "common.h"
#include "dystring.h"
#include "cheapcgi.h"
#include "htmshell.h"
#include "hdb.h"
#include "hCommon.h"
#include "cart.h"
#include "web.h"
#include "customTrack.h"
#include "hgTracks.h"
#include "hgConfig.h"
#include "jsHelper.h"
#include "imageV2.h"
#include "search.h"
#define DOWNLOADS_ONLY_TRACKS_INCLUDED
#ifdef DOWNLOADS_ONLY_TRACKS_INCLUDED
#include "fileUi.h"
#endif///def DOWNLOADS_ONLY_TRACKS_INCLUDED
static void textSizeDropDown()
/* Create drop down for font size. */
{
static char *sizes[] = {"6", "8", "10", "12", "14", "18", "24", "34"};
hDropList(textSizeVar, sizes, ArraySize(sizes), tl.textSize);
}
#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
static void printGroupListHtml(char *groupCgiName, struct group *groupList, char *defaultGroup)
/* Make an HTML select input listing the groups. */
{
char *groups[128];
char *labels[128];
char *defaultLabel = NULL;
int numGroups = 0;
struct group *group = NULL;
for (group = groupList; group != NULL; group = group->next)
{
groups[numGroups] = group->name;
labels[numGroups] = group->name;
if (sameWord(defaultGroup, groups[numGroups]))
defaultLabel = groups[numGroups];
numGroups++;
if (numGroups >= ArraySize(groups))
internalErr();
}
cgiMakeDropListFull(groupCgiName, labels, groups, numGroups,
defaultLabel, NULL);
}
#endif///def PRIORITY_CHANGES_IN_CONFIG_UI
static void trackConfig(struct track *trackList, struct group *groupList,
char *groupTarget, int changeVis)
/* Put up track configurations. If groupTarget is
* NULL then set visibility for tracks in all groups. Otherwise,
* just set it for the given group. If vis is -2, then visibility is
* unchanged. If -1 then set visibility to default, otherwise it should
* be tvHide, tvDense, etc. */
{
#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
char pname[512];
char gname[512];
#endif///def PRIORITY_CHANGES_IN_CONFIG_UI
struct group *group;
boolean showedRuler = FALSE;
setRulerMode();
changeTrackVis(groupList, groupTarget, changeVis);
/* Set up ruler mode according to changeVis. */
#ifdef BOB_DOESNT_LIKE
if (changeVis != -2)
{
if (groupTarget == NULL ||
(groupList != NULL && sameString(groupTarget, groupList->name)))
{
if (changeVis == -1)
rulerMode = tvFull;
else
rulerMode = changeVis;
}
}
#endif /* BOB_DOESNT_LIKE */
jsInit();
cgiMakeHiddenVar(configGroupTarget, "none");
boolean isFirstNotCtGroup = TRUE;
for (group = groupList; group != NULL; group = group->next)
{
struct trackRef *tr;
if (group->trackList == NULL)
continue;
/* check if group section should be displayed */
char *otherState;
char *indicator;
char *indicatorImg;
boolean isOpen = !isCollapsedGroup(group);
collapseGroupGoodies(isOpen, FALSE, &indicatorImg,
&indicator, &otherState);
hTableStart();
hPrintf("
");
- hPrintf("
");
+ hPrintf("
");
hPrintf("\n",group->name);
hPrintf("",
collapseGroupVar(group->name),collapseGroupVar(group->name), (isOpen?0:1));
hPrintf(" ",
hgTracksName(), cartSidUrlString(cart),collapseGroupVar(group->name),
otherState, group->name, group->name, group->name, indicatorImg, indicator,isOpen?"Collapse":"Expand");
hPrintf(" %s ", wrapWhiteFont(group->label));
hPrintf(" ");
hPrintf("",
configHideAll, "hide all", configGroupTarget, group->name,
jsSetVerticalPosition("mainForm"));
hPrintf(" ");
hPrintf("",
configShowAll, "show all", configGroupTarget, group->name,
jsSetVerticalPosition("mainForm"));
hPrintf(" ");
hPrintf("",
configDefaultAll, "default", configGroupTarget, group->name,
jsSetVerticalPosition("mainForm"));
hPrintf(" ");
/* do not want all the submit buttons named the same. It is
* confusing to the javascript submit() function.
*/
char submitName[256];
safef(submitName, sizeof(submitName), "%sSubmit", group->name);
cgiMakeButtonWithMsg(submitName, "submit","Submit your selections and view them in the browser");
#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
if (withPriorityOverride)
{
hPrintf(" ");
hPrintf(" ");
hPrintf(" ");
hPrintf("%s", wrapWhiteFont("Group Order: "));
}
#endif///def PRIORITY_CHANGES_IN_CONFIG_UI
hPrintf("
\n");
#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
if (withPriorityOverride)
{
hPrintf("
");
if (tdbIsSuperTrackChild(tdb))
/* indent members of a supertrack */
hPrintf(" ");
/* If track is not on this chrom print an informational
message for the user. */
#ifdef DOWNLOADS_ONLY_TRACKS_INCLUDED
if (tdbIsDownloadsOnly(tdb))
hPrintf("Downloads", // No vis display for downloadsOnly
hgFileUiName(),cartSessionVarName(), cartSessionId(cart), tdb->track);
else
#endif///def DOWNLOADS_ONLY_TRACKS_INCLUDED
if (hTrackOnChrom(track->tdb, chromName))
{
if (tdbIsSuper(track->tdb))
{
/* supertrack dropdown is hide/show */
superTrackDropDown(cart, track->tdb, 1);
}
else
{
/* check for option of limiting visibility to one mode */
hTvDropDownClassVisOnly(track->track, track->visibility,
track->canPack, (track->visibility == tvHide) ?
"hiddenText" : "normalText",
trackDbSetting(track->tdb, "onlyVisibility"));
}
}
else
hPrintf("[No data-%s]", chromName);
hPrintf("
");
hPrintf("
");
hPrintf("%s", tdb->longLabel);
hPrintf("
");
#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
if (withPriorityOverride)
{
hPrintf("
");
#ifdef DOWNLOADS_ONLY_TRACKS_INCLUDED
if (tdbIsDownloadsOnly(tdb))
hPrintf(" 
\n");
}
hTableEnd();
hPrintf(" ");
}
}
#ifdef DOWNLOADS_ONLY_TRACKS_INCLUDED
static int addDownloadOnlyTracks(char *db,struct group **pGroupList,struct track **pTrackList)
// Download only tracks are not normaly incorporated into the grou and track lists
{
int count = 0;
struct track *track = NULL;
struct group *group = NULL;
struct trackDb *tdbList = hTrackDb(db);
struct trackDb *tdb = tdbList;
for(;tdb != NULL; tdb = tdb->next)
{
if (!tdbIsDownloadsOnly(tdb)
|| tdbIsFolderContent(tdb)
|| tdbIsCompositeChild(tdb))
continue;
// Must find group
if (tdb->grp == NULL)
continue;
for (group = *pGroupList;group != NULL; group = group->next)
{
if (sameWord(group->name,tdb->grp))
break;
}
if (group == NULL)
continue;
// Make the track
track = trackFromTrackDb(tdb);
track->group = group;
track->groupName = cloneString(group->name); // Don't even bother looking in cart. That junk should be thrown out, now that we have dragReorder
slAddHead(pTrackList,track);
count++;
}
if (count > 0)
{
// Going to have to make all new group->trackLists
slSort(pGroupList, gCmpPriority);
for (group = *pGroupList;group != NULL; group = group->next)
slFreeList(&group->trackList);
// Sort the tracks anew and add each on into it's group.
slSort(pTrackList, tgCmpPriority);
for (track = *pTrackList; track != NULL; track = track->next)
{
struct trackRef *tr;
AllocVar(tr);
tr->track = track;
slAddHead(&track->group->trackList, tr);
}
/* Straighten things out, clean up, and go home. */
for (group = *pGroupList;group != NULL; group = group->next)
slReverse(&group->trackList);
}
return count;
}
#endif///def DOWNLOADS_ONLY_TRACKS_INCLUDED
void configPageSetTrackVis(int vis)
/* Do config page after setting track visibility. If vis is -2, then visibility
* is unchanged. If -1 then set visibility to default, otherwise it should
* be tvHide, tvDense, etc. */
{
struct dyString *title = dyStringNew(0);
char *groupTarget = NULL;
struct track *trackList = NULL;
struct track *ideoTrack = NULL;
struct group *groupList = NULL;
withPriorityOverride = cartUsualBoolean(cart, configPriorityOverride, FALSE);
/* Get track list and group them. */
ctList = customTracksParseCart(database, cart, &browserLines, &ctFileName);
trackList = getTrackList(&groupList, vis);
#ifdef DOWNLOADS_ONLY_TRACKS_INCLUDED
addDownloadOnlyTracks(database,&groupList,&trackList);
#endif///def DOWNLOADS_ONLY_TRACKS_INCLUDED
/* The ideogram for some reason is considered a track.
* We don't really want to process it as one though, so
* we see if it's there, and if necessary remove it. */
ideoTrack = chromIdeoTrack(trackList);
if (ideoTrack != NULL)
removeTrackFromGroup(ideoTrack);
/* Fetch group to change on if any from CGI,
* and remove var so it doesn't get used again. */
groupTarget = cloneString(cartUsualString(cart, configGroupTarget, ""));
cartRemove(cart, configGroupTarget);
if (sameString(groupTarget, "none"))
freez(&groupTarget);
dyStringPrintf(title, "Configure Image");
hPrintf("