Skip to content

Commit

Permalink
Update to release v5.5.0 fixes #1694
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jun 29, 2022
1 parent 48f7198 commit c233160
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Change Log: `bootstrap-fileinput`

**Major Release: BC Breaking**

**Date**: 28-Jun-2022
**Date**: 29-Jun-2022

- (enh #1800): Styling enhancements for thumbnail content and rotatable images.
- (enh #1799): Correct translations containing `{maxSize}, {minSize}, {size}`.
Expand Down Expand Up @@ -47,6 +47,8 @@ $input.on('fileuploaderror', function(event, data) {
// $input.fileinput('showUserError', userMessage);
});
```
- (enh #1694): Thumbnail of images only but detailed preview/iconic view of all other files.
- New property `alwaysPreviewFileExtensions` - setup as an array list of extensions whose content will always be shown in preview (irrespective of `preferIconPreview` or `previewFileIconSettings` which will be used to control icon preview for configured types).

## version 5.2.8

Expand Down
13 changes: 8 additions & 5 deletions js/fileinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4369,12 +4369,13 @@
zoomData
) {
var self = this, caption = self.slug(fname), prevContent, zoomContent = '', styleAttribs = '',
filename = fnameUpdated || fname,
filename = fnameUpdated || fname, isIconic, ext = filename.split('.').pop().toLowerCase(),
screenW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
config, title = caption, alt = caption, typeCss = 'type-default', getContent, addFrameCss,
footer = foot || self._renderFileFooter(cat, caption, size, 'auto', isError), isRotatable,
forcePrevIcon = self.preferIconicPreview, forceZoomIcon = self.preferIconicZoomPreview,
newCat = forcePrevIcon ? 'other' : cat, ext = filename.split('.').pop().toLowerCase();
alwaysPreview = $.inArray(ext, self.alwaysPreviewFileExtensions) !== -1,
forcePrevIcon = self.preferIconicPreview && !alwaysPreview,
forceZoomIcon = self.preferIconicZoomPreview && !alwaysPreview, newCat = forcePrevIcon ? 'other' : cat;
config = screenW < 400 ? (self.previewSettingsSmall[newCat] || self.defaults.previewSettingsSmall[newCat]) :
(self.previewSettings[newCat] || self.defaults.previewSettings[newCat]);
if (config) {
Expand Down Expand Up @@ -4448,7 +4449,8 @@
}
addFrameCss = 'kv-preview-thumb';
if (isRotatable) {
addFrameCss += ' rotatable' + (forcePrevIcon || self.hideThumbnailContent ? ' hide-rotate' : '');
isIconic = forcePrevIcon || self.hideThumbnailContent || !!self.previewFileIconSettings[ext];
addFrameCss += ' rotatable' + (isIconic ? ' hide-rotate' : '');
}
prevContent = getContent((forcePrevIcon ? 'other' : cat), data, false, addFrameCss, zoomData);
return prevContent.setTokens({zoomCache: zoomContent});
Expand Down Expand Up @@ -6340,6 +6342,7 @@
previewContentTemplates: {},
preferIconicPreview: false,
preferIconicZoomPreview: false,
alwaysPreviewFileExtensions: [],
rotatableFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
allowedFileTypes: null,
allowedFileExtensions: null,
Expand Down Expand Up @@ -6397,7 +6400,7 @@
maxThreads: 4,
maxRetries: 3,
showErrorLog: true,
retainErrorHistory: true, // display complete error history always unless user explicitly resets upload
retainErrorHistory: false, // when set to true, display complete error history always unless user explicitly resets upload
skipErrorsAndProceed: false // when set to true, files with errors will be skipped and upload will continue with other files
},
uploadExtraData: {},
Expand Down
2 changes: 1 addition & 1 deletion js/fileinput.min.js

Large diffs are not rendered by default.

0 comments on commit c233160

Please sign in to comment.