@@ -95,14 +95,17 @@ function init(display, container, module, ports, moduleToReplace) {
95 // create the actual RTS. Any impure modules will attach themselves to this
95 // create the actual RTS. Any impure modules will attach themselves to this
96 // object. This permits many Elm programs to be embedded per document.
96 // object. This permits many Elm programs to be embedded per document.
97 var elm = {
97 var elm = {
98− notify:notify,
98+ notify: notify,
99− setTimeout:setTimeout,
99+ setTimeout: setTimeout,
100− node:container,
100+ node: container,
102− addListener:addListener,
101+ addListener: addListener,
103− inputs:inputs,
102+ inputs: inputs,
104− timer:timer,
103+ timer: timer,
105− ports: { incoming:ports, outgoing:{}, uses:portUses }
104+ ports: { incoming:ports, outgoing:{}, uses:portUses },
106+ isFullscreen: function() { return display === Display.FULLSCREEN; },
107+ isEmbed: function() { return display === Display.COMPONENT; },
108+ isWorker: function() { return display === Display.NONE; }
108 function swap(newModule) {
111 function swap(newModule) {
@@ -169,7 +172,13 @@ function checkPorts(elm) {
177+//// FILTER SIGNALS ////
179+// TODO: move this code into the signal module and create a function
180+// Signal.initializeGraph that actually instantiates everything.
173function filterListeners(inputs, listeners) {
182function filterListeners(inputs, listeners) {
175 for (var i = listeners.length; i--; ) {
184 for (var i = listeners.length; i--; ) {