📄 isc_foundation.js
字号:
/*
* Isomorphic SmartClient
* Version 6.5 (2008-04-30)
* Copyright(c) 1998-2007 Isomorphic Software, Inc. All rights reserved.
* "SmartClient" is a trademark of Isomorphic Software, Inc.
*
* licensing@smartclient.com
*
* http://smartclient.com/license
*/
if(window.isc&&window.isc.module_Core&&!window.isc.module_Foundation){isc.module_Foundation=1;isc._moduleStart=isc._Foundation_start=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc._moduleEnd&&(!isc.Log||(isc.Log && isc.Log.logIsDebugEnabled('loadTime')))){isc._pTM={ message:'Foundation load/parse time: ' + (isc._moduleStart-isc._moduleEnd) + 'ms', category:'loadTime'};if(isc.Log && isc.Log.logDebug)isc.Log.logDebug(isc._pTM.message,'loadTime')else if(isc._preLog)isc._preLog[isc._preLog.length]=isc._pTMelse isc._preLog=[isc._pTM]}isc.ClassFactory.defineClass("Animation");isc.A=isc.Animation;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.interval=40;isc.A.registry=[];isc.A.animateTime=1000;isc.B.push(isc.A.smoothStart=function(_1){return Math.pow(_1,2)},isc.A.smoothEnd=function(_1){return 1-Math.abs(Math.pow(_1-1,2))},isc.A.smoothStartEnd=function(_1){return(-Math.cos(_1*Math.PI)+1)/2.0});isc.B._maxIndex=isc.C+3;isc.A=isc.Animation;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$0c="ratio,ID,earlyFinish";isc.B.push(isc.A.generateAnimationID=function(){if(!this.$0d)this.$0d=0;return"_"+(this.$0d++)},isc.A.timeoutAction=function(){if(isc.Animation)isc.Animation.fireTimer()},isc.A.registerAnimation=function(_1,_2,_3,_4){if(!this.$0e){this.$0e=isc.Timer.setTimeout(this.timeoutAction,this.interval);this.$0f=isc.timeStamp()}if(!_4)_4=this;if(!_2)_2=this.animateTime;if(isc.isA.String(_3)){if(!isc.Animation.accelerationMap){isc.Animation.accelerationMap={smoothStart:isc.Animation.smoothStart,smoothEnd:isc.Animation.smoothEnd,smoothStartEnd:isc.Animation.smoothStartEnd}}_3=isc.Animation.accelerationMap[_3]}var _5=this.generateAnimationID();this.registry.add({ID:_5,target:_4,callback:_1,duration:_2,elapsed:0,totalFrames:Math.round(_2/ this.interval),currentFrame:0,maxDuration:_2*3,acceleration:_3});return _5},isc.A.clearAnimation=function(_1){for(var i=0;i<this.registry.length;i++){if(this.registry[i].ID==_1){this.registry.removeAt(i);break}}},isc.A.finishAnimation=function(_1){for(var i=0;i<this.registry.length;i++){if(this.registry[i].ID==_1){var _3=this.registry[i];break}}this.clearAnimation(_1);this.fireAction(_3,1,true)},isc.A.fireTimer=function(){var _1=isc.timeStamp(),_2=(_1-this.$0f),_3=Math.max(0,this.interval-(_2-this.interval));this.$0e=isc.Timer.setTimeout(this.timeoutAction,_3);this.$0f=_1;for(var i=0;i<this.registry.length;i++){var _5=this.registry[i];if(_5==null)continue;_5.elapsed+=_2;var _6=_5.currentFrame+1;if(!isc.Animation.timeBased&&((_5.elapsed/ _5.maxDuration)>(_6/ _5.totalFrames))){_6=Math.min(_5.totalFrames,Math.ceil((_5.elapsed/ _5.maxDuration)*_5.totalFrames))}_5.currentFrame=_6;var _7=isc.Animation.timeBased?_5.elapsed/ _5.duration:_5.currentFrame/ _5.totalFrames;var _8=_7,_9=_5.acceleration;if(_9&&isc.isA.Function(_9)){try{_8=_5.acceleration(_8)}catch(e){this.logWarn("Custom ratio function for animation:"+isc.Log.echoAll(_5)+"\nCaused an error:"+(e.message?e.message:e));_5.acceleration=null}}if(_7>=1){_8=1;this.registry[i]=null}var _10=null;try{_10=this.fireAction(_5,_8)}catch(e){_10=e}if(_10!=null){this.logWarn("Attempt to fire registered animation:"+isc.Log.echoAll(_5)+"\nCaused an error:"+(_10.message?_10.message:_10));this.registry[i]=null}if(_7>=1){this.logDebug("animation "+_5.ID+" completed","animation")}}this.registry.removeEmpty();if(this.registry.length==0){isc.Timer.clearTimeout(this.$0e);this.$0e=null}},isc.A.fireAction=function(_1,_2,_3){var _4=_1.target;if(!_4||_4.destroyed){return"No valid target. Target may have been destroyed since animation commenced"}_4.fireCallback(_1.callback,this.$0c,[_2,_1.ID,_3])},isc.A.isActive=function(){return(this.registry&&this.registry.length>0)});isc.B._maxIndex=isc.C+8;isc.A=isc.Canvas.getPrototype();isc.A.animateTime=300;isc.A.animateAcceleration="smoothEnd";isc.A.$0g=["rect","fade","scroll","show","hide"];isc.A=isc.Canvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.$0h={};isc.A.$0i={};isc.A.$0j={};isc.A.$0k={};isc.A.$0l={};isc.A.$0m="move";isc.A.$nx="resize";isc.A.$0n="rect";isc.A.$do="show";isc.A.$0o="slide";isc.A.$0p="wipe";isc.A.$0q="fade";isc.A.$0r="fly";isc.A.$0s="T";isc.A.$0t="L";isc.A.$0u={slide:"show",wipe:"show",fly:"move",fade:"fade"};isc.A.$zb="hide";isc.A.$0v={slide:"hide",wipe:"hide",fly:"move",fade:"fade"};isc.B.push(isc.A.registerAnimation=function(_1,_2,_3){if(!_3)_3=this.animationAcceleration;if(!_2)_2=this.animateTime;return isc.Animation.registerAnimation(_1,_2,_3,this)},isc.A.cancelAnimation=function(_1){isc.Animation.clearAnimation(_1)},isc.A.getAnimateTime=function(_1){if(!isc.isA.String(_1)||isc.isAn.emptyString(_1))return this.animateTime;if(!this.$0h[_1]){this.$0h[_1]="animate"+_1.substring(0,1).toUpperCase()+_1.substring(1)+"Time"}return this[this.$0h[_1]]||this.animateTime},isc.A.getAnimateAcceleration=function(_1){if(!isc.isA.String(_1)||isc.isAn.emptyString(_1))return this.animateAcceleration;if(!this.$0i[_1]){this.$0i[_1]="animate"+_1.substring(0,1).toUpperCase()+_1.substring(1)+"Acceleration"}return this[this.$0i[_1]]||this.animateAcceleration},isc.A.$0w=function(_1){if(!this.$0j[_1]){this.$0j[_1]=_1+"Animation"}return this.$0j[_1]},isc.A.$0x=function(_1){if(!this.$0k[_1]){this.$0k[_1]="fireAnimation"+_1.substring(0,1).toUpperCase()+_1.substring(1)}return this.$0k[_1]},isc.A.$0y=function(_1,_2,_3,_4){var _5=this.$0w(_1);if(this[_5])this.finishAnimation(_1);if(!this.$0l[_1])this.$0l[_1]="$"+_1+"AnimationInfo";this[this.$0l[_1]]=_2;if(_3==null)_3=this.getAnimateTime(_1);if(_4==null)_4=this.getAnimateAcceleration(_1);var _6=this[_5]=this.registerAnimation(this[this.$0x(_1)],_3,_4);if(this.logIsInfoEnabled("animation")){this.logInfo("starting animation "+_6+" of type: "+_1+", duration: "+_3+", acceleration: "+this.echoLeaf(_4),"animation")}return _6},isc.A.$0z=function(_1,_2,_3){if(!_1)return;var _4=this;var _5=function(){_4.fireCallback(_1,"earlyFinish",[_2])}if(_2||_3){_5()}else{isc.Timer.setTimeout(_5,0)}},isc.A.finishAnimation=function(_1){if(_1==null){for(var i=0;i<this.$0g.length;i++){this.finishAnimation(this.$0g[i])}return}var _3=this.$0w(_1);if(!this[_3])return;if(this.logIsInfoEnabled("animation")){this.logInfo("manual finish for animations: "+this.echoAll(this[_3])+(this.logIsDebugEnabled("animation")?this.getStackTrace():""),"animation")}isc.Animation.finishAnimation(this[_3])},isc.A.animateMove=function(_1,_2,_3,_4,_5){return this.animateRect(_1,_2,null,null,_3,_4,_5,this.$0m)},isc.A.fireAnimationMove=function(_1,_2,_3){return this.fireAnimationRect(_1,_2,_3,this.$0m)},isc.A.animateResize=function(_1,_2,_3,_4,_5){return this.animateRect(null,null,_1,_2,_3,_4,_5,this.$nx)},isc.A.fireAnimationResize=function(_1,_2,_3){return this.fireAnimationRect(_1,_2,_3,this.$nx)},isc.A.animateRect=function(_1,_2,_3,_4,_5,_6,_7,_8){if(_8==null){_8=this.$0n;if(this.resizeAnimation!=null)this.finishAnimation(this.$nx);if(this.moveAnimation!=null)this.finishAnimation(this.$0m)}var _9={$00:this.getRect(),_left:_1,_top:_2,$02:_3,$o8:_4,$03:_5};return this.$0y(_8,_9,_6,_7)},isc.A.fireAnimationRect=function(_1,_2,_3,_4){var _5=(_4==this.$nx?this.$resizeAnimationInfo:(_4==this.$0m?this.$moveAnimationInfo:this.$rectAnimationInfo)),_6=_5.$00,_7=_5._left,_8=_5._top,_9=_5.$02,_10=_5.$o8,_11=_7!=null?this.$04(_6[0],_7,_1):null,_12=_8!=null?this.$04(_6[1],_8,_1):null;var _13,_14;if(_9!=null&&_11!=null&&(_7-_6[0]!=0)){var _15=(_9-_6[2])/(_7-_6[0]);if(Math.floor(_15)==_15){_13=_6[2]+(_15*(_11-_6[0]))}}if(_10!=null&&_12!=null&&(_8-_6[1]!=0)){var _15=(_10-_6[3])/(_8-_6[1]);if(Math.floor(_15)==_15){_14=_6[3]+(_15*(_12-_6[1]))}}if(_13==null&&_9!=null){_13=this.$04(_6[2],_9,_1)}if(_14==null&&_10!=null){_14=this.$04(_6[3],_10,_1)}if(_1==1){if(_4==this.$nx){delete this.$resizeAnimationInfo;delete this.resizeAnimation}else if(_4==this.$0m){delete this.$moveAnimationInfo;delete this.moveAnimation}else{delete this.$rectAnimationInfo;delete this.rectAnimation}}this.setRect(_11,_12,_13,_14,(_1<1));if(this.isDirty())this.redraw("animated resize");if(_1==1){this.$0z(_5.$03,_3)}},isc.A.$04=function(_1,_2,_3){if(_2==null)return _1;return(_1+Math.floor(_3*(_2-_1)))},isc.A.animateFade=function(_1,_2,_3,_4){if(this.visibility==isc.Canvas.HIDDEN){this.setOpacity(0);this.show()}if(_1==null)_1=100;var _5={$05:this.opacity!=null?this.opacity:100,$06:_1,$03:_2};return this.$0y("fade",_5,_3,_4)},isc.A.fireAnimationFade=function(_1,_2,_3){var _4=this.$fadeAnimationInfo,_5=_4.$05,_6=_4.$06;var _7=this.$04(_5,_6,_1);if(isc.Browser.isIE&&_7>0&&!_4.$07){var _8=this.getStyleHandle();_8.visibility=isc.Canvas.VISIBLE;_8.visibility=isc.Canvas.INHERIT;_4.$07=true}if(_1==1){delete this.$fadeAnimationInfo;delete this.fadeAnimation}this.setOpacity(_7,(_1<1));if(_1==1)this.$0z(_4.$03,_3)},isc.A.animateScroll=function(_1,_2,_3,_4,_5){var _6=this.overflow;if(this.overflow==isc.Canvas.VISIBLE)return;var _7={$08:this.getScrollLeft(),$09:this.getScrollTop(),$1a:_1,$1b:_2,$03:_3};return this.$0y("scroll",_7,_4,_5)},isc.A.fireAnimationScroll=function(_1,_2,_3){var _4=this.$scrollAnimationInfo,_5=_4.$08,_6=_4.$1a,_7=_4.$09,_8=_4.$1b,_9=this.$04(_5,_6,_1),_10=this.$04(_7,_8,_1);if(_1==1){delete this.$scrollAnimationInfo;delete this.scrollAnimation}this.scrollTo(_9,_10,null,(_1<1));if(_1==1&&_4.$03){this.$0z(_4.$03,_3)}},isc.A.animateShow=function(_1,_2,_3,_4){var _5;if(isc.isAn.Object(_1)){_5=_1;_1=_1.effect}if(this.$va!=null)this.finishAnimation(this.$va);if(this.isDrawn()&&this.isVisible())return;if(this.$vc!=null)return;this.$vc=this.$0u[_1]||this.$do;this.$1c=_2;if(!this.$1d)this.$1d={target:this,methodName:"animateShowComplete"}if(_1==this.$0q){var _6=this.opacity;this.$1e=_2;this.setOpacity(0);this.show();if(_3==null)_3=this.animateShowTime;if(_4==null)_4=this.animateShowAcceleration;return this.animateFade(_6,this.$1d,_3,_4)}else if(_1==this.$0r){if(this.parentElement!=null){this.logInfo("animateShow() called with 'fly' effect - not supported for child widgets"+" defaulting to standard 'wipe' animation instead.","animation");_1=this.$0p}else{if(_3==null)_3=this.animateShowTime;if(_4==null)_4=this.animateShowAcceleration;var _7=this.isRTL(),_8=this.getLeft(),_9=_7?isc.Page.getWidth()+isc.Page.getScrollLeft():0-this.getVisibleWidth();this.setLeft(_9);this.show();return this.animateMove(_8,null,this.$1d,_3,_4)}}if(!this.$1f(_1)){this.logInfo("not animating show, can't do clip animations","animation");this.show();if(_2)this.animateShowComplete(true);return}if(this.isVisible())this.hide();if(!this.isDrawn()){if(this.parentElement&&!this.parentElement.isDrawn()){this.show();this.logInfo("not animating show, component not drawn","animation");if(_2)this.animateShowComplete(true);return}else{this.draw()}}var _10=this.getVisibleHeight(),_11=this.getVisibleWidth(),_12=_5?_5.startFrom==this.$0s:true,_13=(_12?this.getScrollTop():this.getScrollLeft()),_14=(_1=="slide"),_15={$po:this.$po,$1g:this.getHeight(),$1h:_10,$pn:this.$pn,$1i:this.getWidth(),$1j:_11,$1k:this.overflow,$1l:_12,$1m:_13,$1n:_14,$03:this.$1d};if(_12){if(this.vscrollOn&&this.vscrollbar){_15.$495=this.vscrollbar.thumb.getTop();_15.$496=this.vscrollbar.thumb.getHeight();if(this.vscrollbar.thumb){this.vscrollbar.thumb.$jq=false;this.vscrollbar.thumb.$493=true}this.vscrollbar.$494=true;this.vscrollbar.$493=true;this.vscrollbar.setHeight(1)}if(this.hscrollOn&&this.hscrollbar){this.hscrollbar.$493=true;if(this.hscrollbar.thumb)this.hscrollbar.thumb.$493=true;if(!_15.$1n){this.hscrollbar.$jq=false}else{this.hscrollbar.setTop(this.getTop());this.hscrollbar.setHeight(1)}}}else{if(this.hscrollOn&&this.hscrollbar){_15.$495=this.hscrollbar.thumb.getLeft();_15.$496=this.hscrollbar.thumb.getWidth();this.hscrollbar.$494=true;this.hscrollbar.$493=true;if(this.hscrollbar.thumb){this.hscrollbar.thumb.$jq=false;this.hscrollbar.thumb.$493=true}this.hscrollbar.setWidth(1)}if(this.vscrollOn&&this.vscrollbar){this.vscrollbar.$493=true;if(this.vscrollbar.thumb)this.vscrollbar.thumb.$493=true;if(!_15.$1n){this.vscrollbar.$jq=false}else{this.vscrollbar.setLeft(this.getLeft());this.vscrollbar.setWidth(1)}}}if(this.showEdges&&this.$l0){this.$l0.$za=true}if(this.overflow==isc.Canvas.VISIBLE){this.setOverflow(isc.Canvas.HIDDEN)}if(this.overflow==isc.Canvas.AUTO||this.overflow==isc.Canvas.SCROLL){this.$417=true}this.resizeTo((_12?_11:1),(_12?1:_10),true);if(_14)this.scrollTo((_12?null:_13+(_11-1)),(_12?_13+(_10-1):null));if(this.showEdges&&this.$l0){if(_12)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -