X-Git-Url: https://jasonwoof.com/gitweb/?p=watch-my-terminal.git;a=blobdiff_plain;f=terminal.coffee;h=c7dbd7f59970a3eade4b86b7d3b05e43dd7d6e97;hp=34c75156359856245a1fa17253e94e1c64b5cc81;hb=e80ebd564e2216cf66d839520e91c4d17ec9e177;hpb=01cfddd1b825701ad31b1f1326e49db005c3d83f diff --git a/terminal.coffee b/terminal.coffee index 34c7515..c7dbd7f 100644 --- a/terminal.coffee +++ b/terminal.coffee @@ -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