Mercurial > urweb
comparison lib/ur/basis.urs @ 2206:c1a62ce47083
Merge.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Tue, 27 May 2014 21:38:01 -0400 |
parents | fee1f660139c |
children | 2da693675de9 |
comparison
equal
deleted
inserted
replaced
2205:cdea39473c78 | 2206:c1a62ce47083 |
---|---|
794 -> tag [Code = transaction xbody] body [] [] [] | 794 -> tag [Code = transaction xbody] body [] [] [] |
795 | 795 |
796 val script : unit | 796 val script : unit |
797 -> tag [Code = transaction unit] head [] [] [] | 797 -> tag [Code = transaction unit] head [] [] [] |
798 | 798 |
799 val head : unit -> tag [] html head [] [] | 799 (* Type for HTML5 "data-*" attributes. *) |
800 val title : unit -> tag [] head [] [] [] | 800 type data_attr |
801 val link : unit -> tag [Id = id, Rel = string, Typ = string, Href = url, Media = string] head [] [] [] | 801 val data_attr : string (* Key *) -> string (* Value *) -> data_attr |
802 | 802 (* This function will fail if the key doesn't meet HTML's lexical rules! *) |
803 val body : unit -> tag [Onload = transaction unit, Onresize = transaction unit, Onunload = transaction unit, Onhashchange = transaction unit] | 803 val data_attrs : data_attr -> data_attr -> data_attr |
804 | |
805 val head : unit -> tag [Data = data_attr] html head [] [] | |
806 val title : unit -> tag [Data = data_attr] head [] [] [] | |
807 val link : unit -> tag [Data = data_attr, Id = id, Rel = string, Typ = string, Href = url, Media = string] head [] [] [] | |
808 | |
809 val body : unit -> tag [Data = data_attr, Onload = transaction unit, Onresize = transaction unit, Onunload = transaction unit, Onhashchange = transaction unit] | |
804 html body [] [] | 810 html body [] [] |
805 con bodyTag = fn (attrs :: {Type}) => | 811 con bodyTag = fn (attrs :: {Type}) => |
806 ctx ::: {Unit} -> | 812 ctx ::: {Unit} -> |
807 [[Body] ~ ctx] => | 813 [[Body] ~ ctx] => |
808 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] [] | 814 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] [] |
809 con bodyTagStandalone = fn (attrs :: {Type}) => | 815 con bodyTagStandalone = fn (attrs :: {Type}) => |
810 ctx ::: {Unit} | 816 ctx ::: {Unit} |
811 -> [[Body] ~ ctx] => | 817 -> [[Body] ~ ctx] => |
812 unit -> tag attrs ([Body] ++ ctx) [] [] [] | 818 unit -> tag attrs ([Body] ++ ctx) [] [] [] |
813 | 819 |
814 val br : bodyTagStandalone [Id = id] | 820 val br : bodyTagStandalone [Data = data_attr, Id = id] |
815 | 821 |
816 con focusEvents = [Onblur = transaction unit, Onfocus = transaction unit] | 822 con focusEvents = [Onblur = transaction unit, Onfocus = transaction unit] |
817 | 823 |
818 datatype mouseButton = Left | Right | Middle | 824 datatype mouseButton = Left | Right | Middle |
819 | 825 |
835 con scrollEvents = [Onscroll = transaction unit] | 841 con scrollEvents = [Onscroll = transaction unit] |
836 | 842 |
837 con boxEvents = focusEvents ++ mouseEvents ++ keyEvents ++ resizeEvents ++ scrollEvents | 843 con boxEvents = focusEvents ++ mouseEvents ++ keyEvents ++ resizeEvents ++ scrollEvents |
838 con tableEvents = focusEvents ++ mouseEvents ++ keyEvents | 844 con tableEvents = focusEvents ++ mouseEvents ++ keyEvents |
839 | 845 |
840 con boxAttrs = [Id = id, Title = string] ++ boxEvents | 846 con boxAttrs = [Data = data_attr, Id = id, Title = string] ++ boxEvents |
841 con tableAttrs = [Id = id, Title = string] ++ tableEvents | 847 con tableAttrs = [Data = data_attr, Id = id, Title = string] ++ tableEvents |
842 | 848 |
843 val span : bodyTag boxAttrs | 849 val span : bodyTag boxAttrs |
844 val div : bodyTag boxAttrs | 850 val div : bodyTag boxAttrs |
845 | 851 |
846 val p : bodyTag boxAttrs | 852 val p : bodyTag boxAttrs |
863 val ol : bodyTag boxAttrs | 869 val ol : bodyTag boxAttrs |
864 val ul : bodyTag boxAttrs | 870 val ul : bodyTag boxAttrs |
865 | 871 |
866 val hr : bodyTag boxAttrs | 872 val hr : bodyTag boxAttrs |
867 | 873 |
874 val pre : bodyTag boxAttrs | |
875 | |
876 (** sections **) | |
877 val section : bodyTag boxAttrs | |
878 val article : bodyTag boxAttrs | |
879 val nav : bodyTag boxAttrs | |
880 val aside : bodyTag boxAttrs | |
881 val footer : bodyTag boxAttrs | |
882 val header : bodyTag boxAttrs | |
883 val main : bodyTag boxAttrs | |
884 | |
885 (** forms **) | |
886 val meter : bodyTag boxAttrs | |
887 val progress : bodyTag boxAttrs | |
888 val output : bodyTag boxAttrs | |
889 val keygen : bodyTag boxAttrs | |
890 val datalist : bodyTag boxAttrs | |
891 | |
892 (** Interactive Elements **) | |
893 val details : bodyTag boxAttrs | |
894 val dialog : bodyTag boxAttrs | |
895 val menuitem : bodyTag boxAttrs | |
896 | |
897 (** Grouping Content **) | |
898 val figure : bodyTag boxAttrs | |
899 val figcaption : bodyTag boxAttrs | |
900 | |
901 (** Text Level Semantics **) | |
902 val data : bodyTag boxAttrs | |
903 val mark : bodyTag boxAttrs | |
904 val rp : bodyTag boxAttrs | |
905 val rt : bodyTag boxAttrs | |
906 val ruby : bodyTag boxAttrs | |
907 val summary : bodyTag boxAttrs | |
908 val time : bodyTag boxAttrs | |
909 val wbr : bodyTag boxAttrs | |
910 val bdi : bodyTag boxAttrs | |
911 | |
868 val a : bodyTag ([Link = transaction page, Href = url, Target = string, Rel = string] ++ boxAttrs) | 912 val a : bodyTag ([Link = transaction page, Href = url, Target = string, Rel = string] ++ boxAttrs) |
869 | 913 |
870 val img : bodyTag ([Alt = string, Src = url, Width = int, Height = int, | 914 val img : bodyTag ([Alt = string, Src = url, Width = int, Height = int, |
871 Onabort = transaction unit, Onerror = transaction unit, | 915 Onabort = transaction unit, Onerror = transaction unit, |
872 Onload = transaction unit] ++ boxAttrs) | 916 Onload = transaction unit] ++ boxAttrs) |
897 con formTag = fn (ty :: Type) (inner :: {Unit}) (attrs :: {Type}) => | 941 con formTag = fn (ty :: Type) (inner :: {Unit}) (attrs :: {Type}) => |
898 ctx ::: {Unit} | 942 ctx ::: {Unit} |
899 -> [[Form] ~ ctx] => | 943 -> [[Form] ~ ctx] => |
900 nm :: Name -> unit | 944 nm :: Name -> unit |
901 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty] | 945 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty] |
902 val hidden : formTag string [] [Id = string, Value = string] | 946 val hidden : formTag string [] [Data = data_attr, Id = string, Value = string] |
903 val textbox : formTag string [] ([Value = string, Size = int, Placeholder = string, Source = source string, Onchange = transaction unit, | 947 val textbox : formTag string [] ([Value = string, Size = int, Placeholder = string, Source = source string, Onchange = transaction unit, |
904 Ontext = transaction unit] ++ boxAttrs) | 948 Ontext = transaction unit] ++ boxAttrs) |
905 val password : formTag string [] ([Value = string, Size = int, Placeholder = string] ++ boxAttrs) | 949 val password : formTag string [] ([Value = string, Size = int, Placeholder = string] ++ boxAttrs) |
906 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, | 950 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, |
907 Ontext = transaction unit] ++ boxAttrs) | 951 Ontext = transaction unit] ++ boxAttrs) |
931 val fieldName : postField -> string | 975 val fieldName : postField -> string |
932 val fieldValue : postField -> string | 976 val fieldValue : postField -> string |
933 val remainingFields : postField -> string | 977 val remainingFields : postField -> string |
934 | 978 |
935 con radio = [Body, Radio] | 979 con radio = [Body, Radio] |
936 val radio : formTag (option string) radio [Id = id] | 980 val radio : formTag (option string) radio [Data = data_attr, Id = id] |
937 val radioOption : unit -> tag ([Value = string, Checked = bool] ++ boxAttrs) radio [] [] [] | 981 val radioOption : unit -> tag ([Value = string, Checked = bool] ++ boxAttrs) radio [] [] [] |
938 | 982 |
939 con select = [Select] | 983 con select = [Select] |
940 val select : formTag string select ([Onchange = transaction unit] ++ boxAttrs) | 984 val select : formTag string select ([Onchange = transaction unit] ++ boxAttrs) |
941 val option : unit -> tag [Value = string, Selected = bool] select [] [] [] | 985 val option : unit -> tag [Data = data_attr, Value = string, Selected = bool] select [] [] [] |
942 | 986 |
943 val submit : ctx ::: {Unit} -> use ::: {Type} | 987 val submit : ctx ::: {Unit} -> use ::: {Type} |
944 -> [[Form] ~ ctx] => | 988 -> [[Form] ~ ctx] => |
945 unit | 989 unit |
946 -> tag ([Value = string, Action = $use -> transaction page] ++ boxAttrs) | 990 -> tag ([Value = string, Action = $use -> transaction page] ++ boxAttrs) |
988 ([Tr] ++ other) ([Body] ++ other) [] [] | 1032 ([Tr] ++ other) ([Body] ++ other) [] [] |
989 val td : other ::: {Unit} -> [other ~ [Body, Tr]] => unit | 1033 val td : other ::: {Unit} -> [other ~ [Body, Tr]] => unit |
990 -> tag ([Colspan = int, Rowspan = int] ++ tableAttrs) | 1034 -> tag ([Colspan = int, Rowspan = int] ++ tableAttrs) |
991 ([Tr] ++ other) ([Body] ++ other) [] [] | 1035 ([Tr] ++ other) ([Body] ++ other) [] [] |
992 | 1036 |
1037 val thead : other ::: {Unit} -> [other ~ [Table]] => unit | |
1038 -> tag tableAttrs | |
1039 ([Table] ++ other) ([Table] ++ other) [] [] | |
1040 val tbody : other ::: {Unit} -> [other ~ [Table]] => unit | |
1041 -> tag tableAttrs | |
1042 ([Table] ++ other) ([Table] ++ other) [] [] | |
1043 val tfoot : other ::: {Unit} -> [other ~ [Table]] => unit | |
1044 -> tag tableAttrs | |
1045 ([Table] ++ other) ([Table] ++ other) [] [] | |
1046 | |
993 (** Definition lists *) | 1047 (** Definition lists *) |
994 | 1048 |
995 val dl : other ::: {Unit} -> [other ~ [Body,Dl]] | 1049 val dl : other ::: {Unit} -> [other ~ [Body,Dl]] |
996 => unit | 1050 => unit |
997 -> tag [] ([Body] ++ other) ([Dl] ++ other) [] [] | 1051 -> tag [Data = data_attr] ([Body] ++ other) ([Dl] ++ other) [] [] |
998 | 1052 |
999 val dt : other ::: {Unit} -> [other ~ [Body,Dl]] | 1053 val dt : other ::: {Unit} -> [other ~ [Body,Dl]] |
1000 => unit | 1054 => unit |
1001 -> tag [] ([Dl] ++ other) ([Body] ++ other) [] [] | 1055 -> tag [Data = data_attr] ([Dl] ++ other) ([Body] ++ other) [] [] |
1002 | 1056 |
1003 val dd : other ::: {Unit} -> [other ~ [Body,Dl]] | 1057 val dd : other ::: {Unit} -> [other ~ [Body,Dl]] |
1004 => unit | 1058 => unit |
1005 -> tag [] ([Dl] ++ other) ([Body] ++ other) [] [] | 1059 -> tag [Data = data_attr] ([Dl] ++ other) ([Body] ++ other) [] [] |
1060 | |
1006 | 1061 |
1007 (** Aborting *) | 1062 (** Aborting *) |
1008 | 1063 |
1009 val error : t ::: Type -> xbody -> t | 1064 val error : t ::: Type -> xbody -> t |
1010 | 1065 |