aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-04-19 07:22:17 +0100
committerStephen Blott2016-04-22 14:52:45 +0100
commit3adae8c9a683955641fe1417c977a3a06356107b (patch)
tree45b074ee27f7c8dd7c9ee4ac8413f28e44b9afd6
parentcfad0ded611149b2757baa19fbac587a7d4f210d (diff)
downloadvimium-3adae8c9a683955641fe1417c977a3a06356107b.tar.bz2
Help dialog: put keys in greyed-out box.
-rw-r--r--background_scripts/main.coffee11
-rw-r--r--content_scripts/vimium.css32
-rw-r--r--pages/help_dialog.html22
3 files changed, 41 insertions, 24 deletions
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 = ("<span class='vimiumHelpDialogKey'>#{Utils.escapeHtml key}</span>" 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 "<tr class='vimiumReset #{"advanced" if isAdvanced}'>"
if description
- html.push "<td class='vimiumReset'>", Utils.escapeHtml(bindings), "</td>"
- html.push "<td class='vimiumReset'>#{if description and bindings then ':' else ''}</td><td class='vimiumReset vimiumHelpDescription'>", description
+ html.push "<td class='vimiumReset'>#{bindings}</td>"
+ html.push "<td class='vimiumReset'></td><td class='vimiumReset vimiumHelpDescription'>", description
html.push("<span class='vimiumReset commandName'>(#{command})</span>") if showCommandNames
else
- html.push "<td class='vimiumReset' colspan='3' style='text-align: left;'>", Utils.escapeHtml(bindings)
+ html.push "<td class='vimiumReset' colspan='3' style='text-align: left;'>", bindings
html.push("</td></tr>")
# Cache "content_scripts/vimium.css" in chrome.storage.local for UI components.
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index ac683798..86411d0a 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -168,7 +168,6 @@ div#vimiumHelpDialog {
overflow: auto;
}
-div#vimiumHelpDialog a { color:blue; }
div#vimiumTitle, div#vimiumTitle span, div#vimiumTitle * { font-size:20px; }
#vimiumTitle {
display: block;
@@ -198,10 +197,20 @@ div#vimiumHelpDialog div.vimiumColumn tr > td:first-of-type {
font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size:14px;
text-align:right;
- font-weight:bold;
- color:#2f508e;
+ /* font-weight:bold; */
+ /* color:#2f508e; */
white-space:nowrap;
}
+span.vimiumHelpDialogKey {
+ background-color: rgb(243,243,243);
+ color: rgb(33,33,33);
+ margin: 2px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ padding-left: 4px;
+ padding-right: 4px;
+ border-radius: 4px;
+}
/* Make the description column as wide as it can be. */
div#vimiumHelpDialog div.vimiumColumn tr > td:nth-of-type(3) { width:100%; }
div#vimiumHelpDialog div.vimiumDivider {
@@ -228,8 +237,8 @@ div#vimiumHelpDialog.showAdvanced tr.advanced { display: table-row; }
div#vimiumHelpDialog div.advanced td:nth-of-type(3) { color: #555; }
div#vimiumHelpDialog a.closeButton {
position:absolute;
- right:7px;
- top:5px;
+ right:4px;
+ top:2px;
font-family:"courier new";
font-weight:bold;
color:#555;
@@ -244,15 +253,16 @@ div#vimiumHelpDialog a {
div#vimiumHelpDialog .wikiPage, div#vimiumHelpDialog .optionsPage {
position: absolute;
display: block;
- font-size: 11px;
+ font-size: 14px;
line-height: 130%;
- top: 6px;
+ color:#555;
+ top: 11px;
}
div#vimiumHelpDialog .optionsPage {
right: 40px;
}
div#vimiumHelpDialog .wikiPage {
- right: 83px;
+ right: 100px;
}
div#vimiumHelpDialog a.closeButton:hover {
color:black;
@@ -267,6 +277,12 @@ div#vimiumHelpDialogFooter .toggleAdvancedCommands {
position: absolute;
right: 2px;
top: -34px;
+ font-size: 14px;
+ color:#555;
+}
+
+a:link.vimiumHelDialogLink, a:visited.vimiumHelDialogLink, a:hover.vimiumHelDialogLink, a:active.vimiumHelDialogLink{
+ color:#555;
}
/* Vimium HUD CSS */
diff --git a/pages/help_dialog.html b/pages/help_dialog.html
index 3141b1ee..389f09f2 100644
--- a/pages/help_dialog.html
+++ b/pages/help_dialog.html
@@ -60,17 +60,17 @@
<div id="vimiumHelpDialogFooter" class="vimiumReset">
<a href="#" class="vimiumReset toggleAdvancedCommands">Show advanced commands</a>
-
- <div class="vimiumReset vimiumColumn">
- Enjoying Vimium?
- <a class="vimiumReset" target="_blank"
- href="https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb/reviews">Leave us
- feedback</a>.<br/>
- Found a bug? <a class="vimiumReset" target="_blank" href="http://github.com/philc/vimium/issues">Report it here</a>.
- </div>
- <div class="vimiumReset vimiumColumn" style="text-align:right">
- <span class="vimiumReset">Version <span id="help-dialog-version"></span></span><br/>
- <a target="_blank" href="https://github.com/philc/vimium#release-notes" class="vimiumReset">What's new?</a>
+ <div class="vimiumReset vimiumColumn">
+ Enjoying Vimium?
+ <a class="vimiumHelDialogLink" target="_blank"
+ href="https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb/reviews">Leave us
+ feedback</a>.<br/>
+ Found a bug? <a class="vimiumHelDialogLink" target="_blank" href="http://github.com/philc/vimium/issues">Report it here</a>.
+ </div>
+ <div class="vimiumReset vimiumColumn" style="text-align:right">
+ <span class="vimiumReset">Version <span id="help-dialog-version"></span></span><br/>
+ <a href="https://github.com/philc/vimium#release-notes" target="_blank" class="vimiumHelDialogLink">What's new?</a>
+ </div>
</div>
</div>
</div>