Browse Source

Merge branch 'master' of https://github.com/transloadit/uppy

Artur Paikin 7 years ago
parent
commit
2665ea49d7

+ 2 - 2
src/plugins/FileInput.js

@@ -21,8 +21,8 @@ module.exports = class FileInput extends Plugin {
       target: null,
       allowMultipleFiles: true,
       pretty: true,
-      locale: defaultLocale,
-      inputName: 'files[]'
+      inputName: 'files[]',
+      locale: defaultLocale
     }
 
     // Merge default options with the ones set by user

+ 13 - 0
website/src/docs/aws-s3.md

@@ -159,4 +159,17 @@ uppy.use(AwsS3, {
 
 See the [aws-presigned-url example in the uppy repository](https://github.com/transloadit/uppy/tree/master/examples/aws-presigned-url) for a small example that implements both the server-side and the client-side.
 
+### Retrieving presign parameters of the uploaded file
+
+Once the file is uploaded, it's possible to retrieve the parameters that were
+generated in `getUploadParameters(file)` via the `file.meta` field:
+
+```js
+uppy.on("upload-success", (fileId, data) {
+  const file = uppy.getFile(fileId)
+
+  file.meta['key'] // the S3 object key of the uploaded file
+})
+```
+
 [uppy-server docs]: /docs/server/index.html

+ 20 - 1
website/src/docs/dashboard.md

@@ -24,10 +24,14 @@ uppy.use(Dashboard, {
   inline: false,
   width: 750,
   height: 550,
+  semiTransparent: false,
   showProgressDetails: false,
   hideUploadButton: false,
   note: null,
+  metaFields: [],
   closeModalOnClickOutside: false,
+  disableStatusBar: false,
+  disableInformer: false,
   locale: {
     strings: {
       selectToUpload: 'Select files to upload',
@@ -38,14 +42,21 @@ uppy.use(Dashboard, {
       dashboardTitle: 'Uppy Dashboard',
       copyLinkToClipboardSuccess: 'Link copied to clipboard.',
       copyLinkToClipboardFallback: 'Copy the URL below',
+      fileSource: 'File source',
       done: 'Done',
       localDisk: 'Local Disk',
+      myDevice: 'My Device',
       dropPasteImport: 'Drop files here, paste, import from one of the locations above or',
       dropPaste: 'Drop files here, paste or',
       browse: 'browse',
       fileProgress: 'File progress: upload speed and ETA',
       numberOfSelectedFiles: 'Number of selected files',
-      uploadAllNewFiles: 'Upload all new files'
+      uploadAllNewFiles: 'Upload all new files',
+      emptyFolderAdded: 'No files were added from empty folder',
+      folderAdded: {
+        0: 'Added %{smart_count} file from %{folder}',
+        1: 'Added %{smart_count} files from %{folder}'
+      }
     }
   }
 })
@@ -71,6 +82,14 @@ Maximum width of the Dashboard in pixels. Used when `inline: true`.
 
 Maximum height of the Dashboard in pixels. Used when `inline: true`.
 
+### `semiTransparent: false`
+
+Make the dashboard semi-transparent.
+
+### `showProgressDetails: false`
+
+Show progress bars for the uploads.
+
 ### `hideUploadButton: false`
 
 Hide the upload button. Use this if you are providing a custom upload button somewhere on the page using the `uppy.upload()` API.

+ 5 - 5
website/src/docs/fileinput.md

@@ -14,14 +14,14 @@ permalink: docs/fileinput/
 ```js
 uppy.use(FileInput, {
   target: '.UppyForm',
-  multipleFiles: true,
+  allowMultipleFiles: true,
   pretty: true,
+  inputName: 'files[]',
   locale: {
     strings: {
-      selectToUpload: 'Select to upload'
+      chooseFiles: 'Select to upload'
     }
-  },
-  inputName: 'files[]'
+  }
 })
 ```
 
@@ -43,4 +43,4 @@ The `name` attribute for the `<input type="file">` element.
 
 ### `locale: {}`
 
-Custom text to show on the button when `pretty` is true. There is only one string that can be configured: `strings.selectToUpload`.
+Custom text to show on the button when `pretty` is true. There is only one string that can be configured: `strings.chooseFiles`.

+ 8 - 3
website/src/docs/uppy.md

@@ -184,9 +184,14 @@ A shortcut method that returns a specific file object from `uppy.state` by its `
 
 ```js
 const file = uppy.getFile('uppyteamkongjpg1501851828779')
-const img = document.createElement('img')
-img.src = file.preview
-document.body.appendChild(img)
+
+file.id        // 'uppyteamkongjpg1501851828779'
+file.name      // 'nature.jpg'
+file.extension // '.jpg'
+file.type      // 'image/jpeg'
+file.data      // the Blob object
+file.size      // 3947642 (returns 'N/A' if size cannot be determined)
+file.preview   // value that can be used to populate "src" attribute of an "img" tag
 ```
 
 ### `uppy.setState(patch)`