How to use @uppy/robodog - 9 common examples

To help you get started, we’ve selected a few @uppy/robodog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github transloadit / uppy / examples / transloadit-textarea / main.js View on Github external
pickFiles () {
    robodog.pick({
      waitForEncoding: true,
      params: {
        auth: { key: TRANSLOADIT_EXAMPLE_KEY },
        template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
      }
    }).then((result) => {
      // Was cancelled
      if (result == null) return
      this.insertAttachments(
        this.matchFilesAndThumbs(result.results)
      )
    }).catch((err) => {
      console.error(err)
      this.reportUploadError(err)
    })
  }
github transloadit / uppy / examples / transloadit / main.js View on Github external
function openModal () {
  robodog.pick({
    restrictions: {
      allowedFileTypes: ['.png']
    },
    waitForEncoding: true,
    params: {
      auth: { key: TRANSLOADIT_KEY },
      template_id: TEMPLATE_ID
    },
    providers: [
      'webcam'
    ]
    // if providers need custom config
    // webcam: {
    //   option: 'whatever'
    // }
  }).then(console.log, console.error)
github transloadit / uppy / examples / transloadit-textarea / main.js View on Github external
uploadFiles (files) {
    robodog.upload({
      waitForEncoding: true,
      params: {
        auth: { key: TRANSLOADIT_EXAMPLE_KEY },
        template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
      }
    }).then((result) => {
      // Was cancelled
      if (result == null) return
      this.insertAttachments(
        this.matchFilesAndThumbs(result.results)
      )
    }).catch((err) => {
      console.error(err)
      this.reportUploadError(err)
    })
  }
github transloadit / uppy / examples / transloadit / main.js View on Github external
//   ":original": { "robot": "/upload/handle" },
//   "resize": {
//     "use": ":original",
//     "robot": "/image/resize",
//     "width": 100,
//     "height": 100,
//     "imagemagick_stack": "v1.0.0"
//   }
// }
const TEMPLATE_ID = 'bbc273f69e0c4694a5a9d1b587abc1bc'

/**
 * robodog.form
 */

const formUppy = robodog.form('#test-form', {
  debug: true,
  fields: ['message'],
  restrictions: {
    allowedFileTypes: ['.png']
  },
  waitForEncoding: true,
  params: {
    auth: { key: TRANSLOADIT_KEY },
    template_id: TEMPLATE_ID
  },
  modal: true,
  progressBar: '#test-form .progress'
})

formUppy.on('error', (err) => {
  document.querySelector('#test-form .error')
github transloadit / uppy / website / src / examples / markdown-snippets / app.es6 View on Github external
uploadFiles (files) {
    robodog.upload(files, {
      waitForEncoding: true,
      params: {
        auth: { key: TRANSLOADIT_EXAMPLE_KEY },
        template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
      }
    }).then((result) => {
      if (result === null) return
      this.insertAttachments(
        this.matchFilesAndThumbs(result.results)
      )
    }).catch((err) => {
      console.error(err)
      this.reportUploadError(err)
    })
  }
github transloadit / uppy / website / src / examples / markdown-snippets / app.es6 View on Github external
pickFiles () {
    robodog.pick({
      waitForEncoding: true,
      params: {
        auth: { key: TRANSLOADIT_EXAMPLE_KEY },
        template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
      },
      providers: [
        'webcam',
        'url',
        'instagram',
        'google-drive',
        'dropbox'
      ]
    }).then((result) => {
      if (result === null) return
      this.insertAttachments(
        this.matchFilesAndThumbs(result.results)
github transloadit / uppy / examples / transloadit / main.js View on Github external
window.doUpload = (event) => {
  const resultEl = document.querySelector('#upload-result')
  const errorEl = document.querySelector('#upload-error')
  robodog.upload(event.target.files, {
    waitForEncoding: true,
    params: {
      auth: { key: TRANSLOADIT_KEY },
      template_id: TEMPLATE_ID
    }
  }).then((result) => {
    resultEl.classList.remove('hidden')
    errorEl.classList.add('hidden')
    resultEl.textContent = inspect(result.results)
  }, (err) => {
    resultEl.classList.add('hidden')
    errorEl.classList.remove('hidden')
    errorEl.textContent = err.message
  })
}
github transloadit / uppy / examples / transloadit / main.js View on Github external
progressBar: '#test-form .progress'
})

formUppy.on('error', (err) => {
  document.querySelector('#test-form .error')
    .textContent = err.message
})

formUppy.on('upload-error', (file, err) => {
  document.querySelector('#test-form .error')
    .textContent = err.message
})

window.formUppy = formUppy

const formUppyWithDashboard = robodog.form('#dashboard-form', {
  debug: true,
  fields: ['message'],
  restrictions: {
    allowedFileTypes: ['.png']
  },
  waitForEncoding: true,
  note: 'Only PNG files please!',
  params: {
    auth: { key: TRANSLOADIT_KEY },
    template_id: TEMPLATE_ID
  },
  dashboard: '#dashboard-form .dashboard'
})

window.formUppyWithDashboard = formUppyWithDashboard
github transloadit / uppy / examples / transloadit / main.js View on Github external
fields: ['message'],
  restrictions: {
    allowedFileTypes: ['.png']
  },
  waitForEncoding: true,
  note: 'Only PNG files please!',
  params: {
    auth: { key: TRANSLOADIT_KEY },
    template_id: TEMPLATE_ID
  },
  dashboard: '#dashboard-form .dashboard'
})

window.formUppyWithDashboard = formUppyWithDashboard

const dashboard = robodog.dashboard('#dashboard', {
  debug: true,
  waitForEncoding: true,
  note: 'Images will be resized with Transloadit',
  params: {
    auth: { key: TRANSLOADIT_KEY },
    template_id: TEMPLATE_ID
  }
})

window.dashboard = dashboard

/**
 * robodog.modal
 */

function openModal () {

@uppy/robodog

Transloadit SDK for browsers based on Uppy

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis