diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2015-08-19 11:02:23 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2015-08-19 11:02:23 -0400 |
commit | 598756dc69f89cf2dd2b889cad63a7a690ae7ed7 (patch) | |
tree | 5fc521225e717163c30ea494a5839c26725eec2e /lib/ur/basis.urs | |
parent | 7ea9d17bad72cf2829c75d8d241fafa70b2c9b94 (diff) | |
parent | fb6e6599b35df9cfa05786772868b1a3d2e58ac3 (diff) |
Merge branch 'upstream' into dfsg_clean20150819+dfsg
Conflicts:
doc/intro.ur
Diffstat (limited to 'lib/ur/basis.urs')
-rw-r--r-- | lib/ur/basis.urs | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index 56c8d767..ec6ef599 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -811,21 +811,6 @@ val head : unit -> tag [Data = data_attr] html head [] [] val title : unit -> tag [Data = data_attr] head [] [] [] val link : unit -> tag [Data = data_attr, Id = id, Rel = string, Typ = string, Href = url, Media = string] head [] [] [] -val body : unit -> tag [Data = data_attr, Onload = transaction unit, Onresize = transaction unit, Onunload = transaction unit, Onhashchange = transaction unit] - html body [] [] -con bodyTag = fn (attrs :: {Type}) => - ctx ::: {Unit} -> - [[Body] ~ ctx] => - unit -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] [] -con bodyTagStandalone = fn (attrs :: {Type}) => - ctx ::: {Unit} - -> [[Body] ~ ctx] => - unit -> tag attrs ([Body] ++ ctx) [] [] [] - -val br : bodyTagStandalone [Data = data_attr, Id = id] - -con focusEvents = [Onblur = transaction unit, Onfocus = transaction unit] - datatype mouseButton = Left | Right | Middle type mouseEvent = { ScreenX : int, ScreenY : int, ClientX : int, ClientY : int, @@ -841,6 +826,24 @@ type keyEvent = { KeyCode : int, con keyEvents = map (fn _ :: Unit => keyEvent -> transaction unit) [Onkeydown, Onkeypress, Onkeyup] +val body : unit -> tag ([Data = data_attr, Onload = transaction unit, Onresize = transaction unit, Onunload = transaction unit, Onhashchange = transaction unit] + ++ mouseEvents ++ keyEvents) + html body [] [] + +con bodyTag = fn (attrs :: {Type}) => + ctx ::: {Unit} -> + [[Body] ~ ctx] => + unit -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] [] +con bodyTagStandalone = fn (attrs :: {Type}) => + ctx ::: {Unit} + -> [[Body] ~ ctx] => + unit -> tag attrs ([Body] ++ ctx) [] [] [] + +val br : bodyTagStandalone [Data = data_attr, Id = id] + +con focusEvents = [Onblur = transaction unit, Onfocus = transaction unit] + + (* Key arguments are character codes. *) con resizeEvents = [Onresize = transaction unit] con scrollEvents = [Onscroll = transaction unit] @@ -848,8 +851,8 @@ con scrollEvents = [Onscroll = transaction unit] con boxEvents = focusEvents ++ mouseEvents ++ keyEvents ++ resizeEvents ++ scrollEvents con tableEvents = focusEvents ++ mouseEvents ++ keyEvents -con boxAttrs = [Data = data_attr, Id = id, Title = string, Role = string] ++ boxEvents -con tableAttrs = [Data = data_attr, Id = id, Title = string] ++ tableEvents +con boxAttrs = [Data = data_attr, Id = id, Title = string, Role = string, Align = string] ++ boxEvents +con tableAttrs = [Data = data_attr, Id = id, Title = string, Align = string] ++ tableEvents val span : bodyTag boxAttrs val div : bodyTag boxAttrs @@ -1008,7 +1011,7 @@ val remainingFields : postField -> string con radio = [Body, Radio] val radio : formTag (option string) radio [Data = data_attr, Id = id] -val radioOption : unit -> tag ([Value = string, Checked = bool] ++ boxAttrs) radio [] [] [] +val radioOption : unit -> tag ([Value = string, Checked = bool, Onchange = transaction unit] ++ boxAttrs) radio [] [] [] con select = [Select] val select : formTag string select ([Onchange = transaction unit] ++ boxAttrs) |