diff src/monoize.sml @ 817:4585f744574a

ccheckbox
author Adam Chlipala <adamc@hcoop.net>
date Thu, 21 May 2009 10:34:56 -0400
parents 26e911ee924c
children 066493f7f008
line wrap: on
line diff
--- a/src/monoize.sml	Thu May 21 10:18:20 2009 -0400
+++ b/src/monoize.sml	Thu May 21 10:34:56 2009 -0400
@@ -2648,6 +2648,29 @@
                               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 =>