Mercurial > urweb
comparison tests/styleRt.ur @ 1755:e9587120831a
Run-time CSS style validation
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sun, 06 May 2012 16:08:48 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1754:a1380fc15cb5 | 1755:e9587120831a |
---|---|
1 fun handler r = | |
2 return <xml><body> | |
3 <span style={oneProperty | |
4 (oneProperty noStyle (value (property r.Prop) (atom r.Valu))) | |
5 (value (property "background") (css_url (bless r.Url)))}> | |
6 Teeeest | |
7 </span> | |
8 </body></xml> | |
9 | |
10 fun main () = | |
11 prop <- source ""; | |
12 valu <- source ""; | |
13 url <- source ""; | |
14 xm <- source <xml/>; | |
15 return <xml><body> | |
16 Property: <ctextbox source={prop}/><br/> | |
17 Value: <ctextbox source={valu}/><br/> | |
18 URL: <ctextbox source={url}/><br/> | |
19 <button value="Go!" onclick={prop <- get prop; | |
20 valu <- get valu; | |
21 url <- get url; | |
22 set xm <xml><span style={oneProperty | |
23 (oneProperty noStyle (value (property prop) (atom valu))) | |
24 (value (property "background") (css_url (bless url)))}> | |
25 Teeeest | |
26 </span></xml>}/> | |
27 <hr/> | |
28 <dyn signal={signal xm}/> | |
29 <hr/> | |
30 <h2>Or the old fashioned way...</h2> | |
31 | |
32 <form> | |
33 Property: <textbox{#Prop}/><br/> | |
34 Value: <textbox{#Valu}/><br/> | |
35 URL: <textbox{#Url}/><br/> | |
36 <submit action={handler}/> | |
37 </form> | |
38 </body></xml> |