From 924eef06ad07ea6e3bcbcc0071ca812942e117b7 Mon Sep 17 00:00:00 2001 From: Kevin van Zonneveld Date: Fri, 11 Dec 2015 12:05:49 +0100 Subject: [PATCH] Rename playground->cdn example and make it work --- .gitignore | 2 + website/src/examples/index.md | 64 ++++--------------- website/src/examples/playground/src/js/app.js | 9 +-- website/update.js | 6 ++ 4 files changed, 20 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index c77e5b86d..dd9bab1fb 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ website/public/ website/.deploy*/ website/src/_drafts website/src/examples/**/static/js/app.js + +website/themes/uppy/source/js/uppy.js diff --git a/website/src/examples/index.md b/website/src/examples/index.md index fe40aebc6..eae22d87f 100644 --- a/website/src/examples/index.md +++ b/website/src/examples/index.md @@ -1,63 +1,21 @@ --- -title: Playground +title: CDN type: examples order: 0 +snippets: [ playground/src/html/app.html, playground/src/js/app.html ] --- -> Playground +> CDN - -
-
-
-

- Loading.. -

+ -

uppy

-

- With this file we can easily test the built js client locally (via npm run preview) - and online. -

- -
-
- - - -
-
-
- - Puppy icon by Jorge Fernandez del Castillo Gomez
from the Noun Project
- -
-
-
- - - - - - - - - + +This example showcases sourcing an UMD dist build straight from a CDN. diff --git a/website/src/examples/playground/src/js/app.js b/website/src/examples/playground/src/js/app.js index 4c6ea867f..8b1a39374 100644 --- a/website/src/examples/playground/src/js/app.js +++ b/website/src/examples/playground/src/js/app.js @@ -1,8 +1 @@ -// import Uppy from 'uppy/core'; -// import { DragDrop, Tus10 } from 'uppy/plugins'; - -// const uppy = new Uppy({wait: false}); -// const files = uppy -// .use(DragDrop, {selector: '#upload-target'}) -// .use(Tus10, {endpoint: 'http://master.tus.io:8080'}) -// .run(); +// empty diff --git a/website/update.js b/website/update.js index f12aa53a0..957a15c98 100644 --- a/website/update.js +++ b/website/update.js @@ -25,3 +25,9 @@ fs.writeFileSync( return 'uppy_' + p1 + '_size: "' + (sizes[p1] || 99999 ) + '"' }) ) + +// Copy latest uppy version into website so the CDN example can use it +fs.writeFileSync( + './themes/uppy/source/js/uppy.js', + fs.readFileSync(locations.dev, 'utf-8') +);