diff options
| -rw-r--r-- | content_scripts/link_hints.coffee | 1 | ||||
| -rw-r--r-- | pages/help_dialog.coffee | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index c8f9b6f9..e74653f2 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -205,6 +205,7 @@ class LinkHintsMode if (element.hasAttribute("onclick") or element.getAttribute("role")?.toLowerCase() in ["button", "link"] or element.getAttribute("class")?.toLowerCase().indexOf("button") >= 0 or + element.getAttribute("class")?.indexOf("vimiumClickable") >= 0 or element.getAttribute("contentEditable")?.toLowerCase() in ["", "contentEditable", "true"]) isClickable = true diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee index 1b9420c3..0589e379 100644 --- a/pages/help_dialog.coffee +++ b/pages/help_dialog.coffee @@ -38,6 +38,16 @@ HelpDialog = @showAdvancedCommands(@getShowAdvancedCommands()) + # When command names are shown, clicking on them copies their text to the clipboard (and they can be + # clicked with link hints). + for element in @dialogElement.getElementsByClassName "commandName" + do (element) -> + element.classList.add "vimiumClickable" + element.addEventListener "click", -> + commandName = element.textContent.replace("(","").replace ")", "" + chrome.runtime.sendMessage handler: "copyToClipboard", data: commandName + HUD.showForDuration("Yanked #{commandName}.", 2000) + hide: -> UIComponentServer.postMessage "hide" toggle: (html) -> |
