Browse Source

fix: git merge madnesss

Ifedapo Olarewaju 8 years ago
parent
commit
0df9220e05

+ 4 - 4
src/generic-provider-views/index.js

@@ -1,6 +1,6 @@
-import AuthView from './AuthView'
-import Browser from './new/Browser'
-import ErrorView from './Error'
+const AuthView = require('./AuthView')
+const Browser = require('./new/Browser')
+const ErrorView = require('./Error')
 
 /**
  * Class to easily generate generic views for plugins
@@ -33,7 +33,7 @@ import ErrorView from './Error'
  * getItemModifiedDate
  *    @return {object} or {String} date of when last the item was modified
  */
-export default class View {
+module.exports = class View {
   /**
    * @param {object} instance of the plugin
    */

+ 2 - 2
src/plugins/Dropbox/icons.js

@@ -1,6 +1,6 @@
-import html from '../../core/html'
+const html = require('yo-yo')
 
-export default {
+module.exports = {
   folder: () =>
     html`<svg class="UppyIcon" width="16.000000pt" height="16.000000pt" viewBox="0 0 48.000000 48.000000"
     preserveAspectRatio="xMidYMid meet">

+ 9 - 10
src/plugins/Dropbox/index.js

@@ -1,13 +1,12 @@
-import Plugin from '../Plugin'
-import 'whatwg-fetch'
-import html from '../../core/html'
+const html = require('yo-yo')
+const Plugin = require('../Plugin')
 
-import Provider from '../../uppy-base/src/plugins/Provider'
+const Provider = require('../../uppy-base/src/plugins/Provider')
 
-import View from '../../generic-provider-views/index'
-import icons from './icons'
+const View = require('../../generic-provider-views/index')
+const icons = require('./icons')
 
-export default class Dropbox extends Plugin {
+module.exports = class Dropbox extends Plugin {
   constructor (core, opts) {
     super(core, opts)
     this.type = 'acquirer'
@@ -16,11 +15,11 @@ export default class Dropbox extends Plugin {
     this.stateId = 'dropbox'
     this.icon = html`
       <svg class="UppyIcon" width="128" height="118" viewBox="0 0 128 118">
-        <g><path d="M38.145.777L1.108 24.96l25.608 20.507 37.344-23.06z"/>
+        <path d="M38.145.777L1.108 24.96l25.608 20.507 37.344-23.06z"/>
         <path d="M1.108 65.975l37.037 24.183L64.06 68.525l-37.343-23.06zM64.06 68.525l25.917 21.633 37.036-24.183-25.61-20.51z"/>
         <path d="M127.014 24.96L89.977.776 64.06 22.407l37.345 23.06zM64.136 73.18l-25.99 21.567-11.122-7.262v8.142l37.112 22.256 37.114-22.256v-8.142l-11.12 7.262z"/>
-        </g>
-      </svg>`
+      </svg>
+    `
 
     // writing out the key explicitly for readability the key used to store
     // the provider instance must be equal to this.id.

+ 0 - 44
src/plugins/GoogleDrive/Browser.js

@@ -1,44 +0,0 @@
-const html = require('yo-yo')
-const Sidebar = require('./Sidebar')
-const Table = require('./Table')
-
-module.exports = (props, bus) => {
-  let filteredFolders = props.folders
-  let filteredFiles = props.files
-
-  if (props.filterInput !== '') {
-    filteredFolders = props.filterItems(props.folders)
-    filteredFiles = props.filterItems(props.files)
-  }
-
-  return html`
-    <div>
-      <div class="container-fluid">
-        <div class="row">
-          <div class="hidden-md-down col-lg-12 col-xl-12">
-            ${Sidebar({
-              getRootDirectory: () => props.getNextFolder('root', 'Google Drive'),
-              logout: props.logout,
-              filterQuery: props.filterQuery,
-              filterInput: props.filterInput
-            })}
-          </div>
-          <div class="col-md-12 col-lg-12 col-xl-12">
-            <div class="UppyGoogleDrive-browserContainer">
-              ${Table({
-                folders: filteredFolders,
-                files: filteredFiles,
-                activeRow: props.activeRow,
-                sortByTitle: props.sortByTitle,
-                sortByDate: props.sortByDate,
-                handleRowClick: props.handleRowClick,
-                handleFileDoubleClick: props.addFile,
-                handleFolderDoubleClick: props.getNextFolder
-              })}
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-  `
-}

+ 0 - 12
src/plugins/GoogleDrive/Sidebar.js

@@ -1,12 +0,0 @@
-const html = require('yo-yo')
-
-module.exports = (props) => {
-  return html`
-    <ul class="UppyGoogleDrive-sidebar">
-      <li class="UppyGoogleDrive-filter"><input class="UppyGoogleDrive-focusInput" type='text' onkeyup=${props.filterQuery} placeholder="Search.." value=${props.filterInput}/></li>
-      <li><button onclick=${props.getRootDirectory}><img src="https://ssl.gstatic.com/docs/doclist/images/icon_11_collection_list_3.png"/> My Drive</button></li>
-      <li><button><img src="https://ssl.gstatic.com/docs/doclist/images/icon_11_shared_collection_list_1.png"/> Shared with me</button></li>
-      <li><button onclick=${props.logout}>Logout</button></li>
-    </ul>
-  `
-}

+ 0 - 39
src/plugins/GoogleDrive/Table.js

@@ -1,39 +0,0 @@
-const html = require('yo-yo')
-const TableRow = require('./TableRow')
-
-module.exports = (props) => {
-  return html`
-    <table class="UppyGoogleDrive-browser">
-      <thead>
-        <tr>
-          <td class="UppyGoogleDrive-sortableHeader" onclick=${props.sortByTitle}>Name</td>
-          <td>Owner</td>
-          <td class="UppyGoogleDrive-sortableHeader" onclick=${props.sortByDate}>Last Modified</td>
-          <td>Filesize</td>
-        </tr>
-      </thead>
-      <tbody>
-        ${props.folders.map((folder) => {
-          return TableRow({
-            title: folder.title,
-            active: props.activeRow === folder.id,
-            iconLink: folder.iconLink,
-            modifiedByMeDate: folder.modifiedByMeDate,
-            handleClick: () => props.handleRowClick(folder.id),
-            handleDoubleClick: () => props.handleFolderDoubleClick(folder.id, folder.title)
-          })
-        })}
-        ${props.files.map((file) => {
-          return TableRow({
-            title: file.title,
-            active: props.activeRow === file.id,
-            iconLink: file.iconLink,
-            modifiedByMeDate: file.modifiedByMeDate,
-            handleClick: () => props.handleRowClick(file.id),
-            handleDoubleClick: () => props.handleFileDoubleClick(file)
-          })
-        })}
-      </tbody>
-    </table>
-  `
-}

+ 0 - 14
src/plugins/GoogleDrive/TableRow.js

@@ -1,14 +0,0 @@
-const html = require('yo-yo')
-
-module.exports = (props) => {
-  return html`
-    <tr class=${props.active ? 'is-active' : ''}
-      onclick=${props.handleClick}
-      ondblclick=${props.handleDoubleClick}>
-      <td><span class="UppyGoogleDrive-folderIcon"><img src=${props.iconLink}/></span> ${props.title}</td>
-      <td>Me</td>
-      <td>${props.modifiedByMeDate}</td>
-      <td>-</td>
-    </tr>
-  `
-}

+ 0 - 1
src/plugins/GoogleDrive/index.js

@@ -1,5 +1,4 @@
 const html = require('yo-yo')
-require('whatwg-fetch')
 const Plugin = require('../Plugin')
 
 const Provider = require('../../uppy-base/src/plugins/Provider')

+ 0 - 9
src/plugins/GoogleDrive/new/Breadcrumb.js

@@ -1,9 +0,0 @@
-const html = require('yo-yo')
-
-module.exports = (props) => {
-  return html`
-    <li>
-      <button onclick=${props.getNextFolder}>${props.title}</button>
-    </li>
-  `
-}

+ 0 - 17
src/plugins/GoogleDrive/new/Breadcrumbs.js

@@ -1,17 +0,0 @@
-const html = require('yo-yo')
-const Breadcrumb = require('./Breadcrumb')
-
-module.exports = (props) => {
-  return html`
-    <ul class="UppyGoogleDrive-breadcrumbs">
-      ${
-        props.directories.map((directory) => {
-          return Breadcrumb({
-            getNextFolder: () => props.getNextFolder(directory.id, directory.title),
-            title: directory.title
-          })
-        })
-      }
-    </ul>
-  `
-}

+ 2 - 0
src/plugins/_index.js

@@ -9,6 +9,7 @@ const Dummy = require('./Dummy')
 const DragDrop = require('./DragDrop/index.js')
 const FileInput = require('./FileInput')
 const GoogleDrive = require('./GoogleDrive/index.js')
+const Dropbox = require('./Dropbox/index.js')
 const Webcam = require('./Webcam/index.js')
 
 // Progressindicators
@@ -32,6 +33,7 @@ module.exports = {
   Informer,
   DragDrop,
   GoogleDrive,
+  Dropbox,
   FileInput,
   Tus10,
   Multipart,

+ 2 - 0
src/uppy-base/src/plugins/Provider.js

@@ -1,5 +1,7 @@
 'use strict'
 
+require('whatwg-fetch')
+
 const _getName = (id) => {
   return id.split('-').map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(' ')
 }

+ 1 - 1
website/src/examples/dashboard/app.es6

@@ -7,7 +7,7 @@ const Tus10 = require('../../../../src/plugins/Tus10')
 const MetaData = require('../../../../src/plugins/MetaData')
 const Informer = require('../../../../src/plugins/Informer')
 
-const { UPPY_SERVER } = require('../env')
+const UPPY_SERVER = require('../env')
 
 const PROTOCOL = location.protocol === 'https:' ? 'https' : 'http'
 const TUS_ENDPOINT = PROTOCOL + '://master.tus.io/files/'