diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-09-08 10:55:49 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-09-08 10:55:49 -0400 |
commit | 33dbb6c0000a5d82267f984191e7390be86b7dfd (patch) | |
tree | 7d2a84baa2e21562b0754815824f223d61a6621a /demo/more | |
parent | d07c91bf275874a5f6f13af5f338def78eea7ae0 (diff) |
dragList demo working, save for Gecko load delay and highlighting
Diffstat (limited to 'demo/more')
-rw-r--r-- | demo/more/dragList.ur | 26 | ||||
-rw-r--r-- | demo/more/dragList.urp | 3 | ||||
-rw-r--r-- | demo/more/out/dragList.css | 18 | ||||
-rw-r--r-- | demo/more/prose | 4 |
4 files changed, 40 insertions, 11 deletions
diff --git a/demo/more/dragList.ur b/demo/more/dragList.ur index ddb50e82..efdafc8a 100644 --- a/demo/more/dragList.ur +++ b/demo/more/dragList.ur @@ -10,11 +10,12 @@ fun draggableList title items = onmouseover={di <- get draggingItem; case di of None => return () - | Some di => item1 <- get di; - item2 <- get itemSource; - set di item2; - set itemSource item1}> - <dyn signal={s <- signal itemSource; return <xml>{[s]}</xml>}/> + | Some di => original <- get di; + movedOver <- get itemSource; + set di movedOver; + set itemSource original; + set draggingItem (Some itemSource)}> + <dyn signal={Monad.mp (fn s => <xml>{[s]}</xml>) (signal itemSource)}/> </li></xml>) itemSources} </ul> </xml> @@ -26,8 +27,13 @@ fun main () = :: "Sus scrofa ussuricus" :: "Sus scrofa cristatus" :: "Sus scrofa taiwanus" :: []); - return <xml><body> - {bears} - {beers} - {boars} - </body></xml> + return <xml> + <head> + <link rel="stylesheet" type="text/css" href="../../dragList.css"/> + </head> + <body> + {bears} + {beers} + {boars} + </body> + </xml> diff --git a/demo/more/dragList.urp b/demo/more/dragList.urp index 56fb9cce..42ec5c46 100644 --- a/demo/more/dragList.urp +++ b/demo/more/dragList.urp @@ -1,4 +1,5 @@ -debug +allow url ../../dragList.css $/list +$/monad dragList diff --git a/demo/more/out/dragList.css b/demo/more/out/dragList.css new file mode 100644 index 00000000..8fd239a9 --- /dev/null +++ b/demo/more/out/dragList.css @@ -0,0 +1,18 @@ +ul { + width: 200px; + list-style-image: url(http://script.aculo.us/images/bullet.gif); +} + +li { + color: #7E9E50; + font: 20px Georgia; + background-color: #ECF3E1; + border:1px solid #C5DEA1; + cursor: move; + margin: 0px; +} + +h2 { + font: 42px/30px Georgia, serif; + color: #7E9E50; +} diff --git a/demo/more/prose b/demo/more/prose index 37a79724..c2a3d281 100644 --- a/demo/more/prose +++ b/demo/more/prose @@ -1,3 +1,7 @@ <p>These are some extra demo applications written in <a href="http://www.impredicative.com/ur/">Ur/Web</a>. See <a href="http://www.impredicative.com/ur/demo/">the main demo</a> for a more tutorial-like progression through language and library features.</p> +dragList.urp + +This is an Ur/Web version of the "draggable lists" <a href="http://groups.inf.ed.ac.uk/links/examples/">demo program from Links</a>. + grid1.urp |