comparison 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
comparison
equal deleted inserted replaced
1920:2f33d9a51765 1924:b44138e6a3bf
3262 val (class, fm) = monoExp (env, st, fm) class 3262 val (class, fm) = monoExp (env, st, fm) class
3263 val (dynClass, fm) = monoExp (env, st, fm) dynClass 3263 val (dynClass, fm) = monoExp (env, st, fm) dynClass
3264 val (style, fm) = monoExp (env, st, fm) style 3264 val (style, fm) = monoExp (env, st, fm) style
3265 val (dynStyle, fm) = monoExp (env, st, fm) dynStyle 3265 val (dynStyle, fm) = monoExp (env, st, fm) dynStyle
3266 3266
3267 val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active"] 3267 val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active", "activeHead"]
3268 3268
3269 fun isSome (e, _) = 3269 fun isSome (e, _) =
3270 case e of 3270 case e of
3271 L'.ESome _ => true 3271 L'.ESome _ => true
3272 | _ => false 3272 | _ => false
3597 ((L'.EPrim (Prim.String ("<script type=\"text/javascript\">active(execD(")), loc), 3597 ((L'.EPrim (Prim.String ("<script type=\"text/javascript\">active(execD(")), loc),
3598 (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc), 3598 (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc),
3599 (L'.EPrim (Prim.String ("))</script>")), loc)), loc)), loc), 3599 (L'.EPrim (Prim.String ("))</script>")), loc)), loc)), loc),
3600 fm) 3600 fm)
3601 | _ => raise Fail "Monoize: Bad <active> attributes") 3601 | _ => raise Fail "Monoize: Bad <active> attributes")
3602
3603 | "activeHead" =>
3604 (case attrs of
3605 [("Code", e, _)] =>
3606 ((L'.EStrcat
3607 ((L'.EPrim (Prim.String ("<script type=\"text/javascript\">active(execD(")), loc),
3608 (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc),
3609 (L'.EPrim (Prim.String ("))</script>")), loc)), loc)), loc),
3610 fm)
3611 | _ => raise Fail "Monoize: Bad <activeHead> attributes")
3602 3612
3603 | "submit" => normal ("input type=\"submit\"", NONE) 3613 | "submit" => normal ("input type=\"submit\"", NONE)
3604 | "image" => normal ("input type=\"image\"", NONE) 3614 | "image" => normal ("input type=\"image\"", NONE)
3605 | "button" => normal ("input type=\"submit\"", NONE) 3615 | "button" => normal ("input type=\"submit\"", NONE)
3606 | "hidden" => input "hidden" 3616 | "hidden" => input "hidden"