Mercurial > urweb
changeset 812:2fbd1ac2f04b
Loading an FCKeditor
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 16 May 2009 18:09:14 -0400 |
parents | 50b4825115f0 |
children | 7b380e2b9e68 |
files | lib/js/urweb.js src/cjr_print.sml |
diffstat | 2 files changed, 24 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/js/urweb.js Sat May 16 16:59:24 2009 -0400 +++ b/lib/js/urweb.js Sat May 16 18:09:14 2009 -0400 @@ -228,6 +228,18 @@ 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) {
--- a/src/cjr_print.sml Sat May 16 16:59:24 2009 -0400 +++ b/src/cjr_print.sml Sat May 16 18:09:14 2009 -0400 @@ -2841,14 +2841,22 @@ string "uw_write(ctx, begin_xhtml);", newline, string "uw_set_script_header(ctx, \"", - string (case side of + let + val scripts = + case side of ServerOnly => "" | _ => "<script src=\\\"" ^ OS.Path.joinDirFile {dir = Settings.getUrlPrefix (), file = "app.js"} - ^ "\\\"></script>\\n"), - p_list (fn x => string ("<script src=\\\"" ^ x ^ "\\\"></script>")) - (Settings.getScripts ()), + ^ "\\\"></script>\\n" + + val scripts = foldl (fn (x, scripts) => + scripts + ^ "<script src=\\\"" ^ x ^ "\\\"></script>\\n") + scripts (Settings.getScripts ()) + in + string scripts + end, string "\");", newline, string "uw_set_needs_push(ctx, ",