|
@@ -28,13 +28,13 @@ function initUppy (opts = {}) {
|
|
|
maxFileSize: 1024 * 1024 * 1024,
|
|
|
maxNumberOfFiles: 2,
|
|
|
minNumberOfFiles: 1,
|
|
|
- allowedFileTypes
|
|
|
+ allowedFileTypes,
|
|
|
},
|
|
|
locale: {
|
|
|
strings: {
|
|
|
- youCanOnlyUploadFileTypes: 'You can only upload images'
|
|
|
- }
|
|
|
- }
|
|
|
+ youCanOnlyUploadFileTypes: 'You can only upload images',
|
|
|
+ },
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
function getExpiration (future) {
|
|
@@ -49,7 +49,7 @@ function initUppy (opts = {}) {
|
|
|
let params = {
|
|
|
auth: {
|
|
|
key: window.TRANSLOADIT_API_KEY,
|
|
|
- expires: hasSecret ? getExpiration(5 * 60 * 1000) : undefined
|
|
|
+ expires: hasSecret ? getExpiration(5 * 60 * 1000) : undefined,
|
|
|
},
|
|
|
// It's more secure to use a template_id and enable
|
|
|
// Signature Authentication
|
|
@@ -61,18 +61,18 @@ function initUppy (opts = {}) {
|
|
|
resize_strategy: 'fit',
|
|
|
text: [
|
|
|
{
|
|
|
- text: `© ${(new Date).getFullYear()} Transloadit.com`,
|
|
|
+ text: `© ${(new Date()).getFullYear()} Transloadit.com`,
|
|
|
size: 12,
|
|
|
font: 'Ubuntu',
|
|
|
color: '#eeeeee',
|
|
|
valign: 'bottom',
|
|
|
align: 'right',
|
|
|
x_offset: 16,
|
|
|
- y_offset: -10
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
+ y_offset: -10,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
if (zoomMode) {
|
|
@@ -83,7 +83,7 @@ function initUppy (opts = {}) {
|
|
|
result: true,
|
|
|
ffmpeg_stack: 'v3.3.3',
|
|
|
preset: 'ipad-high',
|
|
|
- resize_strategy: 'fillcrop'
|
|
|
+ resize_strategy: 'fillcrop',
|
|
|
},
|
|
|
watermarked: {
|
|
|
use: 'resized',
|
|
@@ -96,8 +96,8 @@ function initUppy (opts = {}) {
|
|
|
watermark_size: '25%',
|
|
|
watermark_url: 'https://demos.transloadit.com/inputs/transloadit-padded.png',
|
|
|
watermark_x_offset: -10,
|
|
|
- watermark_y_offset: 10
|
|
|
- }
|
|
|
+ watermark_y_offset: 10,
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -113,22 +113,22 @@ function initUppy (opts = {}) {
|
|
|
uppy
|
|
|
.use(Transloadit, {
|
|
|
getAssemblyOptions,
|
|
|
- waitForEncoding: true
|
|
|
+ waitForEncoding: true,
|
|
|
})
|
|
|
.use(Dashboard, {
|
|
|
inline: true,
|
|
|
maxHeight: 400,
|
|
|
target: '#uppy-dashboard-container',
|
|
|
- note: 'Images only, 1–2 files, up to 1 MB'
|
|
|
+ note: 'Images only, 1–2 files, up to 1 MB',
|
|
|
})
|
|
|
.use(Instagram, {
|
|
|
target: Dashboard,
|
|
|
companionUrl: 'https://api2.transloadit.com/companion',
|
|
|
- companionAllowedHosts: Transloadit.COMPANION_PATTERN
|
|
|
+ companionAllowedHosts: Transloadit.COMPANION_PATTERN,
|
|
|
})
|
|
|
.use(Facebook, {
|
|
|
target: Dashboard,
|
|
|
- companionUrl: COMPANION
|
|
|
+ companionUrl: COMPANION,
|
|
|
})
|
|
|
.use(Webcam, { target: Dashboard, modes: ['picture'] })
|
|
|
|
|
@@ -136,14 +136,14 @@ function initUppy (opts = {}) {
|
|
|
uppy.use(Zoom, {
|
|
|
target: Dashboard,
|
|
|
companionUrl: 'https://api2.transloadit.com/companion',
|
|
|
- companionAllowedHosts: Transloadit.COMPANION_PATTERN
|
|
|
+ companionAllowedHosts: Transloadit.COMPANION_PATTERN,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
uppy
|
|
|
.on('transloadit:result', (stepName, result) => {
|
|
|
const file = uppy.getFile(result.localId)
|
|
|
- var resultContainer = document.createElement('div')
|
|
|
+ const resultContainer = document.createElement('div')
|
|
|
if (!zoomMode) {
|
|
|
resultContainer.innerHTML = `
|
|
|
<div>
|