summaryrefslogtreecommitdiff
path: root/src/monoize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-21 10:34:56 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-21 10:34:56 -0400
commit0f7c2c431c9871cdffcde7fc0c8a86815a72e89f (patch)
tree760d2417c0ab43fa13f59fb41f6303656c9446c0 /src/monoize.sml
parent7b95b3208e776e2fa66142df858464cfbc5137be (diff)
ccheckbox
Diffstat (limited to 'src/monoize.sml')
-rw-r--r--src/monoize.sml23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index 2ed7c3f8..615863c3 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -2648,6 +2648,29 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
fm)
end)
+ | "ccheckbox" =>
+ (case List.find (fn ("Source", _, _) => true | _ => false) attrs of
+ NONE =>
+ let
+ val (ts, fm) = tagStart "input type=\"checkbox\""
+ in
+ ((L'.EStrcat (ts,
+ (L'.EPrim (Prim.String " />"), loc)),
+ loc), fm)
+ end
+ | SOME (_, src, _) =>
+ let
+ val sc = strcat [str "chk(",
+ (L'.EJavaScript (L'.Script, src), loc),
+ str ")"]
+ val sc = setAttrs sc
+ in
+ (strcat [str "<span><script type=\"text/javascript\">",
+ sc,
+ str "</script></span>"],
+ fm)
+ end)
+
| "cselect" =>
(case List.find (fn ("Source", _, _) => true | _ => false) attrs of
NONE =>