uploader-flash-debug.js revision e66eba403ebf8a09e090b3785e8ea63aa1de7f3d
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * This module provides a UI for file selection and multiple file upload capability using
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Flash as a transport engine.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * The supported features include: automatic upload queue management, upload progress
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * tracking, server response retrieval and error reporting.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @module uploader-flash
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly SELECT_FILES = getCN(UPLOADER, 'selectfiles-button');
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * This module provides a UI for file selection and multiple file upload capability
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * using Flash as a transport engine.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @class UploaderFlash
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @extends Widget
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @constructor
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly UploaderFlash.superclass.constructor.apply ( this, arguments );
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny DonnellyY.UploaderFlash = Y.extend(UploaderFlash, Y.Widget, {
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Stored reference to the instance of SWF used to host the
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Flash uploader.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @property _swfReference
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @type {SWF}
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Stored reference to the instance of Uploader.Queue used to manage
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * the upload process.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @property _uploaderQueue
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @type {Y.Uploader.Queue}
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Stored value of the unique id for the container that holds the
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Flash uploader.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @property _swfContainerId
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @type {String}
_buttonFocus: false,
initializer : function () {
_setMultipleFiles : function () {
if (this._swfReference) {
_setFileFilters : function () {
fileConfObjects = [],
parsedFiles = [],
var newFileConf = {};
renderUI : function () {
bindUI : function () {
this._setMultipleFiles();
this._setFileFilters();
this._attachTabElements();
this._buttonFocus = true;
if (add) {
_attachTabElements : function () {
if (this.get("tabElements") != null && this.get("tabElements").from != null && this.get("tabElements").to != null) {
this._swfReference.on("tabback", function (ev) {this._swfReference._swf.blur(); setTimeout(function () {fromElement.focus();}, 30);}, this);
this._swfReference.on("tabforward", function (ev) {this._swfReference._swf.blur(); setTimeout(function () {toElement.focus();}, 30);}, this);
this._swfReference._swf.on("focus", function (ev) {this._buttonFocus = true; this._setButtonClass("focus", true);}, this);
this._swfReference._swf.on("blur", function (ev) {this._buttonFocus = false; this._setButtonClass("focus", false);}, this);
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
* @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request.
FLASH_CONTAINER: "<div id='{swfContainerId}' style='position:absolute; top:0px; left: 0px; margin:0px; width:100%; height:100%'></div>",
SELECT_FILES_BUTTON: "<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>",
ATTRS: {
value: {
errorAction: {
return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER);
valueFn: function () {
return Y.Node.create(substitute(Y.UploaderFlash.SELECT_FILES_BUTTON, {selectButtonLabel: this.get("selectButtonLabel")}));
value: false
fileFilters: {
value: null
appendNewFiles : {
value: true
simLimit: {
fileList: {
value: []
value: {}
uploadURL: {
* @default "CDN Prefix + assets/flashuploader.swf"
swfURL: {
tabElements: {
value: null
}, '@VERSION@' ,{requires:['swf', 'widget', 'substitute', 'base', 'cssbutton', 'node', 'event-custom', 'file', 'uploader-queue']});