564752c30f5ec7260f1fcd600ae270a700f97e70
max
  Tue Apr 14 05:35:35 2015 -0700
Revert "first go a external tools integration"

This reverts commit ad9686d48e880c57458d09ac2cc03801dc822be4.

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 5d316ca..9f77872 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -4356,53 +4356,30 @@
         {
         hPrintf("%s, %d, %d, %d<br />\n",
 		    track->shortLabel, track->loadTime, track->drawTime,
 		    track->loadTime + track->drawTime);
         if (startsWith("wigMaf", track->tdb->type))
             if (track->subtracks)
                 if (track->subtracks->loadTime)
                     hPrintf("&nbsp; &nbsp; %s wiggle, load %d<br />\n",
                                 track->shortLabel, track->subtracks->loadTime);
         }
     }
 hPrintf("</span>\n");
 }
 
 
-void domAppendToMenu(char *menu, char *url, char *label) 
-/* Add an entry to a drop down menu, by changing the DOM with jquery  */
-{
-printf("$('#%s ul li').last().after('<li><a target=\"_BLANK\" href=\"%s\">%s</a></li>');\n", menu, url, label);
-}
-
-void appendExtTools() 
-{
-    char posStr[SMALLBUF];
-    safef(posStr,ArraySize(posStr),"%s:%d-%d",chromName, winStart, winEnd);
-
-    char *url = "http://www.tefor.net/crisporMax/crispor.cgi?org=$org&pos=$pos&pam=NGG";
-
-    url = replaceChars(url, "$org", database);
-    url = replaceChars(url, "$pos", posStr);
-
-    printf("<script>\n");
-    printf("$(document).ready( function() {\n");
-    domAppendToMenu("tools", url, "External: Tefor CRISPR sites");
-    printf("});\n");
-    printf("</script>\n");
-}
-
 void doTrackForm(char *psOutput, struct tempName *ideoTn)
 /* Make the tracks display form with the zoom/scroll buttons and the active
  * image.  If the ideoTn parameter is not NULL, it is filled in if the
  * ideogram is created.  */
 {
 struct group *group;
 struct track *track;
 char *freezeName = NULL;
 boolean hideAll = cgiVarExists("hgt.hideAll");
 boolean defaultTracks = cgiVarExists("hgt.reset");
 boolean showedRuler = FALSE;
 boolean showTrackControls = cartUsualBoolean(cart, "trackControlsOnMain", TRUE);
 long thisTime = 0, lastTime = 0;
 char *clearButtonJavascript;
 
@@ -4602,46 +4579,44 @@
     // If a portal was established, then set the global dimensions back to the portal size
     if (imgBoxPortalDimensions(theImgBox,NULL,NULL,NULL,NULL,&winStart,&winEnd,&(tl.picWidth),NULL))
         {
         winBaseCount = winEnd - winStart;
         insideWidth = tl.picWidth-gfxBorder-insideX;
         }
     }
 /* Center everything from now on. */
 hPrintf("<CENTER>\n");
 
 // info for drag selection javascript
 jsonObjectAdd(jsonForClient, "winStart", newJsonNumber(winStart));
 jsonObjectAdd(jsonForClient, "winEnd", newJsonNumber(winEnd));
 jsonObjectAdd(jsonForClient, "chromName", newJsonString(chromName));
 
-//printf("adding tools<p>");
-appendExtTools();
-
 if(trackImgOnly && !ideogramToo)
     {
     struct track *ideoTrack = chromIdeoTrack(trackList);
     if (ideoTrack)
         {
         ideoTrack->limitedVisSet = TRUE;
         ideoTrack->limitedVis = tvHide; /* Don't draw in main gif. */
         }
     makeActiveImage(trackList, psOutput);
     fflush(stdout);
     return;  // bail out b/c we are done
     }
 
+
 if (!hideControls)
     {
     /* set white-space to nowrap to prevent buttons from wrapping when screen is
      * narrow */
     hPrintf("<DIV STYLE=\"white-space:nowrap;\">\n");
     printMenuBar();
 
     /* Show title . */
     freezeName = hFreezeFromDb(database);
     if(freezeName == NULL)
         freezeName = "Unknown";
     hPrintf("<span style='font-size:x-large;'><B>");
     if (startsWith("zoo",database) )
         {
 	hPrintf("%s %s on %s June 2002 Assembly %s target1",
@@ -5231,31 +5206,30 @@
 
 return (ret == 0) ? 1 : ret;
 }
 
 void handlePostscript()
 /* Deal with Postscript output. */
 {
 struct tempName psTn, ideoPsTn;
 char *pdfFile = NULL, *ideoPdfFile = NULL;
 ZeroVar(&ideoPsTn);
 trashDirFile(&psTn, "hgt", "hgt", ".eps");
 
 if(!trackImgOnly)
     {
     printMenuBar();
-
     printf("<div style=\"margin: 10px\">\n");
     printf("<H1>PDF Output</H1>\n");
     printf("PDF images can be printed with Acrobat Reader "
            "and edited by many drawing programs such as Adobe "
            "Illustrator or Inkscape.<BR>");
     }
 doTrackForm(psTn.forCgi, &ideoPsTn);
 
 pdfFile = convertEpsToPdf(psTn.forCgi);
 if (strlen(ideoPsTn.forCgi))
     ideoPdfFile = convertEpsToPdf(ideoPsTn.forCgi);
 if (pdfFile != NULL)
     {
     printf("<UL style=\"margin-top:5px;\">\n");
     printf("<LI>Download <A TARGET=_blank HREF=\"%s\">"
@@ -5832,30 +5806,35 @@
  * is more than 4k */
 #if  0
 state = cgiUrlString();
 printf("State: %s\n", state->string);
 #endif
 
 getDbAndGenome(cart, &database, &organism, oldVars);
 
 protDbName = hPdbFromGdb(database);
 debugTmp = cartUsualString(cart, "hgDebug", "off");
 if(sameString(debugTmp, "on"))
     hgDebug = TRUE;
 else
     hgDebug = FALSE;
 
+if (hIsGisaidServer())
+    {
+    validateGisaidUser(cart);
+    }
+
 int timeout = cartUsualInt(cart, "udcTimeout", 300);
 if (udcCacheTimeout() < timeout)
     udcSetCacheTimeout(timeout);
 
 initTl();
 
 char *configPageCall = cartCgiUsualString(cart, "hgTracksConfigPage", "notSet");
 
 /* Do main display. */
 
 if (cartUsualBoolean(cart, "hgt.trackImgOnly", FALSE))
     {
     trackImgOnly = TRUE;
     ideogramToo = cartUsualBoolean(cart, "hgt.ideogramToo", FALSE);
     hideControls = TRUE;