diff src/monoize.sml @ 1924:b44138e6a3bf

Add activeHead tag. activeHead is similar to active but produces xhead instead of xbody
author Sergey Mironov <grrwlf@gmail.com>
date Fri, 06 Dec 2013 13:59:39 +0400
parents 434921f54f54
children 15802a00816c
line wrap: on
line diff
--- a/src/monoize.sml	Tue Dec 03 16:54:04 2013 -0500
+++ b/src/monoize.sml	Fri Dec 06 13:59:39 2013 +0400
@@ -3264,7 +3264,7 @@
                 val (style, fm) = monoExp (env, st, fm) style
                 val (dynStyle, fm) = monoExp (env, st, fm) dynStyle
 
-                val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active"]
+                val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active", "activeHead"]
 
                 fun isSome (e, _) =
                     case e of
@@ -3600,6 +3600,16 @@
 			      fm)
                            | _ => raise Fail "Monoize: Bad <active> attributes")
 
+                      | "activeHead" =>
+                        (case attrs of
+			     [("Code", e, _)] =>
+			     ((L'.EStrcat
+                                   ((L'.EPrim (Prim.String ("<script type=\"text/javascript\">active(execD(")), loc),
+                                    (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc),
+                                                 (L'.EPrim (Prim.String ("))</script>")), loc)), loc)), loc),
+			      fm)
+                           | _ => raise Fail "Monoize: Bad <activeHead> attributes")
+
                       | "submit" => normal ("input type=\"submit\"", NONE)
                       | "image" => normal ("input type=\"image\"", NONE)
                       | "button" => normal ("input type=\"submit\"", NONE)