From 761c5697aa3a33565a53f5a9656069054df39f12 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Tue, 19 Apr 2016 06:18:20 +0100
Subject: Place help dialog in darkend frame.
This mimics the look of Google Inbox or Github.
The background colour is from Google Inbox, Github uses a slightly
lighter colour.
---
content_scripts/vimium.css | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index f902363c..522b9b1c 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -138,25 +138,22 @@ div.vimiumHighlightedFrame {
/* Help Dialog CSS */
iframe.vimiumHelpDialogFrame {
- background-color: transparent;
+ background-color: rgba(10,10,10,0.6);
padding: 0px;
- overflow: hidden;
-
- display: block;
- position: fixed;
+ top: 0px;
+ left: 0px;
width: 100%;
min-width: 400px;
height: 100%;
- top: 0px;
- left: 0px;
+ display: block;
+ position: fixed;
border: none;
-
- /* One less than hint markers. */
- z-index: 2147483645;
+ z-index: 2147483645; /* One less than hint markers. */
}
div#vimiumHelpDialog {
- border:3px solid red;
+ border:3px solid;
+ -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 6px;
opacity:0.92;
background-color:#eee;
position:fixed;
@@ -164,14 +161,11 @@ div#vimiumHelpDialog {
border-radius:6px;
padding:8px 12px;
top:50px;
- left:50%;
- width:640px;
- max-height: calc(100% - 100px - 16px); /* 100% - 2*top - 2*padding for top/bottom */
- /* This needs to be 1/2 width to horizontally center the help dialog */
- margin-left:-320px;
- -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 6px;
- overflow-x: auto;
- overflow-y: auto;
+ left: 50%;
+ max-height: calc(100% - 100px - 12px);
+ width: calc(840px + 24px + 4px + 12px);
+ margin-left:calc(0px - 420px - 12px - 2px - 6px); /* Minus half of the width, above. */
+ overflow: auto;
}
div#vimiumHelpDialog a { color:blue; }
--
cgit v1.2.3
From cfad0ded611149b2757baa19fbac587a7d4f210d Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Tue, 19 Apr 2016 06:57:45 +0100
Subject: Help dialog: increase size and make white background.
---
background_scripts/main.coffee | 2 +-
content_scripts/vimium.css | 17 +++++++++++++----
pages/help_dialog.html | 3 ++-
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 3e1cc0a3..272146cb 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -123,7 +123,7 @@ helpDialogHtmlForCommand = (html, isAdvanced, bindings, description, showCommand
html.push "
"
if description
html.push "| ", Utils.escapeHtml(bindings), " | "
- html.push "#{if description and bindings then ':' else ''} | ", description
+ html.push " | #{if description and bindings then ':' else ''} | ", description
html.push("(#{command})") if showCommandNames
else
html.push " | ", Utils.escapeHtml(bindings)
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index 522b9b1c..ac683798 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -154,8 +154,8 @@ iframe.vimiumHelpDialogFrame {
div#vimiumHelpDialog {
border:3px solid;
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 6px;
- opacity:0.92;
- background-color:#eee;
+ opacity:1.0;
+ background-color:white;
position:fixed;
border:2px solid #b3b3b3;
border-radius:6px;
@@ -194,6 +194,9 @@ div.vimiumColumn table, div.vimiumColumn td, div.vimiumColumn tr { padding:0; ma
div.vimiumColumn table { width:100%; table-layout:auto; }
div.vimiumColumn td { vertical-align:top; padding:1px; }
div#vimiumHelpDialog div.vimiumColumn tr > td:first-of-type {
+ /* This is the "key" column, e.g. "j", "gg". */
+ font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
+ font-size:14px;
text-align:right;
font-weight:bold;
color:#2f508e;
@@ -204,13 +207,19 @@ div#vimiumHelpDialog div.vimiumColumn tr > td:nth-of-type(3) { width:100%; }
div#vimiumHelpDialog div.vimiumDivider {
display: block;
height:1px;
- width:92%;
+ width:100%;
margin:10px auto;
background-color:#9a9a9a;
}
div#vimiumHelpDialog td.vimiumHelpSectionTitle {
- font-weight:bold;
padding-top:3px;
+ font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
+ font-size:16px;
+ font-weight:bold;
+}
+div#vimiumHelpDialog td.vimiumHelpDescription {
+ font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
+ font-size:14px;
}
div#vimiumHelpDialog div.commandName { font-family:"courier new"; }
/* Advanced commands are hidden by default until you show them. */
diff --git a/pages/help_dialog.html b/pages/help_dialog.html
index 3bfa3e5a..3141b1ee 100644
--- a/pages/help_dialog.html
+++ b/pages/help_dialog.html
@@ -15,11 +15,12 @@
-
+
Options
Wiki
×
Vimium
+
--
cgit v1.2.3
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 ++++++-----
content_scripts/vimium.css | 32 ++++++++++++++++++++++++--------
pages/help_dialog.html | 22 +++++++++++-----------
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 = ("#{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.
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 @@
--
cgit v1.2.3
From 1115f2719c3e647ca1c1764c1b8a0140211bf3fa Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Tue, 19 Apr 2016 09:23:57 +0100
Subject: Help dialog; set maximum width.
---
content_scripts/vimium.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index 86411d0a..18908692 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -163,6 +163,7 @@ div#vimiumHelpDialog {
top:50px;
left: 50%;
max-height: calc(100% - 100px - 12px);
+ max-width: calc(100% - 100px + 12px);
width: calc(840px + 24px + 4px + 12px);
margin-left:calc(0px - 420px - 12px - 2px - 6px); /* Minus half of the width, above. */
overflow: auto;
--
cgit v1.2.3
From 4a670aaa3d121834685a672acc904f9824721824 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Tue, 19 Apr 2016 13:07:43 +0100
Subject: Help dialog; better formatting of command names.
This needs more work.
---
background_scripts/main.coffee | 5 +++--
content_scripts/vimium.css | 5 ++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 9689dd79..23b7ab48 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -124,8 +124,9 @@ helpDialogHtmlForCommand = (html, isAdvanced, bindings, description, showCommand
html.push ""
if description
html.push "| #{bindings} | "
- html.push " | ", description
- html.push("(#{command})") if showCommandNames
+ html.push " | | ",
+ "#{description}#{if showCommandNames then ":" else ""}"
+ html.push("#{command}") if showCommandNames
else
html.push " | ", bindings
html.push(" | ")
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index 18908692..6037c9c2 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -231,7 +231,10 @@ div#vimiumHelpDialog td.vimiumHelpDescription {
font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size:14px;
}
-div#vimiumHelpDialog div.commandName { font-family:"courier new"; }
+div#vimiumHelpDialog span.commandName {
+ font-family:"courier new";
+ color: #555;
+}
/* Advanced commands are hidden by default until you show them. */
div#vimiumHelpDialog tr.advanced { display: none; }
div#vimiumHelpDialog.showAdvanced tr.advanced { display: table-row; }
--
cgit v1.2.3
From 740df9a23fa9a1e5b812584ce0702b813b226623 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Tue, 19 Apr 2016 13:32:39 +0100
Subject: Help dialog; do not offer hints outside of the help dialog.
---
background_scripts/main.coffee | 4 ++--
content_scripts/link_hints.coffee | 14 +++++++++++---
pages/help_dialog.coffee | 3 ++-
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 23b7ab48..cb978db3 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -366,10 +366,10 @@ HintCoordinator =
for own frameId, port of @tabState[tabId].ports
@postMessage tabId, parseInt(frameId), messageType, port, request
- prepareToActivateMode: (tabId, originatingFrameId, {modeIndex}) ->
+ prepareToActivateMode: (tabId, originatingFrameId, {modeIndex, isVimiumHelpDialog}) ->
@tabState[tabId] = {frameIds: frameIdsForTab[tabId][..], hintDescriptors: {}, originatingFrameId, modeIndex}
@tabState[tabId].ports = extend {}, portsForTab[tabId]
- @sendMessage "getHintDescriptors", tabId, {modeIndex}
+ @sendMessage "getHintDescriptors", tabId, {modeIndex, isVimiumHelpDialog}
# Receive hint descriptors from all frames and activate link-hints mode when we have them all.
postHintDescriptors: (tabId, frameId, {hintDescriptors}) ->
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 702ff69d..6e1ebe80 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -70,18 +70,26 @@ HintCoordinator =
# place, then Vimium blocks. As a temporary measure, we install a timer to remove it.
Utils.setTimeout 1000, -> suppressKeyboardEvents.exit() if suppressKeyboardEvents?.modeIsActive
@onExit = [onExit]
- @sendMessage "prepareToActivateMode", modeIndex: availableModes.indexOf mode
+ @sendMessage "prepareToActivateMode",
+ modeIndex: availableModes.indexOf(mode), isVimiumHelpDialog: window.isVimiumHelpDialog
# Hint descriptors are global. They include all of the information necessary for each frame to determine
# whether and when a hint from *any* frame is selected. They include the following properties:
# frameId: the frame id of this hint's local frame
# localIndex: the index in @localHints for the full hint descriptor for this hint
# linkText: the link's text for filtered hints (this is null for alphabet hints)
- getHintDescriptors: ({modeIndex}) ->
+ getHintDescriptors: ({modeIndex, isVimiumHelpDialog}) ->
# Ensure that the document is ready and that the settings are loaded.
DomUtils.documentReady => Settings.onLoaded =>
requireHref = availableModes[modeIndex] in [COPY_LINK_URL, OPEN_INCOGNITO]
- @localHints = LocalHints.getLocalHints requireHref
+ # If link hints is launched within the help dialog, then we only offer hints from that frame. This
+ # improves the usability of the help dialog on the options page (particularly for selecting command
+ # names).
+ @localHints =
+ if isVimiumHelpDialog and not window.isVimiumHelpDialog
+ []
+ else
+ LocalHints.getLocalHints requireHref
@localHintDescriptors = @localHints.map ({linkText}, localIndex) -> {frameId, localIndex, linkText}
@sendMessage "postHintDescriptors", hintDescriptors: @localHintDescriptors
diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee
index 401c3222..ebcf8486 100644
--- a/pages/help_dialog.coffee
+++ b/pages/help_dialog.coffee
@@ -38,7 +38,7 @@ HelpDialog =
do (element) ->
element.setAttribute "role", "link"
element.addEventListener "click", ->
- commandName = element.textContent.replace("(","").replace ")", ""
+ commandName = element.textContent
chrome.runtime.sendMessage handler: "copyToClipboard", data: commandName
HUD.showForDuration("Yanked #{commandName}.", 2000)
@@ -82,3 +82,4 @@ UIComponentServer.registerHandler (event) ->
root = exports ? window
root.HelpDialog = HelpDialog
+root.isVimiumHelpDialog = true
--
cgit v1.2.3
From aeca4facc27e694d79228637994f2a5608606ab3 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Fri, 22 Apr 2016 14:59:03 +0100
Subject: Fix x-axis position.
This gest the centring calculation correct.
Also, remove the shadow; it's not visible.
---
content_scripts/vimium.css | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index 6037c9c2..1c4f1e37 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -143,7 +143,6 @@ iframe.vimiumHelpDialogFrame {
top: 0px;
left: 0px;
width: 100%;
- min-width: 400px;
height: 100%;
display: block;
position: fixed;
@@ -153,7 +152,6 @@ iframe.vimiumHelpDialogFrame {
div#vimiumHelpDialog {
border:3px solid;
- -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 6px;
opacity:1.0;
background-color:white;
position:fixed;
@@ -162,10 +160,10 @@ div#vimiumHelpDialog {
padding:8px 12px;
top:50px;
left: 50%;
- max-height: calc(100% - 100px - 12px);
- max-width: calc(100% - 100px + 12px);
- width: calc(840px + 24px + 4px + 12px);
- margin-left:calc(0px - 420px - 12px - 2px - 6px); /* Minus half of the width, above. */
+ width: 840px;
+ height: calc(100% - 100px - 16px); /* 100% -top - 2*padding */
+ max-width: calc(100% - 100px - 12px);
+ margin-left:calc(-420px - 12px); /* -1/2*width - 1*padding */
overflow: auto;
}
--
cgit v1.2.3
From 4c707140985ae03e3c523f2e6e4b6cb4c8465236 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Fri, 22 Apr 2016 16:03:26 +0100
Subject: Better help-dialog formatting.
Use margins to centre the help dialog. This works better on narrow
windows, and seems to produce a balanced dialog in a variety of cases.
---
content_scripts/vimium.css | 45 ++++++++++++++++++---------------------------
pages/help_dialog.coffee | 2 +-
pages/help_dialog.html | 18 ++++++++++++++----
3 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index 1c4f1e37..cddfbc97 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -151,26 +151,32 @@ iframe.vimiumHelpDialogFrame {
}
div#vimiumHelpDialog {
- border:3px solid;
opacity:1.0;
background-color:white;
- position:fixed;
border:2px solid #b3b3b3;
border-radius:6px;
padding:8px 12px;
- top:50px;
- left: 50%;
width: 840px;
- height: calc(100% - 100px - 16px); /* 100% -top - 2*padding */
- max-width: calc(100% - 100px - 12px);
- margin-left:calc(-420px - 12px); /* -1/2*width - 1*padding */
- overflow: auto;
+ max-width: calc(100% - 100px);
+ max-height: calc(100% - 100px);
+ margin: 50px auto;
+ overflow-y: auto;
}
-div#vimiumTitle, div#vimiumTitle span, div#vimiumTitle * { font-size:20px; }
+span#vimiumTitle, span#vimiumTitle span, span#vimiumTitle * { font-size:20px; }
#vimiumTitle {
display: block;
line-height: 130%;
+ white-space: nowrap;
+}
+td.vimiumHelpDialogTopButtons {
+ width: 100%;
+ text-align: right;
+}
+#helpDialogOptionsPage, #helpDialogWikiPage {
+ font-size: 14px;
+ padding-left: 5px;
+ padding-right: 5px;
}
div.vimiumColumn {
width:50%;
@@ -238,34 +244,19 @@ div#vimiumHelpDialog tr.advanced { display: none; }
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:4px;
- top:2px;
font-family:"courier new";
font-weight:bold;
color:#555;
text-decoration:none;
- padding-left:10px;
font-size:20px;
+ position: relative;
+ top: -12px;
+ right: -10px;
}
div#vimiumHelpDialog a {
text-decoration: underline;
}
-div#vimiumHelpDialog .wikiPage, div#vimiumHelpDialog .optionsPage {
- position: absolute;
- display: block;
- font-size: 14px;
- line-height: 130%;
- color:#555;
- top: 11px;
-}
-div#vimiumHelpDialog .optionsPage {
- right: 40px;
-}
-div#vimiumHelpDialog .wikiPage {
- right: 100px;
-}
div#vimiumHelpDialog a.closeButton:hover {
color:black;
-webkit-user-select:none;
diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee
index ebcf8486..6eb13660 100644
--- a/pages/help_dialog.coffee
+++ b/pages/help_dialog.coffee
@@ -15,7 +15,7 @@ HelpDialog =
clickEvent.preventDefault()
@hide()
false)
- @dialogElement.getElementsByClassName("optionsPage")[0].addEventListener("click", (clickEvent) ->
+ document.getElementById("helpDialogOptionsPage").addEventListener("click", (clickEvent) ->
clickEvent.preventDefault()
chrome.runtime.sendMessage({handler: "openOptionsPageInNewTab"})
false)
diff --git a/pages/help_dialog.html b/pages/help_dialog.html
index 389f09f2..e95dd403 100644
--- a/pages/help_dialog.html
+++ b/pages/help_dialog.html
@@ -16,10 +16,20 @@
- Options
- Wiki
- ×
- Vimium
+
--
cgit v1.2.3
From a7446f09538e0b0314611c9d847016a85f735644 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Fri, 22 Apr 2016 16:55:02 +0100
Subject: Nicer styling of command names in help dialog.
The commands names (in the help dialog) look nicer in italics. They
also format better that way.
---
background_scripts/main.coffee | 5 ++---
content_scripts/vimium.css | 5 +++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index cb978db3..653b61e7 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -124,9 +124,8 @@ helpDialogHtmlForCommand = (html, isAdvanced, bindings, description, showCommand
html.push ""
if description
html.push "| #{bindings} | "
- html.push " | ",
- "#{description}#{if showCommandNames then ":" else ""}"
- html.push("#{command}") if showCommandNames
+ html.push " | | ", description
+ html.push("(#{command})") if showCommandNames
else
html.push " | ", bindings
html.push(" | ")
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index cddfbc97..f4029509 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -236,8 +236,9 @@ div#vimiumHelpDialog td.vimiumHelpDescription {
font-size:14px;
}
div#vimiumHelpDialog span.commandName {
- font-family:"courier new";
- color: #555;
+ /* font-family:"courier new"; */
+ /* color: #555; */
+ font-style: italic;
}
/* Advanced commands are hidden by default until you show them. */
div#vimiumHelpDialog tr.advanced { display: none; }
--
cgit v1.2.3
From 546d8b91c2e0991c410a42b2098ff1d478f24c73 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Sat, 23 Apr 2016 06:28:01 +0100
Subject: Fix help dialog HTML.
- Style the links at the top the same as those at the bottom (re.
colour).
- Fix HTML indentation.
---
content_scripts/vimium.css | 1 +
pages/help_dialog.html | 21 ++++++++++-----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index f4029509..1b63c9da 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -177,6 +177,7 @@ td.vimiumHelpDialogTopButtons {
font-size: 14px;
padding-left: 5px;
padding-right: 5px;
+ color:#555;
}
div.vimiumColumn {
width:50%;
diff --git a/pages/help_dialog.html b/pages/help_dialog.html
index e95dd403..e16b0139 100644
--- a/pages/help_dialog.html
+++ b/pages/help_dialog.html
@@ -70,17 +70,16 @@
--
cgit v1.2.3
From 98ea279485fc456bbe4349559f9c08a24e2c4214 Mon Sep 17 00:00:00 2001
From: Stephen Blott
Date: Sat, 23 Apr 2016 06:53:55 +0100
Subject: Show tip re. clicking command names.
It's pretty undiscoverable that you can click command names to yank
them. So, this adds a tip to the bottom of the help dialog.
Also, change the cursor to a pointer when hovering over command names.
---
background_scripts/main.coffee | 1 +
content_scripts/vimium.css | 20 +++++++++++++-------
pages/help_dialog.coffee | 4 ++--
pages/help_dialog.html | 14 +++++++++++++-
4 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 653b61e7..5d1ab864 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -91,6 +91,7 @@ getHelpDialogHtml = ({showUnboundCommands, showCommandNames, customTitle}) ->
replacementStrings =
version: currentVersion
title: customTitle || "Help"
+ tip: if showCommandNames then "Tip: click command names to yank them to the clipboard." else ""
for own group of Commands.commandGroups
replacementStrings[group] =
diff --git a/content_scripts/vimium.css b/content_scripts/vimium.css
index 1b63c9da..a1d88a18 100644
--- a/content_scripts/vimium.css
+++ b/content_scripts/vimium.css
@@ -237,9 +237,9 @@ div#vimiumHelpDialog td.vimiumHelpDescription {
font-size:14px;
}
div#vimiumHelpDialog span.commandName {
- /* font-family:"courier new"; */
- /* color: #555; */
+ color: #555;
font-style: italic;
+ cursor: pointer;
}
/* Advanced commands are hidden by default until you show them. */
div#vimiumHelpDialog tr.advanced { display: none; }
@@ -267,13 +267,19 @@ div#vimiumHelpDialogFooter {
display: block;
position: relative;
}
+td.helpDialogBottomRight {
+ width: 100%;
+ text-align: right;
+}
div#vimiumHelpDialogFooter * { font-size:10px; }
-div#vimiumHelpDialogFooter .toggleAdvancedCommands {
- position: absolute;
- right: 2px;
- top: -34px;
+a#toggleAdvancedCommands, span#help-dialog-tip {
+ position: relative;
+ top: 19px;
+ color: #555;
+ white-space: nowrap;
+}
+td.helpDialogBottomLeft, td.helpDialogBottomRight {
font-size: 14px;
- color:#555;
}
a:link.vimiumHelDialogLink, a:visited.vimiumHelDialogLink, a:hover.vimiumHelDialogLink, a:active.vimiumHelDialogLink{
diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee
index 6eb13660..28aafb4a 100644
--- a/pages/help_dialog.coffee
+++ b/pages/help_dialog.coffee
@@ -19,7 +19,7 @@ HelpDialog =
clickEvent.preventDefault()
chrome.runtime.sendMessage({handler: "openOptionsPageInNewTab"})
false)
- @dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].addEventListener("click",
+ document.getElementById("toggleAdvancedCommands").addEventListener("click",
HelpDialog.toggleAdvancedCommands, false)
document.documentElement.addEventListener "click", (event) =>
@@ -58,7 +58,7 @@ HelpDialog =
Settings.set("helpDialog_showAdvancedCommands", !showAdvanced)
showAdvancedCommands: (visible) ->
- HelpDialog.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].innerHTML =
+ document.getElementById("toggleAdvancedCommands").innerHTML =
if visible then "Hide advanced commands" else "Show advanced commands"
# Add/remove the showAdvanced class to show/hide advanced commands.
diff --git a/pages/help_dialog.html b/pages/help_dialog.html
index e16b0139..a0ba6de5 100644
--- a/pages/help_dialog.html
+++ b/pages/help_dialog.html
@@ -65,11 +65,23 @@
+
+
|