diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-03-10 10:44:26 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-03-10 10:44:26 -0400 |
commit | db7cd221444afce64803e66594d56dc8e7a0843c (patch) | |
tree | da2a0ab3f900743c5d1aaa01d30b665aa858f021 /src/cjr_print.sml | |
parent | aed3aa32e62846a16da55fc7be4cecba92ed5e2b (diff) |
Avoid any JavaScript when pages don't need it; update demo prose
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r-- | src/cjr_print.sml | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml index aff5efd3..ab808426 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -1,4 +1,4 @@ -(* Copyright (c) 2008, Adam Chlipala +(* Copyright (c) 2008-2009, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2130,7 +2130,7 @@ fun p_file env (ds, ps) = E.declBinds env d)) env ds - val fields = foldl (fn ((ek, _, _, ts, _), fields) => + val fields = foldl (fn ((ek, _, _, ts, _, _), fields) => case ek of Core.Link => fields | Core.Rpc => fields @@ -2251,7 +2251,7 @@ fun p_file env (ds, ps) = string "}"] end - fun p_page (ek, s, n, ts, ran) = + fun p_page (ek, s, n, ts, ran, side) = let val (ts, defInputs, inputsVar) = case ek of @@ -2346,6 +2346,12 @@ fun p_file env (ds, ps) = string "uw_write_header(ctx, \"Content-script-type: text/javascript\\r\\n\");", newline, string "uw_write(ctx, \"<html>\");", + newline, + string "uw_set_script_header(ctx, \"", + string (case side of + ServerAndClient => "<script src=\\\"/app.js\\\"></script>\\n" + | ServerOnly => ""), + string "\");", newline]), box [string "{", newline, |