mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 02:08:30 +00:00
update and clean up website examples
This commit is contained in:
parent
b70f803df1
commit
3659dff213
8 changed files with 18 additions and 78 deletions
|
|
@ -1,8 +0,0 @@
|
|||
const Uppy = require('uppy/lib/core/Core')
|
||||
const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
|
||||
const UPPY_SERVER = require('../env')
|
||||
|
||||
const uppy = new Uppy({debug: true, autoProceed: false})
|
||||
uppy
|
||||
.use(GoogleDrive, { target: '#GoogleDriveContainer', host: UPPY_SERVER })
|
||||
.run()
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<!-- Basic Uppy styles -->
|
||||
<link rel="stylesheet" href="/uppy/uppy.min.css">
|
||||
|
||||
<div id="GoogleDriveContainer"></div>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
title: Google Drive
|
||||
layout: example
|
||||
---
|
||||
|
||||
{% blockquote %}
|
||||
Here you'll see a demo of how you might set up Google Drive with Uppy.
|
||||
{% endblockquote %}
|
||||
|
||||
<link rel="stylesheet" href="app.css">
|
||||
<% include app.html %>
|
||||
<script src="app.js"></script>
|
||||
|
||||
<hr />
|
||||
|
||||
<p id="console-wrapper">
|
||||
Console output (latest logs are at the top): <br />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
On this page we're using the following HTML snippet:
|
||||
</p>
|
||||
{% include_code lang:html drive/app.html %}
|
||||
|
||||
<p>
|
||||
Along with this JavaScript:
|
||||
</p>
|
||||
{% include_code lang:js drive/app.es6 %}
|
||||
|
||||
<p>
|
||||
And the following CSS:
|
||||
</p>
|
||||
{% include_code lang:css drive/app.css %}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
const Uppy = require('uppy/lib/core/Core')
|
||||
const Tus = require('uppy/lib/plugins/GoogleDrive')
|
||||
|
||||
const uppy = new Uppy({debug: true, autoProceed: false})
|
||||
|
||||
uppy
|
||||
.use(Tus, {endpoint: '//master.tus.io/files/'})
|
||||
.run()
|
||||
|
||||
console.log('--> Uppy Bundled version with Tus & Russian language pack has loaded')
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<!-- Load Uppy pre-built bundled version. You can use a CDN: https://unpkg.com/uppy -->
|
||||
<script src="/uppy/uppy.min.js"></script>
|
||||
<script>
|
||||
var uppy = Uppy.Core({debug: true});
|
||||
var uppy = Uppy.Core({ debug: true });
|
||||
uppy.use(Uppy.DragDrop, {
|
||||
target: '.UppyDragDrop',
|
||||
locale: {
|
||||
|
|
@ -16,8 +16,8 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
uppy.use(Uppy.ProgressBar, {target: 'body', fixed: true})
|
||||
uppy.use(Uppy.Tus, {endpoint: '//master.tus.io/files/'});
|
||||
uppy.use(Uppy.ProgressBar, { target: 'body', fixed: true });
|
||||
uppy.use(Uppy.Tus, { endpoint: '//master.tus.io/files/' });
|
||||
uppy.run();
|
||||
|
||||
console.log('--> Uppy pre-built version with Tus, DragDrop & Russian language pack has loaded');
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const Tus = require('uppy/lib/plugins/Tus')
|
|||
|
||||
const uppyOne = new Uppy({debug: true})
|
||||
uppyOne
|
||||
.use(FileInput, {target: '.UppyInput'})
|
||||
.use(Tus, {endpoint: '//master.tus.io/files/'})
|
||||
.use(StatusBar, {target: '.UppyInput-Progress'})
|
||||
.use(FileInput, { target: '.UppyInput', pretty: false })
|
||||
.use(Tus, { endpoint: '//master.tus.io/files/' })
|
||||
.use(StatusBar, { target: '.UppyInput-Progress', hideUploadButton: true })
|
||||
.run()
|
||||
|
|
|
|||
|
|
@ -3,22 +3,17 @@ const FileInput = require('uppy/lib/plugins/FileInput')
|
|||
const XHRUpload = require('uppy/lib/plugins/XHRUpload')
|
||||
const ProgressBar = require('uppy/lib/plugins/ProgressBar')
|
||||
|
||||
const uppy = new Uppy({debug: true, autoProceed: true})
|
||||
|
||||
uppy
|
||||
.use(FileInput)
|
||||
.use(XHRUpload, {
|
||||
endpoint: '//api2.transloadit.com',
|
||||
formData: true,
|
||||
fieldName: 'files[]'
|
||||
})
|
||||
// by default Uppy removes everything inside target container,
|
||||
// but we surely don’t want to do that in the case of body, so replaceTargetContent: false
|
||||
.use(ProgressBar, {
|
||||
target: 'body',
|
||||
replaceTargetContent: false,
|
||||
fixed: true
|
||||
})
|
||||
.run()
|
||||
const uppy = new Uppy({ debug: true, autoProceed: true })
|
||||
uppy.use(FileInput, { target: '.UppyForm', replaceTargetContent: true })
|
||||
uppy.use(XHRUpload, {
|
||||
endpoint: '//api2.transloadit.com',
|
||||
formData: true,
|
||||
fieldName: 'files[]'
|
||||
})
|
||||
uppy.use(ProgressBar, {
|
||||
target: 'body',
|
||||
fixed: true
|
||||
})
|
||||
uppy.run()
|
||||
|
||||
console.log('Uppy with Formtag and XHRUpload is loaded')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue