diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-05-06 16:08:48 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-05-06 16:08:48 -0400 |
commit | b9634e3475a851640db7ddf93bb29e7778bc9e34 (patch) | |
tree | a956507879ff7df344774dc30dabdc5438d4cb63 /tests/styleRt.ur | |
parent | e1ea17cb21e3193a99cfd93d7e264ba0176f66f5 (diff) |
Run-time CSS style validation
Diffstat (limited to 'tests/styleRt.ur')
-rw-r--r-- | tests/styleRt.ur | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/styleRt.ur b/tests/styleRt.ur new file mode 100644 index 00000000..583649a1 --- /dev/null +++ b/tests/styleRt.ur @@ -0,0 +1,38 @@ +fun handler r = + return <xml><body> + <span style={oneProperty + (oneProperty noStyle (value (property r.Prop) (atom r.Valu))) + (value (property "background") (css_url (bless r.Url)))}> + Teeeest + </span> + </body></xml> + +fun main () = + prop <- source ""; + valu <- source ""; + url <- source ""; + xm <- source <xml/>; + return <xml><body> + Property: <ctextbox source={prop}/><br/> + Value: <ctextbox source={valu}/><br/> + URL: <ctextbox source={url}/><br/> + <button value="Go!" onclick={prop <- get prop; + valu <- get valu; + url <- get url; + set xm <xml><span style={oneProperty + (oneProperty noStyle (value (property prop) (atom valu))) + (value (property "background") (css_url (bless url)))}> + Teeeest + </span></xml>}/> + <hr/> + <dyn signal={signal xm}/> + <hr/> + <h2>Or the old fashioned way...</h2> + + <form> + Property: <textbox{#Prop}/><br/> + Value: <textbox{#Valu}/><br/> + URL: <textbox{#Url}/><br/> + <submit action={handler}/> + </form> + </body></xml> |