/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.form.uploader.FileList"],["require","dojox.form.uploader.Base"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.form.uploader.FileList"]){_4._hasResource["dojox.form.uploader.FileList"]=true;_4.provide("dojox.form.uploader.FileList");_4.require("dojox.form.uploader.Base");_4.declare("dojox.form.uploader.FileList",[_6.form.uploader.Base],{uploaderId:"",uploader:null,headerIndex:"#",headerType:"Type",headerFilename:"File Name",headerFilesize:"Size",_upCheckCnt:0,rowAmt:0,templateString:"<div class=\"dojoxUploaderFileList\">"+"<div dojoAttachPoint=\"progressNode\" class=\"dojoxUploaderFileListProgress\"><div dojoAttachPoint=\"percentBarNode\" class=\"dojoxUploaderFileListProgressBar\"></div><div dojoAttachPoint=\"percentTextNode\" class=\"dojoxUploaderFileListPercentText\">0%</div></div>"+"<table class=\"dojoxUploaderFileListTable\">"+"<tr class=\"dojoxUploaderFileListHeader\"><th class=\"dojoxUploaderIndex\">${headerIndex}</th><th class=\"dojoxUploaderIcon\">${headerType}</th><th class=\"dojoxUploaderFileName\">${headerFilename}</th><th class=\"dojoxUploaderFileSize\">${headerFilesize}</th></tr>"+"<tr ><td colSpan=\"4\" class=\"dojoxUploaderFileListContainer\" dojoAttachPoint=\"containerNode\">"+"<table class=\"dojoxUploaderFileListContent\" dojoAttachPoint=\"listNode\"></table>"+"</td><tr>"+"</table>"+"<div>",postCreate:function(){this.setUploader();this.hideProgress();},reset:function(){for(var i=0;i<this.rowAmt;i++){this.listNode.deleteRow(0);}this.rowAmt=0;},setUploader:function(){if(!this.uploaderId&&!this.uploader){console.warn("uploaderId not passed to UploaderFileList");}else{if(this.uploaderId&&!this.uploader){this.uploader=_5.byId(this.uploaderId);}else{if(this._upCheckCnt>4){console.warn("uploader not found for ID ",this.uploaderId);return;}}}if(this.uploader){this.connect(this.uploader,"onChange","_onUploaderChange");this.connect(this.uploader,"reset","reset");this.connect(this.uploader,"onBegin",function(){this.showProgress(true);});this.connect(this.uploader,"onProgress","_progress");this.connect(this.uploader,"onComplete",function(){setTimeout(_4.hitch(this,function(){this.hideProgress(true);}),1250);});}else{this._upCheckCnt++;setTimeout(_4.hitch(this,"setUploader"),250);}},hideProgress:function(_7){var o=_7?{ani:true,endDisp:"none",beg:15,end:0}:{endDisp:"none",ani:false};this._hideShowProgress(o);},showProgress:function(_8){var o=_8?{ani:true,endDisp:"block",beg:0,end:15}:{endDisp:"block",ani:false};this._hideShowProgress(o);},_progress:function(_9){this.percentTextNode.innerHTML=_9.percent;_4.style(this.percentBarNode,"width",_9.percent);},_hideShowProgress:function(o){var _a=this.progressNode;var _b=function(){_4.style(_a,"display",o.endDisp);};if(o.ani){_4.style(_a,"display","block");_4.animateProperty({node:_a,properties:{height:{start:o.beg,end:o.end,units:"px"}},onEnd:_b}).play();}else{_b();}},_onUploaderChange:function(_c){this.reset();_4.forEach(_c,function(f,i){this._addRow(i+1,this.getFileType(f.name),f.name,f.size);},this);},_addRow:function(_d,_e,_f,_10){var c,r=this.listNode.insertRow(-1);c=r.insertCell(-1);_4.addClass(c,"dojoxUploaderIndex");c.innerHTML=_d;c=r.insertCell(-1);_4.addClass(c,"dojoxUploaderIcon");c.innerHTML=_e;c=r.insertCell(-1);_4.addClass(c,"dojoxUploaderFileName");c.innerHTML=_f;c=r.insertCell(-1);_4.addClass(c,"dojoxUploaderSize");c.innerHTML=this.convertBytes(_10).value;this.rowAmt++;}});}}};});