浏览代码

uppy icon margin-left: 1px

Artur Paikin 7 年之前
父节点
当前提交
2aece2e184
共有 2 个文件被更改,包括 9 次插入41 次删除
  1. 8 40
      examples/bundled-example/main.js
  2. 1 1
      src/scss/_dashboard.scss

+ 8 - 40
examples/bundled-example/main.js

@@ -6,15 +6,6 @@ const Webcam = require('../../src/plugins/Webcam')
 const Tus = require('../../src/plugins/Tus')
 const Form = require('../../src/plugins/Form')
 
-// const Dropbox = require('../../src/plugins/Dropbox')
-// const XHRUpload = require('../../src/plugins/XHRUpload')
-// const FileInput = require('../../src/plugins/FileInput')
-// const MetaData = require('../../src/plugins/MetaData')
-// const Informer = require('../../src/plugins/Informer')
-// const StatusBar = require('../../src/plugins/StatusBar')
-// const DragDrop = require('../../src/plugins/DragDrop')
-// const GoldenRetriever = require('../../src/plugins/GoldenRetriever')
-
 const TUS_ENDPOINT = 'https://master.tus.io/files/'
 
 const uppy = Uppy({
@@ -24,41 +15,18 @@ const uppy = Uppy({
     username: 'John',
     license: 'Creative Commons'
   }
-  // restrictions: {
-  //   maxFileSize: 300000,
-  //   maxNumberOfFiles: 10,
-  //   minNumberOfFiles: 2,
-  //   allowedFileTypes: ['image/*', 'video/*']
-  // }
-  // onBeforeFileAdded: (currentFile, files) => {
-  //   if (currentFile.name === 'pitercss-IMG_0616.jpg') {
-  //     return Promise.resolve()
-  //   }
-  //   return Promise.reject('this is not the file I was looking for')
-  // },
-  // onBeforeUpload: (files) => {
-  //   if (Object.keys(files).length < 2) {
-  //     return Promise.reject('too few files')
-  //   }
-  //   return Promise.resolve()
-  // }
 })
   .use(Dashboard, {
     trigger: '#pick-files',
+    // inline: true,
+    // target: 'body',
     metaFields: [
       { id: 'license', name: 'License', placeholder: 'specify license' },
       { id: 'caption', name: 'Caption', placeholder: 'add caption' }
-    ]
-    // target: '.uppy-target',
-    // inline: true,
-    // maxWidth: 500,
-    // maxHeight: 350,
-    // replaceTargetContent: true,
-    // closeModalOnClickOutside: false,
-    // note: 'Images and video only, 300kb or less',
-    // locale: {
-    //   strings: { browse: 'browse' }
-    // }
+    ],
+    showProgressDetails: true,
+    proudlyDisplayPoweredByUppy: true,
+    note: '2 files, images and video only'
   })
   .use(GoogleDrive, { target: Dashboard, host: 'http://localhost:3020' })
   .use(Instagram, { target: Dashboard, host: 'http://localhost:3020' })
@@ -89,5 +57,5 @@ if ('serviceWorker' in navigator) {
     })
 }
 
-// var modalTrigger = document.querySelector('#uppyModalOpener')
-// if (modalTrigger) modalTrigger.click()
+var modalTrigger = document.querySelector('#pick-files')
+if (modalTrigger) modalTrigger.click()

+ 1 - 1
src/scss/_dashboard.scss

@@ -76,7 +76,7 @@
 .uppy-Dashboard-poweredByIcon {
   stroke: $color-gray;
   fill: none;
-  margin-left: 2px;
+  margin-left: 1px;
   margin-right: 2px;
 }