aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vimium_frontend.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-03-26 12:08:43 +0000
committerStephen Blott2016-03-26 12:08:43 +0000
commitbfeaeae0df589e5163cdc9e99ea9d3c3b1b15038 (patch)
treeae5f417e29a060efebaf74b12110dd315a92115a /content_scripts/vimium_frontend.coffee
parent24d305500b4fd3574ed31cff33b177f42cd88457 (diff)
parente133f8d2b3d104568959759e8ec7cf907257eb1b (diff)
downloadvimium-bfeaeae0df589e5163cdc9e99ea9d3c3b1b15038.tar.bz2
Merge branch 'standardise-foreground-commands'
Conflicts: content_scripts/vimium_frontend.coffee
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
-rw-r--r--content_scripts/vimium_frontend.coffee10
1 files changed, 4 insertions, 6 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index e4a2e8c9..79459b76 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -121,10 +121,8 @@ class NormalMode extends KeyHandlerMode
handler: "sendMessageToFrames", message: {name: "runInTopFrame", sourceFrameId: frameId, registryEntry}
else if registryEntry.background
chrome.runtime.sendMessage {handler: "runBackgroundCommand", registryEntry, count}
- else if registryEntry.passCountToFunction
- Utils.invokeCommandString registryEntry.command, [count]
else
- Utils.invokeCommandString registryEntry.command for i in [0...count]
+ Utils.invokeCommandString registryEntry.command, count
installModes = ->
# Install the permanent modes. The permanently-installed insert mode tracks focus/blur events, and
@@ -155,7 +153,7 @@ initializePreDomReady = ->
frameFocused: ->
checkEnabledAfterURLChange: checkEnabledAfterURLChange
runInTopFrame: ({sourceFrameId, registryEntry}) ->
- Utils.invokeCommandString registryEntry.command, [sourceFrameId, registryEntry] if DomUtils.isTopFrame()
+ Utils.invokeCommandString registryEntry.command, sourceFrameId, registryEntry if DomUtils.isTopFrame()
chrome.runtime.onMessage.addListener (request, sender, sendResponse) ->
# These requests are intended for the background page, but they're delivered to the options page too.
@@ -499,8 +497,8 @@ findAndFocus = (backwards) ->
else
HUD.showForDuration("No matches for '#{FindMode.query.rawQuery}'", 1000)
-performFind = -> findAndFocus false
-performBackwardsFind = -> findAndFocus true
+performFind = (count) -> findAndFocus false for [0...count] by 1
+performBackwardsFind = (count) -> findAndFocus true for [0...count] by 1
getLinkFromSelection = ->
node = window.getSelection().anchorNode