1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

removing CoffeeScript.activate() simply including the tag will do for text/coffeescript

This commit is contained in:
Jeremy Ashkenas 2010-02-24 23:57:39 -05:00
parent 23c5ebb00f
commit 22674bc536
6 changed files with 20 additions and 35 deletions

View file

@ -1,5 +1,5 @@
(function(){
var lexer, parser, path;
var _a, _b, lexer, parser, path, tag;
// Set up for both the browser and the server.
if ((typeof process !== "undefined" && process !== null)) {
process.mixin(require('nodes'));
@ -47,16 +47,11 @@
};
// Activate CoffeeScript in the browser by having it compile and eval
// all script tags with a content-type of text/coffeescript.
exports.activate = function activate() {
var _a, _b, _c, script, scripts;
scripts = document.getElementsByTagName('script');
_a = []; _b = scripts;
for (_c = 0; _c < _b.length; _c++) {
script = _b[_c];
if (script.type === 'text/coffeescript') {
_a.push(eval(exports.compile(script.innerHTML)));
}
if ((typeof document !== "undefined" && document !== null) && document.getElementsByTagName) {
_a = document.getElementsByTagName('script');
for (_b = 0; _b < _a.length; _b++) {
tag = _a[_b];
tag.type === 'text/coffeescript' ? eval(exports.compile(tag.innerHTML)) : null;
}
return _a;
};
}
})();