Jelajahi Sumber

Fixed build issue

Harry Hedger 9 tahun lalu
induk
melakukan
2be4372b5e

+ 1 - 1
package.json

@@ -19,7 +19,7 @@
     "test:phantom": "zuul test/spec/upload.js --phantom",
     "watch": "npm run watch:css & npm run watch:js",
     "watch:css": "nodemon -e src/scss -x \"npm run build:css\"",
-    "watch:examples": "(rm -rf lib && npm run build:lib) && (npm run watch:js & examples/buildAll node_modules/.bin/watchify)",
+    "watch:examples": "npm run build:lib && (examples/buildAll node_modules/.bin/watchify & npm run watch:js)",
     "watch:js": "nodemon --watch src -e js --ignore src/scss -x \"npm run build:lib\""
   },
   "repository": {

+ 2 - 2
src/plugins/DragDrop.js

@@ -1,5 +1,5 @@
-import { TransloaditPlugin } from './';
-
+import TransloaditPlugin from './TransloaditPlugin';
+console.log('pizza', TransloaditPlugin)
 // This is how we roll $('.element').toggleClass in non-jQuery world
 function toggleClass(el, className) {
   // console.log(el);

+ 54 - 0
src/plugins/Dropbox.js

@@ -0,0 +1,54 @@
+var client = new Dropbox.Client({ key: 'b7dzc9ei5dv5hcv', token: '' });
+
+client.authDriver(new Dropbox.AuthDriver.Redirect());
+client.authenticate();
+
+console.log(client.credentials())
+
+if (client.credentials().token) {
+  client.readdir("/", function(error, entries, stat, statFiles) {
+    if (error) {
+      return showError(error);  // Something went wrong.
+    }
+    render(statFiles);
+
+  });
+}
+
+function render(files) {
+  var elems = files.map(function(file, i) {
+    var icon = (file.isFolder) ? 'Folder' : 'File'
+    return '<li><span>' + icon + '</span><span>' + file.name + '</span></li>'
+  })
+
+  elems.sort();
+
+  // var target = document.getElementById('target');
+  // target.innerHTML = elems.join('');
+}
+
+export default class DropboxPlugin {
+  constructor() {
+
+  }
+
+  connect() {
+
+  }
+
+  authenticate() {
+
+  }
+
+  addFile() {
+
+  }
+
+  getDirectory() {
+
+  }
+
+  upload() {
+
+  }
+}

+ 1 - 0
src/plugins/TransloaditBasic.js

@@ -1,4 +1,5 @@
 import TransloaditPlugin from './TransloaditPlugin';
+console.log(TransloaditPlugin)
 class TransloaditBasic extends TransloaditPlugin {
   constructor(core, opts) {
     super(core, opts);

+ 1 - 1
src/plugins/TransloaditPlugin.js

@@ -1,4 +1,4 @@
-export default class {
+export default class TransloaditPlugin {
   // This contains boilerplate that all TransloaditPlugins share - and should not be used
   // directly. It also shows which methods final plugins should implement/override,
   // this deciding on structure.

+ 2 - 2
src/plugins/Tus10.js

@@ -1,5 +1,5 @@
-import { TransloaditPlugin } from './';
-
+import TransloaditPlugin from './TransloaditPlugin';
+console.log(TransloaditPlugin)
 export default class Tus10 extends TransloaditPlugin {
   constructor(core, opts) {
     super(core, opts);

+ 2 - 1
src/plugins/index.js

@@ -1,9 +1,10 @@
+import TransloaditPlugin from './TransloaditPlugin'
 import DragDrop from './DragDrop'
 import TransloaditBasic from './TransloaditBasic'
 import Tus10 from './Tus10'
-import TransloaditPlugin from './TransloaditPlugin'
 
 export default {
+  TransloaditPlugin,
   DragDrop,
   TransloaditBasic,
   Tus10