index.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Robodog playground</title>
  7. </head>
  8. <body>
  9. <style>
  10. html {
  11. background: #f1f1f1;
  12. }
  13. main {
  14. padding: 20px;
  15. font: 12pt sans-serif;
  16. background: white;
  17. width: 800px;
  18. margin: auto;
  19. }
  20. hr {
  21. border: 0;
  22. background-color: #111e33;
  23. height: 1px;
  24. }
  25. .hidden { display: none; }
  26. .error { color: red; }
  27. #logo { height: 1em; vertical-align: middle; }
  28. </style>
  29. <main>
  30. <h1>Robodog <img src="https://transloadit.edgly.net/assets/images/logo-small.svg" alt="Transloadit" id="logo"> playground</h1>
  31. <p>
  32. This page contains small examples for every API offered by the Robodog library. Please see the <a href="https://github.com/transloadit/uppy/tree/main/examples/transloadit">Github repository</a> for the source code.
  33. <hr>
  34. <h2>robodog.form()</h2>
  35. <p>
  36. The form API allows you to easily send files through Transloadit's encoding backend. When the user submits the form, any files are uploaded to Transloadit. The form data is then sent to your own backend, with additional data about the Transloadit Assemblies that were started.
  37. <form id="test-form" method="post" action="http://localhost:9967/test">
  38. <p><strong>leave a message</strong>
  39. <p>
  40. <label>name:
  41. <input type="text" name="name">
  42. </label>
  43. <p>
  44. <label>message: <br>
  45. <textarea name="message"></textarea>
  46. </label>
  47. <p>
  48. <label>
  49. attachments:
  50. <input type="file" name="files" multiple>
  51. </label>
  52. <div class="progress"></div>
  53. <p>
  54. <button type="submit">
  55. Upload
  56. </button>
  57. <span class="error"></span>
  58. </form>
  59. <hr>
  60. <h2>robodog.form() with dashboard</h2>
  61. <p>
  62. You can also use the Dashboard UI inside a plain old HTML form by specifying a <code>dashboard: '.target-css-selector'</code> option.
  63. <form id="dashboard-form" method="post" action="http://localhost:9967/test">
  64. <p><strong>leave a message</strong>
  65. <p>
  66. <label>name:
  67. <input type="text" name="name">
  68. </label>
  69. <p>
  70. <label>message: <br>
  71. <textarea name="message"></textarea>
  72. </label>
  73. <p>
  74. <label>
  75. attachments:
  76. <span class="dashboard"></span>
  77. </label>
  78. <p>
  79. <button type="submit">
  80. Upload
  81. </button>
  82. <span class="error"></span>
  83. </form>
  84. <hr>
  85. <h2>robodog.dashboard()</h2>
  86. <p>
  87. The <code>robodog.dashboard</code> API allows you to embed a Dashboard at any location. Users can continuously upload files through this UI, so please make sure this fits your use case!
  88. <p id="dashboard">
  89. <hr>
  90. <h2>robodog.pick()</h2>
  91. <p>
  92. This API is a one-shot upload UI using a modal overlay. Call the function and receive a Promise with upload results ✌️
  93. <p>
  94. <button onclick="openModal()">Open</button>
  95. <hr>
  96. <h2>robodog.upload()</h2>
  97. <p>
  98. An &lt;input type=file&gt; backed by <code>robodog.upload</code>:
  99. <p>
  100. <input type="file" multiple onchange="doUpload(event)">
  101. <p id="upload-result">
  102. <p id="upload-error" class="error">
  103. </main>
  104. <link href="uppy.min.css" rel="stylesheet">
  105. <script src="bundle.js"></script>
  106. </body>
  107. </html>