Browse Source

update frontpage code sample and stuff on the website

Artur Paikin 7 years ago
parent
commit
1b9f75b4e7

+ 8 - 16
website/src/api-usage-example.ejs

@@ -1,19 +1,11 @@
 import Uppy from 'uppy/lib/core'
 import Dashboard from 'uppy/lib/plugins/Dashboard'
-import Tus10 from 'uppy/lib/plugins/Tus10'
-import MetaData from 'uppy/lib/plugins/MetaData'
+import Tus from 'uppy/lib/plugins/Tus'
  
-const uppy = Uppy({autoProceed: false})
-  .use(Dashboard, {trigger: '#select-files', target: '#upload-form', replaceTargetContent: true})
-  .use(Tus10, {endpoint: '://master.tus.io/files/'})
-  .use(MetaData, {
-    fields: [
-      { id: 'license', name: 'License', value: 'Creative Commons', placeholder: 'specify license' },
-      { id: 'caption', name: 'Caption', value: 'none', placeholder: 'describe what the image is about' }
-    ]
-  })
-uppy.run()
-uppy.on('success', (files) => {
-  console.log(`Upload complete! We’ve uploaded these files: ${files}`)
-})
+Uppy({ autoProceed: false })
+  .use(Dashboard, { trigger: '#select-files' })
+  .use(Tus, { endpoint: 'https://master.tus.io/files/' })
+  .run()
+  .on('complete', (result) => {
+    console.log('Upload result:', result)
+  })

+ 2 - 0
website/src/examples/dashboard/app.es6

@@ -36,7 +36,9 @@ function uppyInit () {
     trigger: '.UppyModalOpenerBtn',
     inline: opts.DashboardInline,
     target: opts.DashboardInline ? '.DashboardContainer' : 'body',
+    replaceTargetContent: true,
     note: opts.restrictions ? 'Images and video only, 2–3 files, up to 1 MB' : '',
+    maxHeight: 450,
     metaFields: [
       { id: 'license', name: 'License', placeholder: 'specify license' },
       { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }

+ 3 - 1
website/src/examples/dashboard/index.ejs

@@ -40,8 +40,10 @@ const uppy = Uppy({
 .use(Dashboard, {
   trigger: '.UppyModalOpenerBtn',
   inline: true,
-  target: '.DashboardContainer'
+  target: '.DashboardContainer',
+  replaceTargetContent: true,
   note: 'Images and video only, 2–3 files, up to 1 MB',
+  maxHeight: 450,
   metaFields: [
     { id: 'license', name: 'License', placeholder: 'specify license' },
     { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }

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

@@ -1,8 +1,8 @@
 <!-- Basic Uppy styles -->
 <link rel="stylesheet" href="/uppy/uppy.min.css">
 
-<div class="grid">
-  <div class="column-1-2">
+<div>
+  <div>
     <h5>autoProceed is on</h5>
 
     <!-- Target DOM node #1 -->
@@ -12,7 +12,7 @@
     <div class="UppyDragDrop-One-Progress"></div>
   </div>
 
-  <div class="column-1-2">
+  <div>
     <h5>autoProceed is off</h5>
 
     <!-- Target DOM node #2 -->

+ 2 - 0
website/themes/uppy/layout/example.ejs

@@ -6,6 +6,8 @@
 
   <p>Please see <a href="/docs/">documentation</a> for details.</p>
 
+  <hr>
+
   <p>Hey there stranger! Uppy <img src="/images/emojis/dog.png" width="14" align="absmiddle">
     is in the early stages of development and the example section
     is our playground. Things might not yet work, but we're working hard to improve this.</p>

File diff suppressed because it is too large
+ 0 - 0
website/themes/uppy/layout/partials/frontpage-code-sample.html


+ 1 - 1
website/themes/uppy/source/css/_index.scss

@@ -254,7 +254,7 @@
     max-width: 100%;
     width: 47%;
     display: inline-block;
-    vertical-align: middle;
+    vertical-align: top;
     // height: 250px;
   }
 }

Some files were not shown because too many files changed in this diff