comparison examples/togglepanel.ur @ 23:7c734edc6301

Merge from Adam.
author Karn Kallio <kkallio@eka>
date Sat, 24 Sep 2011 18:55:27 -0430
parents 554e342665fe
children 93140c5cc972
comparison
equal deleted inserted replaced
22:4362b15220e4 23:7c734edc6301
2 open TogglePanel 2 open TogglePanel
3 3
4 val defaultContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Default format</b></p></xml> 4 val defaultContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Default format</b></p></xml>
5 val otherContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Other format</b></p></xml> 5 val otherContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Other format</b></p></xml>
6 6
7 val otherFormat = {FormatPanel = fn ctl panel => <xml><span>A Custom {ctl} Format</span>{panel}</xml>, 7 val otherFormat = fn [body ~ []] =>
8 OpenCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>View</a></xml>, 8 {FormatPanel = fn ctl panel => <xml><span>A Custom {ctl} Format</span>{panel}</xml>,
9 CloseCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>Hide</a></xml>} 9 OpenCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>View</a></xml>,
10 CloseCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>Hide</a></xml>}
10 11
11 fun main () = 12 fun main () =
12 13
13 defaultFormatPanel <- create defaultFormat defaultContent True; 14 defaultFormatPanel <- create @defaultFormat defaultContent True;
14 otherFormatPanel <- create otherFormat otherContent False; 15 otherFormatPanel <- create @otherFormat otherContent False;
15 16
16 return <xml> 17 return <xml>
17 <head> 18 <head>
18 <title>A panel that can be shown or hidden.</title> 19 <title>A panel that can be shown or hidden.</title>
19 </head> 20 </head>