b0123e7800e5ed1e0027cad7d23cba806d8c3c0a galt Mon Sep 17 15:39:45 2012 -0700 fixing problems related to cut and paste of url which was picking up trailing blanks - now by removing trailing newline before closing-td and adding jquery trim function we prevent those blanks and remove them even if they somehow get added by some other cause. diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c index d068f20..c130fb0 100644 --- src/hg/hgHubConnect/hgHubConnect.c +++ src/hg/hgHubConnect/hgHubConnect.c @@ -27,43 +27,43 @@ #define hgHubDo hgHub "do_" /* prefix for all commands */ #define hgHubDoClear hgHubDo "clear" #define hgHubDoDisconnect hgHubDo "disconnect" #define hgHubDoReset hgHubDo "reset" struct cart *cart; /* The user's ui state. */ struct hash *oldVars = NULL; static char *destUrl = "../cgi-bin/hgTracks"; static char *pageTitle = "Track Data Hubs"; char *database = NULL; char *organism = NULL; static void ourCellStart() { -puts(""); +fputs("", stdout); // do not add a newline } static void ourCellEnd() { puts(""); } static void ourPrintCell(char *str) { ourCellStart(); if (str != NULL) - puts(str); + fputs(str, stdout); // do not add a newline -- was causing trailing blanks get copied in cut and paste ourCellEnd(); } static char *removeLastComma(char *string) { if (string != NULL) { int len = strlen(string); if ( string[len - 1] == ',') string[len - 1] = 0; } return string; } @@ -86,31 +86,31 @@ static void hgHubConnectUnlisted(struct hubConnectStatus *hubList, struct hash *publicHash) /* Put up the list of unlisted hubs and other controls for the page. */ /* uses publicHash to distingusih public hubs from unlisted ones */ /* NOTE: Destroys hubList */ { // put out the top of our page printf("
\n" " \n" " \n" " \n" " \n"); // count up the number of unlisted hubs we currently have int unlistedHubCount = 0; struct hubConnectStatus *unlistedHubList = NULL; struct hubConnectStatus *hub, *nextHub; struct hash *assHash = newHash(5); for(hub = hubList; hub; hub = nextHub) { nextHub = hub->next; // if url is not in publicHash, it's unlisted */ @@ -284,30 +284,31 @@ ourCellEnd(); } else errAbort("cannot get id for hub with url %s\n", url); ourPrintCell(shortLabel); if (isEmpty(errorMessage)) ourPrintCell(longLabel); else printf("", errorMessage); ourPrintCell(removeLastComma(dbList)); ourPrintCell(url); + hashStore(publicHash, url); } sqlFreeResult(&sr); if (gotAnyRows) { printf("
\n" " \n" "\n" "
ERROR: %s " "Debug
\n"); printf("
"); } return publicHash; } struct hash *hgHubConnectPublic() /* Put up the list of public hubs and other controls for the page. */