Commit graph

14 commits

Author SHA1 Message Date
Jonathan Derrough
4633abc143 Fixed getFileType() when passed a file with an upper case extension
Updated the unit tests
2018-11-23 15:13:08 +01:00
Artur Paikin
4efc27675c Allow locale inheritance: defaultLocale, this.uppy.locale, this.opts.locale
Mostly what @goto-bus-stop did in 4f51deaaf7 (diff-989af75a364b65c408abe1fc3e7ac0f4R34)

> This patch allows locale keys passed to the main Uppy instance to override default keys in plugins. It's just one idea to kick things off, I'm not attached to this particular implementation.
>
> If we do this we need to make sure that all keys have unique names and that things specific to eg. a single service are "namespaced" (`transloaditEncoding` instead of `encoding`).
>
> The benefit to this is that there is a central point of configuration for languages, so there could be language packs with strings for eg Czech at `@uppy/lang-cz` (or `@uppy/langs/cz`) that would be very easy to use.
2018-10-20 12:49:06 -04:00
Renée Kooi
626f511ebd
Support mime types with additional data, fixes #1074 2018-10-08 15:26:32 +02:00
Renée Kooi
e9bb066f29
utils: Previews can be generated for image/jpg mime type 2018-10-08 14:23:31 +02:00
Renée Kooi
f958638455 utils: Add fallback to getFileType (#1022)
If we can't determine the file type, use the generic
'application/octet-stream' type. This way `file.type` will always be
defined and uploaders don't have to worry about it being `null` or
whatever.
2018-08-27 14:33:56 +02:00
Renée Kooi
632c95a094
Remove unused runPromiseSequence util. 2018-06-28 14:15:17 +02:00
Renée Kooi
07eb4fc0b9
Move truncateString util into @uppy/dashboard. 2018-06-28 14:00:17 +02:00
Renée Kooi
a59efea878
Remove unused getArrayBuffer util. 2018-06-28 13:58:03 +02:00
Renée Kooi
e875df7996
Move copyToClipboard util into @uppy/dashboard. 2018-06-28 13:56:40 +02:00
Renée Kooi
d494e7df3c
Unit test fixes. 2018-06-18 15:49:59 +02:00
Renée Kooi
382f4fba95
Move stylesheets into packages. 2018-06-18 12:35:47 +02:00
Renée Kooi
2c4e7eaa68
Move Translator into @uppy/utils package.
Available as `@uppy/utils/lib/Translator`.
The Translator tests were using `Core()` instead of `Translator()`, so I
changed it to using `Translator` instances directly. The functionality
being tested did not change.

Steps taken:

```bash
git mv src/core/Translator.* packages/@uppy/utils/src
sed -i 's/[./]*\/core\/Translator/@uppy\/utils\/lib\/Translator/' src/**/*.js
vim packages/@uppy/utils/src/Translator.test.js # Fix tests
```
2018-06-14 16:31:19 +02:00
Renée Kooi
2e257b7e55
Move utils files to @uppy/utils package.
And rewrite all the require calls.

```bash
git mv src/utils/* packages/@uppy/utils/src
sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils
```
2018-06-14 16:31:19 +02:00
Renée Kooi
c1d378de21
Add @uppy/utils skeleton.
```bash
mkdir -p packages/@uppy
cp -R package-template packages/@uppy/utils
vim packages/@uppy/utils/{README.md,package.json}
```

Next up, copying the implementation.
2018-06-14 16:31:19 +02:00