|
1 /* |
|
2 YUI 3.10.3 (build 2fb5187) |
|
3 Copyright 2013 Yahoo! Inc. All rights reserved. |
|
4 Licensed under the BSD License. |
|
5 http://yuilibrary.com/license/ |
|
6 */ |
|
7 |
|
8 YUI.add('uploader', function (Y, NAME) { |
|
9 |
|
10 /** |
|
11 * Provides UI for selecting multiple files and functionality for |
|
12 * uploading multiple files to the server with support for either |
|
13 * html5 or Flash transport mechanisms, automatic queue management, |
|
14 * upload progress monitoring, and error events. |
|
15 * @module uploader |
|
16 * @main uploader |
|
17 * @since 3.5.0 |
|
18 */ |
|
19 |
|
20 /** |
|
21 * `Y.Uploader` serves as an alias for either <a href="UploaderFlash.html">`Y.UploaderFlash`</a> |
|
22 * or <a href="UploaderHTML5.html">`Y.UploaderHTML5`</a>, depending on the feature set available |
|
23 * in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE` |
|
24 * static property is set to `"none"`. |
|
25 * |
|
26 * @class Uploader |
|
27 */ |
|
28 |
|
29 /** |
|
30 * The static property reflecting the type of uploader that `Y.Uploader` |
|
31 * aliases. The possible values are: |
|
32 * <ul> |
|
33 * <li><strong>`"html5"`</strong>: Y.Uploader is an alias for <a href="UploaderHTML5.html">Y.UploaderHTML5</a></li> |
|
34 * <li><strong>`"flash"`</strong>: Y.Uploader is an alias for <a href="UploaderFlash.html">Y.UploaderFlash</a></li> |
|
35 * <li><strong>`"none"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does |
|
36 * not reference an actual implementation.</li> |
|
37 * </ul> |
|
38 * |
|
39 * @property TYPE |
|
40 * @type {String} |
|
41 * @static |
|
42 */ |
|
43 |
|
44 var Win = Y.config.win; |
|
45 |
|
46 if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) { |
|
47 Y.Uploader = Y.UploaderHTML5; |
|
48 } |
|
49 |
|
50 else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) { |
|
51 Y.Uploader = Y.UploaderFlash; |
|
52 } |
|
53 |
|
54 else { |
|
55 Y.namespace("Uploader"); |
|
56 Y.Uploader.TYPE = "none"; |
|
57 } |
|
58 |
|
59 }, '3.10.3', {"requires": ["uploader-html5", "uploader-flash"]}); |