Kaynağa Gözat

Remove obsolete plugins.

Renée Kooi 6 yıl önce
ebeveyn
işleme
23d3280b4a
2 değiştirilmiş dosya ile 0 ekleme ve 120 silme
  1. 0 79
      src/plugins/Dummy.js
  2. 0 41
      src/plugins/MagicLog.js

+ 0 - 79
src/plugins/Dummy.js

@@ -1,79 +0,0 @@
-const Plugin = require('@uppy/core/lib/Plugin')
-const { h } = require('preact')
-
-/**
- * Dummy
- * A test plugin, does nothing useful
- */
-module.exports = class Dummy extends Plugin {
-  constructor (uppy, opts) {
-    super(uppy, opts)
-    this.type = 'acquirer'
-    this.id = this.opts.id || 'Dummy'
-    this.title = 'Mr. Plugin'
-
-    // set default options
-    const defaultOptions = {}
-
-    // merge default options with the ones set by user
-    this.opts = Object.assign({}, defaultOptions, opts)
-
-    this.strange = <h1>this is strange 1</h1>
-    this.render = this.render.bind(this)
-    this.install = this.install.bind(this)
-  }
-
-  addFakeFileJustToTest () {
-    const blob = new Blob(
-      ['data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+CiAgPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNTAiLz4KPC9zdmc+Cg=='],
-      {type: 'image/svg+xml'}
-    )
-    const file = {
-      source: 'acceptance-test',
-      name: 'test-file',
-      type: 'image/svg+xml',
-      data: blob
-    }
-    this.props.log('Adding fake file blob')
-    try {
-      this.props.addFile(file)
-    } catch (err) {
-      // Nothing, restriction errors handled in Core
-    }
-  }
-
-  render (state) {
-    const bla = <h2>this is strange 2</h2>
-    return (
-      <div class="wow-this-works">
-        <input class="UppyDummy-firstInput" type="text" value="hello" />
-        {this.strange}
-        {bla}
-        {state.dummy.text}
-      </div>
-    )
-  }
-
-  install () {
-    this.uppy.setState({
-      dummy: { text: '123' }
-    })
-
-    const target = this.opts.target
-    if (target) {
-      this.mount(target, this)
-    }
-
-    setTimeout(() => {
-      this.uppy.setState({
-        dummy: {text: '!!!'}
-      })
-    }, 2000)
-  }
-}
-
-// module.exports = function (core, opts) {
-//   if (!(this instanceof Dummy)) {
-//     return new Dummy(core, opts)
-//   }
-// }

+ 0 - 41
src/plugins/MagicLog.js

@@ -1,41 +0,0 @@
-const Plugin = require('@uppy/core/lib/Plugin')
-// import deepDiff from 'deep-diff'
-
-/**
- * Magic Log
- * Helps debug Uppy
- * inspired by https://github.com/yoshuawuyts/choo-log
- *
- */
-module.exports = class MagicLog extends Plugin {
-  constructor (uppy, opts) {
-    super(uppy, opts)
-    this.type = 'debugger'
-    this.id = 'MagicLog'
-    this.title = 'Magic Log'
-
-    // set default options
-    const defaultOptions = {}
-
-    // merge default options with the ones set by user
-    this.opts = Object.assign({}, defaultOptions, opts)
-
-    this.handleStateUpdate = this.handleStateUpdate.bind(this)
-  }
-
-  handleStateUpdate (prev, state, patch) {
-    console.group('State')
-    console.log('Prev', prev)
-    console.log('Next', state)
-    console.log('Patch', patch)
-    console.groupEnd()
-  }
-
-  install () {
-    this.uppy.on('state-update', this.handleStateUpdate)
-  }
-
-  uninstall () {
-    this.uppy.off('state-update', this.handleStateUpdate)
-  }
-}