Mercurial > gui
annotate examples/ckedit.ur @ 34:2d195bee1efa
CKeditor wrapper
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 21 Nov 2013 18:19:02 -0500 |
parents | |
children |
rev | line source |
---|---|
adam@34 | 1 open Ckeditor |
adam@34 | 2 |
adam@34 | 3 fun make1 () = |
adam@34 | 4 editor <- editor {Width = DefaultSize, |
adam@34 | 5 Height = DefaultSize, |
adam@34 | 6 ToolbarSet = DefaultToolbarSet}; |
adam@34 | 7 return <xml> |
adam@34 | 8 {show editor} |
adam@34 | 9 <hr/> |
adam@34 | 10 <button onclick={fn _ => s <- content editor; alert s}/> |
adam@34 | 11 </xml> |
adam@34 | 12 |
adam@34 | 13 fun make2 () = |
adam@34 | 14 editor <- editor {Width = Percent 50, |
adam@34 | 15 Height = Pixels 500, |
adam@34 | 16 ToolbarSet = Custom ( |
adam@34 | 17 Bar {Nam = Some "bloop", Buttons = Cut :: Separator :: Paste :: []} |
adam@34 | 18 :: Newline |
adam@34 | 19 :: Bar {Nam = None, Buttons = Bold :: []} |
adam@34 | 20 :: [])}; |
adam@34 | 21 return <xml> |
adam@34 | 22 {show editor} |
adam@34 | 23 <hr/> |
adam@34 | 24 <button onclick={fn _ => s <- content editor; alert s}/> |
adam@34 | 25 </xml> |
adam@34 | 26 |
adam@34 | 27 fun main () = |
adam@34 | 28 spot1 <- source <xml/>; |
adam@34 | 29 spot2 <- source <xml/>; |
adam@34 | 30 return <xml><body onload={x1 <- make1 (); set spot1 x1; |
adam@34 | 31 x2 <- make2 (); set spot2 x2}> |
adam@34 | 32 <dyn signal={signal spot1}/> |
adam@34 | 33 <hr/> |
adam@34 | 34 <dyn signal={signal spot2}/> |
adam@34 | 35 </body></xml> |