Selaa lähdekoodia

update and clean up website examples

Artur Paikin 7 vuotta sitten
vanhempi
commit
3659dff213

+ 0 - 0
website/src/examples/drive/app.css


+ 0 - 8
website/src/examples/drive/app.es6

@@ -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()

+ 0 - 4
website/src/examples/drive/app.html

@@ -1,4 +0,0 @@
-<!-- Basic Uppy styles -->
-<link rel="stylesheet" href="/uppy/uppy.min.css">
-
-<div id="GoogleDriveContainer"></div>

+ 0 - 33
website/src/examples/drive/index.ejs

@@ -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 %}

+ 0 - 10
website/src/examples/i18n/app.es6

@@ -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')

+ 3 - 3
website/src/examples/i18n/app.html

@@ -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');

+ 3 - 3
website/src/examples/statusbar/app.es6

@@ -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()

+ 12 - 17
website/src/examples/xhrupload/app.es6

@@ -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')