# HG changeset patch # User Adam Chlipala # Date 1416165371 18000 # Node ID 3cd2bd4b1de0c328e2abc1e5a7eb11524d843071 # Parent 855d7746a08438561ccf596ebc069c5415eb0c5a More simple textual HTML5 input types diff -r 855d7746a084 -r 3cd2bd4b1de0 lib/ur/basis.urs --- a/lib/ur/basis.urs Sun Nov 16 14:06:24 2014 -0500 +++ b/lib/ur/basis.urs Sun Nov 16 14:16:11 2014 -0500 @@ -956,12 +956,21 @@ val textbox : formTag string [] ([Value = string, Size = int, Placeholder = string, Source = source string, Onchange = transaction unit, Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) val password : formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) -val email : formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) val checkbox : formTag bool [] ([Checked = bool, Onchange = transaction unit] ++ boxAttrs) +(* HTML5 widgets galore! *) + +type textWidget = formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) + +val email : textWidget +val search : textWidget +val url_ : textWidget +val tel : textWidget + + type file val fileName : file -> option string val fileMimeType : file -> string diff -r 855d7746a084 -r 3cd2bd4b1de0 src/monoize.sml --- a/src/monoize.sml Sun Nov 16 14:06:24 2014 -0500 +++ b/src/monoize.sml Sun Nov 16 14:16:11 2014 -0500 @@ -3664,6 +3664,9 @@ raise Fail "No name passed to textbox tag")) | "password" => input "password" | "email" => input "email" + | "search" => input "search" + | "url_" => input "url" + | "tel" => input "tel" | "textarea" => (case targs of [_, (L.CName name, _)] => diff -r 855d7746a084 -r 3cd2bd4b1de0 src/urweb.grm --- a/src/urweb.grm Sun Nov 16 14:06:24 2014 -0500 +++ b/src/urweb.grm Sun Nov 16 14:16:11 2014 -0500 @@ -221,6 +221,7 @@ fun tagIn bt = case bt of "table" => "tabl" + | "url" => "url_" | _ => bt datatype prop_kind = Delete | Update diff -r 855d7746a084 -r 3cd2bd4b1de0 tests/html5_forms.ur --- a/tests/html5_forms.ur Sun Nov 16 14:06:24 2014 -0500 +++ b/tests/html5_forms.ur Sun Nov 16 14:16:11 2014 -0500 @@ -2,6 +2,10 @@ A: {[r.A]}
B: {[r.B]}
C: {[r.C]}
+ D: {[r.D]}
+ E: {[r.E]}
+ F: {[r.F]}
+ G: {[r.G]}
fun main () = @@ -10,6 +14,10 @@ + + + +