Mercurial > urweb
annotate tests/styleRt.ur @ 1795:d28adceef22a
Allow type class instances with hypotheses via local ('let') definitions
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Wed, 25 Jul 2012 14:04:59 -0400 |
parents | e9587120831a |
children |
rev | line source |
---|---|
adam@1755 | 1 fun handler r = |
adam@1755 | 2 return <xml><body> |
adam@1755 | 3 <span style={oneProperty |
adam@1755 | 4 (oneProperty noStyle (value (property r.Prop) (atom r.Valu))) |
adam@1755 | 5 (value (property "background") (css_url (bless r.Url)))}> |
adam@1755 | 6 Teeeest |
adam@1755 | 7 </span> |
adam@1755 | 8 </body></xml> |
adam@1755 | 9 |
adam@1755 | 10 fun main () = |
adam@1755 | 11 prop <- source ""; |
adam@1755 | 12 valu <- source ""; |
adam@1755 | 13 url <- source ""; |
adam@1755 | 14 xm <- source <xml/>; |
adam@1755 | 15 return <xml><body> |
adam@1755 | 16 Property: <ctextbox source={prop}/><br/> |
adam@1755 | 17 Value: <ctextbox source={valu}/><br/> |
adam@1755 | 18 URL: <ctextbox source={url}/><br/> |
adam@1755 | 19 <button value="Go!" onclick={prop <- get prop; |
adam@1755 | 20 valu <- get valu; |
adam@1755 | 21 url <- get url; |
adam@1755 | 22 set xm <xml><span style={oneProperty |
adam@1755 | 23 (oneProperty noStyle (value (property prop) (atom valu))) |
adam@1755 | 24 (value (property "background") (css_url (bless url)))}> |
adam@1755 | 25 Teeeest |
adam@1755 | 26 </span></xml>}/> |
adam@1755 | 27 <hr/> |
adam@1755 | 28 <dyn signal={signal xm}/> |
adam@1755 | 29 <hr/> |
adam@1755 | 30 <h2>Or the old fashioned way...</h2> |
adam@1755 | 31 |
adam@1755 | 32 <form> |
adam@1755 | 33 Property: <textbox{#Prop}/><br/> |
adam@1755 | 34 Value: <textbox{#Valu}/><br/> |
adam@1755 | 35 URL: <textbox{#Url}/><br/> |
adam@1755 | 36 <submit action={handler}/> |
adam@1755 | 37 </form> |
adam@1755 | 38 </body></xml> |