Mercurial > urweb
annotate tests/dynClass.ur @ 1784:e6bc6bbd7a32
Update demo code for key/mouse handler change
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 21 Jul 2012 10:12:35 -0400 |
parents | acadf9d1214a |
children | 2b2d07946e65 |
rev | line source |
---|---|
adam@1751 | 1 style date |
adam@1751 | 2 style topic |
adam@1643 | 3 |
adam@1643 | 4 fun main () : transaction page = |
adam@1643 | 5 toggle <- source False; |
adam@1643 | 6 return <xml> |
adam@1643 | 7 <head> |
adam@1751 | 8 <link rel="stylesheet" type="text/css" href="http://adam.chlipala.net/style.css"/> |
adam@1643 | 9 </head> |
adam@1643 | 10 <body> |
adam@1751 | 11 <button dynClass={b <- signal toggle; |
adam@1751 | 12 return (if b then date else topic)} |
adam@1751 | 13 dynStyle={b <- signal toggle; |
adam@1751 | 14 return (if b then |
adam@1751 | 15 STYLE "width: 500px" |
adam@1751 | 16 else |
adam@1751 | 17 STYLE "width: 200px")} |
adam@1751 | 18 onclick={b <- get toggle; set toggle (not b)}/> |
adam@1643 | 19 |
adam@1751 | 20 <button dynStyle={b <- signal toggle; |
adam@1751 | 21 return (if b then |
adam@1751 | 22 STYLE "width: 200px" |
adam@1751 | 23 else |
adam@1751 | 24 STYLE "width: 100px")}/> |
adam@1751 | 25 <button dynClass={b <- signal toggle; |
adam@1751 | 26 return (if b then |
adam@1751 | 27 topic |
adam@1751 | 28 else |
adam@1751 | 29 date)}/> |
adam@1643 | 30 </body> |
adam@1643 | 31 </xml> |