Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// ":original": { "robot": "/upload/handle" },
// "resize": {
// "use": ":original",
// "robot": "/image/resize",
// "width": 100,
// "height": 100,
// "imagemagick_stack": "v1.0.0"
// }
// }
const TEMPLATE_ID = 'bbc273f69e0c4694a5a9d1b587abc1bc'
/**
* robodog.form
*/
const formUppy = robodog.form('#test-form', {
debug: true,
fields: ['message'],
restrictions: {
allowedFileTypes: ['.png']
},
waitForEncoding: true,
params: {
auth: { key: TRANSLOADIT_KEY },
template_id: TEMPLATE_ID
},
modal: true,
progressBar: '#test-form .progress'
})
formUppy.on('error', (err) => {
document.querySelector('#test-form .error')
progressBar: '#test-form .progress'
})
formUppy.on('error', (err) => {
document.querySelector('#test-form .error')
.textContent = err.message
})
formUppy.on('upload-error', (file, err) => {
document.querySelector('#test-form .error')
.textContent = err.message
})
window.formUppy = formUppy
const formUppyWithDashboard = robodog.form('#dashboard-form', {
debug: true,
fields: ['message'],
restrictions: {
allowedFileTypes: ['.png']
},
waitForEncoding: true,
note: 'Only PNG files please!',
params: {
auth: { key: TRANSLOADIT_KEY },
template_id: TEMPLATE_ID
},
dashboard: '#dashboard-form .dashboard'
})
window.formUppyWithDashboard = formUppyWithDashboard