From 70b8c396c273172ad2bc5b5cead0db7ad071767c Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Sun, 7 Mar 2010 17:27:29 -0800 Subject: Show a help dialog when pressing ? which displays all of the current keybindings o_O --- commands.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'commands.js') diff --git a/commands.js b/commands.js index 69501b5d..7cab1a56 100644 --- a/commands.js +++ b/commands.js @@ -52,6 +52,7 @@ function parseCustomKeyMappings(customKeyMappings) { } // Navigating the current page: +addCommand('showHelp', 'Show help.', true); addCommand('scrollDown', 'Scroll down.'); addCommand('scrollUp', 'Scroll up.'); addCommand('scrollLeft', 'Scroll left.'); @@ -87,8 +88,25 @@ addCommand('nextTab', 'Go one tab right.', true); addCommand('previousTab', 'Go one tab left.', true); addCommand('createTab', 'Create new tab.', true); addCommand('removeTab', 'Close current tab.', true); -addCommand('restoreTab', "Restore closed tab. (i.e. unwind the 'd' command).", true); - +addCommand('restoreTab', "Restore closed tab.", true); + + +// An ordered listing of all available commands, grouped by type. This is the order they will +// be shown in the help page. +var commandGroups = { + pageNavigation: + ["scrollDown", "scrollUp", "scrollLeft", "scrollRight", + "scrollToTop", "scrollToBottom", "scrollPageDown", "scrollPageUp", "scrollFullPageDown", + "reload", "toggleViewSource", "zoomIn", "zoomOut", "copyCurrentUrl", + "enterInsertMode", "activateLinkHintsMode", "activateLinkHintsModeToOpenInNewTab", + "enterFindMode", "performFind", "performBackwardsFind"], + historyNavigation: + ["goBack", "goForward"], + tabManipulation: + ["nextTab", "previousTab", "createTab", "removeTab", "restoreTab"] +}; + +mapKeyToCommand('?', 'showHelp'); mapKeyToCommand('j', 'scrollDown'); mapKeyToCommand('k', 'scrollUp'); mapKeyToCommand('h', 'scrollLeft'); -- cgit v1.2.3