Comparing version 0.4.2 to 0.4.3
{ | ||
"name": "ezdz-multiple", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"main": [ | ||
@@ -5,0 +5,0 @@ "jquery.ezdz.js", |
{ | ||
"name": "ezdz", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"title": "Ezdz multiple", | ||
@@ -5,0 +5,0 @@ "description": "jQuery File Input plugin ezdz with multiple files support and grid preview.", |
@@ -12,2 +12,72 @@ ezdz-multiple | ||
index.html file demostrates multiple file upload features and preview of image features. | ||
remember add `multiple` attribute to input tag. | ||
Sample Usage | ||
============= | ||
in the html head section | ||
```html | ||
<link rel="stylesheet" href="src/jquery.ezdz.css"> | ||
<script type="text/javascript" src= "node_modules/jquery/dist/jquery.min.js"></script> | ||
<script src="src/jquery.ezdz.js"></script> | ||
``` | ||
in the body section, simply add normal input tag, the plugin will automatically convert it into dropzone. | ||
```html | ||
<input type="file" name="file_upload[]" accept="image/png, image/jpeg" multiple/> | ||
``` | ||
add javascript pointing to input tag, add customize configuration. | ||
```javascript | ||
$('input[type="file"]').ezdz({ | ||
text: 'drop cover photos', | ||
validators: { | ||
maxWidth: 2000, | ||
maxHeight: 2000, | ||
maxNumber: 6 | ||
}, | ||
reject: function(file, errors) { | ||
if (errors.mimeType) { | ||
alert(file.name + ' must be an image.'); | ||
return; | ||
} | ||
if (errors.maxWidth) { | ||
alert(file.name + ' must be width:2000px max.'); | ||
return; | ||
} | ||
if (errors.maxHeight) { | ||
alert(file.name + ' must be height:2000px max.'); | ||
return; | ||
} | ||
if (errors.maxNumber) { | ||
alert('you can upload maximum of 6 images'); | ||
return; | ||
} | ||
} | ||
}); | ||
``` | ||
if you looking for modify preview image grid, editing `jquery.ezdz.css`, for example, the code represent 3 columns grid. | ||
```css | ||
.image-g li { | ||
float: left; | ||
max-width: 32%; | ||
max-height: 48%; | ||
padding: 0.10em; | ||
} | ||
.image-g li:nth-child(3n+1) { | ||
clear: left; | ||
} | ||
``` | ||
Release Note | ||
@@ -17,2 +87,4 @@ ============= | ||
v0.4.2 the repository update to mirror ezdz 0.4.2 | ||
v0.4.3 add example to Ezdz plugin | ||
@@ -19,0 +91,0 @@ License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22472
7
93