diff options
author | Adam Chlipala <adam@chlipala.net> | 2010-08-22 19:45:07 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2010-08-22 19:45:07 -0400 |
commit | 746a9d987a0bfe2b3a4d8cd7c7bb4ace819beb2e (patch) | |
tree | 08a964618ad4f7fd569d5f7670fe5786ed4a878d /src | |
parent | 7765b90d25f98bd9eb0cf2998121e51d4551f733 (diff) |
Confirm boxes; proper event handler setting for ctags
Diffstat (limited to 'src')
-rw-r--r-- | src/monoize.sml | 23 | ||||
-rw-r--r-- | src/settings.sml | 3 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 85ff1905..b76abb67 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -2958,7 +2958,7 @@ fun monoExp (env, st, fm) (all as (e, loc)) = L'.TRecord [] => ((L'.EApp (e, (L'.ERecord [], loc)), loc), s') | _ => ((L'.EApp ((L'.EApp (e, (L'.EFfiApp ("Basis", "kc", []), loc)), loc), (L'.ERecord [], loc)), loc), - s' ^ "uwe=event;") + s' ^ "uw_event=event;") val s' = s' ^ "exec(" in ((L'.EStrcat (s, @@ -3068,10 +3068,27 @@ fun monoExp (env, st, fm) (all as (e, loc)) = SOME (strcat [str "addOnChange(d,exec(", (L'.EJavaScript (L'.Script, e), loc), str "))"]) - | (x, e, _) => + | (x, e, (L'.TFun ((L'.TRecord [], _), _), _)) => SOME (strcat [str ("d." ^ lowercaseFirst x ^ "=exec("), (L'.EJavaScript (L'.Script, e), loc), - str ");"])) + str ");"]) + | (x, e, _) => + let + val e = (L'.EAbs ("_", (L'.TRecord [], loc), (L'.TRecord [], loc), + (L'.EApp ((L'.EApp (liftExpInExp 0 e, + (L'.EFfiApp ("Basis", "kc", []), loc)), + loc), (L'.ERecord [], loc)), loc)), loc) + in + case x of + "Onkeyup" => + SOME (strcat [str ("((function(c){addOnKeyUp(d,function(){window.uw_event=window.event;return c();});})(exec("), + (L'.EJavaScript (L'.Script, e), loc), + str ")));"]) + | _ => + SOME (strcat [str ("((function(c){d." ^ lowercaseFirst x ^ "=function(){window.uw_event=window.event;return c();};})(exec("), + (L'.EJavaScript (L'.Script, e), loc), + str ")));"]) + end) attrs val t = (L'.TFfi ("Basis", "string"), loc) diff --git a/src/settings.sml b/src/settings.sml index 40f2ff20..93b022ab 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -110,6 +110,7 @@ val benignBase = basis ["get_cookie", "set_client_source", "current", "alert", + "confirm", "onError", "onFail", "onConnectFail", @@ -127,6 +128,7 @@ val clientBase = basis ["get", "set", "current", "alert", + "confirm", "recv", "sleep", "spawn", @@ -154,6 +156,7 @@ fun isServerOnly x = S.member (!server, x) val basisM = foldl (fn ((k, v : string), m) => M.insert (m, ("Basis", k), v)) M.empty val jsFuncsBase = basisM [("alert", "alert"), + ("confirm", "confrm"), ("get_client_source", "sg"), ("current", "scur"), ("htmlifyBool", "bs"), |