41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
(function () {
|
|
'use strict'
|
|
|
|
/* dropzone */
|
|
let myDropzone = new Dropzone(".dropzone");
|
|
myDropzone.on("addedfile", file => {
|
|
});
|
|
|
|
/* filepond */
|
|
FilePond.registerPlugin(
|
|
FilePondPluginImagePreview,
|
|
FilePondPluginImageExifOrientation,
|
|
FilePondPluginFileValidateSize,
|
|
FilePondPluginFileEncode,
|
|
FilePondPluginImageEdit,
|
|
FilePondPluginFileValidateType,
|
|
FilePondPluginImageCrop,
|
|
FilePondPluginImageResize,
|
|
FilePondPluginImageTransform
|
|
);
|
|
|
|
/* multiple upload */
|
|
const MultipleElement = document.querySelector('.multiple-filepond');
|
|
FilePond.create(MultipleElement,);
|
|
|
|
/* single upload */
|
|
FilePond.create(
|
|
document.querySelector('.single-fileupload'),
|
|
{
|
|
labelIdle: `Drag & Drop your picture or <span class="filepond--label-action">Browse</span>`,
|
|
imagePreviewHeight: 170,
|
|
imageCropAspectRatio: '1:1',
|
|
imageResizeTargetWidth: 200,
|
|
imageResizeTargetHeight: 200,
|
|
stylePanelLayout: 'compact circle',
|
|
styleLoadIndicatorPosition: 'center bottom',
|
|
styleButtonRemoveItemPosition: 'center bottom'
|
|
}
|
|
);
|
|
|
|
})(); |