# HG changeset patch # User Adam Chlipala # Date 1336831424 14400 # Node ID 93140c5cc972c49d3a0540e3c2e8161cd65ffaeb # Parent 7d001454219962ea2d4672b66a50ff55b500dd9d Clean up dependencies and examples; add Style module diff -r 7d0014542199 -r 93140c5cc972 calendar.ur --- a/calendar.ur Sun Feb 12 10:27:02 2012 -0500 +++ b/calendar.ur Sat May 12 10:03:44 2012 -0400 @@ -130,7 +130,7 @@ Day = day} in cday <- SourceL.value t.Day; - return (if Record.equal thisDate cday then + return (if thisDate = cday then {[day]} else case month of This => +
Bold
+
Image
+
Both
+
diff -r 7d0014542199 -r 93140c5cc972 examples/css.urp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/css.urp Sat May 12 10:03:44 2012 -0400 @@ -0,0 +1,5 @@ +library .. +rewrite all Css/* +allow url http://adam.chlipala.net/web.png + +css diff -r 7d0014542199 -r 93140c5cc972 examples/datebox.ur --- a/examples/datebox.ur Sun Feb 12 10:27:02 2012 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -fun main () = - tm <- now; - - dayCtl <- Datebox.create tm; - - load <- return (Datebox.onChange dayCtl (fn d => alert (show d.Day))); - - return - - Datebox Example - - {Gui.toXml dayCtl} - - diff -r 7d0014542199 -r 93140c5cc972 examples/datebox.urp --- a/examples/datebox.urp Sun Feb 12 10:27:02 2012 -0500 +++ b/examples/datebox.urp Sat May 12 10:03:44 2012 -0400 @@ -1,7 +1,6 @@ -path META=../../meta library ../ -rewrite url Datebox/* +rewrite url DateboxMain/* allow url http://* prefix http://localhost:8080/ -datebox +dateboxMain diff -r 7d0014542199 -r 93140c5cc972 examples/datebox.urs --- a/examples/datebox.urs Sun Feb 12 10:27:02 2012 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -val main : unit -> transaction page diff -r 7d0014542199 -r 93140c5cc972 examples/dateboxMain.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/dateboxMain.ur Sat May 12 10:03:44 2012 -0400 @@ -0,0 +1,14 @@ +fun main () = + tm <- now; + + dayCtl <- Datebox.create tm; + + load <- return (Datebox.onChange dayCtl (fn d => alert (show d.Day))); + + return + + Datebox Example + + {Gui.toXml dayCtl} + + diff -r 7d0014542199 -r 93140c5cc972 examples/dateboxMain.urs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/dateboxMain.urs Sat May 12 10:03:44 2012 -0400 @@ -0,0 +1,1 @@ +val main : unit -> transaction page diff -r 7d0014542199 -r 93140c5cc972 examples/navtest.urp --- a/examples/navtest.urp Sun Feb 12 10:27:02 2012 -0500 +++ b/examples/navtest.urp Sat May 12 10:03:44 2012 -0400 @@ -1,4 +1,3 @@ -path META=../../meta library ../ rewrite url Navtest/* allow url http://* diff -r 7d0014542199 -r 93140c5cc972 examples/popup.urp --- a/examples/popup.urp Sun Feb 12 10:27:02 2012 -0500 +++ b/examples/popup.urp Sat May 12 10:03:44 2012 -0400 @@ -1,4 +1,3 @@ -path META=../../meta library ../ rewrite url Popup/* allow url http://* diff -r 7d0014542199 -r 93140c5cc972 examples/remotePager.ur --- a/examples/remotePager.ur Sun Feb 12 10:27:02 2012 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -fun getPage pg = - return {Content =

This is page {[pg]}.

, - Available = 44} - -structure Pager = RemotePager.Make(struct - type errorMarker = {} - type pageGroup = {} - val initPage = fn _ => getPage 0 - val getPage = fn _ pg => - tm <- now; - if mod (toSeconds tm) 5 = 0 then - return (RemotePager.Bad ()) - else - p <- getPage pg; - return (RemotePager.Good p) - end) - -fun main () = - - pager <- Pager.create (); - - return - - RemotePager Example - alert "bad found")}> -

RemotePager Example

-
{Pager.panelXml pager}
-
{Pager.ctlXml pager}
- -
diff -r 7d0014542199 -r 93140c5cc972 examples/remotePager.urp --- a/examples/remotePager.urp Sun Feb 12 10:27:02 2012 -0500 +++ b/examples/remotePager.urp Sat May 12 10:03:44 2012 -0400 @@ -1,7 +1,6 @@ -path META=../../meta library ../ -rewrite url RemotePager/* +rewrite url RemotePagerMain/* allow url http://* prefix http://localhost:8080/ -remotePager +remotePagerMain diff -r 7d0014542199 -r 93140c5cc972 examples/remotePager.urs --- a/examples/remotePager.urs Sun Feb 12 10:27:02 2012 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -val main : {} -> transaction page diff -r 7d0014542199 -r 93140c5cc972 examples/remotePagerMain.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/remotePagerMain.ur Sat May 12 10:03:44 2012 -0400 @@ -0,0 +1,30 @@ +fun getPage pg = + return {Content =

This is page {[pg]}.

, + Available = 44} + +structure Pager = RemotePager.Make(struct + type errorMarker = {} + type pageGroup = {} + val initPage = fn _ => getPage 0 + val getPage = fn _ pg => + tm <- now; + if mod (toSeconds tm) 5 = 0 then + return (RemotePager.Bad ()) + else + p <- getPage pg; + return (RemotePager.Good p) + end) + +fun main () = + + pager <- Pager.create (); + + return + + RemotePager Example + alert "bad found")}> +

RemotePager Example

+
{Pager.panelXml pager}
+
{Pager.ctlXml pager}
+ +
diff -r 7d0014542199 -r 93140c5cc972 examples/remotePagerMain.urs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/remotePagerMain.urs Sat May 12 10:03:44 2012 -0400 @@ -0,0 +1,1 @@ +val main : {} -> transaction page diff -r 7d0014542199 -r 93140c5cc972 examples/togglepanel.ur --- a/examples/togglepanel.ur Sun Feb 12 10:27:02 2012 -0500 +++ b/examples/togglepanel.ur Sat May 12 10:03:44 2012 -0400 @@ -4,7 +4,7 @@ val defaultContent : xbody =

Here I am inside the panel.
Default format

val otherContent : xbody =

Here I am inside the panel.
Other format

-val otherFormat = fn [body ~ []] => +val otherFormat = fn [[Dyn] ~ body'] => {FormatPanel = fn ctl panel => A Custom {ctl} Format{panel}, OpenCtl = fn behaviour => View, CloseCtl = fn behaviour => Hide} diff -r 7d0014542199 -r 93140c5cc972 examples/togglepanel.urp --- a/examples/togglepanel.urp Sun Feb 12 10:27:02 2012 -0500 +++ b/examples/togglepanel.urp Sat May 12 10:03:44 2012 -0400 @@ -1,4 +1,3 @@ -path META=../../meta library ../ rewrite url Togglepanel/* allow url http://* diff -r 7d0014542199 -r 93140c5cc972 lib.urp --- a/lib.urp Sun Feb 12 10:27:02 2012 -0500 +++ b/lib.urp Sat May 12 10:03:44 2012 -0400 @@ -1,5 +1,3 @@ -library $META - $/string $/list gui @@ -16,3 +14,4 @@ navigation clock remotePager +style diff -r 7d0014542199 -r 93140c5cc972 style.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/style.ur Sat May 12 10:03:44 2012 -0400 @@ -0,0 +1,16 @@ +class attr t = t -> css_value +val attr_string = atom +fun attr_int n = atom (show n) +val attr_url = css_url +fun valu [t] (f : attr t) (x : t) = f x + +fun prop1 [t] (f : attr t) (s : string) (x : t) = + oneProperty noStyle (value (property s) (f x)) + +fun prop (s : string) (xs : list css_value) = + oneProperty noStyle (List.foldl (fn x p => value p x) (property s) xs) + +fun props (ls : list (string * list css_value)) = + List.foldl (fn (s, xs) acc => + oneProperty acc (List.foldl (fn x p => value p x) (property s) xs)) + noStyle ls diff -r 7d0014542199 -r 93140c5cc972 style.urs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/style.urs Sat May 12 10:03:44 2012 -0400 @@ -0,0 +1,9 @@ +class attr +val attr_string : attr string +val attr_int : attr int +val attr_url : attr url +val valu : t ::: Type -> attr t -> t -> css_value + +val prop1 : t ::: Type -> attr t -> string -> t -> css_style +val prop : string -> list css_value -> css_style +val props : list (string * list css_value) -> css_style