diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-09-03 11:48:12 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-09-03 11:48:12 -0400 |
commit | 3c860c3c95d4d085499fd01e3140f32aafbc1bd7 (patch) | |
tree | 7c32d9dad6206562624b1bb483a1c7b8bbdc4fec /src/settings.sml | |
parent | ad19583df3d07b968a9fb983813e45dc55fe2cc6 (diff) |
New client-side, document-level event handlers
Diffstat (limited to 'src/settings.sml')
-rw-r--r-- | src/settings.sml | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/settings.sml b/src/settings.sml index 7b19b1b1..8b376a00 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -147,7 +147,15 @@ val benignBase = basis ["get_cookie", "rand", "now", "getHeader", - "setHeader"] + "setHeader", + "spawn", + "onClick", + "onDblclick", + "onKeydown", + "onKeypress", + "onKeyup", + "onMousedown", + "onMouseup"] val benign = ref benignBase fun setBenignEffectful ls = benign := S.addList (benignBase, ls) @@ -166,7 +174,14 @@ val clientBase = basis ["get", "onConnectFail", "onDisconnect", "onServerError", - "kc"] + "kc", + "onClick", + "onDblclick", + "onKeydown", + "onKeypress", + "onKeyup", + "onMousedown", + "onMouseup"] val client = ref clientBase fun setClientOnly ls = client := S.addList (clientBase, ls) fun isClientOnly x = S.member (!client, x) @@ -255,7 +270,15 @@ val jsFuncsBase = basisM [("alert", "alert"), ("htmlifyTime", "showTime"), ("toSeconds", "toSeconds"), ("addSeconds", "addSeconds"), - ("diffInSeconds", "diffInSeconds")] + ("diffInSeconds", "diffInSeconds"), + + ("onClick", "uw_onClick"), + ("onDblclick", "uw_onDblclick"), + ("onKeydown", "uw_onKeydown"), + ("onKeypress", "uw_onKeypress"), + ("onKeyup", "uw_onKeyup"), + ("onMousedown", "uw_onMousedown"), + ("onMouseup", "uw_onMouseup")] val jsFuncs = ref jsFuncsBase fun setJsFuncs ls = jsFuncs := foldl (fn ((k, v), m) => M.insert (m, k, v)) jsFuncsBase ls fun jsFunc x = M.find (!jsFuncs, x) |