Added code from PR #292 for HTML standard accept attribute for mime-types #357

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

mlynch commented Apr 4, 2012

Fixes #287

demo/file_input.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@jzaefferer

jzaefferer Apr 4, 2012

Collaborator

Needs a html5 doctype

+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>jQuery validation plug-in - comment form example</title>
+
+<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
@jzaefferer

jzaefferer Apr 4, 2012

Collaborator

No need for media and type attributes. Should probably be cleaned up in other demos as well. Also no need for type attribute on script tags.

@mlynch

mlynch Apr 4, 2012

Contributor

Why don't I just change those in a separate PR for all demo files and keep this as-is until then?

demo/file_input.html
+});
+</script>
+
+<style type="text/css">
@jzaefferer

jzaefferer Apr 4, 2012

Collaborator

Can this just use the cmxform.css?

jquery.validate.js
@@ -1136,8 +1136,18 @@ $.extend($.validator, {
// http://docs.jquery.com/Plugins/Validation/Methods/accept
accept: function(value, element, param) {
- param = typeof param === "string" ? param.replace(/,/g, '|') : "png|jpe?g|gif";
- return this.optional(element) || value.match(new RegExp(".(" + param + ")$", "i"));
+ var re_pre = ".(", re_post = ")$", default_param = "png|jpe?g|gif";
@jzaefferer

jzaefferer Apr 4, 2012

Collaborator

These three variables are a bit pointless. Should just build one string/regex or the other. Vars should use camelcase, not underscores.

Contributor

mlynch commented Apr 4, 2012

Gah, 717ffdd is a bad commit, let me clean this up.

Contributor

mlynch commented Apr 4, 2012

Closing due to bad commits. Will submit a new PR.

@mlynch mlynch closed this Apr 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment