summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-16 15:38:01 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-16 15:38:01 -0400
commit2f923a2b261ac47e5f44d26aa92b548bbad86e09 (patch)
tree319480b616f48c0f2ec38e1673c2b89a1de79125 /demo
parent431abe6b2d53ed42d5019a5263e8014de8920eb4 (diff)
Add more buttons to demo, to avoid effectful GET
Diffstat (limited to 'demo')
-rw-r--r--demo/batch.ur6
-rw-r--r--demo/batchG.ur16
-rw-r--r--demo/increment.ur6
-rw-r--r--demo/noisy.ur6
-rw-r--r--demo/roundTrip.ur6
5 files changed, 30 insertions, 10 deletions
diff --git a/demo/batch.ur b/demo/batch.ur
index 4100749f..b7007913 100644
--- a/demo/batch.ur
+++ b/demo/batch.ur
@@ -37,7 +37,7 @@ fun show withDel lss =
</table></xml>}/></xml>
end
-fun main () =
+fun action () =
lss <- source Nil;
batched <- source Nil;
@@ -79,3 +79,7 @@ fun main () =
<button value="Execute" onclick={exec ()}/>
</body></xml>
end
+
+fun main () = return <xml><body>
+ <form><submit value="Begin demo" action={action}/></form>
+</body></xml>
diff --git a/demo/batchG.ur b/demo/batchG.ur
index d0071d7d..ea658164 100644
--- a/demo/batchG.ur
+++ b/demo/batchG.ur
@@ -1,9 +1,13 @@
table t : {Id : int, A : string, B : float}
PRIMARY KEY Id
-open BatchFun.Make(struct
- val tab = t
- val title = "BatchG"
- val cols = {A = BatchFun.string "A",
- B = BatchFun.float "B"}
- end)
+structure B = BatchFun.Make(struct
+ val tab = t
+ val title = "BatchG"
+ val cols = {A = BatchFun.string "A",
+ B = BatchFun.float "B"}
+ end)
+
+fun main () = return <xml><body>
+ <form><submit value="Begin demo" action={B.main}/></form>
+</body></xml>
diff --git a/demo/increment.ur b/demo/increment.ur
index a74e80df..36b8191f 100644
--- a/demo/increment.ur
+++ b/demo/increment.ur
@@ -2,9 +2,13 @@ sequence seq
fun increment () = nextval seq
-fun main () =
+fun action () =
src <- source 0;
return <xml><body>
<dyn signal={n <- signal src; return <xml>{[n]}</xml>}/>
<button value="Update" onclick={n <- increment (); set src n}/>
</body></xml>
+
+fun main () = return <xml><body>
+ <form><submit value="Begin demo" action={action}/></form>
+</body></xml>
diff --git a/demo/noisy.ur b/demo/noisy.ur
index 708cfa2c..7f26eaf2 100644
--- a/demo/noisy.ur
+++ b/demo/noisy.ur
@@ -25,7 +25,7 @@ fun check ls =
| Some a => a);
check ls'
-fun main () =
+fun action () =
idAdd <- source "";
aAdd <- source "";
@@ -41,3 +41,7 @@ fun main () =
<button value="Delete" onclick={id <- get idDel; del (readError id)}/>
<ctextbox source={idDel}/>
</body></xml>
+
+fun main () = return <xml><body>
+ <form><submit value="Begin demo" action={action}/></form>
+</body></xml>
diff --git a/demo/roundTrip.ur b/demo/roundTrip.ur
index a0d29bf6..c3a111b7 100644
--- a/demo/roundTrip.ur
+++ b/demo/roundTrip.ur
@@ -6,7 +6,7 @@ fun writeBack v =
r <- oneRow (SELECT channels.Channel FROM channels WHERE channels.Client = {[me]});
send r.Channels.Channel v
-fun main () =
+fun action () =
me <- self;
ch <- channel;
dml (INSERT INTO channels (Client, Channel) VALUES ({[me]}, {[ch]}));
@@ -28,3 +28,7 @@ fun main () =
<dyn signal={Buffer.render buf}/>
</body></xml>
end
+
+fun main () = return <xml><body>
+ <form><submit value="Begin demo" action={action}/></form>
+</body></xml>