diff options
| author | mrmr1993 | 2017-10-25 01:00:18 +0100 |
|---|---|---|
| committer | mrmr1993 | 2017-10-27 20:35:31 +0100 |
| commit | b06ed7bd5cc82ec3307aeee945bcf6bf8f9264ce (patch) | |
| tree | f3bfb89a61d4216999097559769135021902f958 | |
| parent | d8f8015f4cd71cf3681506a5ec16f00f8ab46f46 (diff) | |
| download | vimium-b06ed7bd5cc82ec3307aeee945bcf6bf8f9264ce.tar.bz2 | |
Include LinkHints, Vomnibar and Marks commands in normal mode file
| -rw-r--r-- | content_scripts/mode_normal.coffee | 25 | ||||
| -rw-r--r-- | tests/unit_tests/commands_test.coffee | 8 |
2 files changed, 32 insertions, 1 deletions
diff --git a/content_scripts/mode_normal.coffee b/content_scripts/mode_normal.coffee index 2408e4aa..3ddbf294 100644 --- a/content_scripts/mode_normal.coffee +++ b/content_scripts/mode_normal.coffee @@ -167,6 +167,31 @@ NormalModeCommands = new FocusSelector hints, visibleInputs, selectedInputIndex +if LinkHints? + extend NormalModeCommands, + "LinkHints.activateMode": LinkHints.activateMode + "LinkHints.activateModeToOpenInNewTab": LinkHints.activateModeToOpenInNewTab + "LinkHints.activateModeToOpenInNewForegroundTab": LinkHints.activateModeToOpenInNewForegroundTab + "LinkHints.activateModeWithQueue": LinkHints.activateModeWithQueue + "LinkHints.activateModeToOpenIncognito": LinkHints.activateModeToOpenIncognito + "LinkHints.activateModeToDownloadLink": LinkHints.activateModeToDownloadLink + "LinkHints.activateModeToCopyLinkUrl": LinkHints.activateModeToCopyLinkUrl + +if Vomnibar? + extend NormalModeCommands, + "Vomnibar.activate": Vomnibar.activate + "Vomnibar.activateInNewTab": Vomnibar.activateInNewTab + "Vomnibar.activateTabSelection": Vomnibar.activateTabSelection + "Vomnibar.activateBookmarks": Vomnibar.activateBookmarks + "Vomnibar.activateBookmarksInNewTab": Vomnibar.activateBookmarksInNewTab + "Vomnibar.activateEditUrl": Vomnibar.activateEditUrl + "Vomnibar.activateEditUrlInNewTab": Vomnibar.activateEditUrlInNewTab + +if Marks? + extend NormalModeCommands, + "Marks.activateCreateMode": Marks.activateCreateMode + "Marks.activateGotoMode": Marks.activateGotoMode + # The types in <input type="..."> that we consider for focusInput command. Right now this is recalculated in # each content script. Alternatively we could calculate it once in the background page and use a request to # fetch it each time. diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee index 08bf0a73..fcc7b821 100644 --- a/tests/unit_tests/commands_test.coffee +++ b/tests/unit_tests/commands_test.coffee @@ -3,8 +3,14 @@ extend global, require "./test_chrome_stubs.js" extend global, require "../../background_scripts/bg_utils.js" global.Settings = {postUpdateHooks: {}, get: (-> ""), set: ->} {Commands} = require "../../background_scripts/commands.js" -global.KeyHandlerMode = {} + +# Include mode_normal to check that all commands have been implemented. +global.KeyHandlerMode = global.Mode = {} global.DomUtils = {makeXPath: ->} +global.KeyboardUtils = {platform: ""} +extend global, require "../../content_scripts/link_hints.js" +extend global, require "../../content_scripts/marks.js" +extend global, require "../../content_scripts/vomnibar.js" {NormalModeCommands} = require "../../content_scripts/mode_normal.js" context "Key mappings", |
