mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-24 02:38:58 +00:00
website: fix Uppy is not defined error (#3461)
This commit is contained in:
parent
4e827ee3f8
commit
c7770657b0
2 changed files with 34 additions and 26 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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! We’ve 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! We’ve uploaded these files:', files)
|
||||
window.uppy = uppy
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue