[Ur] Patch, more html5 attributes

Sergey Mironov grrwlf at gmail.com
Fri Dec 5 02:22:25 EST 2014


2014-11-16 23:26 GMT+03:00 Adam Chlipala <adamc at csail.mit.edu>:
> Thanks for the patch!  I've incorporated it and made some small changes, as
> noted below.
>
> On 10/12/2014 07:58 AM, Sergey Mironov wrote:
>>
>> First thing I need was HTML5 attributes 'required' and 'autofocus' for
>> input
>> fields. Those changes are located in basis.urs and are rather
>> straightforward.
>
>
> I've changed both to be type [bool] instead of [string], and I added an
> Ur/Web parsing extension to allow the usual HTML syntax, without having to
> provide a value for the attribute.
>
> I also undid your addition of attribute 'value' for checkboxes. That
> attribute breaks the Ur/Web abstraction of a checkbox as generating a
> Boolean value; it's nonsensical to allow assigning a string value.  Some
> real-world use cases of checkbox 'value' might come from having multiple
> checkboxes in one form with the same name, but the Ur/Web standard library
> currently rules out duplicate checkbox names at compile time!
>
>> The second thing is the <input type='email'/>. My intuition says me that
>> adding
>> custom input types was not designed to be regular operation, but building
>> recent
>> HTML5 pages may require doing it. Quick search [2] shows that there are
>> 'url'
>> 'tel', 'search', 'number', 'range', 'date', etc. I included the
>> monoize.sml
>> change to support just the [email] for ordinary [formTags].  Is it
>> possible to
>> prepare a procedure of doing the same thing for [cformTags] (references to
>> javaScript confuse me)?
>
>
> I've now added old-school and AJAX versions of all the new HTML5 widgets
> that I learned about.  I'll be interested to know what you think of the
> interface.

Thanks, Adam! I don't have time to check the new version at the
moment, but I hope I will be able to do it in a week or so. By the
way, I've tested modal forms of Bootstrap, they look nice.

Regards,
Sergey



More information about the Ur mailing list