comparison src/monoize.sml @ 1786:d794149b3713

<active>
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Jul 2012 13:55:35 -0400
parents 5bc4fbf9c0fe
children 2e01a36701eb
comparison
equal deleted inserted replaced
1785:ffd7ed3bc0b7 1786:d794149b3713
3232 val (class, fm) = monoExp (env, st, fm) class 3232 val (class, fm) = monoExp (env, st, fm) class
3233 val (dynClass, fm) = monoExp (env, st, fm) dynClass 3233 val (dynClass, fm) = monoExp (env, st, fm) dynClass
3234 val (style, fm) = monoExp (env, st, fm) style 3234 val (style, fm) = monoExp (env, st, fm) style
3235 val (dynStyle, fm) = monoExp (env, st, fm) dynStyle 3235 val (dynStyle, fm) = monoExp (env, st, fm) dynStyle
3236 3236
3237 val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea"] 3237 val dynamics = ["dyn", "ctextbox", "ccheckbox", "cselect", "coption", "ctextarea", "active"]
3238 3238
3239 fun isSome (e, _) = 3239 fun isSome (e, _) =
3240 case e of 3240 case e of
3241 L'.ESome _ => true 3241 L'.ESome _ => true
3242 | _ => false 3242 | _ => false
3539 ((L'.EPrim (Prim.String ("<script type=\"text/javascript\">dyn(\"" 3539 ((L'.EPrim (Prim.String ("<script type=\"text/javascript\">dyn(\""
3540 ^ tag ^ "\", execD(")), loc), 3540 ^ tag ^ "\", execD(")), loc),
3541 (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc), 3541 (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc),
3542 (L'.EPrim (Prim.String ("))</script>")), loc)), loc)), loc), 3542 (L'.EPrim (Prim.String ("))</script>")), loc)), loc)), loc),
3543 fm) 3543 fm)
3544 | _ => raise Fail "Monoize: Bad dyn attributes" 3544 | _ => raise Fail "Monoize: Bad <dyn> attributes"
3545 end 3545 end
3546
3547 | "active" =>
3548 (case attrs of
3549 [("Code", e, _)] =>
3550 ((L'.EStrcat
3551 ((L'.EPrim (Prim.String ("<script type=\"text/javascript\">active(execD(")), loc),
3552 (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc),
3553 (L'.EPrim (Prim.String ("))</script>")), loc)), loc)), loc),
3554 fm)
3555 | _ => raise Fail "Monoize: Bad <active> attributes")
3546 3556
3547 | "submit" => normal ("input type=\"submit\"", NONE) 3557 | "submit" => normal ("input type=\"submit\"", NONE)
3548 | "image" => normal ("input type=\"image\"", NONE) 3558 | "image" => normal ("input type=\"image\"", NONE)
3549 | "button" => normal ("input type=\"submit\"", NONE) 3559 | "button" => normal ("input type=\"submit\"", NONE)
3550 | "hidden" => input "hidden" 3560 | "hidden" => input "hidden"