         return this
     active: ->
         return active
+    log: (args...) ->
+        ctLog(args...)
+    dir: (args...) ->
+        ctDir(args...)
 
 
 

    # Defaults to including a timestamp for extra (excessive?) uniqueness
    widget_id       : "CoffeeTable-#{ (new Date()).getTime() }"


# Trap calls to console.log and console.dir if the console doesn't exist.
# Lookin' at you, IE.
console ?=
    log: ->
    dir: ->

# Alias log and dir for shorter typing if log and dir aren't aready used.
window.log ?= -> console.log arguments...
window.dir ?= -> console.dir arguments...

# Keypress codes, for convenience.
keycode =

            loadFromStorage()

        loaded = true
    return loaded

# ### ctLog
###
Log one or more values to the CoffeeTable widget. Used as the implementation of
`console.log` if `settings.adopt_log` is `true` and `console.log` isn't already
available.
###
ctLog = (args...) ->
    for arg in args
        do ->
            output = arg.toString().replace(/\'/g,"\\'").replace(/\"/g,'\\"')
            execute("'log: #{ output }'")
    return

# ### ctDir
###
Dir one or more values to the CoffeeTable widget. Used as the implementation of
`console.dir` if `settings.adopt_dir` is `true` and `console.dir` isn't already
available.
###
ctDir = (args...) ->
    return

# ### buildAutosuggest
###
