mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 02:09:30 +00:00
This PR adds the first use of Uppy in our codebase, hidden behind a enable_experimental_image_uploader site setting. When the setting is enabled only the user card background uploader will use the new uppy-image-uploader component added in this PR. I've introduced an UppyUpload mixin that has feature parity with the existing Upload mixin, and improves it slightly to deal with multiple/single file distinctions and validations better. For now, this just supports the XHRUpload plugin for uppy, which keeps our existing POST to /uploads.json.
13 lines
579 B
JavaScript
13 lines
579 B
JavaScript
// We need a custom build of Uppy because we do not use webpack for
|
|
// our JS modules/build. The only way to get what you want from Uppy
|
|
// is to use the webpack modules or to include the entire Uppy project
|
|
// including all plugins in a single JS file. This way we can just
|
|
// use the plugins we actually want.
|
|
window.Uppy = {}
|
|
Uppy.Core = require('@uppy/core')
|
|
Uppy.Plugin = Uppy.Core.Plugin
|
|
Uppy.XHRUpload = require('@uppy/xhr-upload')
|
|
Uppy.AwsS3 = require('@uppy/aws-s3')
|
|
Uppy.AwsS3Multipart = require('@uppy/aws-s3-multipart')
|
|
Uppy.DropTarget = require('@uppy/drop-target')
|