暫無描述

downloader.html 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ---
  2. title: "Mini app : Downloader"
  3. layout: default
  4. section: example
  5. ---
  6. <p>
  7. This mini application let you choose the files you want in a list, download
  8. them, zip them and give the result to the user.
  9. </p>
  10. <p>
  11. This demo requires a recent browser, see <a href="{{site.baseurl}}/documentation/howto/write_zip.html">
  12. the howto</a>.
  13. </p>
  14. <p>
  15. This demo depends on the following libraries:
  16. <ul>
  17. <li><a href="https://jquery.com/">jQuery</a> (to manipulate the DOM)</li>
  18. <li><a href="https://github.com/stuk/jszip-utils">JSZipUtils</a> (to download files)</li>
  19. <li><a href="https://getbootstrap.com/">bootstrap</a> (for the progress bar)</li>
  20. </ul>
  21. </p>
  22. <ul class="nav nav-tabs" role="tablist">
  23. <li role="presentation" class="active">
  24. <a href="#downloader-result" aria-controls="downloader-result" role="tab" data-toggle="tab">
  25. result
  26. </a>
  27. </li>
  28. <li role="presentation">
  29. <a href="#downloader-js" aria-controls="downloader-js" role="tab" data-toggle="tab">
  30. js code
  31. </a>
  32. </li>
  33. <li role="presentation">
  34. <a href="#downloader-helpers-js" aria-controls="downloader-helpers-js" role="tab" data-toggle="tab">
  35. js helpers
  36. </a>
  37. </li>
  38. <li role="presentation">
  39. <a href="#downloader-html" aria-controls="downloader-html" role="tab" data-toggle="tab">
  40. html code
  41. </a>
  42. </li>
  43. </ul>
  44. <div class="tab-content">
  45. <div role="tabpanel" class="tab-pane active" id="downloader-result">
  46. <div class="show-example">
  47. <div id="downloader_application">
  48. {% include_relative downloader.inc/downloader.html %}
  49. </div>
  50. </div>
  51. </div>
  52. <div role="tabpanel" class="tab-pane" id="downloader-js">
  53. {% highlight js %}
  54. {% include_relative downloader.inc/downloader.js %}
  55. {% endhighlight %}
  56. </div>
  57. <div role="tabpanel" class="tab-pane" id="downloader-helpers-js">
  58. {% highlight js %}
  59. {% include_relative downloader.inc/helpers.js %}
  60. {% endhighlight %}
  61. </div>
  62. <div role="tabpanel" class="tab-pane" id="downloader-html">
  63. {% highlight html %}
  64. {% include_relative downloader.inc/downloader.html %}
  65. {% endhighlight %}
  66. </div>
  67. </div>
  68. <script type="text/javascript">
  69. jQuery(function ($) {
  70. {% include_relative downloader.inc/downloader.js %}
  71. {% include_relative downloader.inc/helpers.js %}
  72. });
  73. </script>