mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
* relocate .vscode
* Switch to transloadit linter
* Update .eslintrc.json
* autofix code
* unlink and install eslint-config-transloadit@1.1.1
* Change 0 to "off"
* Don't change 'use strict'
* Do not vertically align
* disable key-spacing
* add import/no-extraneous-dependencies per package
* add more react/a11y warnings
* Revert "autofix code"
This reverts commit 14c8a8cde8.
* add import/no-extraneous-dependencies per example and main package
* autofix code (2)
* Allow devDependencies in ./bin
* Change import/no-extraneous-dependencies to warn again
* upgrade linter
* Set import/no-extraneous-dependencies to warn
29 lines
818 B
JavaScript
29 lines
818 B
JavaScript
const Uppy = require('@uppy/core/src')
|
|
const Tus = require('@uppy/tus/src')
|
|
|
|
const DragDrop = require('@uppy/drag-drop/src')
|
|
const ProgressBar = require('@uppy/progress-bar/src')
|
|
|
|
module.exports = () => {
|
|
const uppyDragDrop = new Uppy({
|
|
debug: true,
|
|
autoProceed: true,
|
|
})
|
|
.use(DragDrop, {
|
|
target: '#uppyDragDrop',
|
|
})
|
|
.use(ProgressBar, { target: '#uppyDragDrop-progress', hideAfterFinish: false })
|
|
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
|
|
|
|
window.uppy = uppyDragDrop
|
|
|
|
uppyDragDrop.on('complete', (result) => {
|
|
if (result.failed.length === 0) {
|
|
console.log('Upload successful 😀')
|
|
} else {
|
|
console.warn('Upload failed 😞')
|
|
}
|
|
console.log('successful files:', result.successful)
|
|
console.log('failed files:', result.failed)
|
|
})
|
|
}
|