⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isc_foundation.js

📁 javascript 很酷的类库
💻 JS
📖 第 1 页 / 共 5 页
字号:
/*  SmartClient Ajax RIA system  Version 6.5/LGPL Development Only (2008-04-30)  Copyright 2000-2007 Isomorphic Software, Inc. All rights reserved.  "SmartClient" is a trademark of Isomorphic Software, Inc.  LICENSE NOTICE     INSTALLATION OR USE OF THIS SOFTWARE INDICATES YOUR ACCEPTANCE OF THE     SOFTWARE EVALUATION LICENSE AGREEMENT. If you have received this file     without an Isomorphic Software license file, please see:         http://www.isomorphic.com/licenses/isc_eval_license_050316.html     You are not required to accept this agreement, however, nothing else     grants you the right to copy or use this software. Unauthorized copying     and use of this software is a violation of international copyright law.  EVALUATION ONLY     This software is provided for limited evaluation purposes only. You must     acquire a deployment license from Isomorphic Software in order to use     the SmartClient system, or any portion thereof, in any non-evaluation     application, including internal or non-commercial applications.  PROPRIETARY & PROTECTED MATERIAL     This software contains proprietary materials that are protected by     contract and intellectual property law. YOU ARE EXPRESSLY PROHIBITED     FROM ATTEMPTING TO REVERSE ENGINEER THIS SOFTWARE OR MODIFY THIS     SOFTWARE FOR HUMAN READABILITY.  CONTACT ISOMORPHIC     For more information regarding license rights and restrictions, or to     report possible license violations, please contact Isomorphic Software     by email (licensing@isomorphic.com) or web (www.isomorphic.com).*/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)}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -