From 3a73fdc9c040d85d29fc8b9f11cae062f2ed7fc9 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 9 Mar 2010 19:50:33 -0800 Subject: Add a dialog to show all available commands for key mappings under the options page. --- background_page.html | 23 +++++++++++++++++------ helpDialog.html | 5 ++++- options.html | 26 +++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/background_page.html b/background_page.html index 082c38ea..11788dc6 100644 --- a/background_page.html +++ b/background_page.html @@ -151,7 +151,7 @@ /* * Retrieves the help dialog HTML template from a file, and populates it with the latest keybindings. */ - function helpDialogHtml() { + function helpDialogHtml(showUnboundCommands, showCommandNames, customTitle) { var commandsToKey = {}; for (var key in keyToCommandRegistry) { var command = keyToCommandRegistry[key].command; @@ -160,21 +160,32 @@ var dialogHtml = fetchFileContents("helpDialog.html"); for (var group in commandGroups) dialogHtml = dialogHtml.replace("{{" + group + "}}", - helpDialogHtmlForCommandGroup(group, commandsToKey, availableCommands)); + helpDialogHtmlForCommandGroup(group, commandsToKey, availableCommands, + showUnboundCommands, showCommandNames)); dialogHtml = dialogHtml.replace("{{version}}", currentVersion); + dialogHtml = dialogHtml.replace("{{title}}", customTitle || "Help"); return dialogHtml; } /* * Generates HTML for a given set of commands. commandGroups are defined in commands.js */ - function helpDialogHtmlForCommandGroup(group, commandsToKey, availableCommands) { + function helpDialogHtmlForCommandGroup(group, commandsToKey, availableCommands, + showUnboundCommands, showCommandNames) { var html = []; for (var i = 0; i < commandGroups[group].length; i++) { var command = commandGroups[group][i]; - if (commandsToKey[command]) - html.push("
| Navigating the page |