example.ejs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <%- partial('partials/sidebar', { type: page.type, index: page.index }) %>
  2. <div class="Content js-Content <%- page.type ? page.type + ' with-sidebar' : '' %>">
  3. <h1><%- page.title %> Example</h1>
  4. <p>
  5. Hey there stranger!
  6. Uppy
  7. <img src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f436.png" width="16">
  8. is in the early stages of development and the example section
  9. is our playground. Things might not yet work, but we're working hard to improve this.
  10. <br />
  11. We're on a monthly
  12. <a href="https://github.com/transloadit/uppy/blob/master/CHANGELOG.md">monthly release cycle</a>
  13. and our latest version is v<%- config.uppy_gz_size %>, but the example
  14. pages reflect the latest work in our master branch, so here's
  15. <a href="https://github.com/transloadit/uppy/compare/v<%- config.uppy_version %>...master">what changed since v<%- config.uppy_version %></a>.
  16. </p>
  17. <!-- Add textarea already so it's available immediately for logging.
  18. It is later made visible, and moved into the #console-wrapper to position it in layout how
  19. you see fit. -->
  20. <textarea id="console-log" class="Console"></textarea>
  21. <script>
  22. console.log = (function (old_function, div_log) {
  23. return function (text) {
  24. old_function(text);
  25. if (text !== (text + '')) {
  26. text = JSON.stringify(text);
  27. }
  28. div_log.value = text + "\n" + div_log.value;
  29. };
  30. } (console.log.bind(console), document.getElementById("console-log")));
  31. </script>
  32. <%- page.content %>
  33. <script>
  34. // #console-log textarea is declared earlier so it's available immediately for logging.
  35. // Here it is made visible, and moved into the #console-wrapper, so you can position it in the layout how
  36. // you see fit.
  37. document.getElementById('console-wrapper').appendChild(document.getElementById('console-log'));
  38. document.getElementById('console-log').style.display = 'block';
  39. </script>
  40. <div class="footer">Caught a mistake or want to contribute to the documentation?
  41. <a href="https://github.com/transloadit/uppy/blob/master/website/src/<%- page.source %>" target="_blank">Edit/fork this page directly on Github</a>!
  42. </div>
  43. </div>