Skip to content

Commit

Permalink
fixed #1146, fixed #1229, fixed #1184
Browse files Browse the repository at this point in the history
  • Loading branch information
Danial Farid authored and Danial Farid committed Dec 24, 2015
1 parent 46aea99 commit adf0f28
Show file tree
Hide file tree
Showing 16 changed files with 1,269 additions and 187 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ At least one of the `ngf-select` or `ngf-drop` are mandatory for the plugin to l
// centerCrop false (default) will not crop the image and will fit it within the given width/height or ratio
// so the resulting image width (or height) could be less than given width (or height).
// pattern is to resize only the files that their name or type matches the pattern similar to ngf-pattern.
ngf-resize-if="$width > 1000 || $height > 1000" or "resizeCondition($file, $width, $height)"
// apply ngf-resize only if this function returns true. To filter specific images to be resized.
//validations:
ngf-pattern="'.pdf,.jpg,video/*,!.jog'" // comma separated wildcard to filter file names and types allowed
// you can exclude specific files by ! at the beginning.
Expand All @@ -217,8 +219,13 @@ At least one of the `ngf-select` or `ngf-drop` are mandatory for the plugin to l
ngf-ratio="8:10,1.6" // list of comma separated valid aspect ratio of images in float or 2:3 format
// validate error name: ratio
ngf-min-ratio, ngf-max-ratio="8:10" // min or max allowed aspect ratio for the image.
ngf-dimensions="$width > 1000 || $height > 1000" or "resizeCondition($file, $width, $height)"
// validate the image dimensions, validate error name: dimensions
ngf-min-duration, ngf-max-duration="100.5" in seconds or "'10s'" or "'10m'" or "'10h'" only audio, video
// validate error name: maxDuration
ngf-duration="$duration > 1000" or "validateDuration($file, $duration)"
// validate the media duration, validate error name: duration
ngf-validate="{size: {min: 10, max: '20MB'}, width: {min: 100, max:10000}, height: {min: 100, max: 300}
ratio: '2x1', duration: {min: '10s', max: '5m'}, pattern: '.jpg'}"
shorthand form for above validations in one place.
Expand Down
17 changes: 16 additions & 1 deletion demo/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ <h3>
ng-disabled="disabled" ngf-capture="capture"
ngf-drag-over-class="dragOverClassObj"
ngf-validate="validateObj"
ngf-resize="resizeObj"
ngf-resize-if="resizeIfFn($file, $width, $height)"
ngf-dimensions="dimensionsFn($file, $width, $height)"
ngf-duration="durationFn($file, $duration)"
ngf-keep="keepDistinct ? 'distinct' : keep"
ngf-fix-orientation="orientation"
ngf-allow-dir="allowDir" class="drop-box" ngf-drop-available="dropAvailable">Select File
<span ng-show="dropAvailable"> or Drop File</span>
</div>
Expand All @@ -104,8 +109,13 @@ <h3>
ng-disabled="disabled"
ngf-drag-over-class="dragOverClassObj"
ngf-validate="validateObj"
ngf-resize="resizeObj"
ngf-resize-if="resizeIfFn($file, $width, $height)"
ngf-dimensions="dimensionsFn($file, $width, $height)"
ngf-duration="durationFn($file, $duration)"
ngf-keep="keepDistinct ? 'distinct' : keep"
ngf-enable-firefox-paste="true"
ngf-fix-orientation="orientation"
ngf-allow-dir="allowDir" class="drop-box" ng-show="dropAvailable">
<span>Paste or Drop Image from browser</span></div>
</div>
Expand All @@ -116,14 +126,19 @@ <h3>
<label>ngf-validate: <input type="text" ng-model="validate" size="49"></label><br/>
<label>ngf-drag-over-class (chrome): <input size="31" type="text" ng-model="dragOverClass"></label><br/>
<label>ng-model-options: <input type="text" size="43" ng-model="modelOptions"></label><br/>
<label><input type="checkbox" ng-model="multiple">ngf-multiple (allow multiple files)</label><br/>
<label>ngf-resize: <input type="text" size="43" ng-model="resize"></label><br/>
<label>ngf-resize-if: <input type="text" size="43" ng-model="resizeIf"></label><br/>
<label>ngf-dimensions: <input type="text" size="43" ng-model="dimensions"></label><br/>
<label>ngf-duration: <input type="text" size="43" ng-model="duration"></label><br/>
<label><input type="checkbox" ng-model="multiple">ngf-multiple (allow multiple files)</label>
<label><input type="checkbox" ng-model="disabled">ng-disabled</label><br/>
<label><input type="checkbox" ng-model="allowDir">ngf-allow-dir (allow directory drop Chrome
only)</label><br/>
<label><input type="checkbox" ng-model="keep">ngf-keep (keep the previous model values in
ng-model)</label><br/>
<label><input type="checkbox" ng-model="keepDistinct">ngf-keep="distinct" (do not allow
duplicates)</label><br/>
<label><input type="checkbox" ng-model="orientation">ngf-fix-orientation (for exif jpeg files)</label><br/>
<label>Upload resumable chunk size: <input type="text" ng-model="chunkSize"></label><br/>
</div>

Expand Down
Loading

0 comments on commit adf0f28

Please sign in to comment.