05ccc5f7743fcccebdfd8b59c11374c23ad61bc7 Merge parents a7843fa b505056 larrym Mon Jun 25 11:28:23 2012 -0700 resolve merge conflict with master diff --cc src/hg/hgGateway/hgGateway.c index aae3bf9,e4a61ac..9d5a4d3 --- src/hg/hgGateway/hgGateway.c +++ src/hg/hgGateway/hgGateway.c @@@ -49,164 -49,170 +49,161 @@@ then remove custom track data which will be irrelevant in this new database . If databases were changed then use the new default position too. */ if (sameString(position, "genome") || sameString(position, "hgBatch")) position = defaultPosition; jsIncludeFile("jquery.js", NULL); webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("ajax.js", NULL); jsIncludeFile("autocomplete.js", NULL); jsIncludeFile("hgGateway.js", NULL); jsIncludeFile("utils.js", NULL); +jsIncludeFile("jquery.watermarkinput.js", NULL); - puts( - "<CENTER style='font-size:small;'>" - "The UCSC Genome Browser was created by the \n" - "<A HREF=\"../staff.html\">Genome Bioinformatics Group of UC Santa Cruz</A>.\n" - "<BR>" - "Software Copyright (c) The Regents of the University of California.\n" - "All rights reserved.\n" - "</CENTER>\n" - ); - - puts( - "<FORM ACTION='../cgi-bin/hgTracks' NAME='mainForm' METHOD='GET' style='display:inline;'>\n" - "<CENTER>" - "<table style='background-color:#FFFEF3; border: 1px solid #CCCC99;'>\n" - "<tr><td>\n"); + puts("<CENTER style='font-size:small;'>" + "The UCSC Genome Browser was created by the \n" + "<A HREF=\"../staff.html\">Genome Bioinformatics Group of UC Santa Cruz</A>.\n" + "<BR>" + "Software Copyright (c) The Regents of the University of California.\n" + "All rights reserved.\n" + "</CENTER>\n"); + + puts("<FORM ACTION='../cgi-bin/hgTracks' NAME='mainForm' METHOD='GET' style='display:inline;'>\n" + "<CENTER>" + "<table style='background-color:#FFFEF3; border: 1px solid #CCCC99;'>\n" + "<tr><td>\n"); cgiMakeHiddenVar(hgHubConnectCgiDestUrl, "../cgi-bin/hgTracks"); puts("<table><tr>"); if (gotClade) puts("<td align=center valign=baseline>clade</td>"); - puts( - "<td align=center valign=baseline>genome</td>\n" - "<td align=center valign=baseline>assembly</td>\n" - "<td align=center valign=baseline>position or search term</td>\n"); + puts("<td align=center valign=baseline>genome</td>\n" + "<td align=center valign=baseline>assembly</td>\n" + "<td align=center valign=baseline>position or search term</td>\n"); + if(supportsSuggest) + puts("<td align=center valign=baseline><a title='click for help on gene search box' target='_blank' href='../goldenPath/help/geneSearchBox.html'>gene</a></td>\n"); puts( "<td align=center valign=baseline> </td>\n" "</tr>\n<tr>" ); if (gotClade) { puts("<td align=center>\n"); printCladeListHtml(organism, onChangeClade); puts("</td>\n"); } puts("<td align=center>\n"); if (gotClade) printGenomeListForCladeHtml(db, onChangeOrg); else printGenomeListHtml(db, onChangeOrg); puts("</td>\n"); puts("<td align=center>\n"); printAssemblyListHtml(db, onChangeDB); puts("</td>\n"); puts("<td align=center>\n"); -cgiMakeTextVar("position", addCommasToPos(db, position), 30); +hPrintf("<span class='positionDisplay' id='positionDisplay' title='click to copy position to input box'>%s</span>", addCommasToPos(db, position)); +hPrintf("<input type='hidden' name='position' id='position' value='%s'>\n", addCommasToPos(db, position)); +hPrintf("<input class='positionInput' type='text' name='hgt.positionInput' id='positionInput' size='60'>\n"); +if(assemblySupportsGeneSuggest(db)) + hPrintf("<input type='hidden' name='hgt.suggestTrack' id='suggestTrack' value='%s'>\n", assemblyGeneSuggestTrack(db)); printf("</td>\n"); -if(supportsSuggest) - { - puts("<td align=center>\n"); - hPrintf("<input name='hgt.suggest' type='text' size='5' id='suggest' />\n" - "<input type='hidden' name='hgt.suggestTrack' id='suggestTrack' value='%s'>\n", assemblyGeneSuggestTrack(db) - ); - printf("</td>\n"); - } - cartSetString(cart, "position", position); cartSetString(cart, "db", db); cartSetString(cart, "org", organism); if (gotClade) cartSetString(cart, "clade", clade); freez(&defaultPosition); position = NULL; puts("<td align=center>"); -if(supportsSuggest) - hButtonWithOnClick("Submit", "submit", NULL, "submitButtonOnClick()"); -else - cgiMakeButton("Submit", "submit"); -// This is a clear submit button that browsers will use by default when enter is pressed -// in position box. FIXME: This should be done with js onchange event! -printf("<input TYPE=\"IMAGE\" BORDER=\"0\" NAME=\"hgt.dummyEnterButton\" " - "src=\"../images/DOT.gif\" WIDTH=1 HEIGHT=1 ALT=dot>"); +hButton("Submit", "submit"); - +/* This is a clear submit button that browsers will use by default when enter is pressed in position box. FIXME: This should be done with js onchange event! */ +printf("<input TYPE=\"IMAGE\" BORDER=\"0\" NAME=\"hgt.dummyEnterButton\" src=\"../images/DOT.gif\" WIDTH=1 HEIGHT=1 ALT=dot>"); cartSaveSession(cart); /* Put up hgsid= as hidden variable. */ - puts( - "</td>\n" - "</tr></table>\n" - "</td></tr>\n"); + puts("</td>\n" + "</tr></table>\n" + "</td></tr>\n"); - puts( - "<tr><td><CENTER><BR>\n" - "<a HREF=\"../cgi-bin/cartReset\">Click here to reset</a> the browser user interface settings to their defaults."); + puts("<tr><td><CENTER><BR>\n" + "<a HREF=\"../cgi-bin/cartReset\">Click here to reset</a> " + "the browser user interface settings to their defaults."); #define SURVEY 1 #ifdef SURVEY if (survey && differentWord(survey, "off")) - printf(" <span style='background-color:yellow;'><A HREF=\"%s\" TARGET=_BLANK><EM><B>%s</EM></B></A></span>", survey, surveyLabel ? surveyLabel : "Take survey"); + printf(" <span style='background-color:yellow;'>" + "<A HREF=\"%s\" TARGET=_BLANK><EM><B>%s</EM></B></A></span>", + survey, surveyLabel ? surveyLabel : "Take survey"); #endif - puts( - "<BR>\n" - "</CENTER>\n" - "</td></tr><tr><td><CENTER>\n" - ); + puts("<BR>\n" + "</CENTER>\n" + "</td></tr><tr><td><CENTER>\n"); puts("<TABLE BORDER=\"0\">"); puts("<TR>"); - if(isSearchTracksSupported(db,cart)) + if (isSearchTracksSupported(db,cart)) { puts("<TD VALIGN=\"TOP\">"); cgiMakeButtonWithMsg(TRACK_SEARCH, TRACK_SEARCH_BUTTON,TRACK_SEARCH_HINT); puts("</TD>"); } // custom track button. disable hgCustom button on GSID server, until // necessary additional work is authorized. puts("<TD VALIGN=\"TOP\">"); /* disable CT for CGB servers for the time being */ if (!hIsGsidServer() && !hIsCgbServer()) { boolean hasCustomTracks = customTracksExist(cart, NULL); printf("<input TYPE=SUBMIT onclick=\"document.mainForm.action='%s';\" VALUE='%s' title='%s'>\n", hgCustomName(),hasCustomTracks ? CT_MANAGE_BUTTON_LABEL:CT_ADD_BUTTON_LABEL, hasCustomTracks ? "Manage your custom tracks" : "Add your own custom tracks" ); } puts("</TD>"); if (hubConnectTableExists()) { puts("<TD VALIGN=\"TOP\">"); printf("<input TYPE=SUBMIT onclick=\"document.mainForm.action='%s';\" VALUE='%s' title='%s'>\n", - "../cgi-bin/hgHubConnect", "track hubs", "Import tracks"); + "../cgi-bin/hgHubConnect", "track hubs", "Import tracks"); puts("</TD>"); } // configure button puts("<TD VALIGN=\"TOP\">"); - cgiMakeButtonWithMsg("hgTracksConfigPage", "configure tracks and display","Configure track selections and browser display"); + cgiMakeButtonWithMsg("hgTracksConfigPage", "configure tracks and display", + "Configure track selections and browser display"); puts("</TD>"); // clear possition button puts("<TD VALIGN=\"TOP\">"); if(supportsSuggest) - cgiMakeOnClickButton("document.mainForm.position.value=''; document.getElementById('suggest').value='';", "clear position"); + cgiMakeOnClickButton("document.mainForm.position.value=''; document.getElementById('positionInput').value='';", "clear position"); else cgiMakeOnClickButton("document.mainForm.position.value=''", "clear position"); puts("</TD>"); puts("</TR></TABLE>"); puts("</CENTER>\n" "</td></tr></table>\n" ); puts("</CENTER>"); if(!cartVarExists(cart, "pix")) // put a hidden input for pix on page so default value can be filled in on the client side hPrintf("<input type='hidden' name='pix' value=''>\n");