mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-19 09:34:02 +00:00
bundled-example --> bundled, use Parcel to bundle
This commit is contained in:
parent
645246f85a
commit
8f7595c4e8
7 changed files with 8254 additions and 68 deletions
|
|
@ -1,36 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>uppy</title>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
main {
|
||||
padding-top: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#upload-form {
|
||||
max-width: 400px;
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
<main>
|
||||
<h1>Uppy is here</h1>
|
||||
|
||||
<form id="upload-form" action="/">
|
||||
<button type="button" id="pick-files">Pick Files</button><br>
|
||||
True ? <input type="checkbox" name="check_test" value="1" checked><br>
|
||||
Something: <input type="text" name="yo" value="1"><br>
|
||||
<input type="hidden" name="bla" value="12333"><br>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<link href="uppy.min.css" rel="stylesheet">
|
||||
<script src="bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"aliasify": "^2.1.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babelify": "^8.0.0",
|
||||
"watchify": "^3.11.0"
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "watchify -t babelify -t aliasify main.js -o bundle.js -vd"
|
||||
},
|
||||
"aliasify": {
|
||||
"aliases": {
|
||||
"@uppy": "../../packages/@uppy"
|
||||
}
|
||||
}
|
||||
}
|
||||
32
examples/bundled/index.html
Normal file
32
examples/bundled/index.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>uppy</title>
|
||||
</head>
|
||||
<body>
|
||||
<style>
|
||||
main {
|
||||
padding-top: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#upload-form {
|
||||
max-width: 600px;
|
||||
margin: auto;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
<main>
|
||||
<h1>Uppy</h1>
|
||||
|
||||
<form id="upload-form" action="/">
|
||||
<input type="file">
|
||||
<button type="submit">Upload</button>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<script src="index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,12 +1,15 @@
|
|||
const Uppy = require('./../../packages/@uppy/core/src')
|
||||
const Dashboard = require('./../../packages/@uppy/dashboard/src')
|
||||
const Instagram = require('./../../packages/@uppy/instagram/src')
|
||||
const Dropbox = require('./../../packages/@uppy/dropbox/src')
|
||||
const GoogleDrive = require('./../../packages/@uppy/google-drive/src')
|
||||
const Url = require('./../../packages/@uppy/url/src')
|
||||
const Webcam = require('./../../packages/@uppy/webcam/src')
|
||||
const Tus = require('./../../packages/@uppy/tus/src')
|
||||
const Form = require('./../../packages/@uppy/form/src')
|
||||
const Uppy = require('@uppy/core')
|
||||
const Dashboard = require('@uppy/dashboard')
|
||||
const Instagram = require('@uppy/instagram')
|
||||
const GoogleDrive = require('@uppy/google-drive')
|
||||
const Url = require('@uppy/url')
|
||||
const Webcam = require('@uppy/webcam')
|
||||
const Tus = require('@uppy/tus')
|
||||
|
||||
require('@uppy/core/dist/style.css')
|
||||
require('@uppy/dashboard/dist/style.css')
|
||||
require('@uppy/url/dist/style.css')
|
||||
require('@uppy/webcam/dist/style.css')
|
||||
|
||||
const TUS_ENDPOINT = 'https://master.tus.io/files/'
|
||||
|
||||
|
|
@ -19,8 +22,9 @@ const uppy = Uppy({
|
|||
})
|
||||
.use(Dashboard, {
|
||||
trigger: '#pick-files',
|
||||
// inline: true,
|
||||
// target: 'body',
|
||||
target: '#upload-form',
|
||||
inline: true,
|
||||
replaceTargetContent: true,
|
||||
metaFields: [
|
||||
{ id: 'license', name: 'License', placeholder: 'specify license' },
|
||||
{ id: 'caption', name: 'Caption', placeholder: 'add caption' }
|
||||
|
|
@ -31,11 +35,9 @@ const uppy = Uppy({
|
|||
})
|
||||
.use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' })
|
||||
.use(Instagram, { target: Dashboard, serverUrl: 'http://localhost:3020' })
|
||||
.use(Dropbox, { target: Dashboard, serverUrl: 'http://localhost:3020' })
|
||||
.use(Url, { target: Dashboard, serverUrl: 'http://localhost:3020' })
|
||||
.use(Webcam, { target: Dashboard })
|
||||
.use(Tus, { endpoint: TUS_ENDPOINT })
|
||||
.use(Form, { target: '#upload-form' })
|
||||
// .use(GoldenRetriever, {serviceWorker: true})
|
||||
|
||||
uppy.on('complete', (result) => {
|
||||
|
|
@ -60,6 +62,3 @@ if ('serviceWorker' in navigator) {
|
|||
})
|
||||
}
|
||||
/* eslint-enable */
|
||||
|
||||
var modalTrigger = document.querySelector('#pick-files')
|
||||
if (modalTrigger) modalTrigger.click()
|
||||
8189
examples/bundled/package-lock.json
generated
Normal file
8189
examples/bundled/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
18
examples/bundled/package.json
Normal file
18
examples/bundled/package.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"scripts": {
|
||||
"dev": "parcel index.html",
|
||||
"build": "parcel build index.html"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.26.3",
|
||||
"parcel-bundler": "^1.11.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/core": "^0.29.1",
|
||||
"@uppy/dashboard": "^0.29.1",
|
||||
"@uppy/google-drive": "^0.29.1",
|
||||
"@uppy/instagram": "^0.29.1",
|
||||
"@uppy/tus": "^0.29.1",
|
||||
"@uppy/url": "^0.29.1"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue