diff options
| -rw-r--r-- | content_scripts/link_hints.coffee | 15 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 5 |
2 files changed, 11 insertions, 9 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 783e6369..02b8d656 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -121,7 +121,8 @@ HintCoordinator = @linkHintsMode = @localHints = null LinkHints = - activateMode: (count = 1, mode = OPEN_IN_CURRENT_TAB) -> + activateMode: (count = 1, {mode}) -> + mode ?= OPEN_IN_CURRENT_TAB if 0 < count or mode is OPEN_WITH_QUEUE HintCoordinator.prepareToActivateMode mode, (isSuccess) -> if isSuccess @@ -129,12 +130,12 @@ LinkHints = # which would cause our new mode to exit immediately. Utils.nextTick -> LinkHints.activateMode count-1, mode - activateModeToOpenInNewTab: (count) -> @activateMode count, OPEN_IN_NEW_BG_TAB - activateModeToOpenInNewForegroundTab: (count) -> @activateMode count, OPEN_IN_NEW_FG_TAB - activateModeToCopyLinkUrl: (count) -> @activateMode count, COPY_LINK_URL - activateModeWithQueue: -> @activateMode 1, OPEN_WITH_QUEUE - activateModeToOpenIncognito: (count) -> @activateMode count, OPEN_INCOGNITO - activateModeToDownloadLink: (count) -> @activateMode count, DOWNLOAD_LINK_URL + activateModeToOpenInNewTab: (count) -> @activateMode count, mode: OPEN_IN_NEW_BG_TAB + activateModeToOpenInNewForegroundTab: (count) -> @activateMode count, mode: OPEN_IN_NEW_FG_TAB + activateModeToCopyLinkUrl: (count) -> @activateMode count, mode: COPY_LINK_URL + activateModeWithQueue: -> @activateMode 1, mode: OPEN_WITH_QUEUE + activateModeToOpenIncognito: (count) -> @activateMode count, mode: OPEN_INCOGNITO + activateModeToDownloadLink: (count) -> @activateMode count, mode: DOWNLOAD_LINK_URL class LinkHintsMode hintMarkerContainingDiv: null diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 11c69808..fcca98ab 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -144,7 +144,7 @@ class NormalMode extends KeyHandlerMode else if registryEntry.background chrome.runtime.sendMessage {handler: "runBackgroundCommand", registryEntry, count} else - Utils.invokeCommandString registryEntry.command, count + Utils.invokeCommandString registryEntry.command, count, {registryEntry} installModes = -> # Install the permanent modes. The permanently-installed insert mode tracks focus/blur events, and @@ -393,7 +393,8 @@ extend window, (event) -> recentlyFocusedElement = event.target if DomUtils.isEditable event.target , true - (count, mode = InsertMode) -> + (count) -> + mode = InsertMode # Focus the first input element on the page, and create overlays to highlight all the input elements, with # the currently-focused element highlighted specially. Tabbing will shift focus to the next input element. # Pressing any other key will remove the overlays and the special tab behavior. |
