2af949e966b17c1cf0855c9877c1b25a81c63be5 max Tue Mar 27 13:57:04 2012 -0700 moving link to top of table diff --git src/hg/hgc/pubs.c src/hg/hgc/pubs.c index 5ff910b..5d346af 100644 --- src/hg/hgc/pubs.c +++ src/hg/hgc/pubs.c @@ -40,36 +40,34 @@ if (!stringIn("sciencedirect.com", url)) return url; // cgi param to add the "UCSC matches" sciverse application to elsevier's sciencedirect char* sdAddParam = "?svAppaddApp=298535"; char* longUrl = catTwoStrings(url, sdAddParam); char* newUrl = replaceChars(longUrl, "article", "svapps"); return newUrl; } static void printFilterLink(char* pslTrack, char* articleId) /* print a link to hgTracks with an additional cgi param to activate the single article filter */ { int start = cgiInt("o"); int end = cgiInt("t"); - printf("  ", + printf("

", hgTracksPathAndSettings(), database, seqName, start+1, end, articleId, pslTrack); - char startBuf[64], endBuf[64]; - sprintLongWithCommas(startBuf, start + 1); - sprintLongWithCommas(endBuf, end); - printf("Show these sequence matches individually on genome browser"); + printf("Show these sequence matches individually on genome browser (activates track \"" + "Individual matches for article\")

"); } static char* makeSqlMarkerList(void) /* return list of sections from cgi vars, format like "'abstract','header'" */ { int secCount = sizeof(pubsSecNames)/sizeof(char *); struct slName* names = NULL; int i; for (i=0; i\n", HG_COL_BORDER); printf("\n", HG_COL_TABLE_LABEL); if (showDesc) puts(" Article file\n"); puts(" One row per sequence, with flanking text, sequence in bold\n"); if (pubsDebug) puts(" Identifiers\n"); if (!isClickedSection && !pubsDebug) puts(" Chained matches with this sequence\n"); puts("\n"); } static void printAddWbr(char* text, int distance) @@ -387,31 +386,39 @@ struct sqlResult *sr = sqlGetResult(conn, query); // construct title for section char* otherFormat = NULL; if (fasta) otherFormat = "table"; else otherFormat = "fasta"; char fullTitle[5000]; safef(fullTitle, sizeof(fullTitle), "%s (%s format)", title, cartSidUrlString(cart), cgiString("o"), cgiString("t"), cgiString("g"), cgiString("i"), !fasta, otherFormat); - webNewSection(fullTitle); + webNewSection("%s", fullTitle); + + if (isClickedSection) + { + printFilterLink(pslTable, articleId); + printf(""); + } + else + printf(""); if (!fasta) printSeqHeaders(showDesc, isClickedSection); char **row; bool foundSkippedRows = FALSE; while ((row = sqlNextRow(sr)) != NULL) { char* fileDesc = row[0]; char* snippet = row[1]; char* locString= row[2]; char* artId = row[3]; char* fileId = row[4]; char* seqId = row[5]; char* seq = row[6]; @@ -462,37 +469,32 @@ else { struct slName *locs; locs = slNameListFromStringArray(locArr, partCount); slUniqify(&locs, slNameCmp, slNameFree); printGbLinks(locs); printf("
"); printf("\n"); slFreeList(&locs); } } printf("\n"); } } - printf("\n"); + printf("\n"); // finish section - if (isClickedSection) - { - printf("

 "); - printFilterLink(pslTable, articleId); - } webEndSectionTables(); sqlFreeResult(&sr); return foundSkippedRows; } static void printSeqInfo(struct sqlConnection* conn, char* trackTable, char* pslTable, char* articleId, char* item, char* seqName, int start, bool fileDesc, bool fasta) /* print sequences, split into two sections * two sections: one for sequences that were clicked, one for all others*/ { struct hash* clickedSeqs = getSeqIdHash(conn, trackTable, articleId, item, seqName, start); bool skippedRows; if (clickedSeqs)