mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-16 18:44:56 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user