JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
parse in the client too, limit to 50fps
[watch-my-terminal.git] / terminal.coffee
index 34c7515..c7dbd7f 100644 (file)
@@ -1,5 +1,11 @@
-async = require 'async'
-fs = require 'fs'
+# this file is used by the client and server.
+
+# work around lack of module system in the browser:
+if exports?
+       my_exports = exports
+else
+       window.terminal = {}
+       my_exports = window.terminal
 
 class Terminal
        # public:
@@ -191,5 +197,5 @@ class Terminal
                return -1 unless parts?
                return parts[0].length
 
-exports.new = (width, height) ->
+my_exports.new = (width, height) ->
        return new Terminal width, height