Skip to content

Commit

Permalink
Merge branch 'remove-robodog' of https://github.com/transloadit/uppy
Browse files Browse the repository at this point in the history
…into remove-robodog
  • Loading branch information
arturi committed Aug 8, 2022
2 parents 5402eac + e77ac0d commit d53b16d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 146 deletions.
4 changes: 2 additions & 2 deletions website/src/examples/dashboard/app.es6
@@ -1,4 +1,4 @@
import Uppy from '@uppy/core'
import Uppy, { debugLogger } from '@uppy/core'
import Dashboard from '@uppy/dashboard'
import GoogleDrive from '@uppy/google-drive'
import Dropbox from '@uppy/dropbox'
Expand Down Expand Up @@ -37,7 +37,7 @@ function uppyInit () {
const opts = window.uppyOptions

const uppy = new Uppy({
logger: Uppy.debugLogger,
logger: debugLogger,
})

uppy.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
Expand Down
65 changes: 1 addition & 64 deletions website/src/examples/dashboard/index.ejs
Expand Up @@ -21,67 +21,4 @@ Dashboard is the full-featured UI for Uppy that shows nice file previews and up

<blockquote>Note: in this snippet we've omitted the code to toggle options using checkboxes. The behavior of this code may be different from the above example depending on which options you've selected.</blockquote>

{% codeblock lang:js %}
const Uppy = require('@uppy/core')
const Dashboard = require('@uppy/dashboard')
const GoogleDrive = require('@uppy/google-drive')
const Dropbox = require('@uppy/dropbox')
const Unsplash = require('@uppy/unsplash')
const Box = require('@uppy/box')
const Instagram = require('@uppy/instagram')
const Facebook = require('@uppy/facebook')
const OneDrive = require('@uppy/onedrive')
const Webcam = require('@uppy/webcam')
const ScreenCapture = require('@uppy/screen-capture')
const ImageEditor = require('@uppy/image-editor')
const Tus = require('@uppy/tus')
const Url = require('@uppy/url')
const DropTarget = require('@uppy/drop-target')
const GoldenRetriever = require('@uppy/golden-retriever')
const Compressor = require('@uppy/compressor')

const uppy = new Uppy({
debug: true,
autoProceed: false,
restrictions: {
maxFileSize: 1000000,
maxNumberOfFiles: 3,
minNumberOfFiles: 2,
allowedFileTypes: ['image/*', 'video/*'],
requiredMetaFields: ['caption'],
}
})
.use(Dashboard, {
trigger: '.UppyModalOpenerBtn',
inline: true,
target: '.DashboardContainer',
showProgressDetails: true,
note: 'Images and video only, 2–3 files, up to 1 MB',
height: 470,
metaFields: [
{ id: 'name', name: 'Name', placeholder: 'file name' },
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
],
browserBackButtonClose: false
})
.use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(Dropbox, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(Box, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(Facebook, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(OneDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(Unsplash, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
.use(Webcam, { target: Dashboard })
.use(Audio, { target: Dashboard })
.use(ScreenCapture, { target: Dashboard })
.use(ImageEditor, { target: Dashboard })
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
.use(DropTarget, {target: document.body })
.use(GoldenRetriever)
.use(Compressor)

uppy.on('complete', result => {
console.log('successful files:', result.successful)
console.log('failed files:', result.failed)
})
{% endcodeblock %}
{% include_code lang:js dashboard/app.es6 %}
6 changes: 3 additions & 3 deletions website/src/examples/markdown-snippets/index.ejs
@@ -1,5 +1,5 @@
---
title: Robodog Markdown Snippets
title: Transloadit Markdown Snippets
layout: example
type: examples
order: 0
Expand All @@ -9,9 +9,9 @@ category: 'File Processing'
{% blockquote %}
This is a demo app that works a bit like Github Gists or Pastebin. You can add markdown snippets, and add file attachments to each snippet.

Uppy <a href="/docs/robodog/">Robodog</a> (using <a href="https://transloadit.com">Transloadit</a> internally) generates an inline preview image for images, videos, and audio files.
Uppy <a href="/docs/remote-sources/">Remote Sources plugin</a> (using <a href="https://transloadit.com">Transloadit</a> internally) generates an inline preview image for images, videos, and audio files.

You can view the <a target="_blank" href="https://github.com/transloadit/uppy/blob/main/examples/transloadit-textarea/template.json">Transloadit Assembly Template</a> and the <a href="#snippet-example-code"> code for this demo</a>.
You can view the <a target="_blank" href="https://github.com/transloadit/uppy/blob/main/examples/transloadit-textarea/template.json">Transloadit Assembly Template</a> and the <a href="#snippet-example-code">code for this demo</a>.
{% endblockquote %}

<p>
Expand Down
78 changes: 1 addition & 77 deletions website/src/examples/transloadit/index.ejs
Expand Up @@ -89,80 +89,4 @@ This example demonstrates how to unlock Transloadit’s features within Uppy.
<hr />

<p>On this page we're using the following JavaScript:</p>
{% codeblock lang:js %}
const Uppy = require('@uppy/core')
const Dashboard = require('@uppy/transloadit')
const Webcam = require('@uppy/webcam')
const Transloadit = require('@uppy/transloadit')
const Instagram = require('@uppy/instagram')

const uppy = new Uppy({
debug: true,
autoProceed: false,
restrictions: {
maxFileSize: 1024 * 1024 * 1024,
maxNumberOfFiles: 2,
minNumberOfFiles: 1,
allowedFileTypes: ['image/*']
},
locale: {
strings: {
youCanOnlyUploadFileTypes: 'You can only upload images'
}
}
})

uppy
.use(Transloadit, {
params: {
auth: {
key: YOUR_TRANSLOADIT_API_KEY
},
// It’s more secure to use a template_id and enable
// Signature Authentication
steps: {
resize: {
robot: '/image/resize',
width: 250,
height: 250,
resize_strategy: 'fit',
text: [
{
text: '© Transloadit.com',
size: 12,
font: 'Ubuntu',
color: '#eeeeee',
valign: 'bottom',
align: 'right',
x_offset: 16,
y_offset: -10
}
]
}
}
},
waitForEncoding: true
})
.use(Instagram, { target: Dashboard, companionUrl: 'https://api2.transloadit.com/companion', companionAllowedHosts: /\.transloadit\.com$/ })
.use(Dashboard, {
inline: true,
maxHeight: 400,
target: '#uppy-dashboard-container',
note: 'Images and video only, 1–2 files, up to 1 MB'
})
.use(Webcam, { target: Dashboard })
.on('transloadit:result', (stepName, result) => {
const file = uppy.getFile(result.localId)
var resultContainer = document.createElement('div')
resultContainer.innerHTML = `
<div>
<h3>Name: ${file.name}</h3>
<img src="${result.ssl_url}" /> <br />
<a href="${result.ssl_url}">View</a>
</div>
`
document
.getElementById('uppy-transloadit-result')
.appendChild(resultContainer)
})
{% endcodeblock %}
{% include_code lang:js transloadit/app.es6 %}

0 comments on commit d53b16d

Please sign in to comment.