comparison lib/ur/basis.urs @ 2211:ef766ef6e242

Merge.
author Ziv Scully <ziv@mit.edu>
date Sat, 13 Sep 2014 19:16:07 -0400
parents 795b5b75453c
children e48e09a1f583
comparison
equal deleted inserted replaced
2210:69c0f36255cb 2211:ef766ef6e242
701 701
702 type css_value 702 type css_value
703 val atom : string -> css_value 703 val atom : string -> css_value
704 type url 704 type url
705 val css_url : url -> css_value 705 val css_url : url -> css_value
706 val sql_url : sql_injectable_prim url
706 type css_property 707 type css_property
707 val property : string -> css_property 708 val property : string -> css_property
708 val value : css_property -> css_value -> css_property 709 val value : css_property -> css_value -> css_property
709 type css_style 710 type css_style
710 val noStyle : css_style 711 val noStyle : css_style
794 -> tag [Code = transaction xbody] body [] [] [] 795 -> tag [Code = transaction xbody] body [] [] []
795 796
796 val script : unit 797 val script : unit
797 -> tag [Code = transaction unit] head [] [] [] 798 -> tag [Code = transaction unit] head [] [] []
798 799
799 (* Type for HTML5 "data-*" attributes. *) 800 (* Type for HTML5 "data-*" and "aria-*" attributes. *)
801 type data_attr_kind
802 val data_kind : data_attr_kind
803 val aria_kind : data_attr_kind
804
800 type data_attr 805 type data_attr
801 val data_attr : string (* Key *) -> string (* Value *) -> data_attr 806 val data_attr : data_attr_kind -> string (* Key *) -> string (* Value *) -> data_attr
802 (* This function will fail if the key doesn't meet HTML's lexical rules! *) 807 (* This function will fail if the key doesn't meet HTML's lexical rules! *)
803 val data_attrs : data_attr -> data_attr -> data_attr 808 val data_attrs : data_attr -> data_attr -> data_attr
804 809
805 val head : unit -> tag [Data = data_attr] html head [] [] 810 val head : unit -> tag [Data = data_attr] html head [] []
806 val title : unit -> tag [Data = data_attr] head [] [] [] 811 val title : unit -> tag [Data = data_attr] head [] [] []
841 con scrollEvents = [Onscroll = transaction unit] 846 con scrollEvents = [Onscroll = transaction unit]
842 847
843 con boxEvents = focusEvents ++ mouseEvents ++ keyEvents ++ resizeEvents ++ scrollEvents 848 con boxEvents = focusEvents ++ mouseEvents ++ keyEvents ++ resizeEvents ++ scrollEvents
844 con tableEvents = focusEvents ++ mouseEvents ++ keyEvents 849 con tableEvents = focusEvents ++ mouseEvents ++ keyEvents
845 850
846 con boxAttrs = [Data = data_attr, Id = id, Title = string] ++ boxEvents 851 con boxAttrs = [Data = data_attr, Id = id, Title = string, Role = string] ++ boxEvents
847 con tableAttrs = [Data = data_attr, Id = id, Title = string] ++ tableEvents 852 con tableAttrs = [Data = data_attr, Id = id, Title = string] ++ tableEvents
848 853
849 val span : bodyTag boxAttrs 854 val span : bodyTag boxAttrs
850 val div : bodyTag boxAttrs 855 val div : bodyTag boxAttrs
851 856
944 nm :: Name -> unit 949 nm :: Name -> unit
945 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty] 950 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty]
946 val hidden : formTag string [] [Data = data_attr, Id = string, Value = string] 951 val hidden : formTag string [] [Data = data_attr, Id = string, Value = string]
947 val textbox : formTag string [] ([Value = string, Size = int, Placeholder = string, Source = source string, Onchange = transaction unit, 952 val textbox : formTag string [] ([Value = string, Size = int, Placeholder = string, Source = source string, Onchange = transaction unit,
948 Ontext = transaction unit] ++ boxAttrs) 953 Ontext = transaction unit] ++ boxAttrs)
949 val password : formTag string [] ([Value = string, Size = int, Placeholder = string] ++ boxAttrs) 954 val password : formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs)
950 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, 955 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit,
951 Ontext = transaction unit] ++ boxAttrs) 956 Ontext = transaction unit] ++ boxAttrs)
952 957
953 val checkbox : formTag bool [] ([Checked = bool] ++ boxAttrs) 958 val checkbox : formTag bool [] ([Checked = bool, Onchange = transaction unit] ++ boxAttrs)
954 959
955 type file 960 type file
956 val fileName : file -> option string 961 val fileName : file -> option string
957 val fileMimeType : file -> string 962 val fileMimeType : file -> string
958 val fileData : file -> blob 963 val fileData : file -> blob
1001 1006
1002 (*** AJAX-oriented widgets *) 1007 (*** AJAX-oriented widgets *)
1003 1008
1004 con cformTag = fn (attrs :: {Type}) (inner :: {Unit}) => 1009 con cformTag = fn (attrs :: {Type}) (inner :: {Unit}) =>
1005 ctx ::: {Unit} 1010 ctx ::: {Unit}
1006 -> [[Body] ~ ctx] => 1011 -> [[Body] ~ ctx] => [[Body] ~ inner] =>
1007 unit -> tag attrs ([Body] ++ ctx) inner [] [] 1012 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ inner) [] []
1008 1013
1009 val ctextbox : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit, 1014 val ctextbox : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit,
1010 Ontext = transaction unit] ++ boxAttrs) [] 1015 Ontext = transaction unit] ++ boxAttrs) []
1016 val cpassword : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit,
1017 Ontext = transaction unit] ++ boxAttrs) []
1011 val button : cformTag ([Value = string] ++ boxAttrs) [] 1018 val button : cformTag ([Value = string] ++ boxAttrs) []
1012 1019
1013 val ccheckbox : cformTag ([Value = bool, Size = int, Source = source bool] ++ boxAttrs) [] 1020 val ccheckbox : cformTag ([Value = bool, Size = int, Source = source bool, Onchange = transaction unit] ++ boxAttrs) []
1014 1021
1015 con cselect = [Cselect] 1022 val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxAttrs) [Cselect]
1016 val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxAttrs) cselect 1023 val coption : unit -> tag [Value = string, Selected = bool] [Cselect, Body] [] [] []
1017 val coption : unit -> tag [Value = string, Selected = bool] cselect [] [] []
1018 1024
1019 val ctextarea : cformTag ([Value = string, Rows = int, Cols = int, Source = source string, Onchange = transaction unit, 1025 val ctextarea : cformTag ([Value = string, Rows = int, Cols = int, Source = source string, Onchange = transaction unit,
1020 Ontext = transaction unit] ++ boxAttrs) [] 1026 Ontext = transaction unit] ++ boxAttrs) []
1021 1027
1022 (*** Tables *) 1028 (*** Tables *)