From fd44d539abb06cf86fd8fe76369c056b8f892a26 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 16 May 2009 18:09:14 -0400 Subject: Loading an FCKeditor --- lib/js/urweb.js | 12 ++++++++++++ src/cjr_print.sml | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 04c1cfae..8890c446 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -228,6 +228,18 @@ function addNode(node) { lastParent().appendChild(node); } +function setHTML(html) { + var x = document.createElement("span"); + x.dead = false; + x.signal = null; + x.sources = null; + x.closures = null; + x.innerHTML = html; + addNode(x); + runScripts(x); + alert("HTML:\n" + html); +} + var thisScript = null; function runScripts(node) { diff --git a/src/cjr_print.sml b/src/cjr_print.sml index 7f5dccde..683c2ddf 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -2841,14 +2841,22 @@ fun p_file env (ds, ps) = string "uw_write(ctx, begin_xhtml);", newline, string "uw_set_script_header(ctx, \"", - string (case side of + let + val scripts = + case side of ServerOnly => "" | _ => "\\n"), - p_list (fn x => string ("")) - (Settings.getScripts ()), + ^ "\\\">\\n" + + val scripts = foldl (fn (x, scripts) => + scripts + ^ "\\n") + scripts (Settings.getScripts ()) + in + string scripts + end, string "\");", newline, string "uw_set_needs_push(ctx, ", -- cgit v1.2.3