diff options
| -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", | 
