comparison tests/data_attr.ur @ 2047:6be31671911b

'aria-*' attributes
author Adam Chlipala <adam@chlipala.net>
date Fri, 01 Aug 2014 11:43:44 -0400
parents 93ff76058825
children
comparison
equal deleted inserted replaced
2046:ced78ef1c82f 2047:6be31671911b
1 fun dynd r = return <xml><body> 1 fun dynd r = return <xml><body>
2 <div data={data_attr r.Attr r.Value}>How about that?</div> 2 <div data={data_attr data_kind r.Attr r.Value}>How about that?</div>
3 </body></xml> 3 </body></xml>
4 4
5 fun main () : transaction page = 5 fun main () : transaction page =
6 s <- source <xml/>; 6 s <- source <xml/>;
7 a <- source ""; 7 a <- source "";
8 v <- source ""; 8 v <- source "";
9 return <xml><body> 9 return <xml><body>
10 <div data-foo="hi" data-bar="bye" data-baz="why">Whoa there, cowboy!</div> 10 <div data-foo="hi" aria-something="wow" data-bar="bye" data-baz="why">Whoa there, cowboy!</div>
11 11
12 <hr/> 12 <hr/>
13 13
14 <form> 14 <form>
15 <textbox{#Attr}/> = <textbox{#Value}/> 15 <textbox{#Attr}/> = <textbox{#Value}/>
18 18
19 <hr/> 19 <hr/>
20 20
21 <ctextbox source={a}/> = <ctextbox source={v}/> 21 <ctextbox source={a}/> = <ctextbox source={v}/>
22 <button onclick={fn _ => 22 <button onclick={fn _ =>
23 a <- get a; v <- get v; set s <xml><div data={data_attr a v}>OHO!</div></xml>}/> 23 a <- get a; v <- get v; set s <xml><div data={data_attr data_kind a v}>OHO!</div></xml>}/>
24 <hr/> 24 <hr/>
25 <dyn signal={signal s}/> 25 <dyn signal={signal s}/>
26 </body></xml> 26 </body></xml>