c6cbddabb1c64bda5e814db3057299a3da4158bf max Fri Apr 22 10:06:49 2016 -0700 adding shortcut indicators in light gray to menubar, like in SAA/CUA applications. refs #17212 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 895f4b0..8caf9be 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -3273,34 +3273,59 @@ } }); $('#hgTracksDialog').dialog('option' , 'title' , popUpHgt.title); $('#hgTracksDialog').dialog('open'); } }; // A function to show the keyboard help dialog box, bound to ? and called from the menu bar function showHotkeyHelp() { $("#hotkeyHelp").dialog({width:'600'}); } -// A function to add the keyboard help dialog box to the menubar -function addKeyboardHelpEntry() { - html = '<li><a title="List all possible keyboard shortcuts" href="javascript:showHotkeyHelp()">Keyboard Shortcuts</a></li>'; +// A function to add an entry for the keyboard help dialog box to the menubar +// and add text that indicates the shortcuts to many static menubar items as suggested by good old IBM CUA/SAA +function addKeyboardHelpEntries() { + html = '<li><a title="List all possible keyboard shortcuts" href="javascript:showHotkeyHelp()">Keyboard Shortcuts</a><span class="shortcut">?</span></li>'; $('#help .last').before(html); + + html = '<span class="shortcut">s s</span>'; + $('#sessionsMenuLink').after(html); + + html = '<span class="shortcut">c t</span>'; + $('#customTracksMenuLink').after(html); + + html = '<span class="shortcut">t h</span>'; + $('#trackHubsMenuLink').after(html); + + html = '<span class="shortcut">t b</span>'; + $('#blatMenuLink').after(html); + + html = '<span class="shortcut">t t</span>'; + $('#tableBrowserMenuLink').after(html); + + html = '<span class="shortcut">t i</span>'; + $('#ispMenuLink').after(html); + + html = '<span class="shortcut">c f</span>'; + $('#configureMenuLink').after(html); + + html = '<span class="shortcut">c r</span>'; + $('#cartResetMenuLink').after(html); } // A function for the keyboard shortcut: // View DNA function gotoGetDnaPage() { var position = hgTracks.chromName+":"+hgTracks.winStart+"-"+hgTracks.winEnd; if (hgTracks.virtualSingleChrom && (pos.chrom.search("virt") === 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;