elm/core-js/Everything.js

63 lines
1.4 KiB
JavaScript
Raw Normal View History

2012-04-20 03:10:25 +00:00
var eq = function(x,y) {
if (typeof x === "object") {
if (x === y) return true;
if (x.length !== y.length) return false;
for (var i = x.length; i--; ) {
if (!eq(x[i],y[i])) return false;
}
return true;
}
return x === y;
};
2012-04-20 03:10:25 +00:00
var includeGlobal = this;
(function() {
var include = function(library) {
for (var i in library) {
if (i === 'Internal') continue;
try {
includeGlobal[i] = library[i];
} catch (err) {
if (i === 'length') {
includeGlobal.execScript('var length;');
length = library[i];
continue;
}
}
}
};
var includeAs = function(name) { return function(library) {
includeGlobal[name] = includeGlobal[name] || {};
for (var i in library) {
if (i === 'Internal') continue;
includeGlobal[name][i] = library[i];
}
};
};
include (Element);
include (Text);
color = Element.color;
height = Element.height;
show = Value.show;
include (Color);
include (Shape);
include (Line);
2012-04-20 03:10:25 +00:00
includeAs ('Time') (Signal.Time);
includeAs ('Mouse') (Signal.Mouse);
includeAs ('Keyboard') (Signal.Keyboard);
includeAs ('Window') (Signal.Window);
includeAs ('HTTP') (Signal.HTTP);
includeAs ('Input') (Signal.Input);
includeAs ('Random') (Signal.Random);
2012-06-12 10:44:45 +00:00
}());
var ElmCode = {};
ElmCode.Data = Data;
ElmCode.Signal = Signal;
ElmCode.Data.List = List;
ElmCode.Prelude = Prelude;