summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 11:04:56 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 11:04:56 -0400
commitee2f4ffdf2f283c33fb7bb488fa88a1d9f2cf6be (patch)
treeda75a35df02e170e6cc2cfd6f02433f82d8e3763
parent471d135b67086298642e9bd26e0e380a605b7068 (diff)
cselect.onchange
-rw-r--r--lib/ur/basis.urs3
-rw-r--r--src/elaborate.sml2
-rw-r--r--src/scriptcheck.sml26
-rw-r--r--tests/cselect.ur2
4 files changed, 29 insertions, 4 deletions
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs
index cc18d7b2..45f36ef8 100644
--- a/lib/ur/basis.urs
+++ b/lib/ur/basis.urs
@@ -632,7 +632,8 @@ val ctextbox : cformTag [Value = string, Size = int, Source = source string] []
val button : cformTag [Value = string, Onclick = transaction unit] []
con cselect = [Cselect]
-val cselect : cformTag [Source = source string] cselect
+val cselect : cformTag [Source = source string,
+ Onchange = transaction unit] cselect
val coption : unit -> tag [Value = string, Selected = bool] cselect [] [] []
(*** Tables *)
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 36706b46..f91f83c7 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -3831,6 +3831,8 @@ fun elabFile basis topStr topSgn env file =
else
app (fn f => f ()) (!checks);
+ (*preface ("file", p_file env' file);*)
+
(L'.DFfiStr ("Basis", basis_n, sgn), ErrorMsg.dummySpan)
:: ds
@ (L'.DStr ("Top", top_n, topSgn, topStr), ErrorMsg.dummySpan)
diff --git a/src/scriptcheck.sml b/src/scriptcheck.sml
index 61676dc6..834ff1c7 100644
--- a/src/scriptcheck.sml
+++ b/src/scriptcheck.sml
@@ -43,9 +43,31 @@ val pullBasis = SS.addList (SS.empty,
val pushBasis = SS.addList (SS.empty,
["new_channel",
"self"])
+
+val events = ["abort",
+ "blur",
+ "change",
+ "click",
+ "dblclick",
+ "error",
+ "focus",
+ "keydown",
+ "keypress",
+ "keyup",
+ "load",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup",
+ "reset",
+ "resize",
+ "select",
+ "submit",
+ "unload"]
-val scriptWords = ["<script",
- " onclick='"]
+val scriptWords = "<script"
+ :: map (fn s => "on" ^ s ^ " ='") events
val pushWords = ["rv("]
diff --git a/tests/cselect.ur b/tests/cselect.ur
index ca05f504..f2a83556 100644
--- a/tests/cselect.ur
+++ b/tests/cselect.ur
@@ -1,7 +1,7 @@
fun main () =
s <- source "";
return <xml><body>
- <cselect source={s}>
+ <cselect source={s} onchange={v <- get s; alert ("Now it's " ^ v)}>
<coption>Wilbur</coption>
<coption>Walbur</coption>
</cselect>