summaryrefslogtreecommitdiff
path: root/tests/dynClass.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-05-06 15:15:46 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-05-06 15:15:46 -0400
commit7bb3cb12e6a013204e794db821069d8b9e0ecc58 (patch)
tree0b91d6fdd507e47f191183d49a4d5207ae515be7 /tests/dynClass.ur
parentd6d65ece7537f856f01fdc978a2560107cacc375 (diff)
'dynStyle' pseudo-attribute
Diffstat (limited to 'tests/dynClass.ur')
-rw-r--r--tests/dynClass.ur32
1 files changed, 21 insertions, 11 deletions
diff --git a/tests/dynClass.ur b/tests/dynClass.ur
index 2c7068c8..37f931a2 100644
--- a/tests/dynClass.ur
+++ b/tests/dynClass.ur
@@ -1,21 +1,31 @@
-style s1
-style s2
+style date
+style topic
fun main () : transaction page =
- src <- source s1;
- s <- source "";
toggle <- source False;
return <xml>
<head>
- <link rel="stylesheet" type="text/css" href="http://localhost/test.css"/>
+ <link rel="stylesheet" type="text/css" href="http://adam.chlipala.net/style.css"/>
</head>
<body>
- <button dynClass={signal src} onclick={set src s2}/>
+ <button dynClass={b <- signal toggle;
+ return (if b then date else topic)}
+ dynStyle={b <- signal toggle;
+ return (if b then
+ STYLE "width: 500px"
+ else
+ STYLE "width: 200px")}
+ onclick={b <- get toggle; set toggle (not b)}/>
- <hr/>
-
- <ctextbox source={s} dynClass={t <- signal toggle;
- return (if t then s1 else s2)}
- onkeyup={fn _ => t <- get toggle; set toggle (not t)}/>
+ <button dynStyle={b <- signal toggle;
+ return (if b then
+ STYLE "width: 200px"
+ else
+ STYLE "width: 100px")}/>
+ <button dynClass={b <- signal toggle;
+ return (if b then
+ topic
+ else
+ date)}/>
</body>
</xml>