Skip to content

Commit

Permalink
example: update CDN example
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed May 31, 2022
1 parent 861f264 commit 947d2e7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
50 changes: 38 additions & 12 deletions examples/cdn-example/index.html
Expand Up @@ -2,22 +2,48 @@
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://releases.transloadit.com/uppy/v3.0.0-beta/uppy.min.css" rel="stylesheet">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
href="https://releases.transloadit.com/uppy/v3.0.0-beta/uppy.min.css"
rel="stylesheet"
/>
</head>
<body>
<noscript>You need JavaScript enabled for this example to work.</noscript>
<button id="uppyModalOpener">Open Modal</button>
<script src="https://releases.transloadit.com/uppy/v3.0.0-beta/uppy.min.js"></script>
<script>
const uppy = new Uppy.Core({debug: true, autoProceed: false})
.use(Uppy.Dashboard, { trigger: '#uppyModalOpener' })
.use(Uppy.Webcam, {target: Uppy.Dashboard})
.use(Uppy.Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })

uppy.on('success', (fileCount) => {
console.log(`${fileCount} files uploaded`)
})
<script type="module">
import {
Uppy,
Dashboard,
Webcam,
Tus,
} from "https://releases.transloadit.com/uppy/v3.0.0-beta/uppy.min.mjs";

const uppy = new Uppy({ debug: true, autoProceed: false })
.use(Dashboard, { trigger: "#uppyModalOpener" })
.use(Webcam, { target: Dashboard })
.use(Tus, { endpoint: "https://tusd.tusdemo.net/files/" });

uppy.on("success", (fileCount) => {
console.log(`${fileCount} files uploaded`);
});
</script>

<!-- To support older browsers, you can use the legacy bundle which adds a global `Uppy` object. -->
<script nomodule src="https://releases.transloadit.com/uppy/v3.0.0-beta/uppy.legacy.min.js"></script>
<script nomodule>
{
const uppy = new Uppy.Core({ debug: true, autoProceed: false })
.use(Uppy.Dashboard, { trigger: "#uppyModalOpener" })
.use(Uppy.Webcam, { target: Uppy.Dashboard })
.use(Uppy.Tus, { endpoint: "https://tusd.tusdemo.net/files/" });

uppy.on("success", function (fileCount) {
console.log(`${fileCount} files uploaded`);
});
}
</script>
</body>
</html>
7 changes: 5 additions & 2 deletions examples/cdn-example/package.json
@@ -1,5 +1,8 @@
{
"name": "@uppy-example/cdn-example",
"name": "@uppy-example/cdn",
"version": "0.0.0",
"private": true
"private": true,
"scripts": {
"dev": "deno run --allow-net --allow-read https://deno.land/std/http/file_server.ts"
}
}
4 changes: 2 additions & 2 deletions yarn.lock
Expand Up @@ -9353,9 +9353,9 @@ __metadata:
languageName: unknown
linkType: soft

"@uppy-example/cdn-example@workspace:examples/cdn-example":
"@uppy-example/cdn@workspace:examples/cdn-example":
version: 0.0.0-use.local
resolution: "@uppy-example/cdn-example@workspace:examples/cdn-example"
resolution: "@uppy-example/cdn@workspace:examples/cdn-example"
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 947d2e7

Please sign in to comment.