ade564bc3cec3561f35064cd78b8845dc5051089 braney Tue Jul 26 15:21:21 2011 -0700 change "import tracks" button to "track hubs" button. Make disconnects in hgHubConnect return to myHubs tab diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c index 1401f46..09c94b0 100644 --- src/hg/hgHubConnect/hgHubConnect.c +++ src/hg/hgHubConnect/hgHubConnect.c @@ -261,41 +261,46 @@ char *id = cartOptionalString(cart, "hubId"); if (id != NULL) { char buffer[1024]; safef(buffer, sizeof buffer, "hgHubConnect.hub.%s", id); cartRemove(cart, buffer); } cartRemove(theCart, "hubId"); } void doMiddle(struct cart *theCart) /* Write header and body of html page. */ { +boolean gotDisconnect = FALSE; + cart = theCart; setUdcCacheDir(); if (cartVarExists(cart, hgHubDoClear)) { doClearHub(cart); cartWebEnd(); return; } if (cartVarExists(cart, hgHubDoDisconnect)) + { + gotDisconnect = TRUE; doDisconnectHub(cart); + } cartWebStart(cart, NULL, "%s", pageTitle); jsIncludeFile("jquery.js", NULL); jsIncludeFile("utils.js", NULL); jsIncludeFile("jquery-ui.js", NULL); webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("ajax.js", NULL); jsIncludeFile("hgHubConnect.js", NULL); webIncludeResourceFile("hgHubConnect.css"); printf("<div id=\"hgHubConnectUI\"> <div id=\"description\"> \n"); printf( "<P>Track data hubs are collections of tracks from outside of UCSC that " @@ -328,31 +333,31 @@ // ... and now the main form printf("<FORM ACTION=\"%s\" METHOD=\"POST\" NAME=\"mainForm\">\n", destUrl); cartSaveSession(cart); // we have two tabs for the public and unlisted hubs printf("<div id=\"tabs\">" "<ul> <li><a href=\"#publicHubs\">Public Hubs</a></li>" "<li><a href=\"#unlistedHubs\">My Hubs</a></li> " "</ul> "); hgHubConnectPublic(); hgHubConnectUnlisted(); printf("</div>"); -if (gotNew) // make MyHubs the default tab +if (gotNew || gotDisconnect) // make MyHubs the default tab { printf("<script type='text/javascript'>\n "); printf("var $tabs = $('#tabs').tabs();\n"); printf(" $tabs.tabs('select',1);\n"); printf("</script>\n"); } cgiMakeHiddenVar(hgHubConnectRemakeTrackHub, "on"); printf("</div>\n"); puts("</FORM>"); cartWebEnd(); } char *excludeVars[] = {"Submit", "submit", "hc_one_url",