a4ed1e0d2c39286d95a53d98db4b0bdc51836260 Merge parents 7ab9bea 3c4e793 larrym Wed Jul 25 15:20:22 2012 -0700 resolve merge conflict with master diff --cc src/hg/hgTracks/hgTracks.c index 3bc4d83,5151590..10af409 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@@ -4468,144 -4516,188 +4513,167 @@@ { if (sameString(organism, "Archaea")) { hPrintf("%s %s on Archaeon %s Assembly", organization, browserName, freezeName); } else { if (stringIn(database, freezeName)) hPrintf("%s %s on %s %s Assembly", organization, browserName, organism, freezeName); else hPrintf("%s %s on %s %s Assembly (%s)", organization, browserName, organism, freezeName, database); } - } + } hPrintf("</B></span><BR>\n"); /* This is a clear submit button that browsers will use by default when enter is pressed in position box. */ hPrintf("<INPUT TYPE=IMAGE BORDER=0 NAME=\"hgt.dummyEnterButton\" src=\"../images/DOT.gif\">"); /* Put up scroll and zoom controls. */ #ifndef USE_NAVIGATION_LINKS hWrites("move "); - hButtonWithOnClick("hgt.left3", "<<<", "move 95% to the left", "return imageV2.navigateButtonClick(this);"); - hButtonWithOnClick("hgt.left2", " <<", "move 47.5% to the left", "return imageV2.navigateButtonClick(this);"); - hButtonWithOnClick("hgt.left1", " < ", "move 10% to the left", "return imageV2.navigateButtonClick(this);"); - hButtonWithOnClick("hgt.right1", " > ", "move 10% to the right", "return imageV2.navigateButtonClick(this);"); - hButtonWithOnClick("hgt.right2", ">> ", "move 47.5% to the right", "return imageV2.navigateButtonClick(this);"); - hButtonWithOnClick("hgt.right3", ">>>", "move 95% to the right", "return imageV2.navigateButtonClick(this);"); + hButtonWithOnClick("hgt.left3", "<<<", "move 95% to the left", + "return imageV2.navigateButtonClick(this);"); + hButtonWithOnClick("hgt.left2", " <<", "move 47.5% to the left", + "return imageV2.navigateButtonClick(this);"); + hButtonWithOnClick("hgt.left1", " < ", "move 10% to the left", + "return imageV2.navigateButtonClick(this);"); + hButtonWithOnClick("hgt.right1", " > ", "move 10% to the right", + "return imageV2.navigateButtonClick(this);"); + hButtonWithOnClick("hgt.right2", ">> ", "move 47.5% to the right", + "return imageV2.navigateButtonClick(this);"); + hButtonWithOnClick("hgt.right3", ">>>", "move 95% to the right", + "return imageV2.navigateButtonClick(this);"); hWrites(" zoom in "); /* use button maker that determines padding, so we can share constants */ topButton("hgt.in1", ZOOM_1PT5X); topButton("hgt.in2", ZOOM_3X); topButton("hgt.in3", ZOOM_10X); topButton("hgt.inBase", ZOOM_BASE); hWrites(" zoom out "); topButton("hgt.out1", ZOOM_1PT5X); topButton("hgt.out2", ZOOM_3X); topButton("hgt.out3", ZOOM_10X); - hWrites("<div style='height:1em;'></div>\n"); + hWrites("<div style='height:0.3em;'></div>\n"); #endif//ndef USE_NAVIGATION_LINKS if (showTrackControls) - { + { /* Break into a second form so that zooming and scrolling * can be done with a 'GET' so that user can back up from details * page without Internet Explorer popping up an annoying dialog. * Do rest of page as a 'POST' so that the ultra-long URL from * all the track controls doesn't break things. IE URL limit * is 2000 bytes, but some firewalls impose a ~1000 byte limit. * As a side effect of breaking up the page into two forms * we need to repeat the position in a hidden variable here * so that zoom/scrolling always has current position to work * from. */ // This 'dirty' field is used to check if js/ajax changes to the page have occurred. // If so and it is reached by the back button, a page reload will occur instead. hPrintf("<INPUT TYPE='text' style='display:none;' name='dirty' id='dirty' VALUE='false'>\n"); - // Unfortunately this does not work in IE, so that browser will get the reload only after this full load. - // NOTE: Larry and I have seen that the new URL is not even used, but this will abort the page load and hasten the isDirty() check in hgTracks.js - hPrintf("<script type='text/javascript'>if (document.getElementById('dirty').value == 'true') {document.getElementById('dirty').value = 'false'; window.location = '%s?hgsid=%d';}</script>\n",hgTracksName(),cart->sessionId); - hPrintf("<INPUT TYPE=HIDDEN id='positionHidden' NAME=\"position\" " - "VALUE=\"%s:%d-%d\">", chromName, winStart+1, winEnd); - hPrintf("\n%s", trackGroupsHidden1->string); - hPrintf("</CENTER></FORM>\n"); - hPrintf("<FORM ACTION=\"%s\" NAME=\"TrackForm\" id=\"TrackForm\" METHOD=\"POST\">\n\n", hgTracksName()); + // Unfortunately this does not work in IE, so IE will get reloaded only after this full load + // NOTE: Larry and I have seen that the new URL is not even used, but this will abort + // the page load and hasten the isDirty() check in hgTracks.js + hPrintf("<script type='text/javascript'>if (document.getElementById('dirty').value == " + "'true') {document.getElementById('dirty').value = 'false'; " + "window.location = '%s?hgsid=%d';}</script>\n",hgTracksName(),cart->sessionId); + hPrintf("<INPUT TYPE=HIDDEN id='positionHidden' NAME=\"position\" " + "VALUE=\"%s:%d-%d\">", chromName, winStart+1, winEnd); + hPrintf("\n%s", trackGroupsHidden1->string); + hPrintf("</CENTER></FORM>\n"); + hPrintf("<FORM ACTION=\"%s\" NAME=\"TrackForm\" id=\"TrackForm\" METHOD=\"POST\">\n\n", hgTracksName()); hPrintf("%s", trackGroupsHidden2->string); freeDyString(&trackGroupsHidden1); freeDyString(&trackGroupsHidden2); if (!psOutput) cartSaveSession(cart); /* Put up hgsid= as hidden variable. */ clearButtonJavascript = "document.TrackForm.position.value=''; document.getElementById('suggest').value='';"; hPrintf("<CENTER>"); } /* Make line that says position. */ { char buf[256]; char *survey = cfgOptionEnv("HGDB_SURVEY", "survey"); char *surveyLabel = cfgOptionEnv("HGDB_SURVEY_LABEL", "surveyLabel"); char *javascript = "onchange=\"document.location = '/cgi-bin/hgTracks?db=' + document.TrackForm.db.options[document.TrackForm.db.selectedIndex].value;\""; if (containsStringNoCase(database, "zoo")) { hPuts("Organism "); printAssemblyListHtmlExtra(database, javascript); } sprintf(buf, "%s:%d-%d", chromName, winStart+1, winEnd); position = cloneString(buf); -#ifdef MERGE_GENE_SUGGEST hPrintf("<span class='positionDisplay' id='positionDisplay' title='click to copy position to input box'>%s</span>", addCommasToPos(database, position)); hPrintf("<input type='hidden' name='position' id='position' value='%s'>\n", buf); sprintLongWithCommas(buf, winEnd - winStart); hPrintf(" <span id='size'>%s</span> bp. ", buf); - hPrintf("<input class='positionInput' type='text' name='hgt.positionInput' id='positionInput' size='60'>\n"); - hWrites(" "); - hButtonWithOnClick("hgt.jump", "go", NULL, "imageV2.jumpButtonOnClick()"); - jsonObjectAdd(jsonForClient, "assemblySupportsGeneSuggest", - newJsonBoolean(assemblySupportsGeneSuggest(database))); - if (assemblySupportsGeneSuggest(database)) - hPrintf("<input type='hidden' name='hgt.suggestTrack' id='suggestTrack' value='%s'>\n", - assemblyGeneSuggestTrack(database)); -#else///ifndef MERGE_GENE_SUGGEST - hWrites("position/search "); - hTextVar("position", addCommasToPos(database, position), 30); - sprintLongWithCommas(buf, winEnd - winStart); - if(assemblySupportsGeneSuggest(database)) - hPrintf(" <a title='click for help on gene search box' target='_blank' href='../goldenPath/help/geneSearchBox.html'>gene</a> " - "<input type='text' size='8' name='hgt.suggest' id='suggest'>\n" - "<input type='hidden' name='hgt.suggestTrack' id='suggestTrack' value='%s'>\n", assemblyGeneSuggestTrack(database) - ); + hPrintf("<input class='positionInput' type='text' name='hgt.positionInput' id='positionInput' size='60'>\n"); hWrites(" "); - hButtonWithOnClick("hgt.jump", "jump", NULL, "imageV2.jumpButtonOnClick()"); - hOnClickButton(clearButtonJavascript,"clear"); - hPrintf(" size <span id='size'>%s</span> bp. ", buf); - hWrites(" "); - hButton("hgTracksConfigPage", "configure"); -#endif///ndef MERGE_GENE_SUGGEST - if (survey && differentWord(survey, "off")) - hPrintf(" <span style='background-color:yellow;'><A HREF='%s' " - "TARGET=_BLANK><EM><B>%s</EM></B></A></span>\n", - survey, surveyLabel ? surveyLabel : "Take survey"); - hPutc('\n'); - } + hButton("hgt.jump", "go"); + jsonObjectAdd(jsonForClient, "assemblySupportsGeneSuggest", newJsonBoolean(assemblySupportsGeneSuggest(database))); + if(assemblySupportsGeneSuggest(database)) + hPrintf("<input type='hidden' name='hgt.suggestTrack' id='suggestTrack' value='%s'>\n", assemblyGeneSuggestTrack(database)); + if (survey && differentWord(survey, "off")) + hPrintf(" <span style='background-color:yellow;'><A HREF='%s' TARGET=_BLANK><EM><B>%s</EM></B></A></span>\n", survey, surveyLabel ? surveyLabel : "Take survey"); + hPutc('\n'); + } } /* Make chromsome ideogram gif and map. */ makeChromIdeoImage(&trackList, psOutput, ideoTn); #ifdef USE_NAVIGATION_LINKS - hPrintf("<TABLE BORDER=0 CELLPADDING=0 width='%d'><tr style='font-size:small;'>\n",tl.picWidth);//min(tl.picWidth, 800)); - hPrintf("<td width='40' align='left'><a href='?hgt.left3=1' title='move 95% to the left'><<<</a>\n"); - hPrintf("<td width='30' align='left'><a href='?hgt.left2=1' title='move 47.5% to the left'><<</a>\n"); - hPrintf("<td width='20' align='left'><a href='?hgt.left1=1' title='move 10% to the left'><</a>\n"); - - hPrintf("<td> </td>\n"); // Without 'width=' this cell expand to table with, forcing other cells to the sides. - hPrintf("<td width='40' align='left'><a href='?hgt.in1=1' title='zoom in 1.5x'>> <</a>\n"); - hPrintf("<td width='60' align='left'><a href='?hgt.in2=1' title='zoom in 3x'>>> <<</a>\n"); - hPrintf("<td width='80' align='left'><a href='?hgt.in3=1' title='zoom in 10x'>>>> <<<</a>\n"); - hPrintf("<td width='40' align='left'><a href='?hgt.inBase=1' title='zoom in to base range'>><i>base</i><</a>\n"); - - hPrintf("<td> </td>\n"); // Without 'width=' this cell expand to table with, forcing other cells to the sides. - hPrintf("<td width='40' align='right'><a href='?hgt.out1=1' title='zoom out 1.5x'>< ></a>\n"); - hPrintf("<td width='60' align='right'><a href='?hgt.out2=1' title='zoom out 3x'><< >></a>\n"); - hPrintf("<td width='80' align='right'><a href='?hgt.out3=1' title='zoom out 10x'><<< >>></a>\n"); - hPrintf("<td> </td>\n"); // Without 'width=' this cell expand to table with, forcing other cells to the sides. - hPrintf("<td width='20' align='right'><a href='?hgt.right1=1' title='move 10% to the right'>></a>\n"); - - hPrintf("<td width='30' align='right'><a href='?hgt.right2=1' title='move 47.5% to the right'>>></a>\n"); - hPrintf("<td width='40' align='right'><a href='?hgt.right3=1' title='move 95% to the right'>>>></a>\n"); - hPrintf("</tr></table>\n"); + hPrintf("<TABLE BORDER=0 CELLPADDING=0 width='%d'><tr style='font-size:small;'>\n", + tl.picWidth);//min(tl.picWidth, 800)); + hPrintf("<td width='40' align='left'><a href='?hgt.left3=1' " + "title='move 95% to the left'><<<</a>\n"); + hPrintf("<td width='30' align='left'><a href='?hgt.left2=1' " + "title='move 47.5% to the left'><<</a>\n"); + hPrintf("<td width='20' align='left'><a href='?hgt.left1=1' " + "title='move 10% to the left'><</a>\n"); + + hPrintf("<td> </td>\n"); // Without width cell expands table with, forcing others to sides + hPrintf("<td width='40' align='left'><a href='?hgt.in1=1' " + "title='zoom in 1.5x'>> <</a>\n"); + hPrintf("<td width='60' align='left'><a href='?hgt.in2=1' " + "title='zoom in 3x'>>> <<</a>\n"); + hPrintf("<td width='80' align='left'><a href='?hgt.in3=1' " + "title='zoom in 10x'>>>> <<<</a>\n"); + hPrintf("<td width='40' align='left'><a href='?hgt.inBase=1' " + "title='zoom in to base range'>><i>base</i><</a>\n"); + + hPrintf("<td> </td>\n"); // Without width cell expands table with, forcing others to sides + hPrintf("<td width='40' align='right'><a href='?hgt.out1=1' " + "title='zoom out 1.5x'>< ></a>\n"); + hPrintf("<td width='60' align='right'><a href='?hgt.out2=1' " + "title='zoom out 3x'><< >></a>\n"); + hPrintf("<td width='80' align='right'><a href='?hgt.out3=1' " + "title='zoom out 10x'><<< >>></a>\n"); + hPrintf("<td> </td>\n"); // Without width cell expands table with, forcing others to sides + hPrintf("<td width='20' align='right'><a href='?hgt.right1=1' " + "title='move 10% to the right'>></a>\n"); + + hPrintf("<td width='30' align='right'><a href='?hgt.right2=1' " + "title='move 47.5% to the right'>>></a>\n"); + hPrintf("<td width='40' align='right'><a href='?hgt.right3=1' """ + "title='move 95% to the right'>>>></a>\n"); + hPrintf("</tr></table>\n"); #endif///def USE_NAVIGATION_LINKS /* Make clickable image and map. */ makeActiveImage(trackList, psOutput); fflush(stdout); if(trackImgOnly) { // bail out b/c we are done if (measureTiming) { printTrackTiming(); } return; } @@@ -5501,50 -5607,52 +5583,50 @@@ hgFindMatches = NULL; // XXXX necessary ??? } jsonForClient = newJsonObject(newHash(8)); jsonObjectAdd(jsonForClient, "cgiVersion", newJsonString(CGI_VERSION)); boolean searching = differentString(cartUsualString(cart, TRACK_SEARCH,"0"), "0"); if(!trackImgOnly) { // Write out includes for css and js files hWrites(commonCssStyles()); jsIncludeFile("jquery.js", NULL); jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("utils.js", NULL); jsIncludeFile("ajax.js", NULL); -#ifdef MERGE_GENE_SUGGEST jsIncludeFile("jquery.watermarkinput.js", NULL); -#endif///def MERGE_GENE_SUGGEST if(!searching) { jsIncludeFile("jquery.imgareaselect.js", NULL); } jsIncludeFile("autocomplete.js", NULL); jsIncludeFile("hgTracks.js", NULL); #ifdef LOWELAB jsIncludeFile("lowetooltip.js", NULL); #endif///def LOWELAB - webIncludeResourceFile("jquery-ui.css"); - if (!searching) // NOT doing search - { - webIncludeResourceFile("jquery.contextmenu.css"); - jsIncludeFile("jquery.contextmenu.js", NULL); - webIncludeResourceFile("ui.dropdownchecklist.css"); - jsIncludeFile("ui.dropdownchecklist.js", NULL); - jsIncludeFile("ddcl.js", NULL); + webIncludeResourceFile("jquery-ui.css"); + if (!searching) // NOT doing search + { + webIncludeResourceFile("jquery.contextmenu.css"); + jsIncludeFile("jquery.contextmenu.js", NULL); + webIncludeResourceFile("ui.dropdownchecklist.css"); + jsIncludeFile("ui.dropdownchecklist.js", NULL); + jsIncludeFile("ddcl.js", NULL); } hPrintf("<div id='hgTrackUiDialog' style='display: none'></div>\n"); } /* check for new data hub */ if (cartVarExists(cart, hgHubDataText)) { addDataHubs(cart); } if (cartVarExists(cart, "chromInfoPage")) { cartRemove(cart, "chromInfoPage"); chromInfoPage();