2012-04-20 03:10:25 +00:00
|
|
|
|
2012-06-28 08:50:16 +00:00
|
|
|
var eq = Value.eq;
|
2012-06-10 12:58:11 +00:00
|
|
|
|
2012-06-28 17:57:17 +00:00
|
|
|
Signal.addListener(document, 'elm_log', function(e) { console.log(e.value); });
|
|
|
|
Signal.addListener(document, 'elm_title', function(e) { document.title = e.value; });
|
|
|
|
Signal.addListener(document, 'elm_redirect', function(e) {
|
|
|
|
if (e.value.length > 0) { window.location = e.value; }
|
|
|
|
});
|
|
|
|
|
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;
|
2012-06-21 03:37:28 +00:00
|
|
|
|
2012-08-31 06:42:33 +00:00
|
|
|
include (ElmCode.Graphics.Color);
|
2012-09-02 05:27:36 +00:00
|
|
|
include (ElmCode.Graphics.Element);
|
2012-04-20 03:10:25 +00:00
|
|
|
|
2012-06-11 11:14:19 +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
|
|
|
|
|
|
|
}());
|
|
|
|
|
2012-08-31 06:42:33 +00:00
|
|
|
var ElmCode = ElmCode || {};
|
2012-06-12 10:44:45 +00:00
|
|
|
ElmCode.Data = Data;
|
|
|
|
ElmCode.Signal = Signal;
|
2012-06-21 03:37:28 +00:00
|
|
|
ElmCode.Data.List = List;
|
2012-06-28 08:50:16 +00:00
|
|
|
ElmCode.Foreign = Foreign;
|
2012-06-21 03:37:28 +00:00
|
|
|
ElmCode.Prelude = Prelude;
|