5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen RabinovichYUI.add('uploader', function(Y) {
5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen Rabinovich
5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen Rabinovich/**
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich * Provides UI for selecting multiple files and functionality for
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich * uploading multiple files to the server with support for either
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich * html5 or Flash transport mechanisms, automatic queue management,
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich * upload progress monitoring, and error events.
5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen Rabinovich * @module uploader
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich * @main uploader
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich * @since 3.5.0
5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen Rabinovich */
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich/**
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * `Y.Uploader` serves as an alias for either <a href="UploaderFlash.html">`Y.UploaderFlash`</a>
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * or <a href="UploaderHTML5.html">`Y.UploaderHTML5`</a>, depending on the feature set available
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE`
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * static property is set to `"none"`.
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich *
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * @class Uploader
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich */
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich /**
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * The static property reflecting the type of uploader that `Y.Uploader`
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * aliases. The possible values are:
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * <ul>
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * <li><strong>`"html5"`</strong>: Y.Uploader is an alias for <a href="UploaderHTML5.html">Y.UploaderHTML5</a></li>
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * <li><strong>`"flash"`</strong>: Y.Uploader is an alias for <a href="UploaderFlash.html">Y.UploaderFlash</a></li>
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * <li><strong>`"none"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * not reference an actual implementation.</li>
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * </ul>
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich *
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * @property TYPE
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * @type {String}
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich * @static
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich */
71bbbe94567d63ab107a7eab263595bcc6e47833Allen Rabinovich
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich var Win = Y.config.win;
5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen Rabinovich
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {
bb2dfd6657cd525faa66dd17e2d809ac775be8faAllen Rabinovich Y.Uploader = Y.UploaderHTML5;
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich }
a6189ae642ddafa345fd7e17fba1d4d438708e0bAllen Rabinovich
5ea4ee9d2ec59b568afec78f52e036181df216b6Allen Rabinovich else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {
bb2dfd6657cd525faa66dd17e2d809ac775be8faAllen Rabinovich Y.Uploader = Y.UploaderFlash;
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich }
5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen Rabinovich
5ea4ee9d2ec59b568afec78f52e036181df216b6Allen Rabinovich else {
bb2dfd6657cd525faa66dd17e2d809ac775be8faAllen Rabinovich Y.namespace("Uploader");
bb2dfd6657cd525faa66dd17e2d809ac775be8faAllen Rabinovich Y.Uploader.TYPE = "none";
5ea4ee9d2ec59b568afec78f52e036181df216b6Allen Rabinovich }
5ea4ee9d2ec59b568afec78f52e036181df216b6Allen Rabinovich
5c62b3a15fd9e2709acc2ff32869fba56bb7d30eAllen Rabinovich
66900b43227bf441b6a6b1084af2c96ce2c747c8Allen Rabinovich}, '@VERSION@' ,{requires:['uploader-flash', 'uploader-html5']});