diff options
author | Adam Chlipala <adam@chlipala.net> | 2014-05-02 15:32:10 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2014-05-02 15:32:10 -0400 |
commit | 1580340ec252e4e399c2c1d2b403974f49c3a084 (patch) | |
tree | e35283c198e93ed20c6a38a6d01361630a6b0771 /tests | |
parent | 48f4fa7d2482829d6195e91e1cd4c5a940aacab4 (diff) |
HTML5 data-* attributes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data_attr.ur | 26 | ||||
-rw-r--r-- | tests/data_attr.urs | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/data_attr.ur b/tests/data_attr.ur new file mode 100644 index 00000000..80dda857 --- /dev/null +++ b/tests/data_attr.ur @@ -0,0 +1,26 @@ +fun dynd r = return <xml><body> + <div data={data_attr r.Attr r.Value}>How about that?</div> +</body></xml> + +fun main () : transaction page = + s <- source <xml/>; + a <- source ""; + v <- source ""; + return <xml><body> + <div data-foo="hi" data-bar="bye" data-baz="why">Whoa there, cowboy!</div> + + <hr/> + + <form> + <textbox{#Attr}/> = <textbox{#Value}/> + <submit action={dynd}/> + </form> + + <hr/> + + <ctextbox source={a}/> = <ctextbox source={v}/> + <button onclick={fn _ => + a <- get a; v <- get v; set s <xml><div data={data_attr a v}>OHO!</div></xml>}/> + <hr/> + <dyn signal={signal s}/> + </body></xml> diff --git a/tests/data_attr.urs b/tests/data_attr.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/tests/data_attr.urs @@ -0,0 +1 @@ +val main : unit -> transaction page |