a4ed1e0d2c39286d95a53d98db4b0bdc51836260 Merge parents 7ab9bea 3c4e793 larrym Wed Jul 25 15:20:22 2012 -0700 resolve merge conflict with master diff --cc src/hg/lib/web.c index 0f5afc7,1939350..c4d617f --- src/hg/lib/web.c +++ src/hg/lib/web.c @@@ -173,71 -180,243 +173,71 @@@ for(ptr1=newString, ptr2=textOutBuf; *ptr2 ; ptr2++) { if (*ptr2 == '<') { for(; *ptr2 && (*ptr2 != '>'); ptr2++) ; } else *ptr1++ = *ptr2; } *ptr1 = 0; htmlTextOut(newString); printf(" \n "); if (endsWith(scriptName, "qaPushQ")) // Tired of failed stylesheet versioning that messes up RR releaseLog.html (regular and ENCODE) - printf(" \n"); + printf(" \n"); else webIncludeResourceFile("HGStyle.css"); if (extraStyle != NULL) puts(extraStyle); - printf("" "\n" - "", - hgColOutside()); + printf("\n"); + printBodyTag(stdout); htmlWarnBoxSetup(stdout);// Sets up a warning box which can be filled with errors as they occur puts(commonCssStyles()); } puts( "" "\n" "" "\n" "" "\n"); if (withLogo) { puts("" "\n" - "" "\n" ); + "" "\n" ); } /* Put up the hot links bar. */ -#ifdef NEW_MENUS - - char *docRoot = hDocumentRoot(); - jsIncludeFile("jquery.js", NULL); - if(docRoot != NULL) - { - struct dyString *file = dyStringCreate("%s/%s", docRoot, "NavBar.html"); - FILE *fd = fopen(dyStringContents(file), "r"); - if(fd == NULL) - // fail some other way (e.g. HTTP 500)? - errAbort("Couldn't open header file '%s' for reading", dyStringContents(file)); - else - { - char buf[4096]; - while(TRUE) - { - size_t n = fread(buf, 1, sizeof(buf), fd); - if(n) - fwrite(buf, 1, n, stdout); - else - break; - } - fclose(fd); - printf("\n"); - } - } - else - { - // tolerate missing docRoot (i.e. when running from command line) - // XXXX ???? - } - -#else - -if (isGisaid) - { - printf("
"); if (isEncode) { puts("" "\"ENCODE" ""); puts("\"ENCODE"); } else { puts(""); } puts("
\n"); - printf("\n"); - if (haveBlat) - printf("\n"); - printf("\n"); - printf("\n",uiState); - printf("\n"); - printf("
HomeBlatSample ViewSequence ViewTable View 
\n"); - // last column squeezes other columns left - } -else if (isGsid) - { - printf("\n"); - printf("\n"); - if (haveBlat) - printf("\n"); - printf("\n"); - printf("\n",uiState); - printf("\n"); - if (endsWith(scriptName, "hgBlat")) - printf("\n"); - else - printf("\n"); - printf("
HomeBlatSubject ViewSequence ViewTable ViewHelpHelp 
\n"); - // last column squeezes other columns left - } -else if (dbIsFound) +char *menuStr = menuBar(theCart); +if(menuStr) { - puts("\n" - ""); - puts(""); - - if (isEncode) - printf("\n"); - else - { - printf("\n", uiState); - if (isGsid) - printf("\n", - uiState); - else - printf("\n", - uiState); - - if (endsWith(scriptName, "hgTracks") || endsWith(scriptName, "hgGene") || - endsWith(scriptName, "hgTables") || endsWith(scriptName, "hgTrackUi") || - endsWith(scriptName, "hgSession") || endsWith(scriptName, "hgCustom") || - endsWith(scriptName, "hgHubConnect") || - endsWith(scriptName, "hgc") || endsWith(scriptName, "hgPal")) - printf("\n",uiState,TRACK_SEARCH); - - if (haveBlat && !endsWith(scriptName, "hgBlat")) - printf("\n",theCart ? "&" : "", uiState+1 ); - } - - if (!isGsid && !hIsCgbServer()) // disable TB for both GSID and CGB servers - { - char *table = (theCart == NULL ? NULL : - (endsWith(scriptName, "hgGene") ? - cartOptionalString(theCart, "hgg_type") : - cartOptionalString(theCart, "g"))); - if (table && theCart && - (endsWith(scriptName, "hgc") || endsWith(scriptName, "hgTrackUi") || - endsWith(scriptName, "hgGene"))) - { - struct trackDb *tdb = hTrackDbForTrack(db, table); - if (tdb != NULL) - printf("\n"); - } - - if (!endsWith(scriptName, "hgNear") && db != NULL && hgNearOk(db)) - { - if (isGsid) - printf("\n", - uiState); - else - printf("\n", - uiState); - } - if ((!endsWith(scriptName, "hgPcr")) && (db == NULL || hgPcrOk(db))) - printf("\n",uiState); - if (endsWith(scriptName, "hgGenome")) - printf("\n",uiState); - if (endsWith(scriptName, "hgHeatmap")) - printf("\n",uiState); -#ifndef GBROWSE - if (wikiLinkEnabled() && !endsWith(scriptName, "hgSession")) - printf("\n",uiState, theCart ? "&" : "?" ); -#endif /* GBROWSE */ - if (!isGsid) - printf(""); - if (!isGsid) - { - if (endsWith(scriptName, "hgBlat")) - printf("\n"); - } + jsIncludeFile("jquery.js", NULL); + puts(menuStr); } - printf("
HomeHomeSubject ViewGenomesGenome BrowserBlat", - uiState, tdb->grp, tdb->track, tdb->table); - else - printf("", - uiState); - trackDbFree(&tdb); - } - else - printf("", - uiState, theCart ? "&" : "?" ); - printf("TablesTable ViewGene SorterPCR" - "PDF/PS" - "PDF/PS" - "SessionFAQHelp 
\n"); - // last column squeezes other columns left - puts("\n"); - -#endif if (endsWith(scriptName, "hgGateway") && geoMirrorEnabled()) { // Show an opt-out alert if user is on a host to which user has been automatically redirected (just once, right after they have been redirected) char *source = cgiOptionalString("source"); char *redirect = cgiOptionalString("redirect"); if (source != NULL && redirect != NULL && sameString(redirect, "auto")) { char *domain = cgiServerName(); char *port = cgiServerPort(); // We don't bother maintaining stuff in request URI, because it may contain items like hgsid and other host specific values int newUriSize = 2048; char *newUri = needMem(newUriSize); // TODO what about https? safef(newUri, newUriSize, "http://%s:%s/cgi-bin/hgGateway?redirect=manual&source=%s", source, port, domain);