summaryrefslogtreecommitdiff
path: root/tests
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
commit85341a176564ac3ce4e0a4ec4612262e2945660a (patch)
tree0b91d6fdd507e47f191183d49a4d5207ae515be7 /tests
parent9e25c1ce13add31807463c913129c24643944e38 (diff)
'dynStyle' pseudo-attribute
Diffstat (limited to 'tests')
-rw-r--r--tests/dynClass.ur32
-rw-r--r--tests/dynClass.urp2
2 files changed, 22 insertions, 12 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>
diff --git a/tests/dynClass.urp b/tests/dynClass.urp
index 4358782b..0818a3b2 100644
--- a/tests/dynClass.urp
+++ b/tests/dynClass.urp
@@ -1,4 +1,4 @@
rewrite all DynClass/*
-allow url http://localhost/*
+allow url http://adam.chlipala.net/*
dynClass