website: fix Uppy is not defined error (#3461)

This commit is contained in:
Antoine du Hamel 2022-02-02 15:05:46 +01:00 committed by GitHub
parent 4e827ee3f8
commit c7770657b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 26 deletions

View file

@ -16,6 +16,8 @@
<script src="https://releases.transloadit.com/uppy/v2.4.1/uppy.legacy.min.js" nomodule></script>
<script src="https://releases.transloadit.com/uppy/locales/v2.0.5/ru_RU.min.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
'use strict';
var uppy = new Uppy.Core({
debug: true,
autoProceed: true,
@ -45,4 +47,6 @@
});
console.log('--> Uppy pre-built version with Tus, DragDrop & Russian language pack has loaded');
window.uppy = uppy;
});
</script>

View file

@ -192,32 +192,36 @@
<script src="https://releases.transloadit.com/uppy/v2.4.1/uppy.legacy.min.js" nomodule></script>
<script>
var TUS_ENDPOINT = 'https://tusd.tusdemo.net/files/'
var COMPANION_ENDPOINT = 'http://localhost:3020'
if (location.hostname === 'uppy.io') {
COMPANION_ENDPOINT = '//companion.uppy.io'
}
var uppy = new Uppy.Core({ debug: true })
.use(Uppy.Dashboard, {
target: '#demo',
inline: true,
metaFields: [
{ id: 'license', name: 'License', placeholder: 'specify license' },
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
]
window.addEventListener('DOMContentLoaded', function() {
'use strict'
var TUS_ENDPOINT = 'https://tusd.tusdemo.net/files/'
var COMPANION_ENDPOINT = 'http://localhost:3020'
if (location.hostname === 'uppy.io') {
COMPANION_ENDPOINT = '//companion.uppy.io'
}
var uppy = new Uppy.Core({ debug: true })
.use(Uppy.Dashboard, {
target: '#demo',
inline: true,
metaFields: [
{ id: 'license', name: 'License', placeholder: 'specify license' },
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
]
})
.use(Uppy.GoogleDrive, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Instagram, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Dropbox, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
// .use(Uppy.Box, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Facebook, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.OneDrive, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Webcam, { target: Uppy.Dashboard })
.use(Uppy.Url, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Tus, { endpoint: TUS_ENDPOINT})
uppy.on('success', function (files) {
console.log('Upload complete! Weve uploaded these files:', files)
})
.use(Uppy.GoogleDrive, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Instagram, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Dropbox, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
// .use(Uppy.Box, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Facebook, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.OneDrive, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Webcam, { target: Uppy.Dashboard })
.use(Uppy.Url, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
.use(Uppy.Tus, { endpoint: TUS_ENDPOINT})
uppy.on('success', function (files) {
console.log('Upload complete! Weve uploaded these files:', files)
window.uppy = uppy
})
</script>