$telerik.findAsyncUpload=$find; $telerik.toAsyncUpload=function(a){return a; }; (function(){var a=$telerik.$,b=Telerik.Web.UI,c={Disabled:0,Automatic:1},d={BelowFileInput:0,AboveFileInput:1}; Type.registerNamespace("Telerik.Web.UI"); b.RadAsyncUpload=function(e){b.RadAsyncUpload.initializeBase(this,[e]); this._pageGUID=null; this._height=""; this._skin=""; this._maxFileSize=0; this._chunkSize=2097152; this._allowedFileExtensions=[]; this._serializedConfiguration=""; this._serializedConfigurationType=""; this._uploadedFiles=[]; this._isManagerRegistered=null; this._autoAddFileInputs=true; this._multipleFileSelection=c.Disabled; this._flashModuleUrl=""; this._silverlightModuleUrl=""; this._enableInlineProgress=true; this._selectedFilesCount=0; this._currentIndex=-1; this._additionalFieldIndex=-1; this._enabled=true; this._handlerUrl=""; this._progressHandlerUrl=""; this._progressAreaUpdater=null; this._fileFilter=null; this._isFileUploaded=false; this._uploadedFilesRendering=d.AboveFileInput; this._accessKey=""; this._isInitializing=false; this._manualUpload=false; this._disableChunkUpload=false; this._dropZones=[]; this._hideFileInput=false; this._tabIndex=0; this._isPaused=false; this._disablePlugins=false; }; b.RadAsyncUpload.prototype={initialize:function(){var k=this,f=k.get_element(),e=a(f); if(this._disablePlugins){this._disableAllPlugins(); }this._initializeUploadModule(); this._initializeProgressTracker(); if(this._getIsRightToLeft()){this._applyRightToLeft(); }this._renderList(); var h=this.get_multipleFileSelectionEnabled()==false?this.get_initialFileInputsCount():1; this._initializeClientState(); if(this._uploadedFiles.length>this._maxFileCount){throw"MaxFileInputsCount property is less than count of the already uploaded files"; }if(this._uploadedFiles.length!=this._maxFileCount){for(var g=0; g0; if(b.RadAsyncUpload.Modules.FileApi.isAvailable()){this._uploadModule=new b.RadAsyncUpload.Modules.FileApi(this); }else{if(b.RadAsyncUpload.Modules.Silverlight.isAvailable()&&!$telerik.isOpera&&!e){this._uploadModule=new b.RadAsyncUpload.Modules.Silverlight(this); }else{if(b.RadAsyncUpload.Modules.Flash.isAvailable()&&!e&&!$telerik.isIE9Mode&&!$telerik.isOpera){this._uploadModule=new b.RadAsyncUpload.Modules.Flash(this); }else{this._uploadModule=new b.RadAsyncUpload.Modules.IFrame(this,this._pageGUID); }}}},_marshalUploadedFiles:function(g){var f=Sys.Serialization.JavaScriptSerializer.deserialize(g),j=f.uploadedFiles; this._uploadedFiles=j; this._selectedFilesCount=j.length; for(var h=0; h'+j[h].fileInfo.FileName+''); e.data("fileInfo",j[h]); a(".ruInputs",this.get_element()).append(e); }},dispose:function(){a(document).off("keydown."+this.get_id()); Telerik.Web.UI.RadAsyncUpload.callBaseMethod(this,"dispose"); a(this.get_element()).off(); this._uploadModule.dispose(); },_pauseFileBrowsing:function(){var e=a(this._element); e.addClass("ruPaused").find(".ruFileInput").attr("disabled","disabled"); this._isPaused=true; },_resumeFileBrowsing:function(){var e=a(this._element); e.find(".ruFileInput").removeAttr("disabled"); e.removeClass("ruPaused"); this._isPaused=false; },addFileInput:function(){var e=this._createStyledRow(); this._isInitializing=true; this._appendStyledRow(e); this._setHoverStateOnBrowseButton(e); this._uploadModule.fileInputAdded(e.children("span")); a.raiseControlEvent(this,"added",{row:e[0],index:e.index()}); this.get_enabled()?this._enable():this._disable(); },saveClientState:function(){return"{'isEnabled':'"+this.get_enabled()+"','uploadedFiles':"+Sys.Serialization.JavaScriptSerializer.serialize(this._uploadedFiles)+"}"; },deleteFileInputAt:function(e,g){var f=a(a("li",this.get_element())[e]); this._deleteFileInput(f,g,true); },deleteAllFileInputs:function(){var e=this._selectedFilesCount,f=0; if(this._uploadedFilesRendering==d.BelowFileInput&&this.get_maxFileCount()!=1){f=1; }for(var g=0; g").addClass("ruInputs").attr("id",this.get_id()+"ListContainer").css("height",this._height); a(this.get_element()).append(e); },_shouldAddNewInputOnDelete:function(){var e=a("li",this.get_element()).size(); if(e==0){return true; }var f; if(this.get_loadedModuleName()=="IFrame"||this.get_loadedModuleName()=="File API"){f="li .ruFileInput"; }else{f="li object"; }return !(a(f,this.get_element()).size()>0); },_deleteFileInput:function(h,i,j){var e=a(h); if(a(".ruUploadSuccess",e).size()>0){var f=e.data("fileInfo"); if(this._onFileUploadRemoving(f,e[0],e.index())){return; }Array.remove(this._uploadedFiles,f); this.updateClientState(); this._uploadModule.rowRemoved(e); if(e.find("span span object").size()==1&&!j){this._markForDeletion(e); }else{e.remove(); }}else{e.remove(); }if(e.find(".ruUploadSuccess, .ruUploadFailure").size()>0){this._selectedFilesCount--; }var g=e.find(".ruUploadProgress").html(); this._onFileUploadRemoved(g); if(this._shouldAddNewInputOnDelete()){this.addFileInput(); }},_cancelUpload:function(e){this._updateRowImage(e,"cancel"); this._updateCancelButton(e); a(".ruFileProgressWrap",e).remove(); this._uploadModule.cancel(e); },_appendCancelButton:function(e){var f=this._createInput("Cancel","ruButton ruCancel","button",this._tabIndex); f.name="RowRemove"; e.appendChild(f); return f; },_appendSelectButton:function(e){var f=this._createInput("Select","ruButton ruBrowse","button","-1"); e.appendChild(f); return f; },_createInput:function(f,e,g,i){var h=this.get_localization(); var j=h[f]; return a("").attr({type:g,tabindex:i,value:j,"class":e})[0]; },_createLabel:function(f){var e=a("