diff options
author | 2009-05-21 10:34:56 -0400 | |
---|---|---|
committer | 2009-05-21 10:34:56 -0400 | |
commit | c53470daa7b350ac8545d8934cedbcb1aae49bd0 (patch) | |
tree | 760d2417c0ab43fa13f59fb41f6303656c9446c0 /src/monoize.sml | |
parent | c0b8071a49ce472ff915ba3ea3387c29edbebfc1 (diff) |
ccheckbox
Diffstat (limited to 'src/monoize.sml')
-rw-r--r-- | src/monoize.sml | 23 |
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 => |