DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

Need additional option for FileType enum for HTML5 new camera capture option. #412

Closed johnwc closed 8 years ago

johnwc commented 8 years ago

We need the ability to also add the type for camera capture. So that the accept can be as below. <input type="file" id="vFile" name="vFile" accept="image/*;capture=camera" />

DmitryEfimenko commented 8 years ago

there is nothing "below"

johnwc commented 8 years ago

Sorry, I didn't realize I had to wrap the code in special characters for them not to be stripped out.

DmitryEfimenko commented 8 years ago

I see. You can use .HtmlAttributes extension to set these:

@Html.Bootstrap().FileFor(m => m.SomeFile).HtmlAttributes(new { @accept = "image/*;capture=camera" })
johnwc commented 8 years ago

Or... you could add it to your existing Accept method and FileType enum and we can keep it clean.

Sent from my iPhone

On Feb 8, 2016, at 9:48 PM, Dmitry A. Efimenko notifications@github.com wrote:

I see. You can use .HtmlAttributes extension to set these:

@Html.Bootstrap().FileFor(m => m.SomeFile).HtmlAttributes(new { @accept = "image/*;capture=camera" }) — Reply to this email directly or view it on GitHub.

DmitryEfimenko commented 8 years ago

true, however there are so many of these types... The challenge of having an Enum for every single one is not something I would like to pursue.

johnwc commented 8 years ago

Not true, this is not a mime type it's a html5 standard functionality to tell mobile devices to use the camera.

Sent from my iPhone

On Feb 9, 2016, at 10:17 AM, Dmitry A. Efimenko notifications@github.com wrote:

true, however. There are so many of these types... The challenge of having an Enum for every single one is not something I would like to pursue.

— Reply to this email directly or view it on GitHub.

DmitryEfimenko commented 8 years ago

Whatever it is, there are too many of them

johnwc commented 8 years ago

Again, there are several several mime types, but this is not a mime type to be added. This is a hrml5 functionality to be added to the end of accept attribute.

Sent from my iPhone

On Feb 9, 2016, at 1:57 PM, Dmitry A. Efimenko notifications@github.com wrote:

Whatever it is, there are too many of them

— Reply to this email directly or view it on GitHub.

johnwc commented 8 years ago

There is only one...

Sent from my iPhone

On Feb 9, 2016, at 1:57 PM, Dmitry A. Efimenko notifications@github.com wrote:

Whatever it is, there are too many of them

— Reply to this email directly or view it on GitHub.

DmitryEfimenko commented 8 years ago

This example already shows multiple options What would be the api for this?

johnwc commented 8 years ago

It's the Round 1 HTML Media Capture section.

Sent from my iPhone

On Feb 9, 2016, at 3:10 PM, Dmitry A. Efimenko notifications@github.com wrote:

This example already shows multiple options What would be the api for this?

— Reply to this email directly or view it on GitHub.

johnwc commented 8 years ago

Just add another enum for image, video and audio like so.

[Description("image/*;capture=camera")] ImageCapture, [Description("image/*;capture=camcorder")] VideoCapture, [Description("audio/*;capture=microphone")] AudioCapture,

DmitryEfimenko commented 8 years ago

This is done