ProgressBar.js 1.7 KB

12
  1. //>>built
  2. define("pd/widgets/ProgressBar",["dojo/_base/declare","dijit/ProgressBar","dojo/number","dojo/dom-style"],function(_1,_2,_3,_4){var _5="Infinity";var _6="html5";var _7="flash";var _2=_1("pd/widgets/ProgressBar",[_2],{maxBytesPerLoad:0,previousBytesLoaded:0,init:function(_8){this.uploadType=_8;this.pdHide();this.update({progress:0});},pdHide:function(){_4.set(this.domNode,"display","none");},_pdShow:function(){_4.set(this.domNode,"display","");},_isDeterminate:function(){if(this._getDeterminateMode()&&this._supportDeterminate()){return true;}return false;},_setDeterminateMode:function(_9){this.indeterminate=!_9;if(!_9){this.value=_5;}},_getDeterminateMode:function(){return !this.indeterminate;},_supportDeterminate:function(){return (this.uploadType==_6||this.uploadType==_7);},onStageZero:function(){this._pdShow();this._setDeterminateMode(this._supportDeterminate());this.maxBytesPerLoad=0;this.previousBytesLoaded=0;this.update({stage:0,label:PDMSG.IPT.IDS_IPT_PROGRESS_STAGE_IMPORT});},onStageOne:function(_a){this._pdShow();this.update({stage:1,label:PDMSG.IPT.IDS_IPT_PROGRESS_STAGE_UPLOAD,progress:_a});},onStageTwo:function(_b){var _c=_b||PDMSG.IPT.IDS_IPT_PROGRESS_STAGE_IMPORT;this._pdShow();this._setDeterminateMode(false);this.update({stage:2,label:_c,progress:100});},onStageThree:function(){this._setDeterminateMode(true);this.update({stage:3,progress:100,label:""});var _d=this;setTimeout(function(){_d.pdHide();_d.update({progress:0});},1000);},onCancel:function(){this.pdHide();this.update({progress:0});},report:function(_e){var _f=this.label||" ";if(this._isDeterminate()||(this.stage==undefined||this.stage==3)){_f+=" "+_3.format(_e,{type:"percent",places:this.places,locale:this.lang});}return _f;}});return _2;});