Bladeren bron

Use robodog for var name

Kevin van Zonneveld 6 jaren geleden
bovenliggende
commit
2389d3f914
2 gewijzigde bestanden met toevoegingen van 14 en 14 verwijderingen
  1. 9 9
      examples/transloadit/main.js
  2. 5 5
      website/src/docs/robodog.md

+ 9 - 9
examples/transloadit/main.js

@@ -1,5 +1,5 @@
 const { inspect } = require('util')
 const { inspect } = require('util')
-const transloadit = require('@uppy/robodog')
+const robodog = require('@uppy/robodog')
 
 
 const TRANSLOADIT_KEY = '35c1aed03f5011e982b6afe82599b6a0'
 const TRANSLOADIT_KEY = '35c1aed03f5011e982b6afe82599b6a0'
 // A trivial template that resizes images, just for example purposes.
 // A trivial template that resizes images, just for example purposes.
@@ -17,10 +17,10 @@ const TRANSLOADIT_KEY = '35c1aed03f5011e982b6afe82599b6a0'
 const TEMPLATE_ID = 'bbc273f69e0c4694a5a9d1b587abc1bc'
 const TEMPLATE_ID = 'bbc273f69e0c4694a5a9d1b587abc1bc'
 
 
 /**
 /**
- * transloadit.form
+ * robodog.form
  */
  */
 
 
-const formUppy = transloadit.form('#test-form', {
+const formUppy = robodog.form('#test-form', {
   debug: true,
   debug: true,
   fields: ['message'],
   fields: ['message'],
   restrictions: {
   restrictions: {
@@ -47,7 +47,7 @@ formUppy.on('upload-error', (file, err) => {
 
 
 window.formUppy = formUppy
 window.formUppy = formUppy
 
 
-const formUppyWithDashboard = transloadit.form('#dashboard-form', {
+const formUppyWithDashboard = robodog.form('#dashboard-form', {
   debug: true,
   debug: true,
   fields: ['message'],
   fields: ['message'],
   restrictions: {
   restrictions: {
@@ -63,7 +63,7 @@ const formUppyWithDashboard = transloadit.form('#dashboard-form', {
 
 
 window.formUppyWithDashboard = formUppyWithDashboard
 window.formUppyWithDashboard = formUppyWithDashboard
 
 
-const dashboard = transloadit.dashboard('#dashboard', {
+const dashboard = robodog.dashboard('#dashboard', {
   debug: true,
   debug: true,
   waitForEncoding: true,
   waitForEncoding: true,
   params: {
   params: {
@@ -75,11 +75,11 @@ const dashboard = transloadit.dashboard('#dashboard', {
 window.dashboard = dashboard
 window.dashboard = dashboard
 
 
 /**
 /**
- * transloadit.modal
+ * robodog.modal
  */
  */
 
 
 function openModal () {
 function openModal () {
-  transloadit.pick({
+  robodog.pick({
     restrictions: {
     restrictions: {
       allowedFileTypes: ['.png']
       allowedFileTypes: ['.png']
     },
     },
@@ -101,13 +101,13 @@ function openModal () {
 window.openModal = openModal
 window.openModal = openModal
 
 
 /**
 /**
- * transloadit.upload
+ * robodog.upload
  */
  */
 
 
 window.doUpload = (event) => {
 window.doUpload = (event) => {
   const resultEl = document.querySelector('#upload-result')
   const resultEl = document.querySelector('#upload-result')
   const errorEl = document.querySelector('#upload-error')
   const errorEl = document.querySelector('#upload-error')
-  transloadit.upload(event.target.files, {
+  robodog.upload(event.target.files, {
     waitForEncoding: true,
     waitForEncoding: true,
     params: {
     params: {
       auth: { key: TRANSLOADIT_KEY },
       auth: { key: TRANSLOADIT_KEY },

+ 5 - 5
website/src/docs/robodog.md

@@ -23,7 +23,7 @@ npm install --save @uppy/robodog
 Then, with a bundler such as [webpack][webpack] or [Browserify][browserify], do:
 Then, with a bundler such as [webpack][webpack] or [Browserify][browserify], do:
 
 
 ```js
 ```js
-const transloadit = require('@uppy/robodog')
+const robodog = require('@uppy/robodog')
 ```
 ```
 
 
 If you are not using a bundler, you can also import Robodog using an HTML script tag.
 If you are not using a bundler, you can also import Robodog using an HTML script tag.
@@ -50,7 +50,7 @@ And if any of these methods are not flexible enough, you can always replace them
 Show a modal UI that allows users to pick files from their device and from the web. It uploads files to Transloadit for processing.
 Show a modal UI that allows users to pick files from their device and from the web. It uploads files to Transloadit for processing.
 
 
 ```js
 ```js
-const resultPromise = transloadit.pick({
+const resultPromise = robodog.pick({
   target: 'body',
   target: 'body',
   params: {
   params: {
     auth: { key: '' },
     auth: { key: '' },
@@ -74,12 +74,12 @@ Add resumable uploads and Transloadit's processing to your existing HTML upload
 ```html
 ```html
 <form id="myForm" method="POST" action="/upload">
 <form id="myForm" method="POST" action="/upload">
   <input type="file" multiple>
   <input type="file" multiple>
-  <!-- Will be inserted by `transloadit.form()`: -->
+  <!-- Will be inserted by `robodog.form()`: -->
   <!-- <input type="hidden" name="transloadit" value="{...json...}"> -->
   <!-- <input type="hidden" name="transloadit" value="{...json...}"> -->
   <button type="submit">Upload</button>
   <button type="submit">Upload</button>
 </form>
 </form>
 <script>
 <script>
-transloadit.form('form#myForm', {
+robodog.form('form#myForm', {
   params: {
   params: {
     auth: { key: '' },
     auth: { key: '' },
     template_id: ''
     template_id: ''
@@ -95,7 +95,7 @@ transloadit.form('form#myForm', {
 Upload files straight to Transloadit from your own custom UI. Give us an array of files, and we'll give you an array of results!
 Upload files straight to Transloadit from your own custom UI. Give us an array of files, and we'll give you an array of results!
 
 
 ```js
 ```js
-const resultPromise = transloadit.upload(files, {
+const resultPromise = robodog.upload(files, {
   params: {
   params: {
     auth: { key: '' },
     auth: { key: '' },
     template_id: ''
     template_id: ''