src/hg/hgTables/schema.c 1.54
1.54 2009/03/16 05:08:48 kent
Starting to add bigBed support. So far the schema button works at least.
Index: src/hg/hgTables/schema.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/schema.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -b -B -U 4 -r1.53 -r1.54
--- src/hg/hgTables/schema.c 10 Mar 2009 01:25:24 -0000 1.53
+++ src/hg/hgTables/schema.c 16 Mar 2009 05:08:48 -0000 1.54
@@ -190,43 +190,8 @@
"1-based.\n</I></P>");
}
}
-static void stripHtmlTags(char *text)
-/* remove HTML tags from text string, replacing in place by moving
- * the text up to take their place
- */
-{
-char *s = text;
-char *e = text;
-char c = *text;
-for ( ; c != 0 ; )
- {
- c = *s++;
- if (c == 0)
- /* input string is NULL, or it ended with '>' without any
- * opening '>'
- */
- {
- *e = 0;
- break;
- }
- /* stays in the while loop for adjacent tags <TR><TD> ... etc */
- while (c == '<' && c != 0)
- {
- s = strchr(s,'>');
- if (s != NULL)
- {
- if (*s == '>') ++s; /* skip closing bracket > */
- c = *s++; /* next char after the closing bracket > */
- }
- else
- c = 0; /* no closing bracket > found, end of string */
- }
- *e++ = c; /* copies all text outside tags, including ending NULL */
- }
-}
-
static void printSampleRows(int sampleCount, struct sqlConnection *conn, char *table)
/* Put up sample values. */
{
@@ -278,27 +243,11 @@
if (row[i] == NULL)
{
hPrintf("<TD></TD>");
}
- else if (strlen(row[i]) > 128)
- {
- char *s = cloneStringZ(row[i],128);
- char *r;
- stripHtmlTags(s);
- eraseTrailingSpaces(s);
- r = replaceChars(s, " ", " ");
- hPrintf("<TD>%s ...</TD>", r);
- freeMem(s);
- freeMem(r);
- }
else
{
- char *r;
- stripHtmlTags(row[i]);
- eraseTrailingSpaces(row[i]);
- r = replaceChars(row[i], " ", " ");
- hPrintf("<TD>%s</TD>", r);
- freeMem(r);
+ writeHtmlCell(row[i]);
}
}
}
hPrintf("</TR>\n");
@@ -589,9 +538,11 @@
static void showSchema(char *db, struct trackDb *tdb, char *table)
/* Show schema to open html page. */
{
-if (isCustomTrack(table))
+if (isBigBed(table))
+ showSchemaBigBed(table);
+else if (isCustomTrack(table))
showSchemaCt(table);
else if (sameWord(table, WIKI_TRACK_TABLE))
showSchemaWiki(tdb, table);
else