comparison tests/dynClass.ur @ 1643:b0720700c36e

'dynClass' pseudo-attribute
author Adam Chlipala <adam@chlipala.net>
date Tue, 27 Dec 2011 16:20:48 -0500
parents
children acadf9d1214a
comparison
equal deleted inserted replaced
1642:c3627f317bfd 1643:b0720700c36e
1 style s1
2 style s2
3
4 fun main () : transaction page =
5 src <- source s1;
6 s <- source "";
7 toggle <- source False;
8 return <xml>
9 <head>
10 <link rel="stylesheet" type="text/css" href="http://localhost/test.css"/>
11 </head>
12 <body>
13 <button dynClass={signal src} onclick={set src s2}/>
14
15 <hr/>
16
17 <ctextbox source={s} dynClass={t <- signal toggle;
18 return (if t then s1 else s2)}
19 onkeyup={fn _ => t <- get toggle; set toggle (not t)}/>
20 </body>
21 </xml>