bbed927851c49abc7a66c8ed6350dfa99cebb189 hiram Fri Mar 22 15:11:31 2019 -0700 clean up some long duplicated strings refs #18869 diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c index 76c7c93..76b3083 100644 --- src/hg/hubApi/hubApi.c +++ src/hg/hubApi/hubApi.c @@ -216,49 +216,58 @@ safef(errorPrint, sizeof(errorPrint), " ERROR: %s", errorString); } unsigned start = chromSize / 4; unsigned end = start + 10000; if (end > chromSize) end = chromSize; char *genome = NULL; if (hub) genome = hub->genomeList->name; if (db) { if (hub) { + char urlReference[2048]; + safef(urlReference, sizeof(urlReference), " (sample getData)%s\n", urlPrefix, hub->url, genome, tdb->track, chrom, start, end, errorPrint); + if (tdb->parent) - hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); + hPrintf("
  • %s : %s subtrack of parent: %s%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlReference); else - hPrintf("
  • %s : %s (sample getData)%s
  • \n", tdb->track, tdb->type, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); + hPrintf("
  • %s : %s%s
  • \n", tdb->track, tdb->type, urlReference); } else { + char urlReference[2048]; + safef(urlReference, sizeof(urlReference), " (sample getData)%s\n", urlPrefix, db, chrom, tdb->track, start, end, errorPrint); + if (tdb->parent) - hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, db, chrom, tdb->track, start, end, errorPrint); + hPrintf("
  • %s : %s subtrack of parent: %s%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlReference); else - hPrintf("
  • %s : %s (sample getData)%s
  • \n", tdb->track, tdb->type, urlPrefix, db, chrom, tdb->track, start, end, errorPrint); + hPrintf("
  • %s : %s%s
  • \n", tdb->track, tdb->type, urlReference ); } } else if (hub) { + char urlReference[2048]; + safef(urlReference, sizeof(urlReference), " (sample getData)%s\n", urlPrefix, hub->url, genome, tdb->track, chrom, start, end, errorPrint); + if (tdb->parent) - hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); + hPrintf("
  • %s : %s subtrack of parent: %s%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlReference); else - hPrintf("
  • %s : %s (sample getData)%s
  • \n", tdb->track, tdb->type, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); + hPrintf("
  • %s : %s%s
  • \n", tdb->track, tdb->type, urlReference); } else hPrintf("
  • %s : %s not db hub track ?
  • \n", tdb->track, tdb->type); } static void hubSampleUrl(struct trackHub *hub, struct trackDb *tdb, long chromCount, long itemCount, char *chromName, unsigned chromSize, char *genome, char *errorString) { unsigned start = chromSize / 4; unsigned end = start + 10000; if (end > chromSize) end = chromSize; char errorPrint[2048]; @@ -1193,42 +1202,31 @@ } // hPrintf("

    ucscDb: '%s'

    \n", ucscDb); struct trackHubGenome *hubGenome = hub->genomeList; introductionText(); showExamples(urlInput, hubGenome, ucscDb); if (debug) showCartDump(); hPrintf("

    Explore hub or database assemblies and tracks

    \n"); -// hPrintf("
    \n\n", "../cgi-bin/hubApi"); -hPrintf("\n\n", urlPrefix); - -#ifdef NOT -if (isEmpty(urlPrefix)) - { - char *scriptUri = getenv("SCRIPT_URI"); - hPrintf("\n\n", scriptUri); - } -else hPrintf("\n\n", urlPrefix); -#endif hPrintf("Select public hub: "); #define JBUFSIZE 2048 #define SMALLBUF 256 char javascript[JBUFSIZE]; struct slPair *events = NULL; safef(javascript, sizeof(javascript), "this.lastIndex=this.selectedIndex;"); slPairAdd(&events, "focus", cloneString(javascript)); cgiMakeDropListClassWithIdStyleAndJavascript("publicHubs", "publicHubs", shortLabels, publicHubCount, hubDropDown, NULL, "width: 400px", events); hWrites(" "); hButton("goPublicHub", "go");