diff src/monoize.sml @ 1099:118ab9641a64

ctextarea; s/header/include in the manual
author Adam Chlipala <adamc@hcoop.net>
date Tue, 29 Dec 2009 13:34:03 -0500
parents 25d491287358
children 72670131dace
line wrap: on
line diff
--- a/src/monoize.sml	Tue Dec 29 12:55:26 2009 -0500
+++ b/src/monoize.sml	Tue Dec 29 13:34:03 2009 -0500
@@ -2985,6 +2985,29 @@
 
                    | "coption" => normal ("option", NONE, NONE)
 
+                   | "ctextarea" =>
+                     (case List.find (fn ("Source", _, _) => true | _ => false) attrs of
+                          NONE =>
+                          let
+                              val (ts, fm) = tagStart "textarea"
+                          in
+                              ((L'.EStrcat (ts,
+                                            (L'.EPrim (Prim.String " />"), loc)),
+                                loc), fm)
+                          end
+                        | SOME (_, src, _) =>
+                          let
+                              val sc = strcat [str "tbx(exec(",
+                                               (L'.EJavaScript (L'.Script, src), loc),
+                                               str "))"]
+                              val sc = setAttrs sc
+                          in
+                              (strcat [str "<script type=\"text/javascript\">",
+                                       sc,
+                                       str "</script>"],
+                               fm)
+                          end)
+
                    | "tabl" => normal ("table", NONE, NONE)
                    | _ => normal (tag, NONE, NONE))
             end