adding a minified combined coffee-script.js. Include it on the page, after any text/coffeescript tags, and call CoffeeScript.activate(); to run it

This commit is contained in:
Jeremy Ashkenas
2010-02-24 19:57:29 -05:00
parent 2a46e13d33
commit c1427d6558
6 changed files with 568 additions and 1 deletions

View File

@@ -38,3 +38,9 @@ exports.tokenize: (code) ->
exports.tree: (code) ->
parser.parse lexer.tokenize code
# Activate CoffeeScript in the browser by having it compile and eval
# all script tags with a content-type of text/coffeescript.
exports.activate: ->
scripts: document.getElementsByTagName 'script'
for script in scripts when script.type is 'text/coffeescript'
eval exports.compile script.innerHTML