From 3adae8c9a683955641fe1417c977a3a06356107b Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 19 Apr 2016 07:22:17 +0100 Subject: Help dialog: put keys in greyed-out box. --- background_scripts/main.coffee | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 272146cb..9689dd79 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -106,11 +106,12 @@ helpDialogHtmlForCommandGroup = (group, commandsToKey, availableCommands, showUnboundCommands, showCommandNames) -> html = [] for command in Commands.commandGroups[group] - bindings = (commandsToKey[command] || [""]).join(", ") + keys = commandsToKey[command] || [] + bindings = ("#{Utils.escapeHtml key}" for key in keys).join ", " if (showUnboundCommands || commandsToKey[command]) isAdvanced = Commands.advancedCommands.indexOf(command) >= 0 description = availableCommands[command].description - if bindings.length < 12 + if keys.join(", ").length < 12 helpDialogHtmlForCommand html, isAdvanced, bindings, description, showCommandNames, command else # If the length of the bindings is too long, then we display the bindings on a separate row from the @@ -122,11 +123,11 @@ helpDialogHtmlForCommandGroup = (group, commandsToKey, availableCommands, helpDialogHtmlForCommand = (html, isAdvanced, bindings, description, showCommandNames, command) -> html.push "" if description - html.push "", Utils.escapeHtml(bindings), "" - html.push "#{if description and bindings then ':' else ''}", description + html.push "#{bindings}" + html.push "", description html.push("(#{command})") if showCommandNames else - html.push "", Utils.escapeHtml(bindings) + html.push "", bindings html.push("") # Cache "content_scripts/vimium.css" in chrome.storage.local for UI components. -- cgit v1.2.3