aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932017-08-15 17:03:37 +0100
committermrmr19932017-11-18 12:40:36 +0000
commit448d609489f835162274f9ccef52918641927746 (patch)
tree9d531c7b916dcbc5f568b559a2d9fe3eb795b528
parent05604d8965da712b1709d0458fa1f3ca7a1d7f2f (diff)
downloadvimium-448d609489f835162274f9ccef52918641927746.tar.bz2
FF: Use HUD frame for openCopiedUrlIn{Current,New}Tab
-rw-r--r--background_scripts/commands.coffee4
-rw-r--r--content_scripts/mode_normal.coffee9
2 files changed, 11 insertions, 2 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 7e171d31..4d2e1606 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -340,8 +340,8 @@ commandDescriptions =
toggleViewSource: ["View page source", { noRepeat: true }]
copyCurrentUrl: ["Copy the current URL to the clipboard", { noRepeat: true }]
- openCopiedUrlInCurrentTab: ["Open the clipboard's URL in the current tab", { background: true, noRepeat: true }]
- openCopiedUrlInNewTab: ["Open the clipboard's URL in a new tab", { background: true, repeatLimit: 20 }]
+ openCopiedUrlInCurrentTab: ["Open the clipboard's URL in the current tab", { noRepeat: true }]
+ openCopiedUrlInNewTab: ["Open the clipboard's URL in a new tab", { repeatLimit: 20 }]
enterInsertMode: ["Enter insert mode", { noRepeat: true }]
passNextKey: ["Pass the next key to the page"]
diff --git a/content_scripts/mode_normal.coffee b/content_scripts/mode_normal.coffee
index 738f009e..e91feecf 100644
--- a/content_scripts/mode_normal.coffee
+++ b/content_scripts/mode_normal.coffee
@@ -95,6 +95,15 @@ NormalModeCommands =
url = url[0..25] + "...." if 28 < url.length
HUD.showForDuration("Yanked #{url}", 2000)
+ openCopiedUrlInNewTab: (count) ->
+ HUD.pasteFromClipboard (url) ->
+ for i in [0...count] by 1
+ chrome.runtime.sendMessage { handler: "openUrlInNewTab", url }
+
+ openCopiedUrlInCurrentTab: ->
+ HUD.pasteFromClipboard (url) ->
+ chrome.runtime.sendMessage { handler: "openUrlInCurrentTab", url }
+
# Mode changes.
enterInsertMode: ->
# If a focusable element receives the focus, then we exit and leave the permanently-installed insert-mode