2014-08-26 16:24:29 +00:00
|
|
|
// Generated by CoffeeScript 1.8.0
|
2010-09-04 10:39:01 +00:00
|
|
|
(function() {
|
2013-03-18 02:49:49 +00:00
|
|
|
var CoffeeScript, compile, runScripts,
|
2013-02-25 16:43:59 +00:00
|
|
|
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2010-09-21 16:05:00 +00:00
|
|
|
CoffeeScript = require('./coffee-script');
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2010-10-12 08:10:39 +00:00
|
|
|
CoffeeScript.require = require;
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2013-03-18 05:06:33 +00:00
|
|
|
compile = CoffeeScript.compile;
|
2013-03-16 15:22:05 +00:00
|
|
|
|
2012-01-11 23:04:14 +00:00
|
|
|
CoffeeScript["eval"] = function(code, options) {
|
2012-04-10 18:57:45 +00:00
|
|
|
if (options == null) {
|
|
|
|
options = {};
|
|
|
|
}
|
2013-04-22 18:38:17 +00:00
|
|
|
if (options.bare == null) {
|
2012-04-10 18:57:45 +00:00
|
|
|
options.bare = true;
|
|
|
|
}
|
2013-03-16 15:22:05 +00:00
|
|
|
return eval(compile(code, options));
|
2010-09-21 16:05:00 +00:00
|
|
|
};
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2010-09-22 02:31:59 +00:00
|
|
|
CoffeeScript.run = function(code, options) {
|
2012-04-10 18:57:45 +00:00
|
|
|
if (options == null) {
|
|
|
|
options = {};
|
|
|
|
}
|
2010-10-26 10:13:55 +00:00
|
|
|
options.bare = true;
|
2013-03-25 17:56:24 +00:00
|
|
|
options.shiftLine = true;
|
2013-03-16 15:22:05 +00:00
|
|
|
return Function(compile(code, options))();
|
2010-09-22 02:31:59 +00:00
|
|
|
};
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2012-04-10 18:57:45 +00:00
|
|
|
if (typeof window === "undefined" || window === null) {
|
|
|
|
return;
|
|
|
|
}
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2013-03-25 17:56:24 +00:00
|
|
|
if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) {
|
2013-03-18 05:06:33 +00:00
|
|
|
compile = function(code, options) {
|
|
|
|
var js, v3SourceMap, _ref;
|
|
|
|
if (options == null) {
|
|
|
|
options = {};
|
|
|
|
}
|
|
|
|
options.sourceMap = true;
|
|
|
|
options.inline = true;
|
|
|
|
_ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
|
2013-07-30 04:06:41 +00:00
|
|
|
return "" + js + "\n//# sourceMappingURL=data:application/json;base64," + (btoa(unescape(encodeURIComponent(v3SourceMap)))) + "\n//# sourceURL=coffeescript";
|
2013-03-18 05:06:33 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-06-28 01:40:22 +00:00
|
|
|
CoffeeScript.load = function(url, callback, options, hold) {
|
2010-09-21 16:05:00 +00:00
|
|
|
var xhr;
|
2013-02-25 16:43:59 +00:00
|
|
|
if (options == null) {
|
|
|
|
options = {};
|
|
|
|
}
|
2013-06-28 01:40:22 +00:00
|
|
|
if (hold == null) {
|
|
|
|
hold = false;
|
|
|
|
}
|
2013-03-16 15:22:05 +00:00
|
|
|
options.sourceFiles = [url];
|
2013-03-18 19:16:05 +00:00
|
|
|
xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest();
|
2010-09-21 16:05:00 +00:00
|
|
|
xhr.open('GET', url, true);
|
2012-04-10 18:57:45 +00:00
|
|
|
if ('overrideMimeType' in xhr) {
|
|
|
|
xhr.overrideMimeType('text/plain');
|
|
|
|
}
|
2010-09-21 16:05:00 +00:00
|
|
|
xhr.onreadystatechange = function() {
|
2013-06-28 01:40:22 +00:00
|
|
|
var param, _ref;
|
2010-11-09 04:07:51 +00:00
|
|
|
if (xhr.readyState === 4) {
|
2011-05-01 12:28:00 +00:00
|
|
|
if ((_ref = xhr.status) === 0 || _ref === 200) {
|
2013-06-28 01:40:22 +00:00
|
|
|
param = [xhr.responseText, options];
|
|
|
|
if (!hold) {
|
|
|
|
CoffeeScript.run.apply(CoffeeScript, param);
|
|
|
|
}
|
2011-04-30 17:48:54 +00:00
|
|
|
} else {
|
|
|
|
throw new Error("Could not load " + url);
|
|
|
|
}
|
2012-04-10 18:57:45 +00:00
|
|
|
if (callback) {
|
2013-06-28 01:40:22 +00:00
|
|
|
return callback(param);
|
2012-04-10 18:57:45 +00:00
|
|
|
}
|
2010-11-09 04:07:51 +00:00
|
|
|
}
|
2010-09-04 10:39:01 +00:00
|
|
|
};
|
2010-09-21 16:05:00 +00:00
|
|
|
return xhr.send(null);
|
|
|
|
};
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2010-10-12 08:10:39 +00:00
|
|
|
runScripts = function() {
|
2013-06-28 01:40:22 +00:00
|
|
|
var coffees, coffeetypes, execute, i, index, s, script, scripts, _fn, _i, _len;
|
2013-03-18 19:16:05 +00:00
|
|
|
scripts = window.document.getElementsByTagName('script');
|
2013-02-25 16:43:59 +00:00
|
|
|
coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];
|
2011-04-30 17:48:54 +00:00
|
|
|
coffees = (function() {
|
2013-02-25 16:43:59 +00:00
|
|
|
var _i, _len, _ref, _results;
|
2011-04-30 17:48:54 +00:00
|
|
|
_results = [];
|
|
|
|
for (_i = 0, _len = scripts.length; _i < _len; _i++) {
|
|
|
|
s = scripts[_i];
|
2013-02-25 16:43:59 +00:00
|
|
|
if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) {
|
2012-04-10 18:57:45 +00:00
|
|
|
_results.push(s);
|
|
|
|
}
|
2011-04-30 17:48:54 +00:00
|
|
|
}
|
|
|
|
return _results;
|
|
|
|
})();
|
|
|
|
index = 0;
|
2013-06-28 01:40:22 +00:00
|
|
|
execute = function() {
|
|
|
|
var param;
|
|
|
|
param = coffees[index];
|
|
|
|
if (param instanceof Array) {
|
|
|
|
CoffeeScript.run.apply(CoffeeScript, param);
|
|
|
|
index++;
|
|
|
|
return execute();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
_fn = function(script, i) {
|
|
|
|
var options;
|
|
|
|
options = {
|
|
|
|
literate: script.type === coffeetypes[1]
|
|
|
|
};
|
|
|
|
if (script.src) {
|
|
|
|
return CoffeeScript.load(script.src, function(param) {
|
|
|
|
coffees[i] = param;
|
2011-04-30 17:48:54 +00:00
|
|
|
return execute();
|
2013-06-28 01:40:22 +00:00
|
|
|
}, options, true);
|
|
|
|
} else {
|
|
|
|
options.sourceFiles = ['embedded'];
|
|
|
|
return coffees[i] = [script.innerHTML, options];
|
2011-04-11 19:38:38 +00:00
|
|
|
}
|
2013-06-28 01:40:22 +00:00
|
|
|
};
|
|
|
|
for (i = _i = 0, _len = coffees.length; _i < _len; i = ++_i) {
|
|
|
|
script = coffees[i];
|
|
|
|
_fn(script, i);
|
|
|
|
}
|
|
|
|
return execute();
|
2010-09-21 16:05:00 +00:00
|
|
|
};
|
2011-09-18 22:16:39 +00:00
|
|
|
|
2011-04-30 17:33:28 +00:00
|
|
|
if (window.addEventListener) {
|
2013-03-18 19:16:05 +00:00
|
|
|
window.addEventListener('DOMContentLoaded', runScripts, false);
|
2011-04-30 17:33:28 +00:00
|
|
|
} else {
|
2013-03-18 19:16:05 +00:00
|
|
|
window.attachEvent('onload', runScripts);
|
2010-09-04 10:39:01 +00:00
|
|
|
}
|
2011-12-14 15:39:20 +00:00
|
|
|
|
2010-09-21 07:53:58 +00:00
|
|
|
}).call(this);
|