4c6d2bf78e0ad85c283310b6a00c26fd0a82fb2e max Mon Sep 15 03:46:21 2025 -0700 adding a hub quick connect dialog box. qa still can decide if this should go into the menu somewhere, refs #35667 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 5e07d09597f..2e8b05ecca3 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -3814,30 +3814,58 @@ function gotoGetDnaPage() { var position = hgTracks.chromName+":"+hgTracks.winStart+"-"+hgTracks.winEnd; if (hgTracks.virtualSingleChrom && (pos.chrom.search("multi") === 0)) { position = genomePos.get().replace(/,/g,''); } else if (hgTracks.windows && hgTracks.nonVirtPosition) { position = hgTracks.nonVirtPosition; } var pos = parsePosition(position); if (pos) { var url = "hgc?hgsid="+getHgsid()+"&g=getDna&i=mixed&c="+pos.chrom+"&l="+pos.start+"&r="+pos.end+"&db="+getDb(); window.location.href = url; } return false; } +function hubQuickConnect() { + /* open a little dialog window that accepts a URL to a hub.txt file */ + const dialogHtml = + '<div id="hubQuickDialog" title="Track hub quick connect">'+ + '<b>Track hub URL:</b><br>'+ + '<form action="hgTracks" method="GET">'+ + '<input type="text" name="hubUrl" maxlength="1024" size="60" />'+ + '<input type="hidden" hgsid="'+getHgsid()+'"/>'+ + '<input type="submit" value="OK" />'+ + '</form>'+ + 'To connect to public hubs, more options when connecting via URL or hub development tools, select from the menu My Data > Track Hubs.'+ + '</div>'; + $('body').append(dialogHtml); + + // Initialize the dialog + $("#hubQuickDialog").dialog({ + autoOpen: false, + width: 600, + height: 400, + modal: true, + // not showing a Cancel button, the standard X should be sufficient and the user can always use Esc + }); + + // Show dialog + $("#hubQuickDialog").dialog("open"); +} + + // A function for the keyboard shortcuts "zoom to x bp" function zoomTo(zoomSize) { var flankSize = Math.floor(zoomSize/2); var posStr = genomePos.get(); posStr = posStr.replace("virt:", "multi:"); var pos = parsePosition(posStr); var mid = pos.start+(Math.floor((pos.end-pos.start)/2)); var newStart = Math.max(mid - flankSize, 0); var newEnd = mid + flankSize - 1; var newPos = genomePos.setByCoordinates(pos.chrom, newStart, newEnd); if (hgTracks.virtualSingleChrom && (newPos.search("multi:")===0)) newPos = genomePos.disguisePosition(newPosition); // DISGUISE? imageV2.navigateInPlace("db=" + getDb() + "&position="+newPos, null, true); }