diff --git a/apps/furnace-fjsc/resources/bootstrap.factor b/apps/furnace-fjsc/resources/bootstrap.factor new file mode 100644 index 0000000000..090b395dcb --- /dev/null +++ b/apps/furnace-fjsc/resources/bootstrap.factor @@ -0,0 +1,4 @@ +: alert + window { } "alert" { "string" } alien-invoke ; + +"Bootstrap code loaded" alert \ No newline at end of file diff --git a/apps/furnace-fjsc/resources/bootstrap.js b/apps/furnace-fjsc/resources/bootstrap.js index be64a23435..3c50767a89 100644 --- a/apps/furnace-fjsc/resources/bootstrap.js +++ b/apps/furnace-fjsc/resources/bootstrap.js @@ -1,5 +1,6 @@ function Factor() { var self = this; + this.form = false; this.data_stack = [ ]; this.words = { dup: function() { self.fjsc_dup(); }, @@ -20,11 +21,13 @@ function Factor() { "f": function() { self.fjsc_false(); }, "t": function() { self.fjsc_true(); }, "empty?": function() { self.fjsc_is_empty(); }, - alert: function() { self.fjsc_alert(); } + "window": function() { self.fjsc_window(); }, + "run-file": function() { self.fjsc_run_file(); }, + "bootstrap": function() { self.fjsc_bootstrap(); } }; } -Factor.prototype.fjsc_eval = function(form) { +Factor.prototype.server_eval = function(text) { var self = this; var callback = { success: function(o) { @@ -33,13 +36,18 @@ Factor.prototype.fjsc_eval = function(form) { self.display_datastack(); document.getElementById('compiled').innerHTML="
" + v + ""; document.getElementById('code').value=""; - } }; - YAHOO.util.Connect.setForm(form); + this.form.code.value=text; + YAHOO.util.Connect.setForm(this.form); YAHOO.util.Connect.asyncRequest('POST', "/responder/fjsc/compile", callback); } +Factor.prototype.fjsc_eval = function(form) { + this.form = form; + this.server_eval(form.code.value); +} + Factor.prototype.display_datastack = function() { var html=[]; html.push("