Version 3.18.1
Show:

File: uploader/js/uploader.js

  1. /**
  2. * Provides UI for selecting multiple files and functionality for
  3. * uploading multiple files to the server with support for either
  4. * html5 or Flash transport mechanisms, automatic queue management,
  5. * upload progress monitoring, and error events.
  6. * @module uploader
  7. * @main uploader
  8. * @since 3.5.0
  9. */
  10. /**
  11. * `Y.Uploader` serves as an alias for either <a href="UploaderFlash.html">`Y.UploaderFlash`</a>
  12. * or <a href="UploaderHTML5.html">`Y.UploaderHTML5`</a>, depending on the feature set available
  13. * in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE`
  14. * static property is set to `"none"`.
  15. *
  16. * @class Uploader
  17. */
  18. /**
  19. * The static property reflecting the type of uploader that `Y.Uploader`
  20. * aliases. The possible values are:
  21. * <ul>
  22. * <li><strong>`"html5"`</strong>: Y.Uploader is an alias for <a href="UploaderHTML5.html">Y.UploaderHTML5</a></li>
  23. * <li><strong>`"flash"`</strong>: Y.Uploader is an alias for <a href="UploaderFlash.html">Y.UploaderFlash</a></li>
  24. * <li><strong>`"none"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does
  25. * not reference an actual implementation.</li>
  26. * </ul>
  27. *
  28. * @property TYPE
  29. * @type {String}
  30. * @static
  31. */
  32. var Win = Y.config.win;
  33. if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {
  34. Y.Uploader = Y.UploaderHTML5;
  35. }
  36. else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {
  37. Y.Uploader = Y.UploaderFlash;
  38. }
  39. else {
  40. Y.namespace("Uploader");
  41. Y.Uploader.TYPE = "none";
  42. }