From 33dbb6c0000a5d82267f984191e7390be86b7dfd Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 8 Sep 2009 10:55:49 -0400 Subject: dragList demo working, save for Gecko load delay and highlighting --- demo/more/dragList.ur | 26 ++++++++++++++++---------- demo/more/dragList.urp | 3 ++- demo/more/out/dragList.css | 18 ++++++++++++++++++ demo/more/prose | 4 ++++ 4 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 demo/more/out/dragList.css (limited to 'demo/more') 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}> - {[s]}}/> + | Some di => original <- get di; + movedOver <- get itemSource; + set di movedOver; + set itemSource original; + set draggingItem (Some itemSource)}> + {[s]}) (signal itemSource)}/> ) itemSources} @@ -26,8 +27,13 @@ fun main () = :: "Sus scrofa ussuricus" :: "Sus scrofa cristatus" :: "Sus scrofa taiwanus" :: []); - return - {bears} - {beers} - {boars} - + return + + + + + {bears} + {beers} + {boars} + + 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 @@

These are some extra demo applications written in Ur/Web. See the main demo for a more tutorial-like progression through language and library features.

+dragList.urp + +This is an Ur/Web version of the "draggable lists" demo program from Links. + grid1.urp -- cgit v1.2.3