aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/commands.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-01-31 13:10:39 +0000
committerStephen Blott2016-01-31 13:10:39 +0000
commitd16c7c52ef12debbde5538a353f683be845e8847 (patch)
treebb5cc4cc0ae5a0b087dac97d7930973ddd92e055 /background_scripts/commands.coffee
parent72f76a4ef22b06e076cf631b8e0c3ad5cc3ccfbd (diff)
parenteba184604678dbc11fffa04c8fe05ff537a50e36 (diff)
downloadvimium-d16c7c52ef12debbde5538a353f683be845e8847.tar.bz2
Merge pull request #1958 from smblott-github/logging-page
Add a logging page...
Diffstat (limited to 'background_scripts/commands.coffee')
-rw-r--r--background_scripts/commands.coffee8
1 files changed, 4 insertions, 4 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index e3a6f0dc..0a296c3e 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -13,7 +13,7 @@ Commands =
# command passed to it. This is used to implement e.g. "closing of 3 tabs".
addCommand: (command, description, options) ->
if command of @availableCommands
- console.log(command, "is already defined! Check commands.coffee for duplicates.")
+ logMessage? "#{command} is already defined! Check commands.coffee for duplicates."
return
options ||= {}
@@ -26,7 +26,7 @@ Commands =
mapKeyToCommand: ({ key, command, options }) ->
unless @availableCommands[command]
- console.log command, "doesn't exist!"
+ logMessage? "#{command} doesn't exist!"
return
options ?= []
@@ -55,13 +55,13 @@ Commands =
[ _, key, command, options... ] = tokens
if command? and @availableCommands[command]
key = @normalizeKey key
- console.log "Mapping", key, "to", command
+ logMessage? "Mapping #{key} to #{command}"
@mapKeyToCommand { key, command, options }
when "unmap"
if tokens.length == 2
key = @normalizeKey tokens[1]
- console.log "Unmapping", key
+ logMessage? "Unmapping #{key}"
delete @keyToCommandRegistry[key]
when "unmapAll"