Browse files

Changed this file:

modified:   anim/StyleTransition-test.html
  • Loading branch information...
1 parent 960805e commit 1a7eee075e96514b14631a5e0895e8da0fe58991 @GarrettS committed Jul 25, 2009
View
2 build/anim/StyleTransition-min.js
@@ -1 +1 @@
-APE.anim.StyleTransition=function(D,A,B,C){APE.anim.Animation.call(this,B);if(D.id){D=D.id}this.id=D;this.adapters=[];this.style=document.getElementById(D).style;if(C){this.transition=C}this.init(A)};APE.extend(APE.anim.StyleTransition,APE.anim.Animation,{inited:false,run:function run(E){var C=0,D=this.adapters,A=D.length,B;while(C<A){B=D[C++];this.style[B.prop]=B.blendTo(E)}},init:function(J){if(this.inited){return}var D=document.getElementById(this.id),M=[],K,E=window.APE,C,H,B,G,F=E.dom,I=E.anim.TransitionAdapterFactory,A=I.ThresholdTransitionAdapter,L=I.ImmediateThresholdTransitionAdapter;for(C in J){G=J[C];if(!G){continue}if(C=="opacity"&&!("opacity" in this.style)&&("filter" in this.style)){C="alpha";this.style.zoom="1";B=F.getFilterOpacity(D)}else{if(C=="clip"&&(!B||B.indexOf("auto")!=-1)){B="rect(0px "+D.offsetWidth+"px "+D.offsetHeight+"px 0px)"}else{H=F.getStyleUnit(G);B=F.findInheritedStyle(D,C,H)}}K=I.fromValues(C,B,G);M.push(K)}M.sort(function(O,N){return(O instanceof L?-1:1)});this.adapters=M},toString:function(){return"StyleTransitionAdapter : id=#"+this.id+"\n"+APE.anim.Animation.prototype.toString.call(this)+"\nAdapters:\n "+this.adapters.join("\n ")}});APE.anim.TransitionAdapterFactory={lengthExp:/(^-?\d+|(?:-?\d*\.\d+))(px|em|ex|pt|pc|in|cm|mm|%)/i,colorExp:/color/i,positiveLengthExp:/(?:width|height|padding|fontSize)$/ig,filterExp:/alpha/,opacityExp:/^opacity/,intExp:/^\d+$/,noVisibilityExp:/^(?:hidden|collapse)/,fromValues:function(C,B,A){if(this.positiveLengthExp.test(C)){return new this.PositiveLengthTransitionAdapter(C,B,A)}if(this.colorExp.test(C)){return new this.ColorTransitionAdapter(C,B,A)}if(C=="clip"){return new this.ClipTransitionAdapter(C,B,A)}if(this.lengthExp.test(B)){return new this.LengthTransitionAdapter(C,B,A)}if(this.filterExp.test(C)){return new this.FilterTransitionAdapter(C,B,A)}if(this.opacityExp.test(C)){return new this.OpacityTransitionAdapter(C,B,A)}if(C=="fontWeight"&&this.intExp.test(B)&&this.intExp.test(A)){return new this.FontWeightTransitionAdapter(C,B,A)}if(C=="visibility"&&this.noVisibilityExp.test(B)||C=="display"&&B=="none"){return new this.ImmediateThresholdTransitionAdapter(C,B,A)}return new this.ThresholdTransitionAdapter(C,B,A)}};(function(){var E=window.APE,C=E.color&&E.color.ColorRGB,J={PositiveLengthTransitionAdapter:H,ColorTransitionAdapter:F,LengthTransitionAdapter:N,FilterTransitionAdapter:K,OpacityTransitionAdapter:D,FontWeightTransitionAdapter:P,ThresholdTransitionAdapter:A,ImmediateThresholdTransitionAdapter:M,ClipTransitionAdapter:I};E.mixin(E.anim.TransitionAdapterFactory,J);function G(T,S,Q,R){this.prop=T;this.fromValue=S;this.toValue=Q;if(R){this.units=R}}G.prototype.toString=function(){var Q=(this.units||"");return E.getFunctionName(this.constructor)+": "+this.prop+", "+this.fromValue.toString()+Q+" \u2014 "+this.toValue.toString()+Q};function F(U,T,Q){if(!C){C=E.color.ColorRGB}var S=C.fromString(T),R=Q=C.fromString(Q);G.call(this,U,S,R);this.currentValue=new C()}E.extend(F,G,{blendTo:function(Q){var R=C.blend(this.fromValue,this.toValue,Q,this.currentValue);return R.toString()}});function N(V,U,Q){var R=E.anim.TransitionAdapterFactory.lengthExp,T=R.exec(U),S=R.exec(Q);G.call(this,V,parseFloat(T[0]),parseFloat(S[0]),T[2])}E.extend(N,G);N.prototype.blendTo=function(R){var Q=1-R;return((this.fromValue*Q)+(this.toValue*R))+this.units};function H(){N.apply(this,arguments)}E.extend(H,N);H.prototype.blendTo=function(S){var Q=1-S,R=Math.max((this.fromValue*Q)+(this.toValue*S),0)+this.units;return R};var B=/,?\s/,O=/rect\(([^\)]+)\)/,L=/0(\s|\))/g;function I(U,S,Q){this.prop="clip";var T=O.exec(S.replace(L,"0px$1"))[1],R=O.exec(Q.replace(L,"0px$1"))[1];this.fromValues=T.split(B);this.toValues=R.split(B);this.clips=[];this.values=[];this.init()}I.prototype={init:function(){for(var R=0,S,Q;R<4;R++){S=this.fromValues[R],Q=this.toValues[R];if(S=="0"){S="0px"}if(Q=="0"){Q="0px"}this.clips[R]=new N(this.prop,S,Q)}},blendTo:function(R){for(var Q=0;Q<4;Q++){this.values[Q]=this.clips[Q].blendTo(R)}return"rect("+this.values.join(" ")+")"},toString:function(){return"ClipTransitionAdapter: \n"+this.clips.join(" \n")}};function D(S,R,Q){G.call(this,S,parseFloat(R),parseFloat(Q))}E.extend(D,G);D.prototype.blendTo=function(S){var Q=1-S,R=Math.max((this.fromValue*Q)+(this.toValue*S),0);return R};function K(S,R,Q){G.call(this,"filter",R,Q)}E.extend(K,G);K.prototype.blendTo=function(S){var Q=1-S,R=Math.abs((this.fromValue*Q)+(this.toValue*S),0);return"alpha(opacity="+Math.abs(R*100)+")"};function P(S,R,Q){G.call(this,S,parseInt(R),parseInt(Q))}E.extend(P,G);P.prototype.blendTo=function(S){var Q=1-S,R=(((this.fromValue*Q)+(this.toValue*S))/100<<0)*100;if(R<100){return 100}if(R>900){return 900}return R};function A(S,R,Q){G.call(this,S,R,Q)}E.extend(A,G);A.prototype.blendTo=function(Q){if(Q==1){return this.toValue}return this.fromValue};function M(S,R,Q){G.call(this,S,R,Q)}E.extend(M,G);M.prototype.blendTo=function(Q){if(Q==0){return this.fromValue}return this.toValue}})();
+APE.anim.StyleTransition=function(D,A,B,C){APE.anim.Animation.call(this,B);if(D.id){D=D.id}this.id=D;this.adapters=[];this.style=document.getElementById(D).style;if(C){this.transition=C}this.init(A)};APE.extend(APE.anim.StyleTransition,APE.anim.Animation,{inited:false,run:function run(E){var C=0,D=this.adapters,A=D.length,B;while(C<A){B=D[C++];this.style[B.prop]=B.blendTo(E)}},init:function(J){if(this.inited){return}var D=document.getElementById(this.id),M=[],K,E=window.APE,C,H,B,G,F=E.dom,I=E.anim.TransitionAdapterFactory,A=I.ThresholdTransitionAdapter,L=I.ImmediateThresholdTransitionAdapter;for(C in J){G=J[C];if(!G){continue}if(C=="opacity"&&!("opacity" in this.style)&&("filter" in this.style)){C="alpha";this.style.zoom="1";B=F.getFilterOpacity(D)}else{H=F.getStyleUnit(G);B=F.findInheritedStyle(D,C,H)}K=I.fromValues(C,B,G);M.push(K)}M.sort(function(O,N){return(O instanceof L?-1:1)});this.adapters=M},toString:function(){return"StyleTransitionAdapter : id=#"+this.id+"\n"+APE.anim.Animation.prototype.toString.call(this)+"\nAdapters:\n "+this.adapters.join("\n ")}});APE.anim.TransitionAdapterFactory={lengthExp:/(^-?\d+|(?:-?\d*\.\d+))(px|em|ex|pt|pc|in|cm|mm|%)/i,colorExp:/color/i,positiveLengthExp:/(?:width|height|padding|fontSize)$/ig,filterExp:/alpha/,opacityExp:/^opacity/,intExp:/^\d+$/,noVisibilityExp:/^(?:hidden|collapse)/,fromValues:function(C,B,A){if(this.positiveLengthExp.test(C)){return new this.PositiveLengthTransitionAdapter(C,B,A)}if(this.colorExp.test(C)){return new this.ColorTransitionAdapter(C,B,A)}if(this.lengthExp.test(B)){return new this.LengthTransitionAdapter(C,B,A)}if(this.filterExp.test(C)){return new this.FilterTransitionAdapter(C,B,A)}if(this.opacityExp.test(C)){return new this.OpacityTransitionAdapter(C,B,A)}if(C=="fontWeight"&&this.intExp.test(B)&&this.intExp.test(A)){return new this.FontWeightTransitionAdapter(C,B,A)}if(C=="visibility"&&this.noVisibilityExp.test(B)||C=="display"&&B=="none"){return new this.ImmediateThresholdTransitionAdapter(C,B,A)}return new this.ThresholdTransitionAdapter(C,B,A)}};(function(){var D=window.APE,B=D.color&&D.color.ColorRGB,H={PositiveLengthTransitionAdapter:G,ColorTransitionAdapter:E,LengthTransitionAdapter:L,FilterTransitionAdapter:I,OpacityTransitionAdapter:C,FontWeightTransitionAdapter:M,ThresholdTransitionAdapter:A,ImmediateThresholdTransitionAdapter:K};D.mixin(D.anim.TransitionAdapterFactory,H);function F(Q,P,N,O){this.prop=Q;this.fromValue=P;this.toValue=N;if(O){this.units=O}}F.prototype.toString=function(){var N=(this.units||"");return D.getFunctionName(this.constructor)+": "+this.prop+", "+this.fromValue.toString()+N+" \u2014 "+this.toValue.toString()+N};function E(R,Q,N){if(!B){B=D.color.ColorRGB}var P=B.fromString(Q),O=N=B.fromString(N);F.call(this,R,P,O);this.currentValue=new B()}D.extend(E,F,{blendTo:function(N){var O=B.blend(this.fromValue,this.toValue,N,this.currentValue);return O.toString()}});function L(S,R,N){var O=D.anim.TransitionAdapterFactory.lengthExp,Q=O.exec(R),P=O.exec(N);F.call(this,S,parseFloat(Q[0]),parseFloat(P[0]),Q[2])}D.extend(L,F);L.prototype.blendTo=function(O){var N=1-O;return((this.fromValue*N)+(this.toValue*O))+this.units};function G(){L.apply(this,arguments)}D.extend(G,L);G.prototype.blendTo=function(P){var N=1-P,O=Math.max((this.fromValue*N)+(this.toValue*P),0)+this.units;return O};var J=/0(\s|\))/g;function C(P,O,N){F.call(this,P,parseFloat(O),parseFloat(N))}D.extend(C,F);C.prototype.blendTo=function(P){var N=1-P,O=Math.max((this.fromValue*N)+(this.toValue*P),0);return O};function I(P,O,N){F.call(this,"filter",O,N)}D.extend(I,F);I.prototype.blendTo=function(P){var N=1-P,O=Math.abs((this.fromValue*N)+(this.toValue*P),0);return"alpha(opacity="+Math.abs(O*100)+")"};function M(P,O,N){F.call(this,P,parseInt(O),parseInt(N))}D.extend(M,F);M.prototype.blendTo=function(P){var N=1-P,O=(((this.fromValue*N)+(this.toValue*P))/100<<0)*100;if(O<100){return 100}if(O>900){return 900}return O};function A(P,O,N){F.call(this,P,O,N)}D.extend(A,F);A.prototype.blendTo=function(N){if(N==1){return this.toValue}return this.fromValue};function K(P,O,N){F.call(this,P,O,N)}D.extend(K,F);K.prototype.blendTo=function(N){if(N==0){return this.fromValue}return this.toValue}})();
View
53 build/anim/StyleTransition.js
@@ -79,14 +79,8 @@ APE.extend(APE.anim.StyleTransition, APE.anim.Animation, {
this.style.zoom = "1";
fromValue = dom.getFilterOpacity(el);
} else {
- if (prop == 'clip'
- && (!fromValue || fromValue.indexOf("auto") != -1)) {
- fromValue = "rect(0px " + el.offsetWidth + "px "
- + el.offsetHeight + "px 0px)";
- } else {
- units = dom.getStyleUnit(toValue);
- fromValue = dom.findInheritedStyle(el, prop, units);
- }
+ units = dom.getStyleUnit(toValue);
+ fromValue = dom.findInheritedStyle(el, prop, units);
}
// Get a ITransitionAdapter from the factory.
adapter = TransitionAdapterFactory.fromValues(prop, fromValue,
@@ -147,8 +141,6 @@ APE.anim.TransitionAdapterFactory = {
}
if (this.colorExp.test(prop))
return new this.ColorTransitionAdapter(prop, fromValue, toValue);
- if (prop == 'clip')
- return new this.ClipTransitionAdapter(prop, fromValue, toValue);
if (this.lengthExp.test(fromValue)) {
return new this.LengthTransitionAdapter(prop, fromValue, toValue);
}
@@ -183,8 +175,7 @@ APE.anim.TransitionAdapterFactory = {
OpacityTransitionAdapter : OpacityTransitionAdapter,
FontWeightTransitionAdapter : FontWeightTransitionAdapter,
ThresholdTransitionAdapter : ThresholdTransitionAdapter,
- ImmediateThresholdTransitionAdapter : ImmediateThresholdTransitionAdapter,
- ClipTransitionAdapter : ClipTransitionAdapter
+ ImmediateThresholdTransitionAdapter : ImmediateThresholdTransitionAdapter
};
APE.mixin(APE.anim.TransitionAdapterFactory, Adapters);
@@ -262,43 +253,7 @@ APE.anim.TransitionAdapterFactory = {
return v;
};
- var splitClipExp = /,?\s/, clipExp = /rect\(([^\)]+)\)/, zeroToPxExp = /0(\s|\))/g;
-
- function ClipTransitionAdapter(prop, fromValue, toValue) {
- this.prop = "clip";
-
- var fromString = clipExp.exec(fromValue.replace(zeroToPxExp, "0px$1"))[1], toString = clipExp
- .exec(toValue.replace(zeroToPxExp, "0px$1"))[1];
-
- this.fromValues = fromString.split(splitClipExp);
- this.toValues = toString.split(splitClipExp);
- this.clips = [];
- this.values = [];
- this.init();
- }
-
- ClipTransitionAdapter.prototype = {
- init : function() {
- for (var i = 0, f, t; i < 4; i++) {
- f = this.fromValues[i], t = this.toValues[i];
- if (f == "0")
- f = "0px";
- if (t == "0")
- t = "0px";
- this.clips[i] = new LengthTransitionAdapter(this.prop, f, t);
- }
- },
-
- blendTo : function(rationalValue) {
- for (var i = 0; i < 4; i++)
- this.values[i] = this.clips[i].blendTo(rationalValue);
- return "rect(" + this.values.join(" ") + ")";
- },
-
- toString : function() {
- return "ClipTransitionAdapter: \n" + this.clips.join(" \n");
- }
- };
+ var zeroToPxExp = /0(\s|\))/g;
/** @ignore */
function OpacityTransitionAdapter(prop, fromValue, toValue) {
View
2 build/anim/anim-min.js
@@ -1 +1 @@
-APE.anim.Animation=function(A){if(typeof A=="number"){this.duration=A*1000}this.timeLimit=this.duration};APE.anim.Animation.prototype={paused:false,duration:1000,timeLimit:1000,isReversed:false,startOffset:0,endOffset:1,startValue:0,endValue:1,rationalValue:0,transition:function(A){return A},position:0,onstart:function(){},onend:function(){},onabort:function(A){throw A},run:function(){},start:function(){if(this.paused){return}this.playing=true;this.timeLimit=this.duration;this.endOffset=this.transition(this.endValue);this._start()},_start:function(){APE.anim.Manager.unregister(this);this._startTime=new Date-0;this.onstart();APE.anim.Manager.register(this);this.started=true},seekTo:function(C,A){C=parseFloat(C);if(!isFinite(C)){return}if(C===this.rationalValue){return}this.startOffset=this.position;this.startValue=this.rationalValue;this.endValue=C;var B=Math.abs(C-this.startValue);this.timeLimit=this.duration*B;this.isReversed=(C<this.rationalValue);this._transitionBackwards=this.isReversed&&A;if(this._transitionBackwards){this.endOffset=1-this.transition(1-C)}else{this.endOffset=this.transition(C)}this._start()},toggleDirection:function(){if(!this.started){this.start();return}if(this.isReversed){this.seekTo(1)}else{this.seekTo(0,this.position==1)}},reset:function(){this.position=0;this.timeLimit=this.duration},pause:function(){this.paused=true;this.elapsedTime=new Date-this._startTime;APE.anim.Manager.unregister(this)},resume:function(){this.paused=false;this._startTime=new Date-this.elapsedTime;APE.anim.Manager.register(this)},_playFrame:function(){var A=new Date-this._startTime;if(A>=this.timeLimit){this.run(this.position=this.endOffset);this.rationalValue=this.endValue;this._end();return}var B=(A/this.duration);if(this.isReversed){this.rationalValue=this.startValue-B;if(this._transitionBackwards){this.position=1-this.transition(1-this.rationalValue)}else{this.position=this.transition(this.rationalValue)}}else{this.rationalValue=this.startValue+B;this.position=this.transition(this.rationalValue)}if(typeof this.onplay=="function"){this.onplay(this.position)}this.run(this.position)},toString:function(){return"Animation {duration millis: "+this.duration+", position:"+this.position+"}"},stop:function(A){this._end(A)},abort:function(A){APE.anim.Manager.unregister(this);this.onabort(A||{})},_end:function(A){APE.anim.Manager.unregister(this);if(A!==false){this.onend()}}};APE.anim.Manager=new function(){this.register=E;this.unregister=C;var A=[],F;function E(J){if(A.length===0){H.call(this)}for(var I=0;I<A.length;I++){if(A[I]===J){return}}A.push(J)}function C(J){for(var I=0;I<A.length;I++){if(A[I]===J){A.splice(I,1)}}if(A.length==0){A=[];B.call(this)}}this.toString=function(){return"APE.anim.Manager : activeAnimations:\n"+A.join("\n ")};var D;function H(){D=new Date;var I=17;F=window.setInterval(G,I)}function G(){var J=0,K;for(;J<A.length;J++){K=A[J];try{K._playFrame()}catch(I){K.abort(I)}}}function B(){window.clearInterval(F)}};APE.anim.Transitions={none:function(A){return A},accel:function(A){return A*A*A},decel:function(A){A=1-A;return 1-(A*A*A)},reverse:function(A){return 1-A},sigmoid:function(C,A){var B=Math.atan;A=A||1;return(B(A*(2*C-1))/B(A)+1)/(2)},sigmoid2:function(B){var A=Math.atan;return(A(2*(2*B-1))/A(2)+1)/(2)},sigmoid3:function(B){var A=Math.atan;return(A(3*(2*B-1))/A(3)+1)/(2)},sigmoid4:function(B){var A=Math.atan;return(A(4*(2*B-1))/A(4)+1)/(2)},tan:function(B){var A=Math.tan;return(A(1*(2*B-1))/A(1)+1)/(2)},reverseWarp:function(B){var A=Math.tan;return(A(2*(2*B-1))/A(2)+1)/(2)},easeInEaseOut:function(B){var A=Math.PI;return(Math.atan(B*A/1-A/2)+1)/2.0038848218538874},wobble:function(A){return(-Math.cos(3*A*Math.PI)/2)+0.5},loop:function(A){return(-Math.cos(2*A*Math.PI)/2)+0.5},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},swingTo:function(B){var A=1.70158;return(B-=1)*B*((A+1)*B+A)+1},swingToFrom:function(B){var A=1.70158;if((B/=0.5)<1){return 0.5*(B*B*(((A*=(1.525))+1)*B-A))}return 0.5*((B-=2)*B*(((A*=(1.525))+1)*B+A)+2)},toString:function(){return"APE anim Transitions"}};APE.anim.StyleTransition=function(D,A,B,C){APE.anim.Animation.call(this,B);if(D.id){D=D.id}this.id=D;this.adapters=[];this.style=document.getElementById(D).style;if(C){this.transition=C}this.init(A)};APE.extend(APE.anim.StyleTransition,APE.anim.Animation,{inited:false,run:function run(E){var C=0,D=this.adapters,A=D.length,B;while(C<A){B=D[C++];this.style[B.prop]=B.blendTo(E)}},init:function(J){if(this.inited){return}var D=document.getElementById(this.id),M=[],K,E=window.APE,C,H,B,G,F=E.dom,I=E.anim.TransitionAdapterFactory,A=I.ThresholdTransitionAdapter,L=I.ImmediateThresholdTransitionAdapter;for(C in J){G=J[C];if(!G){continue}if(C=="opacity"&&!("opacity" in this.style)&&("filter" in this.style)){C="alpha";this.style.zoom="1";B=F.getFilterOpacity(D)}else{if(C=="clip"&&(!B||B.indexOf("auto")!=-1)){B="rect(0px "+D.offsetWidth+"px "+D.offsetHeight+"px 0px)"}else{H=F.getStyleUnit(G);B=F.findInheritedStyle(D,C,H)}}K=I.fromValues(C,B,G);M.push(K)}M.sort(function(O,N){return(O instanceof L?-1:1)});this.adapters=M},toString:function(){return"StyleTransitionAdapter : id=#"+this.id+"\n"+APE.anim.Animation.prototype.toString.call(this)+"\nAdapters:\n "+this.adapters.join("\n ")}});APE.anim.TransitionAdapterFactory={lengthExp:/(^-?\d+|(?:-?\d*\.\d+))(px|em|ex|pt|pc|in|cm|mm|%)/i,colorExp:/color/i,positiveLengthExp:/(?:width|height|padding|fontSize)$/ig,filterExp:/alpha/,opacityExp:/^opacity/,intExp:/^\d+$/,noVisibilityExp:/^(?:hidden|collapse)/,fromValues:function(C,B,A){if(this.positiveLengthExp.test(C)){return new this.PositiveLengthTransitionAdapter(C,B,A)}if(this.colorExp.test(C)){return new this.ColorTransitionAdapter(C,B,A)}if(C=="clip"){return new this.ClipTransitionAdapter(C,B,A)}if(this.lengthExp.test(B)){return new this.LengthTransitionAdapter(C,B,A)}if(this.filterExp.test(C)){return new this.FilterTransitionAdapter(C,B,A)}if(this.opacityExp.test(C)){return new this.OpacityTransitionAdapter(C,B,A)}if(C=="fontWeight"&&this.intExp.test(B)&&this.intExp.test(A)){return new this.FontWeightTransitionAdapter(C,B,A)}if(C=="visibility"&&this.noVisibilityExp.test(B)||C=="display"&&B=="none"){return new this.ImmediateThresholdTransitionAdapter(C,B,A)}return new this.ThresholdTransitionAdapter(C,B,A)}};(function(){var E=window.APE,C=E.color&&E.color.ColorRGB,J={PositiveLengthTransitionAdapter:H,ColorTransitionAdapter:F,LengthTransitionAdapter:N,FilterTransitionAdapter:K,OpacityTransitionAdapter:D,FontWeightTransitionAdapter:P,ThresholdTransitionAdapter:A,ImmediateThresholdTransitionAdapter:M,ClipTransitionAdapter:I};E.mixin(E.anim.TransitionAdapterFactory,J);function G(T,S,Q,R){this.prop=T;this.fromValue=S;this.toValue=Q;if(R){this.units=R}}G.prototype.toString=function(){var Q=(this.units||"");return E.getFunctionName(this.constructor)+": "+this.prop+", "+this.fromValue.toString()+Q+" \u2014 "+this.toValue.toString()+Q};function F(U,T,Q){if(!C){C=E.color.ColorRGB}var S=C.fromString(T),R=Q=C.fromString(Q);G.call(this,U,S,R);this.currentValue=new C()}E.extend(F,G,{blendTo:function(Q){var R=C.blend(this.fromValue,this.toValue,Q,this.currentValue);return R.toString()}});function N(V,U,Q){var R=E.anim.TransitionAdapterFactory.lengthExp,T=R.exec(U),S=R.exec(Q);G.call(this,V,parseFloat(T[0]),parseFloat(S[0]),T[2])}E.extend(N,G);N.prototype.blendTo=function(R){var Q=1-R;return((this.fromValue*Q)+(this.toValue*R))+this.units};function H(){N.apply(this,arguments)}E.extend(H,N);H.prototype.blendTo=function(S){var Q=1-S,R=Math.max((this.fromValue*Q)+(this.toValue*S),0)+this.units;return R};var B=/,?\s/,O=/rect\(([^\)]+)\)/,L=/0(\s|\))/g;function I(U,S,Q){this.prop="clip";var T=O.exec(S.replace(L,"0px$1"))[1],R=O.exec(Q.replace(L,"0px$1"))[1];this.fromValues=T.split(B);this.toValues=R.split(B);this.clips=[];this.values=[];this.init()}I.prototype={init:function(){for(var R=0,S,Q;R<4;R++){S=this.fromValues[R],Q=this.toValues[R];if(S=="0"){S="0px"}if(Q=="0"){Q="0px"}this.clips[R]=new N(this.prop,S,Q)}},blendTo:function(R){for(var Q=0;Q<4;Q++){this.values[Q]=this.clips[Q].blendTo(R)}return"rect("+this.values.join(" ")+")"},toString:function(){return"ClipTransitionAdapter: \n"+this.clips.join(" \n")}};function D(S,R,Q){G.call(this,S,parseFloat(R),parseFloat(Q))}E.extend(D,G);D.prototype.blendTo=function(S){var Q=1-S,R=Math.max((this.fromValue*Q)+(this.toValue*S),0);return R};function K(S,R,Q){G.call(this,"filter",R,Q)}E.extend(K,G);K.prototype.blendTo=function(S){var Q=1-S,R=Math.abs((this.fromValue*Q)+(this.toValue*S),0);return"alpha(opacity="+Math.abs(R*100)+")"};function P(S,R,Q){G.call(this,S,parseInt(R),parseInt(Q))}E.extend(P,G);P.prototype.blendTo=function(S){var Q=1-S,R=(((this.fromValue*Q)+(this.toValue*S))/100<<0)*100;if(R<100){return 100}if(R>900){return 900}return R};function A(S,R,Q){G.call(this,S,R,Q)}E.extend(A,G);A.prototype.blendTo=function(Q){if(Q==1){return this.toValue}return this.fromValue};function M(S,R,Q){G.call(this,S,R,Q)}E.extend(M,G);M.prototype.blendTo=function(Q){if(Q==0){return this.fromValue}return this.toValue}})();
+APE.anim.Animation=function(A){if(typeof A=="number"){this.duration=A*1000}this.timeLimit=this.duration};APE.anim.Animation.prototype={paused:false,duration:1000,timeLimit:1000,isReversed:false,startOffset:0,endOffset:1,startValue:0,endValue:1,rationalValue:0,transition:function(A){return A},position:0,onstart:function(){},onend:function(){},onabort:function(A){throw A},run:function(){},start:function(){if(this.paused){return}this.playing=true;this.timeLimit=this.duration;this.endOffset=this.transition(this.endValue);this._start()},_start:function(){APE.anim.Manager.unregister(this);this._startTime=new Date-0;this.onstart();APE.anim.Manager.register(this);this.started=true},seekTo:function(C,A){C=parseFloat(C);if(!isFinite(C)){return}if(C===this.rationalValue){return}this.startOffset=this.position;this.startValue=this.rationalValue;this.endValue=C;var B=Math.abs(C-this.startValue);this.timeLimit=this.duration*B;this.isReversed=(C<this.rationalValue);this._transitionBackwards=this.isReversed&&A;if(this._transitionBackwards){this.endOffset=1-this.transition(1-C)}else{this.endOffset=this.transition(C)}this._start()},toggleDirection:function(){if(!this.started){this.start();return}if(this.isReversed){this.seekTo(1)}else{this.seekTo(0,this.position==1)}},reset:function(){this.position=0;this.timeLimit=this.duration},pause:function(){this.paused=true;this.elapsedTime=new Date-this._startTime;APE.anim.Manager.unregister(this)},resume:function(){this.paused=false;this._startTime=new Date-this.elapsedTime;APE.anim.Manager.register(this)},_playFrame:function(){var A=new Date-this._startTime;if(A>=this.timeLimit){this.run(this.position=this.endOffset);this.rationalValue=this.endValue;this._end();return}var B=(A/this.duration);if(this.isReversed){this.rationalValue=this.startValue-B;if(this._transitionBackwards){this.position=1-this.transition(1-this.rationalValue)}else{this.position=this.transition(this.rationalValue)}}else{this.rationalValue=this.startValue+B;this.position=this.transition(this.rationalValue)}if(typeof this.onplay=="function"){this.onplay(this.position)}this.run(this.position)},toString:function(){return"Animation {duration millis: "+this.duration+", position:"+this.position+"}"},stop:function(A){this._end(A)},abort:function(A){APE.anim.Manager.unregister(this);this.onabort(A||{})},_end:function(A){APE.anim.Manager.unregister(this);if(A!==false){this.onend()}}};APE.anim.Manager=new function(){this.register=E;this.unregister=C;var A=[],F;function E(J){if(A.length===0){H.call(this)}for(var I=0;I<A.length;I++){if(A[I]===J){return}}A.push(J)}function C(J){for(var I=0;I<A.length;I++){if(A[I]===J){A.splice(I,1)}}if(A.length==0){A=[];B.call(this)}}this.toString=function(){return"APE.anim.Manager : activeAnimations:\n"+A.join("\n ")};var D;function H(){D=new Date;var I=17;F=window.setInterval(G,I)}function G(){var J=0,K;for(;J<A.length;J++){K=A[J];try{K._playFrame()}catch(I){K.abort(I)}}}function B(){window.clearInterval(F)}};APE.anim.Transitions={none:function(A){return A},accel:function(A){return A*A*A},decel:function(A){A=1-A;return 1-(A*A*A)},reverse:function(A){return 1-A},sigmoid:function(C,A){var B=Math.atan;A=A||1;return(B(A*(2*C-1))/B(A)+1)/(2)},sigmoid2:function(B){var A=Math.atan;return(A(2*(2*B-1))/A(2)+1)/(2)},sigmoid3:function(B){var A=Math.atan;return(A(3*(2*B-1))/A(3)+1)/(2)},sigmoid4:function(B){var A=Math.atan;return(A(4*(2*B-1))/A(4)+1)/(2)},tan:function(B){var A=Math.tan;return(A(1*(2*B-1))/A(1)+1)/(2)},reverseWarp:function(B){var A=Math.tan;return(A(2*(2*B-1))/A(2)+1)/(2)},easeInEaseOut:function(B){var A=Math.PI;return(Math.atan(B*A/1-A/2)+1)/2.0038848218538874},wobble:function(A){return(-Math.cos(3*A*Math.PI)/2)+0.5},loop:function(A){return(-Math.cos(2*A*Math.PI)/2)+0.5},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},swingTo:function(B){var A=1.70158;return(B-=1)*B*((A+1)*B+A)+1},swingToFrom:function(B){var A=1.70158;if((B/=0.5)<1){return 0.5*(B*B*(((A*=(1.525))+1)*B-A))}return 0.5*((B-=2)*B*(((A*=(1.525))+1)*B+A)+2)},toString:function(){return"APE anim Transitions"}};APE.anim.StyleTransition=function(D,A,B,C){APE.anim.Animation.call(this,B);if(D.id){D=D.id}this.id=D;this.adapters=[];this.style=document.getElementById(D).style;if(C){this.transition=C}this.init(A)};APE.extend(APE.anim.StyleTransition,APE.anim.Animation,{inited:false,run:function run(E){var C=0,D=this.adapters,A=D.length,B;while(C<A){B=D[C++];this.style[B.prop]=B.blendTo(E)}},init:function(J){if(this.inited){return}var D=document.getElementById(this.id),M=[],K,E=window.APE,C,H,B,G,F=E.dom,I=E.anim.TransitionAdapterFactory,A=I.ThresholdTransitionAdapter,L=I.ImmediateThresholdTransitionAdapter;for(C in J){G=J[C];if(!G){continue}if(C=="opacity"&&!("opacity" in this.style)&&("filter" in this.style)){C="alpha";this.style.zoom="1";B=F.getFilterOpacity(D)}else{H=F.getStyleUnit(G);B=F.findInheritedStyle(D,C,H)}K=I.fromValues(C,B,G);M.push(K)}M.sort(function(O,N){return(O instanceof L?-1:1)});this.adapters=M},toString:function(){return"StyleTransitionAdapter : id=#"+this.id+"\n"+APE.anim.Animation.prototype.toString.call(this)+"\nAdapters:\n "+this.adapters.join("\n ")}});APE.anim.TransitionAdapterFactory={lengthExp:/(^-?\d+|(?:-?\d*\.\d+))(px|em|ex|pt|pc|in|cm|mm|%)/i,colorExp:/color/i,positiveLengthExp:/(?:width|height|padding|fontSize)$/ig,filterExp:/alpha/,opacityExp:/^opacity/,intExp:/^\d+$/,noVisibilityExp:/^(?:hidden|collapse)/,fromValues:function(C,B,A){if(this.positiveLengthExp.test(C)){return new this.PositiveLengthTransitionAdapter(C,B,A)}if(this.colorExp.test(C)){return new this.ColorTransitionAdapter(C,B,A)}if(this.lengthExp.test(B)){return new this.LengthTransitionAdapter(C,B,A)}if(this.filterExp.test(C)){return new this.FilterTransitionAdapter(C,B,A)}if(this.opacityExp.test(C)){return new this.OpacityTransitionAdapter(C,B,A)}if(C=="fontWeight"&&this.intExp.test(B)&&this.intExp.test(A)){return new this.FontWeightTransitionAdapter(C,B,A)}if(C=="visibility"&&this.noVisibilityExp.test(B)||C=="display"&&B=="none"){return new this.ImmediateThresholdTransitionAdapter(C,B,A)}return new this.ThresholdTransitionAdapter(C,B,A)}};(function(){var D=window.APE,B=D.color&&D.color.ColorRGB,H={PositiveLengthTransitionAdapter:G,ColorTransitionAdapter:E,LengthTransitionAdapter:L,FilterTransitionAdapter:I,OpacityTransitionAdapter:C,FontWeightTransitionAdapter:M,ThresholdTransitionAdapter:A,ImmediateThresholdTransitionAdapter:K};D.mixin(D.anim.TransitionAdapterFactory,H);function F(Q,P,N,O){this.prop=Q;this.fromValue=P;this.toValue=N;if(O){this.units=O}}F.prototype.toString=function(){var N=(this.units||"");return D.getFunctionName(this.constructor)+": "+this.prop+", "+this.fromValue.toString()+N+" \u2014 "+this.toValue.toString()+N};function E(R,Q,N){if(!B){B=D.color.ColorRGB}var P=B.fromString(Q),O=N=B.fromString(N);F.call(this,R,P,O);this.currentValue=new B()}D.extend(E,F,{blendTo:function(N){var O=B.blend(this.fromValue,this.toValue,N,this.currentValue);return O.toString()}});function L(S,R,N){var O=D.anim.TransitionAdapterFactory.lengthExp,Q=O.exec(R),P=O.exec(N);F.call(this,S,parseFloat(Q[0]),parseFloat(P[0]),Q[2])}D.extend(L,F);L.prototype.blendTo=function(O){var N=1-O;return((this.fromValue*N)+(this.toValue*O))+this.units};function G(){L.apply(this,arguments)}D.extend(G,L);G.prototype.blendTo=function(P){var N=1-P,O=Math.max((this.fromValue*N)+(this.toValue*P),0)+this.units;return O};var J=/0(\s|\))/g;function C(P,O,N){F.call(this,P,parseFloat(O),parseFloat(N))}D.extend(C,F);C.prototype.blendTo=function(P){var N=1-P,O=Math.max((this.fromValue*N)+(this.toValue*P),0);return O};function I(P,O,N){F.call(this,"filter",O,N)}D.extend(I,F);I.prototype.blendTo=function(P){var N=1-P,O=Math.abs((this.fromValue*N)+(this.toValue*P),0);return"alpha(opacity="+Math.abs(O*100)+")"};function M(P,O,N){F.call(this,P,parseInt(O),parseInt(N))}D.extend(M,F);M.prototype.blendTo=function(P){var N=1-P,O=(((this.fromValue*N)+(this.toValue*P))/100<<0)*100;if(O<100){return 100}if(O>900){return 900}return O};function A(P,O,N){F.call(this,P,O,N)}D.extend(A,F);A.prototype.blendTo=function(N){if(N==1){return this.toValue}return this.fromValue};function K(P,O,N){F.call(this,P,O,N)}D.extend(K,F);K.prototype.blendTo=function(N){if(N==0){return this.fromValue}return this.toValue}})();
View
53 build/anim/anim.js
@@ -557,14 +557,8 @@ APE.extend(APE.anim.StyleTransition, APE.anim.Animation, {
this.style.zoom = "1";
fromValue = dom.getFilterOpacity(el);
} else {
- if (prop == 'clip'
- && (!fromValue || fromValue.indexOf("auto") != -1)) {
- fromValue = "rect(0px " + el.offsetWidth + "px "
- + el.offsetHeight + "px 0px)";
- } else {
- units = dom.getStyleUnit(toValue);
- fromValue = dom.findInheritedStyle(el, prop, units);
- }
+ units = dom.getStyleUnit(toValue);
+ fromValue = dom.findInheritedStyle(el, prop, units);
}
// Get a ITransitionAdapter from the factory.
adapter = TransitionAdapterFactory.fromValues(prop, fromValue,
@@ -625,8 +619,6 @@ APE.anim.TransitionAdapterFactory = {
}
if (this.colorExp.test(prop))
return new this.ColorTransitionAdapter(prop, fromValue, toValue);
- if (prop == 'clip')
- return new this.ClipTransitionAdapter(prop, fromValue, toValue);
if (this.lengthExp.test(fromValue)) {
return new this.LengthTransitionAdapter(prop, fromValue, toValue);
}
@@ -661,8 +653,7 @@ APE.anim.TransitionAdapterFactory = {
OpacityTransitionAdapter : OpacityTransitionAdapter,
FontWeightTransitionAdapter : FontWeightTransitionAdapter,
ThresholdTransitionAdapter : ThresholdTransitionAdapter,
- ImmediateThresholdTransitionAdapter : ImmediateThresholdTransitionAdapter,
- ClipTransitionAdapter : ClipTransitionAdapter
+ ImmediateThresholdTransitionAdapter : ImmediateThresholdTransitionAdapter
};
APE.mixin(APE.anim.TransitionAdapterFactory, Adapters);
@@ -740,43 +731,7 @@ APE.anim.TransitionAdapterFactory = {
return v;
};
- var splitClipExp = /,?\s/, clipExp = /rect\(([^\)]+)\)/, zeroToPxExp = /0(\s|\))/g;
-
- function ClipTransitionAdapter(prop, fromValue, toValue) {
- this.prop = "clip";
-
- var fromString = clipExp.exec(fromValue.replace(zeroToPxExp, "0px$1"))[1], toString = clipExp
- .exec(toValue.replace(zeroToPxExp, "0px$1"))[1];
-
- this.fromValues = fromString.split(splitClipExp);
- this.toValues = toString.split(splitClipExp);
- this.clips = [];
- this.values = [];
- this.init();
- }
-
- ClipTransitionAdapter.prototype = {
- init : function() {
- for (var i = 0, f, t; i < 4; i++) {
- f = this.fromValues[i], t = this.toValues[i];
- if (f == "0")
- f = "0px";
- if (t == "0")
- t = "0px";
- this.clips[i] = new LengthTransitionAdapter(this.prop, f, t);
- }
- },
-
- blendTo : function(rationalValue) {
- for (var i = 0; i < 4; i++)
- this.values[i] = this.clips[i].blendTo(rationalValue);
- return "rect(" + this.values.join(" ") + ")";
- },
-
- toString : function() {
- return "ClipTransitionAdapter: \n" + this.clips.join(" \n");
- }
- };
+ var zeroToPxExp = /0(\s|\))/g;
/** @ignore */
function OpacityTransitionAdapter(prop, fromValue, toValue) {
View
2 build/ape-ep-dom-min.js
@@ -1 +1 @@
-if(APE!==undefined){throw Error("APE is already defined.")}var APE={extend:function(A,E,B){if(arguments.length===0){return}var D=arguments.callee,C;D.prototype=E.prototype;A.prototype=C=new D;if(typeof B=="object"){APE.mixin(C,B)}C.constructor=A;return A},mixin:function(E,D){var C=["toString","valueOf"],F,B=0,A;for(F in D){if(D.hasOwnProperty(F)){E[F]=D[F]}}for(;B<C.length;B++){A=C[B];if(D.hasOwnProperty(A)){E[A]=D[A]}}return E},toString:function(){return"[APE JavaScript Library]"},getByNode:function(A){var C=A.id,B;if(!C){if(!APE.getByNode._i){APE.getByNode._i=0}B=APE.getFunctionName(this);if(!B){B="APE"}C=A.id=B+"_"+(APE.getByNode._i++)}if(!this.hasOwnProperty("instances")){this.instances={}}return this.instances[C]||(this.instances[C]=APE.newApply(this,arguments))},getFunctionName:function(A){if(typeof A.name=="string"){return A.name}var B=Function.prototype.toString.call(A).match(/\s([a-z]+)\(/i);return B&&B[1]||""},getById:function(A){if(!this.hasOwnProperty("instances")){this.instances={}}return this.instances[A]||(this.instances[A]=APE.newApply(this,arguments))},createFactory:function(B,C){var A={},E=A.instances={};if(C){B.prototype=C}A.getById=D;return A;function D(F){return E[F]||(E[F]=APE.newApply(B,arguments))}},newApply:(function(){function B(){}return A;function A(E,C){var D;B.prototype=E.prototype;B.prototype.constructor=E;D=new B;E.apply(D,C);return D}})(),deferError:function(A){setTimeout(function(){throw A},1)}};(function(){APE.namespace=A;function A(G){var H=G.split("."),E=window,J=Object.prototype.hasOwnProperty,I=E.qualifiedName,F=0,C=H.length,D;for(;F<C;F++){D=H[F];if(!J.call(E,D)){E[D]=new B((I||"APE")+"."+D)}E=E[D]}return E}B.prototype.toString=function(){return"["+this.qualifiedName+"]"};function B(C){this.qualifiedName=C}})();(function(){var B=Object.prototype,A=B.hasOwnProperty;if(typeof window!="undefined"&&A&&!A.call(window,"Object")){Object.prototype.hasOwnProperty=function(C){if(this===window){return(C in this)&&(B[C]!==this[C])}return A.call(this,C)}}})();APE.EventPublisher=function(B,A){this.src=B;this._callStack=[];this.type=A};APE.EventPublisher.prototype={add:function(B,A){this._callStack.push([B,A||this.src]);return this},addBefore:function(B,A){return APE.EventPublisher.add(this,"beforeFire",B,A)},addAfter:function(B,A){return APE.EventPublisher.add(this,"afterFire",B,A)},getEvent:function(A){return APE.EventPublisher.get(this,A)},remove:function(C,B){var F=this._callStack,D=0,A,E;if(!B){B=this.src}for(A=F.length;D<A;D++){E=F[D];if(E[0]===C&&E[1]===B){return F.splice(D,1)}}return null},removeBefore:function(B,A){return this.getEvent("beforeFire").remove(B,A)},removeAfter:function(B,A){return this.getEvent("afterFire").remove(B,A)},fire:function(A){return APE.EventPublisher.fire(this)(A)},toString:function(){return"APE.EventPublisher: {src="+this.src+", type="+this.type+", length="+this._callStack.length+"}"}};APE.EventPublisher.add=function(D,C,B,A){return APE.EventPublisher.get(D,C).add(B,A)};APE.EventPublisher.fire=function(B){return A;function A(I){var E=false,G=0,C,H=B._callStack,D;if(typeof B.beforeFire=="function"){try{if(B.beforeFire(I)==false){E=true}}catch(F){APE.deferError(F)}}for(C=H.length;G<C;G++){D=H[G];try{if(D[0].call(D[1],I)==false){E=true}}catch(F){APE.deferError(F)}}if(typeof B.afterFire=="function"){if(B.afterFire(I)==false){E=true}}return !E}};APE.EventPublisher.get=function(F,E){var D=this.Registry.hasOwnProperty(E)&&this.Registry[E]||(this.Registry[E]=[]),B=0,A=D.length,C;for(;B<A;B++){if(D[B].src===F){return D[B]}}C=new APE.EventPublisher(F,E);if(F[E]){C.add(F[E],F)}F[E]=this.fire(C);D[D.length]=C;return C};APE.EventPublisher.Registry={};APE.EventPublisher.cleanUp=function(){var C,E,D,B,A;for(C in this.Registry){E=this.Registry[C];for(B=0,A=E.length;B<A;B++){D=E[B];D.src[D.type]=null}}};if(window.CollectGarbage){APE.EventPublisher.get(window,"onunload").addAfter(APE.EventPublisher.cleanUp,APE.EventPublisher)}APE.namespace("APE.dom");(function(){var C=APE.dom,D=document.documentElement,B="textContent",A=document.defaultView;C.IS_COMPUTED_STYLE=(typeof A!="undefined"&&"getComputedStyle" in A);C.textContent=B in D?B:"innerText"})();(function(){APE.mixin(APE.dom,{getScrollOffsets:A,getViewportDimensions:C});var B="documentElement",E=document[B],D=E&&E.clientWidth===0;E=null;function A(H){H=H||window;var G,I=H.document,F=I[B];if("pageXOffset" in H){G=function(){return{left:H.pageXOffset,top:H.pageYOffset}}}else{if(D){F=I.body}G=function(){return{left:F.scrollLeft,top:F.scrollTop}}}I=null;this.getScrollOffsets=G;return G()}function C(J){J=J||window;var G=J.document,K=G,I="client",L,H;if(typeof K.clientWidth=="number"){}else{if(D||F(J)){G=K.body}else{if(K[B].clientHeight>0){G=K[B]}else{if(typeof innerHeight=="number"){G=J;I="inner"}}}}L=I+"Width";H=I+"Height";return(this.getViewportDimensions=function(){return{width:G[L],height:G[H]}})();function F(N){var O=N.document,P=O.createElement("div");P.style.height="2500px";O.body.insertBefore(P,O.body.firstChild);var M=O[B].clientHeight>2400;O.body.removeChild(P);return M}}})();(function(){APE.mixin(APE.dom,{getOffsetCoords:Z,isAboveElement:D,isBelowElement:U,isInsideElement:J});var f=this.document,Y,e=f.documentElement,b=Math.round,W=Math.max,O=e&&e.clientWidth===0,P="clientTop" in e,N=/^h/.test(e.tagName)?"table":"TABLE",K="currentStyle" in e,R,C,c,T,Q,M,E,H,A,L,d,F=f.defaultView&&typeof f.defaultView.getComputedStyle!="undefined",G="getBoundingClientRect",a="relative",X="borderTopWidth",B="borderLeftWidth",I=/^(?:r|a)/,S=/^(?:a|f)/;function Z(h,z,AF){var AL=h.ownerDocument,AJ=AL.documentElement,u=AL.body;if(!z){z=AL}if(!AF){AF={x:0,y:0}}if(h===z){AF.x=AF.y=0;return AF}if(G in h){var AH=O?u:AJ,s=h[G](),r=s.left+W(AJ.scrollLeft,u.scrollLeft),p=s.top+W(AJ.scrollTop,u.scrollTop),AE,AB=AH.clientTop,i=AH.clientLeft;if(P){r-=i;p-=AB}if(z!==AL){s=Z(z,null);r-=s.x;p-=s.y;if(O&&z===u&&P){r-=i;p-=AB}}if(O&&K&&z!=AL&&z!==u){AE=u.currentStyle;r+=parseFloat(AE.marginLeft)||0+parseFloat(AE.left)||0;p+=parseFloat(AE.marginTop)||0+parseFloat(AE.top)||0}AF.x=r;AF.y=p;return AF}else{if(F){if(!Y){V()}var n=h.offsetLeft,AG=h.offsetTop,AC=AL.defaultView,m=AC.getComputedStyle(h,"");if(m.position=="fixed"){AF.x=n+AJ.scrollLeft;AF.y=AG+AJ.scrollTop;return AF}var t=AC.getComputedStyle(u,""),v=!I.test(t.position),l=h,o=h.parentNode,g=h.offsetParent;for(;o&&o!==z;o=o.parentNode){if(o!==u&&o!==AJ){n-=o.scrollLeft;AG-=o.scrollTop}if(o===g){if(o===u&&v){}else{if(!R&&!(o.tagName===N&&Q)){var k=AC.getComputedStyle(o,"");n+=parseFloat(k[B])||0;AG+=parseFloat(k[X])||0}if(o!==u){n+=g.offsetLeft;AG+=g.offsetTop;l=g;g=o.offsetParent}}}}var q=0,AD=0,AK,w,AI=z===AL||z===AJ,AA,j;if(l!=AL){j=AC.getComputedStyle(l,"").position;AK=S.test(j);w=AK||I.test(j)}if((l===h&&h.offsetParent===u&&!C&&z!==u&&!(v&&T))||(C&&l===h&&!w)||!v&&w&&E&&AI){AD+=parseFloat(t.marginTop)||0;q+=parseFloat(t.marginLeft)||0}if(z===u){AA=AC.getComputedStyle(AJ,"");if((!v&&((A&&!AK)||(L&&AK)))||v&&H){AD-=parseFloat(AA.paddingTop)||0;q-=parseFloat(AA.paddingLeft)||0}if(d){if(!w||w&&!v){AD-=parseFloat(AA.marginTop)||0}q-=parseFloat(AA.marginLeft)||0}}if(v){if(M||(!AK&&!R&&AI)){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}else{if(T){if(AI){if(!c){AD+=parseFloat(t.top)||0;q+=parseFloat(t.left)||0;if(AK&&R){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}if(z===AL&&!v&&!A){if(!AA){AA=AC.getComputedStyle(AJ,"")}AD+=parseFloat(AA.paddingTop)||0;q+=parseFloat(AA.paddingLeft)||0}}else{if(c){AD-=parseFloat(t.top);q-=parseFloat(t.left)}}if(C&&(!w||z===u)){AD-=parseFloat(t.marginTop)||0;q-=parseFloat(t.marginLeft)||0}}}AF.x=b(n+q);AF.y=b(AG+AD);return AF}}}function V(){Y=true;var p=f.body;if(!p){return}var g="marginTop",o="position",u="padding",m="static",l="border",y=p.style,j=y.cssText,t="1px solid transparent",q="0",n="1px",h="offsetTop",i=e.style,w=i.cssText,r=f.createElement("div"),k=r.style,v=f.createElement(N);y[u]=y[g]=y.top=q;i.position=m;y[l]=t;k.margin=q;k[o]=m;r=p.insertBefore(r,p.firstChild);R=(r[h]===1);y[l]=q;v.innerHTML="<tbody><tr><td>x</td></tr></tbody>";v.style[l]="7px solid";v.cellSpacing=v.cellPadding=q;p.insertBefore(v,p.firstChild);Q=v.getElementsByTagName("td")[0].offsetLeft===7;p.removeChild(v);y[g]=n;y[o]=a;C=(r[h]===1);T=p[h]===0;y[g]=q;y.top=n;c=r[h]===1;y.top=q;y[g]=n;y[o]=k[o]=a;E=r[h]===0;k[o]="absolute";y[o]=m;if(r.offsetParent===p){y[l]=t;k.top="2px";M=r[h]===1;y[l]=q;k[o]=a;i[u]=n;y[g]=q;H=r[h]===3;y[o]=a;A=r[h]===3;k[o]="absolute";L=r[h]===3;i[u]=q;i[g]=n;d=r[h]===3}p.removeChild(r);y.cssText=j||"";i.cssText=w||""}function J(h,g){var j=Z(h).y,i=Z(g).y;return j+h.offsetHeight<=i+g.offsetHeight&&j>=i}function D(h,g){return(Z(h).y<=Z(g).y)}function U(h,g){return(Z(h).y+h.offsetHeight>=Z(g).y+g.offsetHeight)}J=D=U=null})();(function(){APE.mixin(APE.dom,{hasToken:E,removeClass:J,addClass:F,getElementsByClassName:K,findAncestorWithClass:H});var G="className";function E(M,L){return B(L,"").test(M)}function J(M,L){var N=M[G];if(!N){return}if(N===L){M[G]="";return}M[G]=C(N.replace(B(L,"g")," "))}function F(M,L){if(!M[G]){M[G]=L}if(!B(L).test(M[G])){M[G]+=" "+L}}var A={};function B(M,L){var N=M+"$"+L;return(A[N]||(A[N]=RegExp("(?:^|\\s)"+M+"(?:$|\\s)",L)))}function K(M,N,T){if(!T){return[]}N=N||"*";if(M.getElementsByClassName&&(N==="*")){return M.getElementsByClassName(T)}var O=B(T,""),Q=M.getElementsByTagName(N),R=Q.length,L=0,P,S=Array(R);for(P=0;P<R;P++){if(O.test(Q[P][G])){S[L++]=Q[P]}}S.length=L;return S}function H(O,L,M){if(O==null||O===M){return null}var P=B(L,""),N;for(N=O.parentNode;N!=M;){if(P.test(N[G])){return N}N=N.parentNode}return null}var D=/^\s+|\s+$/g,I=/\s\s+/g;function C(L){return L.replace(D,"").replace(I," ")}})();(function(){var D=document.documentElement,F="nodeType",E="tagName",H="parentNode",B="compareDocumentPosition",I=/^H/.test(D[E])?"toUpperCase":"toLowerCase",K=/^[A-Z]/;APE.mixin(APE.dom,{contains:L(),findAncestorWithAttribute:A,findAncestorWithTagName:M,findNextSiblingElement:C,findPreviousSiblingElement:G,getChildElements:J});function L(){if(B in D){return function(O,N){return(O[B](N)&16)!==0}}else{if("contains" in D){return function(O,N){return O!==N&&O.contains(N)}}}return function(O,N){if(O===N){return false}while(O!=N&&(N=N[H])!==null){}return O===N}}function A(P,S,Q){for(var R,O=P[H];O!==null;){R=O.attributes;if(!R){return null}var N=R[S];if(N&&N.specified){if(N.value===Q||(Q===undefined)){return O}}O=O[H]}return null}function M(P,N){N=N[I]();for(var O=P[H];O!==null;){if(O[E]===N){return O}O=O[H]}return null}function C(O){for(var N=O.nextSibling;N!==null;N=N.nextSibling){if(N[F]===1){return N}}return null}function G(N){for(var O=N.previousSibling;O!==null;O=O.previousSibling){if(O[F]===1){return O}}return null}function J(R){var Q=0,P=[],O,N,T=R.children||R.childNodes,S;for(O=T.length;Q<O;Q++){S=T[Q];if(S[F]!==1){continue}P[P.length]=S}return P}})();(function(){var A="addEventListener" in this,F=A?"target":"srcElement";APE.mixin(APE.dom.Event={},{eventTarget:F,getTarget:D,addCallback:E,removeCallback:G,preventDefault:B});function D(H){return(H||event)[F]}function C(I,H){return A?H:function(J){H.call(I,J)}}function E(K,J,H){if(A){K.addEventListener(J,H,false)}else{var I=C(K,H);K.attachEvent("on"+J,I)}return I||H}function G(J,I,H){if(A){J.removeEventListener(I,H,false)}else{J.detachEvent("on"+I,H)}return H}function B(H){H=H||event;if(typeof H.preventDefault=="function"){H.preventDefault()}else{if("returnValue" in H){H.returnValue=false}}}})();APE.namespace("APE.dom.Event");(function(){var C=APE.dom,A=C.Event;A.getCoords=B;function B(E){var D;if("pageX" in E){D=function(F){return{x:F.pageX,y:F.pageY}}}else{D=function(G){var F=C.getScrollOffsets();G=G||window.event;return{x:G.clientX+F.left,y:G.clientY+F.top}}}return(A.getCoords=D)(E)}})();(function(){var P=/^(?:margin|(border)(Width)|padding)$/,D=/^[a-zA-Z]*[bB]orderRadius$/,R=APE.dom;APE.mixin(R,{getStyle:E,setOpacity:U,getFilterOpacity:J,multiLengthPropExp:/^(?:margin|(border)(Width)|padding)$/,borderRadiusExp:/^[a-zA-Z]*[bB]orderRadius$/,tryGetShorthandValues:V,getCurrentStyleValueFromAuto:A,getCurrentStyleClipValues:F,convertNonPixelToPixel:B});var I=document.defaultView,T="getComputedStyle",G=R.IS_COMPUTED_STYLE,L="currentStyle",S="style";I=null;function J(W){var X=W.filters;if(!X){return""}try{return X["DXImageTransform.Microsoft.Alpha"].opacity/100}catch(Y){try{return X("alpha").opacity/100}catch(Y){return 1}}}function U(Z,W){var Y=Z[S],X;if("opacity" in Y){Y.opacity=W}else{if("filter" in Y){X=Z[L];Y.filter="alpha(opacity="+(W*100)+")";if(X&&("hasLayout" in X)&&!X.hasLayout){S.zoom=1}}}}function E(X,W){var f="",c,a,Y,Z,d,e=X.ownerDocument,b=e.defaultView;if(G){c=b[T](X,"");if(W=="borderRadius"&&!("borderRadius" in c)){W="MozBorderRadius" in c?"MozBorderRadius":"WebkitBorderRadius" in c?"WebkitBorderRadius":""}if(!(W in c)){return""}f=c[W];if(f===""){f=(V(c,W)).join(" ")}}else{c=X[L];if(W=="opacity"&&!("opacity" in X[L])){f=J(X)}else{if(W=="cssFloat"){W="styleFloat"}f=c[W];if(W=="clip"&&!f&&("clipTop" in c)){f=F(X,c)}else{if(f=="auto"){f=A(X,W)}else{if(!(W in c)){return""}}}}a=H.exec(f);if(a){Y=f.split(" ");Y[0]=B(X,a);for(Z=1,d=Y.length;Z<d;Z++){a=H.exec(Y[Z]);Y[Z]=B(X,a)}f=Y.join(" ")}}return f}function F(Z,Y){var W=[],X=0,a;for(;X<4;X++){a=C[X];clipValue=Y["clip"+a];if(clipValue=="auto"){clipValue=(a=="Left"||a=="Top"?"0px":a=="Right"?Z.offsetWidth+M:Z.offsetHeight+M)}W.push(clipValue)}return{top:W[0],right:W[1],bottom:W[2],left:W[3],toString:function(){return"rect("+W.join(" ")+")"}}}var K=document.documentElement[S],N="cssFloat" in K?"cssFloat":"styleFloat",C=["Top","Right","Bottom","Left"],O=["Topright","Bottomright","Bottomleft","Topleft"];K=null;function A(a,c){var Z=a[S],Y,X,b=a.ownerDocument;if("pixelWidth" in Z&&Q.test(c)){var W="pixel"+(c.charAt(0).toUpperCase())+c.substring(1);Y=Z[W];if(Y===0){if(c=="width"){X=parseFloat(E(a,"borderRightWidth"))||0;paddingWidth=parseFloat(E(a,"paddingLeft"))||0+parseFloat(E(a,"paddingRight"))||0;return a.offsetWidth-a.clientLeft-X-paddingWidth+M}else{if(c=="height"){X=parseFloat(E(a,"borderBottomWidth"))||0;paddingWidth=parseFloat(E(a,"paddingTop"))||0+parseFloat(E(a,"paddingBottom"))||0;return a.offsetHeight-a.clientTop-X+M}}}return Z[W]+M}if(c=="margin"&&a[L].position!="absolute"&&b.compatMode!="BackCompat"){Y=parseFloat(E(a.parentNode,"width"))-a.offsetWidth;if(Y==0){return"0px"}Y="0px "+Y;return Y+" "+Y}}function V(c,X){var Y=P.exec(X),a,g,b,e,f,d=true,W,Z=1;if(Y&&Y[0]){W=C;a=Y[1]||Y[0];g=Y[2]||""}else{if(D.test(X)){W=O;a=D.exec(X)[0];g=""}else{return[""]}}b=c[a+W[0]+g];f=[b];while(Z<4){e=c[a+W[Z]+g];d=d&&e==b;b=e;f[Z++]=e}if(d){return[b]}return f}var H=/(-?\d+|(?:-?\d*\.\d+))(?:em|ex|pt|pc|in|cm|mm\s*)/,Q=/width|height|top|left/,M="px";function B(a,b){if(a.runtimeStyle){var c=b[0];if(parseFloat(c)==0){return"0px"}var Z=a[S],Y=Z.left,X=a.runtimeStyle,W=X.left;X.left=a[L].left;Z.left=(c||0);c=Z.pixelLeft+M;Z.left=Y;X.left=W;return c}}})();(function(){var D=document,A=D.body,F,C="getElementById",E=document[C];if(!A){return setTimeout(arguments.callee,50)}try{F=D.createElement("<A NAME=0>");A.insertBefore(F,A.firstChild);if(D[C]("0")){A.removeChild(F);D[C]=B}}catch(A){}function B(J){var I=Function.prototype.call.call(E,this,J),H,G;if(I.id==J){return I}H=this.getElementsByName(J);for(G=0;G<H.length;G++){if(H[G].id===J){return H[G]}}return null}})();
+if(APE!==undefined){throw Error("APE is already defined.")}var APE={extend:function(A,E,B){if(arguments.length===0){return}var D=arguments.callee,C;D.prototype=E.prototype;A.prototype=C=new D;if(typeof B=="object"){APE.mixin(C,B)}C.constructor=A;return A},mixin:function(E,D){var C=["toString","valueOf"],F,B=0,A;for(F in D){if(D.hasOwnProperty(F)){E[F]=D[F]}}for(;B<C.length;B++){A=C[B];if(D.hasOwnProperty(A)){E[A]=D[A]}}return E},toString:function(){return"[APE JavaScript Library]"},getByNode:function(A){var C=A.id,B;if(!C){if(!APE.getByNode._i){APE.getByNode._i=0}B=APE.getFunctionName(this);if(!B){B="APE"}C=A.id=B+"_"+(APE.getByNode._i++)}if(!this.hasOwnProperty("instances")){this.instances={}}return this.instances[C]||(this.instances[C]=APE.newApply(this,arguments))},getFunctionName:function(A){if(typeof A.name=="string"){return A.name}var B=Function.prototype.toString.call(A).match(/\s([a-z]+)\(/i);return B&&B[1]||""},getById:function(A){if(!this.hasOwnProperty("instances")){this.instances={}}return this.instances[A]||(this.instances[A]=APE.newApply(this,arguments))},createFactory:function(B,C){var A={},E=A.instances={};if(C){B.prototype=C}A.getById=D;return A;function D(F){return E[F]||(E[F]=APE.newApply(B,arguments))}},newApply:(function(){function B(){}return A;function A(E,C){var D;B.prototype=E.prototype;B.prototype.constructor=E;D=new B;E.apply(D,C);return D}})(),deferError:function(A){setTimeout(function(){throw A},1)}};(function(){APE.namespace=A;function A(G){var H=G.split("."),E=window,J=Object.prototype.hasOwnProperty,I=E.qualifiedName,F=0,C=H.length,D;for(;F<C;F++){D=H[F];if(!J.call(E,D)){E[D]=new B((I||"APE")+"."+D)}E=E[D]}return E}B.prototype.toString=function(){return"["+this.qualifiedName+"]"};function B(C){this.qualifiedName=C}})();(function(){var B=Object.prototype,A=B.hasOwnProperty;if(typeof window!="undefined"&&A&&!A.call(window,"Object")){Object.prototype.hasOwnProperty=function(C){if(this===window){return(C in this)&&(B[C]!==this[C])}return A.call(this,C)}}})();APE.EventPublisher=function(B,A){this.src=B;this._callStack=[];this.type=A};APE.EventPublisher.prototype={add:function(B,A){this._callStack.push([B,A||this.src]);return this},addBefore:function(B,A){return APE.EventPublisher.add(this,"beforeFire",B,A)},addAfter:function(B,A){return APE.EventPublisher.add(this,"afterFire",B,A)},getEvent:function(A){return APE.EventPublisher.get(this,A)},remove:function(C,B){var F=this._callStack,D=0,A,E;if(!B){B=this.src}for(A=F.length;D<A;D++){E=F[D];if(E[0]===C&&E[1]===B){return F.splice(D,1)}}return null},removeBefore:function(B,A){return this.getEvent("beforeFire").remove(B,A)},removeAfter:function(B,A){return this.getEvent("afterFire").remove(B,A)},fire:function(A){return APE.EventPublisher.fire(this)(A)},toString:function(){return"APE.EventPublisher: {src="+this.src+", type="+this.type+", length="+this._callStack.length+"}"}};APE.EventPublisher.add=function(D,C,B,A){return APE.EventPublisher.get(D,C).add(B,A)};APE.EventPublisher.fire=function(B){return A;function A(I){var E=false,G=0,C,H=B._callStack,D;if(typeof B.beforeFire=="function"){try{if(B.beforeFire(I)==false){E=true}}catch(F){APE.deferError(F)}}for(C=H.length;G<C;G++){D=H[G];try{if(D[0].call(D[1],I)==false){E=true}}catch(F){APE.deferError(F)}}if(typeof B.afterFire=="function"){if(B.afterFire(I)==false){E=true}}return !E}};APE.EventPublisher.get=function(F,E){var D=this.Registry.hasOwnProperty(E)&&this.Registry[E]||(this.Registry[E]=[]),B=0,A=D.length,C;for(;B<A;B++){if(D[B].src===F){return D[B]}}C=new APE.EventPublisher(F,E);if(F[E]){C.add(F[E],F)}F[E]=this.fire(C);D[D.length]=C;return C};APE.EventPublisher.Registry={};APE.EventPublisher.cleanUp=function(){var C,E,D,B,A;for(C in this.Registry){E=this.Registry[C];for(B=0,A=E.length;B<A;B++){D=E[B];D.src[D.type]=null}}};if(window.CollectGarbage){APE.EventPublisher.get(window,"onunload").addAfter(APE.EventPublisher.cleanUp,APE.EventPublisher)}APE.namespace("APE.dom");(function(){var C=APE.dom,D=document.documentElement,B="textContent",A=document.defaultView;C.IS_COMPUTED_STYLE=(typeof A!="undefined"&&"getComputedStyle" in A);C.textContent=B in D?B:"innerText"})();(function(){APE.mixin(APE.dom,{getScrollOffsets:A,getViewportDimensions:C});var B="documentElement",E=document[B],D=E&&E.clientWidth===0;E=null;function A(H){H=H||window;var G,I=H.document,F=I[B];if("pageXOffset" in H){G=function(){return{left:H.pageXOffset,top:H.pageYOffset}}}else{if(D){F=I.body}G=function(){return{left:F.scrollLeft,top:F.scrollTop}}}I=null;this.getScrollOffsets=G;return G()}function C(J){J=J||window;var G=J.document,K=G,I="client",L,H;if(typeof K.clientWidth=="number"){}else{if(D||F(J)){G=K.body}else{if(K[B].clientHeight>0){G=K[B]}else{if(typeof innerHeight=="number"){G=J;I="inner"}}}}L=I+"Width";H=I+"Height";return(this.getViewportDimensions=function(){return{width:G[L],height:G[H]}})();function F(N){var O=N.document,P=O.createElement("div");P.style.height="2500px";O.body.insertBefore(P,O.body.firstChild);var M=O[B].clientHeight>2400;O.body.removeChild(P);return M}}})();(function(){APE.mixin(APE.dom,{getOffsetCoords:Z,isAboveElement:D,isBelowElement:U,isInsideElement:J});var f=this.document,Y,e=f.documentElement,b=Math.round,W=Math.max,O=e&&e.clientWidth===0,P="clientTop" in e,N=/^h/.test(e.tagName)?"table":"TABLE",K="currentStyle" in e,R,C,c,T,Q,M,E,H,A,L,d,F=f.defaultView&&typeof f.defaultView.getComputedStyle!="undefined",G="getBoundingClientRect",a="relative",X="borderTopWidth",B="borderLeftWidth",I=/^(?:r|a)/,S=/^(?:a|f)/;function Z(h,z,AF){var AL=h.ownerDocument,AJ=AL.documentElement,u=AL.body;if(!z){z=AL}if(!AF){AF={x:0,y:0}}if(h===z){AF.x=AF.y=0;return AF}if(G in h){var AH=O?u:AJ,s=h[G](),r=s.left+W(AJ.scrollLeft,u.scrollLeft),p=s.top+W(AJ.scrollTop,u.scrollTop),AE,AB=AH.clientTop,i=AH.clientLeft;if(P){r-=i;p-=AB}if(z!==AL){s=Z(z,null);r-=s.x;p-=s.y;if(O&&z===u&&P){r-=i;p-=AB}}if(O&&K&&z!=AL&&z!==u){AE=u.currentStyle;r+=parseFloat(AE.marginLeft)||0+parseFloat(AE.left)||0;p+=parseFloat(AE.marginTop)||0+parseFloat(AE.top)||0}AF.x=r;AF.y=p;return AF}else{if(F){if(!Y){V()}var n=h.offsetLeft,AG=h.offsetTop,AC=AL.defaultView,m=AC.getComputedStyle(h,"");if(m.position=="fixed"){AF.x=n+AJ.scrollLeft;AF.y=AG+AJ.scrollTop;return AF}var t=AC.getComputedStyle(u,""),v=!I.test(t.position),l=h,o=h.parentNode,g=h.offsetParent;for(;o&&o!==z;o=o.parentNode){if(o!==u&&o!==AJ){n-=o.scrollLeft;AG-=o.scrollTop}if(o===g){if(o===u&&v){}else{if(!R&&!(o.tagName===N&&Q)){var k=AC.getComputedStyle(o,"");n+=parseFloat(k[B])||0;AG+=parseFloat(k[X])||0}if(o!==u){n+=g.offsetLeft;AG+=g.offsetTop;l=g;g=o.offsetParent}}}}var q=0,AD=0,AK,w,AI=z===AL||z===AJ,AA,j;if(l!=AL){j=AC.getComputedStyle(l,"").position;AK=S.test(j);w=AK||I.test(j)}if((l===h&&h.offsetParent===u&&!C&&z!==u&&!(v&&T))||(C&&l===h&&!w)||!v&&w&&E&&AI){AD+=parseFloat(t.marginTop)||0;q+=parseFloat(t.marginLeft)||0}if(z===u){AA=AC.getComputedStyle(AJ,"");if((!v&&((A&&!AK)||(L&&AK)))||v&&H){AD-=parseFloat(AA.paddingTop)||0;q-=parseFloat(AA.paddingLeft)||0}if(d){if(!w||w&&!v){AD-=parseFloat(AA.marginTop)||0}q-=parseFloat(AA.marginLeft)||0}}if(v){if(M||(!AK&&!R&&AI)){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}else{if(T){if(AI){if(!c){AD+=parseFloat(t.top)||0;q+=parseFloat(t.left)||0;if(AK&&R){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}if(z===AL&&!v&&!A){if(!AA){AA=AC.getComputedStyle(AJ,"")}AD+=parseFloat(AA.paddingTop)||0;q+=parseFloat(AA.paddingLeft)||0}}else{if(c){AD-=parseFloat(t.top);q-=parseFloat(t.left)}}if(C&&(!w||z===u)){AD-=parseFloat(t.marginTop)||0;q-=parseFloat(t.marginLeft)||0}}}AF.x=b(n+q);AF.y=b(AG+AD);return AF}}}function V(){Y=true;var p=f.body;if(!p){return}var g="marginTop",o="position",u="padding",m="static",l="border",y=p.style,j=y.cssText,t="1px solid transparent",q="0",n="1px",h="offsetTop",i=e.style,w=i.cssText,r=f.createElement("div"),k=r.style,v=f.createElement(N);y[u]=y[g]=y.top=q;i.position=m;y[l]=t;k.margin=q;k[o]=m;r=p.insertBefore(r,p.firstChild);R=(r[h]===1);y[l]=q;v.innerHTML="<tbody><tr><td>x</td></tr></tbody>";v.style[l]="7px solid";v.cellSpacing=v.cellPadding=q;p.insertBefore(v,p.firstChild);Q=v.getElementsByTagName("td")[0].offsetLeft===7;p.removeChild(v);y[g]=n;y[o]=a;C=(r[h]===1);T=p[h]===0;y[g]=q;y.top=n;c=r[h]===1;y.top=q;y[g]=n;y[o]=k[o]=a;E=r[h]===0;k[o]="absolute";y[o]=m;if(r.offsetParent===p){y[l]=t;k.top="2px";M=r[h]===1;y[l]=q;k[o]=a;i[u]=n;y[g]=q;H=r[h]===3;y[o]=a;A=r[h]===3;k[o]="absolute";L=r[h]===3;i[u]=q;i[g]=n;d=r[h]===3}p.removeChild(r);y.cssText=j||"";i.cssText=w||""}function J(h,g){var j=Z(h).y,i=Z(g).y;return j+h.offsetHeight<=i+g.offsetHeight&&j>=i}function D(h,g){return(Z(h).y<=Z(g).y)}function U(h,g){return(Z(h).y+h.offsetHeight>=Z(g).y+g.offsetHeight)}J=D=U=null})();(function(){APE.mixin(APE.dom,{hasToken:E,removeClass:J,addClass:F,getElementsByClassName:K,findAncestorWithClass:H});var G="className";function E(M,L){return B(L,"").test(M)}function J(M,L){var N=M[G];if(!N){return}if(N===L){M[G]="";return}M[G]=C(N.replace(B(L,"g")," "))}function F(M,L){if(!M[G]){M[G]=L}if(!B(L).test(M[G])){M[G]+=" "+L}}var A={};function B(M,L){var N=M+"$"+L;return(A[N]||(A[N]=RegExp("(?:^|\\s)"+M+"(?:$|\\s)",L)))}function K(M,N,T){if(!T){return[]}N=N||"*";if(M.getElementsByClassName&&(N==="*")){return M.getElementsByClassName(T)}var O=B(T,""),Q=M.getElementsByTagName(N),R=Q.length,L=0,P,S=Array(R);for(P=0;P<R;P++){if(O.test(Q[P][G])){S[L++]=Q[P]}}S.length=L;return S}function H(O,L,M){if(O==null||O===M){return null}var P=B(L,""),N;for(N=O.parentNode;N!=M;){if(P.test(N[G])){return N}N=N.parentNode}return null}var D=/^\s+|\s+$/g,I=/\s\s+/g;function C(L){return L.replace(D,"").replace(I," ")}})();(function(){var D=document.documentElement,F="nodeType",E="tagName",H="parentNode",B="compareDocumentPosition",I=/^H/.test(D[E])?"toUpperCase":"toLowerCase",K=/^[A-Z]/;APE.mixin(APE.dom,{contains:L(),findAncestorWithAttribute:A,findAncestorWithTagName:M,findNextSiblingElement:C,findPreviousSiblingElement:G,getChildElements:J});function L(){if(B in D){return function(O,N){return(O[B](N)&16)!==0}}else{if("contains" in D){return function(O,N){return O!==N&&O.contains(N)}}}return function(O,N){if(O===N){return false}while(O!=N&&(N=N[H])!==null){}return O===N}}function A(P,S,Q){for(var R,O=P[H];O!==null;){R=O.attributes;if(!R){return null}var N=R[S];if(N&&N.specified){if(N.value===Q||(Q===undefined)){return O}}O=O[H]}return null}function M(P,N){N=N[I]();for(var O=P[H];O!==null;){if(O[E]===N){return O}O=O[H]}return null}function C(O){for(var N=O.nextSibling;N!==null;N=N.nextSibling){if(N[F]===1){return N}}return null}function G(N){for(var O=N.previousSibling;O!==null;O=O.previousSibling){if(O[F]===1){return O}}return null}function J(R){var Q=0,P=[],O,N,T=R.children||R.childNodes,S;for(O=T.length;Q<O;Q++){S=T[Q];if(S[F]!==1){continue}P[P.length]=S}return P}})();(function(){var A="addEventListener" in this,F=A?"target":"srcElement";APE.mixin(APE.dom.Event={},{eventTarget:F,getTarget:D,addCallback:E,removeCallback:G,preventDefault:B});function D(H){return(H||window.event)[F]}function C(I,H){return A?H:function(J){H.call(I,J)}}function E(K,J,H){if(A){K.addEventListener(J,H,false)}else{var I=C(K,H);K.attachEvent("on"+J,I)}return I||H}function G(J,I,H){if(A){J.removeEventListener(I,H,false)}else{J.detachEvent("on"+I,H)}return H}function B(H){H=H||window.event;if("preventDefault" in H){H.preventDefault()}else{if("returnValue" in H){H.returnValue=false}}}})();APE.namespace("APE.dom.Event");(function(){var C=APE.dom,A=C.Event;A.getCoords=B;function B(E){var D;if("pageX" in E){D=function(F){return{x:F.pageX,y:F.pageY}}}else{D=function(G){var F=C.getScrollOffsets();G=G||window.event;return{x:G.clientX+F.left,y:G.clientY+F.top}}}return(A.getCoords=D)(E)}})();(function(){var P=/^(?:margin|(border)(Width)|padding)$/,D=/^[a-zA-Z]*[bB]orderRadius$/,R=APE.dom;APE.mixin(R,{getStyle:E,setOpacity:U,getFilterOpacity:J,multiLengthPropExp:/^(?:margin|(border)(Width)|padding)$/,borderRadiusExp:/^[a-zA-Z]*[bB]orderRadius$/,tryGetShorthandValues:V,getCurrentStyleValueFromAuto:A,getCurrentStyleClipValues:F,convertNonPixelToPixel:B});var I=document.defaultView,T="getComputedStyle",G=R.IS_COMPUTED_STYLE,L="currentStyle",S="style";I=null;function J(W){var X=W.filters;if(!X){return""}try{return X["DXImageTransform.Microsoft.Alpha"].opacity/100}catch(Y){try{return X("alpha").opacity/100}catch(Y){return 1}}}function U(Z,W){var Y=Z[S],X;if("opacity" in Y){Y.opacity=W}else{if("filter" in Y){X=Z[L];Y.filter="alpha(opacity="+(W*100)+")";if(X&&("hasLayout" in X)&&!X.hasLayout){S.zoom=1}}}}function E(X,W){var f="",c,a,Y,Z,d,e=X.ownerDocument,b=e.defaultView;if(G){c=b[T](X,"");if(W=="borderRadius"&&!("borderRadius" in c)){W="MozBorderRadius" in c?"MozBorderRadius":"WebkitBorderRadius" in c?"WebkitBorderRadius":""}if(!(W in c)){return""}f=c[W];if(f===""){f=(V(c,W)).join(" ")}}else{c=X[L];if(W=="opacity"&&!("opacity" in X[L])){f=J(X)}else{if(W=="cssFloat"){W="styleFloat"}f=c[W];if(W=="clip"&&!f&&("clipTop" in c)){f=F(X,c)}else{if(f=="auto"){f=A(X,W)}else{if(!(W in c)){return""}}}}a=H.exec(f);if(a){Y=f.split(" ");Y[0]=B(X,a);for(Z=1,d=Y.length;Z<d;Z++){a=H.exec(Y[Z]);Y[Z]=B(X,a)}f=Y.join(" ")}}return f}function F(Z,Y){var W=[],X=0,a;for(;X<4;X++){a=C[X];clipValue=Y["clip"+a];if(clipValue=="auto"){clipValue=(a=="Left"||a=="Top"?"0px":a=="Right"?Z.offsetWidth+M:Z.offsetHeight+M)}W.push(clipValue)}return{top:W[0],right:W[1],bottom:W[2],left:W[3],toString:function(){return"rect("+W.join(" ")+")"}}}var K=document.documentElement[S],N="cssFloat" in K?"cssFloat":"styleFloat",C=["Top","Right","Bottom","Left"],O=["Topright","Bottomright","Bottomleft","Topleft"];K=null;function A(a,c){var Z=a[S],Y,X,b=a.ownerDocument;if("pixelWidth" in Z&&Q.test(c)){var W="pixel"+(c.charAt(0).toUpperCase())+c.substring(1);Y=Z[W];if(Y===0){if(c=="width"){X=parseFloat(E(a,"borderRightWidth"))||0;paddingWidth=parseFloat(E(a,"paddingLeft"))||0+parseFloat(E(a,"paddingRight"))||0;return a.offsetWidth-a.clientLeft-X-paddingWidth+M}else{if(c=="height"){X=parseFloat(E(a,"borderBottomWidth"))||0;paddingWidth=parseFloat(E(a,"paddingTop"))||0+parseFloat(E(a,"paddingBottom"))||0;return a.offsetHeight-a.clientTop-X+M}}}return Z[W]+M}if(c=="margin"&&a[L].position!="absolute"&&b.compatMode!="BackCompat"){Y=parseFloat(E(a.parentNode,"width"))-a.offsetWidth;if(Y==0){return"0px"}Y="0px "+Y;return Y+" "+Y}}function V(c,X){var Y=P.exec(X),a,g,b,e,f,d=true,W,Z=1;if(Y&&Y[0]){W=C;a=Y[1]||Y[0];g=Y[2]||""}else{if(D.test(X)){W=O;a=D.exec(X)[0];g=""}else{return[""]}}b=c[a+W[0]+g];f=[b];while(Z<4){e=c[a+W[Z]+g];d=d&&e==b;b=e;f[Z++]=e}if(d){return[b]}return f}var H=/(-?\d+|(?:-?\d*\.\d+))(?:em|ex|pt|pc|in|cm|mm\s*)/,Q=/width|height|top|left/,M="px";function B(a,b){if(a.runtimeStyle){var c=b[0];if(parseFloat(c)==0){return"0px"}var Z=a[S],Y=Z.left,X=a.runtimeStyle,W=X.left;X.left=a[L].left;Z.left=(c||0);c=Z.pixelLeft+M;Z.left=Y;X.left=W;return c}}})();(function(){var D=document,A=D.body,F,C="getElementById",E=document[C];if(!A){return setTimeout(arguments.callee,50)}try{F=D.createElement("<A NAME=0>");A.insertBefore(F,A.firstChild);if(D[C]("0")){A.removeChild(F);D[C]=B}}catch(A){}function B(J){var I=Function.prototype.call.call(E,this,J),H,G;if(I.id==J){return I}H=this.getElementsByName(J);for(G=0;G<H.length;G++){if(H[G].id===J){return H[G]}}return null}})();
View
8 build/ape-ep-dom.js
@@ -1287,7 +1287,7 @@ function normalizeString(s) { return s.replace(STRING_TRIM_EXP,'').replace(WS_MU
});
function getTarget(e) {
- return (e || event)[eventTarget];
+ return (e || window.event)[eventTarget];
}
/**
@@ -1344,10 +1344,10 @@ function normalizeString(s) { return s.replace(STRING_TRIM_EXP,'').replace(WS_MU
* @param {Event}
*/
function preventDefault(ev) {
- ev = ev || event;
- if(typeof ev.preventDefault == "function") {
+ ev = ev || window.event;
+ if("preventDefault" in ev) {
ev.preventDefault();
- } else if('returnValue' in ev) {
+ } else if("returnValue" in ev) {
ev.returnValue = false;
}
}
View
2 build/dom/Event-min.js
@@ -1 +1 @@
-APE.namespace("APE.dom");(function(){var A="addEventListener" in this,F=A?"target":"srcElement";APE.mixin(APE.dom.Event={},{eventTarget:F,getTarget:D,addCallback:E,removeCallback:G,preventDefault:B});function D(H){return(H||event)[F]}function C(I,H){return A?H:function(J){H.call(I,J)}}function E(K,J,H){if(A){K.addEventListener(J,H,false)}else{var I=C(K,H);K.attachEvent("on"+J,I)}return I||H}function G(J,I,H){if(A){J.removeEventListener(I,H,false)}else{J.detachEvent("on"+I,H)}return H}function B(H){H=H||event;if(typeof H.preventDefault=="function"){H.preventDefault()}else{if("returnValue" in H){H.returnValue=false}}}})();
+APE.namespace("APE.dom");(function(){var A="addEventListener" in this,F=A?"target":"srcElement";APE.mixin(APE.dom.Event={},{eventTarget:F,getTarget:D,addCallback:E,removeCallback:G,preventDefault:B});function D(H){return(H||window.event)[F]}function C(I,H){return A?H:function(J){H.call(I,J)}}function E(K,J,H){if(A){K.addEventListener(J,H,false)}else{var I=C(K,H);K.attachEvent("on"+J,I)}return I||H}function G(J,I,H){if(A){J.removeEventListener(I,H,false)}else{J.detachEvent("on"+I,H)}return H}function B(H){H=H||window.event;if("preventDefault" in H){H.preventDefault()}else{if("returnValue" in H){H.returnValue=false}}}})();
View
8 build/dom/Event.js
@@ -19,7 +19,7 @@ APE.namespace("APE.dom");
});
function getTarget(e) {
- return (e || event)[eventTarget];
+ return (e || window.event)[eventTarget];
}
/**
@@ -76,10 +76,10 @@ APE.namespace("APE.dom");
* @param {Event}
*/
function preventDefault(ev) {
- ev = ev || event;
- if(typeof ev.preventDefault == "function") {
+ ev = ev || window.event;
+ if("preventDefault" in ev) {
ev.preventDefault();
- } else if('returnValue' in ev) {
+ } else if("returnValue" in ev) {
ev.returnValue = false;
}
}
View
2 build/dom/dom-min.js
@@ -1 +1 @@
-APE.namespace("APE.dom");(function(){var C=APE.dom,D=document.documentElement,B="textContent",A=document.defaultView;C.IS_COMPUTED_STYLE=(typeof A!="undefined"&&"getComputedStyle" in A);C.textContent=B in D?B:"innerText"})();(function(){APE.mixin(APE.dom,{getScrollOffsets:A,getViewportDimensions:C});var B="documentElement",E=document[B],D=E&&E.clientWidth===0;E=null;function A(H){H=H||window;var G,I=H.document,F=I[B];if("pageXOffset" in H){G=function(){return{left:H.pageXOffset,top:H.pageYOffset}}}else{if(D){F=I.body}G=function(){return{left:F.scrollLeft,top:F.scrollTop}}}I=null;this.getScrollOffsets=G;return G()}function C(J){J=J||window;var G=J.document,K=G,I="client",L,H;if(typeof K.clientWidth=="number"){}else{if(D||F(J)){G=K.body}else{if(K[B].clientHeight>0){G=K[B]}else{if(typeof innerHeight=="number"){G=J;I="inner"}}}}L=I+"Width";H=I+"Height";return(this.getViewportDimensions=function(){return{width:G[L],height:G[H]}})();function F(N){var O=N.document,P=O.createElement("div");P.style.height="2500px";O.body.insertBefore(P,O.body.firstChild);var M=O[B].clientHeight>2400;O.body.removeChild(P);return M}}})();(function(){APE.mixin(APE.dom,{getOffsetCoords:Z,isAboveElement:D,isBelowElement:U,isInsideElement:J});var f=this.document,Y,e=f.documentElement,b=Math.round,W=Math.max,O=e&&e.clientWidth===0,P="clientTop" in e,N=/^h/.test(e.tagName)?"table":"TABLE",K="currentStyle" in e,R,C,c,T,Q,M,E,H,A,L,d,F=f.defaultView&&typeof f.defaultView.getComputedStyle!="undefined",G="getBoundingClientRect",a="relative",X="borderTopWidth",B="borderLeftWidth",I=/^(?:r|a)/,S=/^(?:a|f)/;function Z(h,z,AF){var AL=h.ownerDocument,AJ=AL.documentElement,u=AL.body;if(!z){z=AL}if(!AF){AF={x:0,y:0}}if(h===z){AF.x=AF.y=0;return AF}if(G in h){var AH=O?u:AJ,s=h[G](),r=s.left+W(AJ.scrollLeft,u.scrollLeft),p=s.top+W(AJ.scrollTop,u.scrollTop),AE,AB=AH.clientTop,i=AH.clientLeft;if(P){r-=i;p-=AB}if(z!==AL){s=Z(z,null);r-=s.x;p-=s.y;if(O&&z===u&&P){r-=i;p-=AB}}if(O&&K&&z!=AL&&z!==u){AE=u.currentStyle;r+=parseFloat(AE.marginLeft)||0+parseFloat(AE.left)||0;p+=parseFloat(AE.marginTop)||0+parseFloat(AE.top)||0}AF.x=r;AF.y=p;return AF}else{if(F){if(!Y){V()}var n=h.offsetLeft,AG=h.offsetTop,AC=AL.defaultView,m=AC.getComputedStyle(h,"");if(m.position=="fixed"){AF.x=n+AJ.scrollLeft;AF.y=AG+AJ.scrollTop;return AF}var t=AC.getComputedStyle(u,""),v=!I.test(t.position),l=h,o=h.parentNode,g=h.offsetParent;for(;o&&o!==z;o=o.parentNode){if(o!==u&&o!==AJ){n-=o.scrollLeft;AG-=o.scrollTop}if(o===g){if(o===u&&v){}else{if(!R&&!(o.tagName===N&&Q)){var k=AC.getComputedStyle(o,"");n+=parseFloat(k[B])||0;AG+=parseFloat(k[X])||0}if(o!==u){n+=g.offsetLeft;AG+=g.offsetTop;l=g;g=o.offsetParent}}}}var q=0,AD=0,AK,w,AI=z===AL||z===AJ,AA,j;if(l!=AL){j=AC.getComputedStyle(l,"").position;AK=S.test(j);w=AK||I.test(j)}if((l===h&&h.offsetParent===u&&!C&&z!==u&&!(v&&T))||(C&&l===h&&!w)||!v&&w&&E&&AI){AD+=parseFloat(t.marginTop)||0;q+=parseFloat(t.marginLeft)||0}if(z===u){AA=AC.getComputedStyle(AJ,"");if((!v&&((A&&!AK)||(L&&AK)))||v&&H){AD-=parseFloat(AA.paddingTop)||0;q-=parseFloat(AA.paddingLeft)||0}if(d){if(!w||w&&!v){AD-=parseFloat(AA.marginTop)||0}q-=parseFloat(AA.marginLeft)||0}}if(v){if(M||(!AK&&!R&&AI)){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}else{if(T){if(AI){if(!c){AD+=parseFloat(t.top)||0;q+=parseFloat(t.left)||0;if(AK&&R){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}if(z===AL&&!v&&!A){if(!AA){AA=AC.getComputedStyle(AJ,"")}AD+=parseFloat(AA.paddingTop)||0;q+=parseFloat(AA.paddingLeft)||0}}else{if(c){AD-=parseFloat(t.top);q-=parseFloat(t.left)}}if(C&&(!w||z===u)){AD-=parseFloat(t.marginTop)||0;q-=parseFloat(t.marginLeft)||0}}}AF.x=b(n+q);AF.y=b(AG+AD);return AF}}}function V(){Y=true;var p=f.body;if(!p){return}var g="marginTop",o="position",u="padding",m="static",l="border",y=p.style,j=y.cssText,t="1px solid transparent",q="0",n="1px",h="offsetTop",i=e.style,w=i.cssText,r=f.createElement("div"),k=r.style,v=f.createElement(N);y[u]=y[g]=y.top=q;i.position=m;y[l]=t;k.margin=q;k[o]=m;r=p.insertBefore(r,p.firstChild);R=(r[h]===1);y[l]=q;v.innerHTML="<tbody><tr><td>x</td></tr></tbody>";v.style[l]="7px solid";v.cellSpacing=v.cellPadding=q;p.insertBefore(v,p.firstChild);Q=v.getElementsByTagName("td")[0].offsetLeft===7;p.removeChild(v);y[g]=n;y[o]=a;C=(r[h]===1);T=p[h]===0;y[g]=q;y.top=n;c=r[h]===1;y.top=q;y[g]=n;y[o]=k[o]=a;E=r[h]===0;k[o]="absolute";y[o]=m;if(r.offsetParent===p){y[l]=t;k.top="2px";M=r[h]===1;y[l]=q;k[o]=a;i[u]=n;y[g]=q;H=r[h]===3;y[o]=a;A=r[h]===3;k[o]="absolute";L=r[h]===3;i[u]=q;i[g]=n;d=r[h]===3}p.removeChild(r);y.cssText=j||"";i.cssText=w||""}function J(h,g){var j=Z(h).y,i=Z(g).y;return j+h.offsetHeight<=i+g.offsetHeight&&j>=i}function D(h,g){return(Z(h).y<=Z(g).y)}function U(h,g){return(Z(h).y+h.offsetHeight>=Z(g).y+g.offsetHeight)}J=D=U=null})();(function(){APE.mixin(APE.dom,{hasToken:E,removeClass:J,addClass:F,getElementsByClassName:K,findAncestorWithClass:H});var G="className";function E(M,L){return B(L,"").test(M)}function J(M,L){var N=M[G];if(!N){return}if(N===L){M[G]="";return}M[G]=C(N.replace(B(L,"g")," "))}function F(M,L){if(!M[G]){M[G]=L}if(!B(L).test(M[G])){M[G]+=" "+L}}var A={};function B(M,L){var N=M+"$"+L;return(A[N]||(A[N]=RegExp("(?:^|\\s)"+M+"(?:$|\\s)",L)))}function K(M,N,T){if(!T){return[]}N=N||"*";if(M.getElementsByClassName&&(N==="*")){return M.getElementsByClassName(T)}var O=B(T,""),Q=M.getElementsByTagName(N),R=Q.length,L=0,P,S=Array(R);for(P=0;P<R;P++){if(O.test(Q[P][G])){S[L++]=Q[P]}}S.length=L;return S}function H(O,L,M){if(O==null||O===M){return null}var P=B(L,""),N;for(N=O.parentNode;N!=M;){if(P.test(N[G])){return N}N=N.parentNode}return null}var D=/^\s+|\s+$/g,I=/\s\s+/g;function C(L){return L.replace(D,"").replace(I," ")}})();(function(){var D=document.documentElement,F="nodeType",E="tagName",H="parentNode",B="compareDocumentPosition",I=/^H/.test(D[E])?"toUpperCase":"toLowerCase",K=/^[A-Z]/;APE.mixin(APE.dom,{contains:L(),findAncestorWithAttribute:A,findAncestorWithTagName:M,findNextSiblingElement:C,findPreviousSiblingElement:G,getChildElements:J});function L(){if(B in D){return function(O,N){return(O[B](N)&16)!==0}}else{if("contains" in D){return function(O,N){return O!==N&&O.contains(N)}}}return function(O,N){if(O===N){return false}while(O!=N&&(N=N[H])!==null){}return O===N}}function A(P,S,Q){for(var R,O=P[H];O!==null;){R=O.attributes;if(!R){return null}var N=R[S];if(N&&N.specified){if(N.value===Q||(Q===undefined)){return O}}O=O[H]}return null}function M(P,N){N=N[I]();for(var O=P[H];O!==null;){if(O[E]===N){return O}O=O[H]}return null}function C(O){for(var N=O.nextSibling;N!==null;N=N.nextSibling){if(N[F]===1){return N}}return null}function G(N){for(var O=N.previousSibling;O!==null;O=O.previousSibling){if(O[F]===1){return O}}return null}function J(R){var Q=0,P=[],O,N,T=R.children||R.childNodes,S;for(O=T.length;Q<O;Q++){S=T[Q];if(S[F]!==1){continue}P[P.length]=S}return P}})();(function(){var A="addEventListener" in this,F=A?"target":"srcElement";APE.mixin(APE.dom.Event={},{eventTarget:F,getTarget:D,addCallback:E,removeCallback:G,preventDefault:B});function D(H){return(H||event)[F]}function C(I,H){return A?H:function(J){H.call(I,J)}}function E(K,J,H){if(A){K.addEventListener(J,H,false)}else{var I=C(K,H);K.attachEvent("on"+J,I)}return I||H}function G(J,I,H){if(A){J.removeEventListener(I,H,false)}else{J.detachEvent("on"+I,H)}return H}function B(H){H=H||event;if(typeof H.preventDefault=="function"){H.preventDefault()}else{if("returnValue" in H){H.returnValue=false}}}})();APE.namespace("APE.dom.Event");(function(){var C=APE.dom,A=C.Event;A.getCoords=B;function B(E){var D;if("pageX" in E){D=function(F){return{x:F.pageX,y:F.pageY}}}else{D=function(G){var F=C.getScrollOffsets();G=G||window.event;return{x:G.clientX+F.left,y:G.clientY+F.top}}}return(A.getCoords=D)(E)}})();(function(){var P=/^(?:margin|(border)(Width)|padding)$/,D=/^[a-zA-Z]*[bB]orderRadius$/,R=APE.dom;APE.mixin(R,{getStyle:E,setOpacity:U,getFilterOpacity:J,multiLengthPropExp:/^(?:margin|(border)(Width)|padding)$/,borderRadiusExp:/^[a-zA-Z]*[bB]orderRadius$/,tryGetShorthandValues:V,getCurrentStyleValueFromAuto:A,getCurrentStyleClipValues:F,convertNonPixelToPixel:B});var I=document.defaultView,T="getComputedStyle",G=R.IS_COMPUTED_STYLE,L="currentStyle",S="style";I=null;function J(W){var X=W.filters;if(!X){return""}try{return X["DXImageTransform.Microsoft.Alpha"].opacity/100}catch(Y){try{return X("alpha").opacity/100}catch(Y){return 1}}}function U(Z,W){var Y=Z[S],X;if("opacity" in Y){Y.opacity=W}else{if("filter" in Y){X=Z[L];Y.filter="alpha(opacity="+(W*100)+")";if(X&&("hasLayout" in X)&&!X.hasLayout){S.zoom=1}}}}function E(X,W){var f="",c,a,Y,Z,d,e=X.ownerDocument,b=e.defaultView;if(G){c=b[T](X,"");if(W=="borderRadius"&&!("borderRadius" in c)){W="MozBorderRadius" in c?"MozBorderRadius":"WebkitBorderRadius" in c?"WebkitBorderRadius":""}if(!(W in c)){return""}f=c[W];if(f===""){f=(V(c,W)).join(" ")}}else{c=X[L];if(W=="opacity"&&!("opacity" in X[L])){f=J(X)}else{if(W=="cssFloat"){W="styleFloat"}f=c[W];if(W=="clip"&&!f&&("clipTop" in c)){f=F(X,c)}else{if(f=="auto"){f=A(X,W)}else{if(!(W in c)){return""}}}}a=H.exec(f);if(a){Y=f.split(" ");Y[0]=B(X,a);for(Z=1,d=Y.length;Z<d;Z++){a=H.exec(Y[Z]);Y[Z]=B(X,a)}f=Y.join(" ")}}return f}function F(Z,Y){var W=[],X=0,a;for(;X<4;X++){a=C[X];clipValue=Y["clip"+a];if(clipValue=="auto"){clipValue=(a=="Left"||a=="Top"?"0px":a=="Right"?Z.offsetWidth+M:Z.offsetHeight+M)}W.push(clipValue)}return{top:W[0],right:W[1],bottom:W[2],left:W[3],toString:function(){return"rect("+W.join(" ")+")"}}}var K=document.documentElement[S],N="cssFloat" in K?"cssFloat":"styleFloat",C=["Top","Right","Bottom","Left"],O=["Topright","Bottomright","Bottomleft","Topleft"];K=null;function A(a,c){var Z=a[S],Y,X,b=a.ownerDocument;if("pixelWidth" in Z&&Q.test(c)){var W="pixel"+(c.charAt(0).toUpperCase())+c.substring(1);Y=Z[W];if(Y===0){if(c=="width"){X=parseFloat(E(a,"borderRightWidth"))||0;paddingWidth=parseFloat(E(a,"paddingLeft"))||0+parseFloat(E(a,"paddingRight"))||0;return a.offsetWidth-a.clientLeft-X-paddingWidth+M}else{if(c=="height"){X=parseFloat(E(a,"borderBottomWidth"))||0;paddingWidth=parseFloat(E(a,"paddingTop"))||0+parseFloat(E(a,"paddingBottom"))||0;return a.offsetHeight-a.clientTop-X+M}}}return Z[W]+M}if(c=="margin"&&a[L].position!="absolute"&&b.compatMode!="BackCompat"){Y=parseFloat(E(a.parentNode,"width"))-a.offsetWidth;if(Y==0){return"0px"}Y="0px "+Y;return Y+" "+Y}}function V(c,X){var Y=P.exec(X),a,g,b,e,f,d=true,W,Z=1;if(Y&&Y[0]){W=C;a=Y[1]||Y[0];g=Y[2]||""}else{if(D.test(X)){W=O;a=D.exec(X)[0];g=""}else{return[""]}}b=c[a+W[0]+g];f=[b];while(Z<4){e=c[a+W[Z]+g];d=d&&e==b;b=e;f[Z++]=e}if(d){return[b]}return f}var H=/(-?\d+|(?:-?\d*\.\d+))(?:em|ex|pt|pc|in|cm|mm\s*)/,Q=/width|height|top|left/,M="px";function B(a,b){if(a.runtimeStyle){var c=b[0];if(parseFloat(c)==0){return"0px"}var Z=a[S],Y=Z.left,X=a.runtimeStyle,W=X.left;X.left=a[L].left;Z.left=(c||0);c=Z.pixelLeft+M;Z.left=Y;X.left=W;return c}}})();(function(){var D=document,A=D.body,F,C="getElementById",E=document[C];if(!A){return setTimeout(arguments.callee,50)}try{F=D.createElement("<A NAME=0>");A.insertBefore(F,A.firstChild);if(D[C]("0")){A.removeChild(F);D[C]=B}}catch(A){}function B(J){var I=Function.prototype.call.call(E,this,J),H,G;if(I.id==J){return I}H=this.getElementsByName(J);for(G=0;G<H.length;G++){if(H[G].id===J){return H[G]}}return null}})();
+APE.namespace("APE.dom");(function(){var C=APE.dom,D=document.documentElement,B="textContent",A=document.defaultView;C.IS_COMPUTED_STYLE=(typeof A!="undefined"&&"getComputedStyle" in A);C.textContent=B in D?B:"innerText"})();(function(){APE.mixin(APE.dom,{getScrollOffsets:A,getViewportDimensions:C});var B="documentElement",E=document[B],D=E&&E.clientWidth===0;E=null;function A(H){H=H||window;var G,I=H.document,F=I[B];if("pageXOffset" in H){G=function(){return{left:H.pageXOffset,top:H.pageYOffset}}}else{if(D){F=I.body}G=function(){return{left:F.scrollLeft,top:F.scrollTop}}}I=null;this.getScrollOffsets=G;return G()}function C(J){J=J||window;var G=J.document,K=G,I="client",L,H;if(typeof K.clientWidth=="number"){}else{if(D||F(J)){G=K.body}else{if(K[B].clientHeight>0){G=K[B]}else{if(typeof innerHeight=="number"){G=J;I="inner"}}}}L=I+"Width";H=I+"Height";return(this.getViewportDimensions=function(){return{width:G[L],height:G[H]}})();function F(N){var O=N.document,P=O.createElement("div");P.style.height="2500px";O.body.insertBefore(P,O.body.firstChild);var M=O[B].clientHeight>2400;O.body.removeChild(P);return M}}})();(function(){APE.mixin(APE.dom,{getOffsetCoords:Z,isAboveElement:D,isBelowElement:U,isInsideElement:J});var f=this.document,Y,e=f.documentElement,b=Math.round,W=Math.max,O=e&&e.clientWidth===0,P="clientTop" in e,N=/^h/.test(e.tagName)?"table":"TABLE",K="currentStyle" in e,R,C,c,T,Q,M,E,H,A,L,d,F=f.defaultView&&typeof f.defaultView.getComputedStyle!="undefined",G="getBoundingClientRect",a="relative",X="borderTopWidth",B="borderLeftWidth",I=/^(?:r|a)/,S=/^(?:a|f)/;function Z(h,z,AF){var AL=h.ownerDocument,AJ=AL.documentElement,u=AL.body;if(!z){z=AL}if(!AF){AF={x:0,y:0}}if(h===z){AF.x=AF.y=0;return AF}if(G in h){var AH=O?u:AJ,s=h[G](),r=s.left+W(AJ.scrollLeft,u.scrollLeft),p=s.top+W(AJ.scrollTop,u.scrollTop),AE,AB=AH.clientTop,i=AH.clientLeft;if(P){r-=i;p-=AB}if(z!==AL){s=Z(z,null);r-=s.x;p-=s.y;if(O&&z===u&&P){r-=i;p-=AB}}if(O&&K&&z!=AL&&z!==u){AE=u.currentStyle;r+=parseFloat(AE.marginLeft)||0+parseFloat(AE.left)||0;p+=parseFloat(AE.marginTop)||0+parseFloat(AE.top)||0}AF.x=r;AF.y=p;return AF}else{if(F){if(!Y){V()}var n=h.offsetLeft,AG=h.offsetTop,AC=AL.defaultView,m=AC.getComputedStyle(h,"");if(m.position=="fixed"){AF.x=n+AJ.scrollLeft;AF.y=AG+AJ.scrollTop;return AF}var t=AC.getComputedStyle(u,""),v=!I.test(t.position),l=h,o=h.parentNode,g=h.offsetParent;for(;o&&o!==z;o=o.parentNode){if(o!==u&&o!==AJ){n-=o.scrollLeft;AG-=o.scrollTop}if(o===g){if(o===u&&v){}else{if(!R&&!(o.tagName===N&&Q)){var k=AC.getComputedStyle(o,"");n+=parseFloat(k[B])||0;AG+=parseFloat(k[X])||0}if(o!==u){n+=g.offsetLeft;AG+=g.offsetTop;l=g;g=o.offsetParent}}}}var q=0,AD=0,AK,w,AI=z===AL||z===AJ,AA,j;if(l!=AL){j=AC.getComputedStyle(l,"").position;AK=S.test(j);w=AK||I.test(j)}if((l===h&&h.offsetParent===u&&!C&&z!==u&&!(v&&T))||(C&&l===h&&!w)||!v&&w&&E&&AI){AD+=parseFloat(t.marginTop)||0;q+=parseFloat(t.marginLeft)||0}if(z===u){AA=AC.getComputedStyle(AJ,"");if((!v&&((A&&!AK)||(L&&AK)))||v&&H){AD-=parseFloat(AA.paddingTop)||0;q-=parseFloat(AA.paddingLeft)||0}if(d){if(!w||w&&!v){AD-=parseFloat(AA.marginTop)||0}q-=parseFloat(AA.marginLeft)||0}}if(v){if(M||(!AK&&!R&&AI)){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}else{if(T){if(AI){if(!c){AD+=parseFloat(t.top)||0;q+=parseFloat(t.left)||0;if(AK&&R){AD+=parseFloat(t[X]);q+=parseFloat(t[B])}}if(z===AL&&!v&&!A){if(!AA){AA=AC.getComputedStyle(AJ,"")}AD+=parseFloat(AA.paddingTop)||0;q+=parseFloat(AA.paddingLeft)||0}}else{if(c){AD-=parseFloat(t.top);q-=parseFloat(t.left)}}if(C&&(!w||z===u)){AD-=parseFloat(t.marginTop)||0;q-=parseFloat(t.marginLeft)||0}}}AF.x=b(n+q);AF.y=b(AG+AD);return AF}}}function V(){Y=true;var p=f.body;if(!p){return}var g="marginTop",o="position",u="padding",m="static",l="border",y=p.style,j=y.cssText,t="1px solid transparent",q="0",n="1px",h="offsetTop",i=e.style,w=i.cssText,r=f.createElement("div"),k=r.style,v=f.createElement(N);y[u]=y[g]=y.top=q;i.position=m;y[l]=t;k.margin=q;k[o]=m;r=p.insertBefore(r,p.firstChild);R=(r[h]===1);y[l]=q;v.innerHTML="<tbody><tr><td>x</td></tr></tbody>";v.style[l]="7px solid";v.cellSpacing=v.cellPadding=q;p.insertBefore(v,p.firstChild);Q=v.getElementsByTagName("td")[0].offsetLeft===7;p.removeChild(v);y[g]=n;y[o]=a;C=(r[h]===1);T=p[h]===0;y[g]=q;y.top=n;c=r[h]===1;y.top=q;y[g]=n;y[o]=k[o]=a;E=r[h]===0;k[o]="absolute";y[o]=m;if(r.offsetParent===p){y[l]=t;k.top="2px";M=r[h]===1;y[l]=q;k[o]=a;i[u]=n;y[g]=q;H=r[h]===3;y[o]=a;A=r[h]===3;k[o]="absolute";L=r[h]===3;i[u]=q;i[g]=n;d=r[h]===3}p.removeChild(r);y.cssText=j||"";i.cssText=w||""}function J(h,g){var j=Z(h).y,i=Z(g).y;return j+h.offsetHeight<=i+g.offsetHeight&&j>=i}function D(h,g){return(Z(h).y<=Z(g).y)}function U(h,g){return(Z(h).y+h.offsetHeight>=Z(g).y+g.offsetHeight)}J=D=U=null})();(function(){APE.mixin(APE.dom,{hasToken:E,removeClass:J,addClass:F,getElementsByClassName:K,findAncestorWithClass:H});var G="className";function E(M,L){return B(L,"").test(M)}function J(M,L){var N=M[G];if(!N){return}if(N===L){M[G]="";return}M[G]=C(N.replace(B(L,"g")," "))}function F(M,L){if(!M[G]){M[G]=L}if(!B(L).test(M[G])){M[G]+=" "+L}}var A={};function B(M,L){var N=M+"$"+L;return(A[N]||(A[N]=RegExp("(?:^|\\s)"+M+"(?:$|\\s)",L)))}function K(M,N,T){if(!T){return[]}N=N||"*";if(M.getElementsByClassName&&(N==="*")){return M.getElementsByClassName(T)}var O=B(T,""),Q=M.getElementsByTagName(N),R=Q.length,L=0,P,S=Array(R);for(P=0;P<R;P++){if(O.test(Q[P][G])){S[L++]=Q[P]}}S.length=L;return S}function H(O,L,M){if(O==null||O===M){return null}var P=B(L,""),N;for(N=O.parentNode;N!=M;){if(P.test(N[G])){return N}N=N.parentNode}return null}var D=/^\s+|\s+$/g,I=/\s\s+/g;function C(L){return L.replace(D,"").replace(I," ")}})();(function(){var D=document.documentElement,F="nodeType",E="tagName",H="parentNode",B="compareDocumentPosition",I=/^H/.test(D[E])?"toUpperCase":"toLowerCase",K=/^[A-Z]/;APE.mixin(APE.dom,{contains:L(),findAncestorWithAttribute:A,findAncestorWithTagName:M,findNextSiblingElement:C,findPreviousSiblingElement:G,getChildElements:J});function L(){if(B in D){return function(O,N){return(O[B](N)&16)!==0}}else{if("contains" in D){return function(O,N){return O!==N&&O.contains(N)}}}return function(O,N){if(O===N){return false}while(O!=N&&(N=N[H])!==null){}return O===N}}function A(P,S,Q){for(var R,O=P[H];O!==null;){R=O.attributes;if(!R){return null}var N=R[S];if(N&&N.specified){if(N.value===Q||(Q===undefined)){return O}}O=O[H]}return null}function M(P,N){N=N[I]();for(var O=P[H];O!==null;){if(O[E]===N){return O}O=O[H]}return null}function C(O){for(var N=O.nextSibling;N!==null;N=N.nextSibling){if(N[F]===1){return N}}return null}function G(N){for(var O=N.previousSibling;O!==null;O=O.previousSibling){if(O[F]===1){return O}}return null}function J(R){var Q=0,P=[],O,N,T=R.children||R.childNodes,S;for(O=T.length;Q<O;Q++){S=T[Q];if(S[F]!==1){continue}P[P.length]=S}return P}})();(function(){var A="addEventListener" in this,F=A?"target":"srcElement";APE.mixin(APE.dom.Event={},{eventTarget:F,getTarget:D,addCallback:E,removeCallback:G,preventDefault:B});function D(H){return(H||window.event)[F]}function C(I,H){return A?H:function(J){H.call(I,J)}}function E(K,J,H){if(A){K.addEventListener(J,H,false)}else{var I=C(K,H);K.attachEvent("on"+J,I)}return I||H}function G(J,I,H){if(A){J.removeEventListener(I,H,false)}else{J.detachEvent("on"+I,H)}return H}function B(H){H=H||window.event;if("preventDefault" in H){H.preventDefault()}else{if("returnValue" in H){H.returnValue=false}}}})();APE.namespace("APE.dom.Event");(function(){var C=APE.dom,A=C.Event;A.getCoords=B;function B(E){var D;if("pageX" in E){D=function(F){return{x:F.pageX,y:F.pageY}}}else{D=function(G){var F=C.getScrollOffsets();G=G||window.event;return{x:G.clientX+F.left,y:G.clientY+F.top}}}return(A.getCoords=D)(E)}})();(function(){var P=/^(?:margin|(border)(Width)|padding)$/,D=/^[a-zA-Z]*[bB]orderRadius$/,R=APE.dom;APE.mixin(R,{getStyle:E,setOpacity:U,getFilterOpacity:J,multiLengthPropExp:/^(?:margin|(border)(Width)|padding)$/,borderRadiusExp:/^[a-zA-Z]*[bB]orderRadius$/,tryGetShorthandValues:V,getCurrentStyleValueFromAuto:A,getCurrentStyleClipValues:F,convertNonPixelToPixel:B});var I=document.defaultView,T="getComputedStyle",G=R.IS_COMPUTED_STYLE,L="currentStyle",S="style";I=null;function J(W){var X=W.filters;if(!X){return""}try{return X["DXImageTransform.Microsoft.Alpha"].opacity/100}catch(Y){try{return X("alpha").opacity/100}catch(Y){return 1}}}function U(Z,W){var Y=Z[S],X;if("opacity" in Y){Y.opacity=W}else{if("filter" in Y){X=Z[L];Y.filter="alpha(opacity="+(W*100)+")";if(X&&("hasLayout" in X)&&!X.hasLayout){S.zoom=1}}}}function E(X,W){var f="",c,a,Y,Z,d,e=X.ownerDocument,b=e.defaultView;if(G){c=b[T](X,"");if(W=="borderRadius"&&!("borderRadius" in c)){W="MozBorderRadius" in c?"MozBorderRadius":"WebkitBorderRadius" in c?"WebkitBorderRadius":""}if(!(W in c)){return""}f=c[W];if(f===""){f=(V(c,W)).join(" ")}}else{c=X[L];if(W=="opacity"&&!("opacity" in X[L])){f=J(X)}else{if(W=="cssFloat"){W="styleFloat"}f=c[W];if(W=="clip"&&!f&&("clipTop" in c)){f=F(X,c)}else{if(f=="auto"){f=A(X,W)}else{if(!(W in c)){return""}}}}a=H.exec(f);if(a){Y=f.split(" ");Y[0]=B(X,a);for(Z=1,d=Y.length;Z<d;Z++){a=H.exec(Y[Z]);Y[Z]=B(X,a)}f=Y.join(" ")}}return f}function F(Z,Y){var W=[],X=0,a;for(;X<4;X++){a=C[X];clipValue=Y["clip"+a];if(clipValue=="auto"){clipValue=(a=="Left"||a=="Top"?"0px":a=="Right"?Z.offsetWidth+M:Z.offsetHeight+M)}W.push(clipValue)}return{top:W[0],right:W[1],bottom:W[2],left:W[3],toString:function(){return"rect("+W.join(" ")+")"}}}var K=document.documentElement[S],N="cssFloat" in K?"cssFloat":"styleFloat",C=["Top","Right","Bottom","Left"],O=["Topright","Bottomright","Bottomleft","Topleft"];K=null;function A(a,c){var Z=a[S],Y,X,b=a.ownerDocument;if("pixelWidth" in Z&&Q.test(c)){var W="pixel"+(c.charAt(0).toUpperCase())+c.substring(1);Y=Z[W];if(Y===0){if(c=="width"){X=parseFloat(E(a,"borderRightWidth"))||0;paddingWidth=parseFloat(E(a,"paddingLeft"))||0+parseFloat(E(a,"paddingRight"))||0;return a.offsetWidth-a.clientLeft-X-paddingWidth+M}else{if(c=="height"){X=parseFloat(E(a,"borderBottomWidth"))||0;paddingWidth=parseFloat(E(a,"paddingTop"))||0+parseFloat(E(a,"paddingBottom"))||0;return a.offsetHeight-a.clientTop-X+M}}}return Z[W]+M}if(c=="margin"&&a[L].position!="absolute"&&b.compatMode!="BackCompat"){Y=parseFloat(E(a.parentNode,"width"))-a.offsetWidth;if(Y==0){return"0px"}Y="0px "+Y;return Y+" "+Y}}function V(c,X){var Y=P.exec(X),a,g,b,e,f,d=true,W,Z=1;if(Y&&Y[0]){W=C;a=Y[1]||Y[0];g=Y[2]||""}else{if(D.test(X)){W=O;a=D.exec(X)[0];g=""}else{return[""]}}b=c[a+W[0]+g];f=[b];while(Z<4){e=c[a+W[Z]+g];d=d&&e==b;b=e;f[Z++]=e}if(d){return[b]}return f}var H=/(-?\d+|(?:-?\d*\.\d+))(?:em|ex|pt|pc|in|cm|mm\s*)/,Q=/width|height|top|left/,M="px";function B(a,b){if(a.runtimeStyle){var c=b[0];if(parseFloat(c)==0){return"0px"}var Z=a[S],Y=Z.left,X=a.runtimeStyle,W=X.left;X.left=a[L].left;Z.left=(c||0);c=Z.pixelLeft+M;Z.left=Y;X.left=W;return c}}})();(function(){var D=document,A=D.body,F,C="getElementById",E=document[C];if(!A){return setTimeout(arguments.callee,50)}try{F=D.createElement("<A NAME=0>");A.insertBefore(F,A.firstChild);if(D[C]("0")){A.removeChild(F);D[C]=B}}catch(A){}function B(J){var I=Function.prototype.call.call(E,this,J),H,G;if(I.id==J){return I}H=this.getElementsByName(J);for(G=0;G<H.length;G++){if(H[G].id===J){return H[G]}}return null}})();
View
8 build/dom/dom.js
@@ -798,7 +798,7 @@ function normalizeString(s) { return s.replace(STRING_TRIM_EXP,'').replace(WS_MU
});
function getTarget(e) {
- return (e || event)[eventTarget];
+ return (e || window.event)[eventTarget];
}
/**
@@ -855,10 +855,10 @@ function normalizeString(s) { return s.replace(STRING_TRIM_EXP,'').replace(WS_MU
* @param {Event}
*/
function preventDefault(ev) {
- ev = ev || event;
- if(typeof ev.preventDefault == "function") {
+ ev = ev || window.event;
+ if("preventDefault" in ev) {
ev.preventDefault();
- } else if('returnValue' in ev) {
+ } else if("returnValue" in ev) {
ev.returnValue = false;
}
}
View
1 build/timing/Lock-a-min.js
@@ -1 +0,0 @@
-APE.Lock={getLock:function(){if(this.__ape_lock_has_lock){return false}return this.__ape_lock_has_lock=true},releaseLock:function(){this.__ape_lock_has_lock=false},isLocked:function(){return(true===this.__ape_lock_has_lock)}};
View
1 build/widget/HSVPicker/HSVPicker-min.js
@@ -1 +0,0 @@
-APE.namespace("APE.widget");APE.widget.HsvPicker=function(E){var A=APE.drag.Draggable;this.id=E;var D=document.getElementById(this.id+"-hue-slider");var B=document.getElementById(this.id+"-saturation-value-selector");this.hueSlider=A.getByNode(D,APE.drag.Draggable.constraints.VERT);this.hueSlider.keepInContainer=true;this.bgSelector=A.getByNode(B);var C=B.parentNode.parentNode;C.onselectstart=function(){return false};this.bg=C;this.bgSelector.container=C;this.bgSelector.keepInContainer=true;this.textInput=document.getElementById(this.id+"-color-input");this.displayStyle=document.getElementById(this.id+"-color-preview").style;this.bgClipTop=12/2;this.bgClipLeft=12/2;this.enabled=true;this.prevValue=this.textInput.value};APE.widget.HsvPicker.getById=APE.getById;(function(){var B=APE.widget.HsvPicker;APE.mixin(B,{hueSlid:C,grabHueSlider:D,bgSelectorDrag:F,textInputBlur:J,checkEnabled:G,textInputKeyDown:I,backgroundMousedown:H,saveValue:A,transparentClicked:E});function C(L){var K=B.getById(this.id.split("-")[0]);if(!K.enabled){return}K.onbeforechange();K.h=360*K.hueSlider.el.offsetTop/128;K.bg.style.background=K.rgbForHue(K.h);K.updateDisplay();K.onchange(L)}function D(L){var K=B.getById(this.id.split("-")[0]);if(!K.enabled){return}K.hueSlider.grab(L);K.updateDisplay();K.onchange(L);K.onchangecomplete(L)}function J(L){var K=B.getById(this.id.split("-")[0]);if(!K.enabled){return}return K.trySetValue(this.value,L||event)}function G(){return B.getById(this.id.split("-")[0]).enabled}function I(M){M=M||window.event;var L=M.keyCode==9;var K=M.keyCode==13;if(L||K){B.getById(this.id.split("-")[0]).trySetValue(this.value,M||event)}if(K){this.focus()}}function H(L){var K=B.getById(this.id.split("-")[0]);if(!K.enabled){return}K.onbeforechange();K.bgSelector.grab(L);K.bg.style.background=K.rgbForHue(K.h);K.updateDisplay();K.onchange(L);K.onchangecomplete(L)}function F(L){var K=B.getById(this.id.split("-")[0]);if(!K.enabled){return}K.v=(127-(this.el.offsetTop+K.bgClipTop))/127;K.s=(this.el.offsetLeft+K.bgClipLeft)/127;K.updateDisplay();K.onchange(L)}function A(){if(this.textInput.value){this.prevValue=this.textInput.value}}function E(L){var K=B.getById(this.id.split("-")[0]);K.onbeforechange();if(this.checked){K.prevValue=K.textInput.value;K.setEnabled(false);K.setValue("transparent")}else{K.setValue(K.prevValue||new APE.color.ColorRGB(255,255,255).toString());K.prevValue="";K.setEnabled(true);K.hueSlider.ondrag(L);K.bgSelector.ondrag(L)}K.onchange(L);K.onchangecomplete(L)}})();APE.widget.HsvPicker.prototype={rgbForHue:APE.color.ColorHSV.rgbForHue,rgbFromString:APE.color.ColorRGB.fromString,init:function(){if(this.textInput.value){this.setValue(this.textInput.value)}else{this.setValue("#ff0000")}var A=APE.widget.HsvPicker;this.bgSelector.onbeforedragstart=A.bgSelectorDrag;this.bgSelector.ondrag=A.bgSelectorDrag;this.bgSelector.onglide=A.bgSelectorDrag;this.hueSlider.onbeforedragstart=A.hueSlid;this.hueSlider.ondrag=A.hueSlid;this.hueSlider.onglide=A.hueSlid;this.hueSlider.container.onmousedown=A.grabHueSlider;this.bgSelector.onglide=A.bgSelectorDrag;this.bgSelector.onfocus=A.checkEnabled;this.hueSlider.onfocus=A.checkEnabled;var C=APE.EventPublisher;C.add(this.textInput,"onblur",A.textInputBlur);C.add(this,"onbeforechange",A.saveValue);C.add(this.bgSelector.el.parentNode,"onmousedown",A.backgroundMousedown);C.add(this.bgSelector,"ondragend",function(D){this.onchangecomplete(D)},this);C.add(this.hueSlider,"ondragend",function(D){this.onchangecomplete(D)},this);var B=document.getElementById(this.id+"-transparent-checkbox");C.add(B,"onclick",A.transparentClicked);if(B.checked){A.transparentClicked.call(document.getElementById(this.id+"-transparent-checkbox"))}},getHexValue:function(){if(this.textInput.value==""){return""}return new APE.color.ColorHSV(this.h,this.s,this.v).toRGB().toHexString()},onbeforechange:function(){},onchange:function(A){},onchangecomplete:function(A){},setEnabled:function(A){this.enabled=A},setValue:function(D){if(D=="transparent"){this.displayStyle.background="transparent";this.hueSlider.el.parentNode.style.background="transparent";this.bgSelector.el.parentNode.style.visibility="hidden";this.bgSelector.el.parentNode.previousSibling.style.visibility="inherit";this.setEnabled(false);this.bg.style.backgroundColor="transparent";this.textInput.value="";document.getElementById(this.id+"-transparent-checkbox").checked=true;return}else{this.displayStyle.background="transparent";this.bgSelector.el.parentNode.style.visibility="inherit";this.bgSelector.el.parentNode.previousSibling.style.visibility="hidden";this.setEnabled(true);document.getElementById(this.id+"-transparent-checkbox").checked=false}var B=this.rgbFromString(D);var C=B.isValid();if(!C){B=this.rgbForHue(this.h=0,this.s=1,this.v=1)}var A=B.toHSV();this.h=A.h;this.s=A.s;this.v=A.v;this.hueSlider.el.style.top=(A.h/360*128)+"px";this.bgSelector.moveToX((A.s*127)-this.bgClipLeft);this.bgSelector.moveToY(127-(A.v*127)-this.bgClipTop);this.bg.style.backgroundColor=this.rgbForHue(A.h,1,1).toHexString();this.updateDisplay(B,C)},updateDisplay:function(B,C){var A=B||new APE.color.ColorHSV(this.h,this.s,this.v).toRGB();if(A.isValid()&&!(C==false)){this.displayStyle.backgroundColor=this.textInput.value=A.toHexString()}else{this.textInput.value=""}},trySetValue:function(A,B){if(this.rgbFromString(A).isValid()){this.setValue(A);this.onchange(B);this.onchangecomplete(B);return true}else{alert("Please enter a valid color value.");return false}}};
View
1 build/widget/Panel-min.js
@@ -1 +0,0 @@
-APE.namespace("APE.widget");APE.widget.Panel=function(A){this.id=A};APE.widget.Panel.activeId="";APE.widget.Panel.prototype={show:function(){APE.widget.Panel.activeId=this.id;document.getElementById(this.id).style.display="block";var A=this.id.replace(/Panel$/,"Actuator"),B=document.getElementById(A);if(B){APE.dom.addClass(B,"actuatorActive")}},hide:function(){document.getElementById(this.id).style.display="none";APE.widget.Panel.activeId="";var A=this.id.replace(/Panel$/,"Actuator"),B=document.getElementById(A);if(typeof this.onhide=="function"){this.onhide()}if(B){APE.dom.removeClass(B,"actuatorActive")}}};APE.widget.Panel.getById=APE.getById;(function(){var E=APE.dom,B=document.body;E.Event.addCallback(B,"click",F);E.Event.addCallback(B,"mousedown",D);B=null;var A={};function F(I){var H=E.Event.getTarget(I),M=H.id,J=document,L,G=APE.widget.Panel,K=/Actuator$/;if(!M||!K.test(M)){return}M=M.replace(K,"Panel");I=I||event;if(I.preventDefault){I.preventDefault()}else{I.returnValue=false}D();L=J.getElementById(M);if(!(M in A)){A[M]=M;E.Event.addCallback(L,"mousedown",C)}G.getById(M).show()}function D(){var G=APE.widget.Panel;if(!G.activeId){return}G.getById(G.activeId).hide()}function C(H){H=H||window.event;if(H.stopPropagation){H.stopPropagation()}H.cancelBubble=true;var I=APE.dom,G=I.Event.getTarget(H);if(I.hasToken(G.className,"panelClose")){APE.widget.Panel.getById(this.id).hide()}}})();
View
1 build/widget/Placeholder-min.js
@@ -1 +0,0 @@
-(function(){APE.namespace("APE.widget");APE.widget.Placeholder=C;C.getById=APE.getById;function C(G){this.id=G;this.labelId=G+"Label";var F=document.getElementById(this.labelId);this.placeholderText=F&&F.firstChild.data||"";this.init()}C.prototype={init:function(){var F=document.getElementById(this.id),G=APE.dom.Event.addCallback;G(F,"focus",D);G(F,"blur",E);G(F,"keydown",A);G(F,"keyup",B);G(F,"mouseup",B)},reset:function(){var F=document.getElementById(this.id);if(!F){return}F.value=F.defaultValue=this.placeholderText;APE.dom.addClass(F.form,"defaultState");this.onreset(true)},isEmpty:function(){var F=document.getElementById(this.id),H=/^\s+|\s+$/g,G=F.value.replace(H,""),I=this.placeholderText;return G===""||(!!I&&G===I.replace(H,""))},onreset:function(F){}};function E(){var G=APE.dom,F=C.getById(this.id);G.removeClass(this,"focus");if(F.isEmpty()){G.addClass(this.form,"defaultState");this.value=F.placeholderText}else{G.removeClass(this.form,"defaultState")}}function D(){var F=C.getById(this.id);APE.dom.addClass(this,"focus");if(this.value===F.placeholderText){this.value=""}}function A(G){G=G||event;if(G.keyCode===27){this.value=this.defaultValue;try{this.blur()}catch(F){}C.getById(this.id).onreset(false)}}function B(){var G=APE.dom,F=C.getById(this.id);if(F.isEmpty()){G.addClass(this.form,"defaultState")}else{G.removeClass(this.form,"defaultState")}}})();
View
1 build/widget/TableAccordian-min.js
@@ -1 +0,0 @@
-function TableAccordian(B,A){this.id=B;this.duration=(A||300)/1000;this.rows=[];this.sheet=new APE.dom.StyleSheetAdapter(this.id+"Sheet")}TableAccordian.getById=APE.getById;TableAccordian.prototype={getRow:function(A){var B,C=this.rows[A];if(!C){B=document.getElementById(this.id);C=TableAccordian.Row.getByNode(B.rows[A],this);this.rows[A]=C}return C},toggleRow:function(A){this.getRow(A).toggle()},openRow:function(A){this.getRow(A).open()},closeRow:function(A){this.getRow(A).close()}};TableAccordian.Row=function(D,A){APE.anim.Animation.call(this,A.duration);this.transition=APE.anim.Transitions.accel;this.id=D.id;var B="#"+A.id+" #"+D.id+" .tableAccordian";var C=A.sheet.getRule(B);if(!C){C=A.sheet.addRule(B)}this.style=C.style;this.isExpanded=D.offsetHeight!=0;this.maxHeight=this.getRowHeight(D);this.isReversed=this.isExpanded;C.style.height="0";D.style.display=""};TableAccordian.Row.name="TableAccordianRow";TableAccordian.Row.getByNode=APE.getByNode;APE.extend(TableAccordian.Row,APE.anim.Animation,{run:function(A){var B=1-A;if("opacity" in this.style){this.style.opacity=String(B)}else{this.style.filter="alpha(opacity="+(0|B*100)+")"}this.style.height=B*this.maxHeight+"px"},onstart:function(){this.isExpanded=!this.isExpanded},toggle:function(){if(this.isExpanded){this.seekTo(1)}else{this.seekTo(0)}},open:function(){if(this.isExpanded){this.seekTo(0)}},close:function(){if(this.isExpanded){this.seekTo(1)}},getRowHeight:function(){var K=document.getElementById(this.id),J=K.cells[0],C=J.style,H=K.style,B=K.parentNode.style,A=C.cssText,D=H.cssText,I=B.cssText,G=J.currentStyle?"display: block;":"",E;C.cssText=G+"display: table-cell";H.cssText=G+"display: table-row;";B.cssText=G+"display: table-row-group";C.height=H.height=B.height="auto";E=J.clientHeight;C.height=E+"px";var F=J.clientHeight-E;C.cssText=A;H.cssText=D;B.cssText=I;return E-F}});
View
1 build/widget/calendar/Calendar-min.js
@@ -1 +0,0 @@
-APE.namespace("APE.widget");APE.widget.Calendar=function(B){this.id=(typeof B=="string"?B:B.id);var A=document.getElementById(this.id);this.displayDate=new Date(A.value);if(isNaN(this.displayDate.valueOf())){this.displayDate=new Date}this.initEvents()};APE.widget.Calendar.getByNode=APE.getByNode;APE.widget.Calendar.getById=APE.getById;APE.widget.Calendar.focusHandler=function(A){APE.widget.Calendar.getById(this.id)._show(A)};APE.widget.Calendar.documentMouseDownHandler=function(C){var E=APE.dom,B=E.Event.getTarget(C),D=APE.widget.Calendar,F=D.activeCalendar,A;if(F){A=document.getElementById(F.calendarId);if(!A){D.activeCalendar=null;return}if(E.contains(A,B)||B===A){return}F._hasFocus=false;F._hide(C)}};APE.widget.Calendar.blurHandler=function(C){var B=APE.widget.Calendar.getByNode(this);B.hideTimer=setTimeout(function A(){B._hide(C||event)},10)};APE.widget.Calendar.mousedownHandler=function(D){D=D||event;var B=APE.dom,E=B.Event.getTarget(D),H,I,G;if(E.className=="ape-calendar"){H=E}else{H=B.findAncestorWithClass(E,"ape-calendar")}I=APE.widget.Calendar.getById(H.id.replace(/-calendar$/,""));G=I.id;I._hasFocus=true;clearTimeout(I.hideTimer);selectedId=G+"-selected-day";if(E.tagName.toLowerCase()=="b"){if(E.id===selectedId){return}var A=parseInt(E.firstChild.data);if(!A){return}var C=document.getElementById(selectedId);if(C){B.removeClass(C,"ape-calendar-selected-day");C.id=""}E.id=selectedId;B.addClass(E,"ape-calendar-selected-day");I.setDateOfMonth(A);I.onselect();if(I.hideOnSelect){setTimeout(function(){I._hide(D);I._hasFocus=false;I=null},115)}}else{var F=new Date(I.displayDate);if(E.id===G+"-next-year"){F.setYear(F.getFullYear()+1);I.setDate(F)}else{if(E.id===G+"-prev-year"){F.setYear(F.getFullYear()-1);I.setDate(F)}else{if(E.id===G+"-next-month"){F.setMonth(F.getMonth()+1);I.setDate(F)}else{if(E.id===G+"-prev-month"){F.setMonth(F.getMonth()-1);I.setDate(F)}}}}}};APE.widget.Calendar.prototype={days:[31,28,31,30,31,30,31,31,30,31,30,31],hideOnSelect:true,initEvents:function(){var D=document,A=D.getElementById(this.id),C=APE.widget.Calendar,B=APE.EventPublisher;B.add(A,"onfocus",C.focusHandler);B.add(A,"onblur",C.blurHandler);B.add(A,"onclick",C.focusHandler);B.add(D,"onmousedown",C.documentMouseDownHandler)},id:"",calendarId:"",hiddenDayClass:"ape-calendar-empty-day",calendarClass:"ape-calendar",_isHidden:undefined,_show:function(C){if(!this.calendarId){this.create()}var B=document.getElementById(this.calendarId),D=B.style,A=this.constructor.activeCalendar;this._isHidden=false;if(A){if(A===this){return}else{A._hide()}}this.position(D);this.constructor.activeCalendar=this;this.show(D);this.onshow(C);this.setDate(this.displayDate)},position:function(C){var A=document.getElementById(this.id),B=APE.dom.getOffsetCoords(A);C.left=B.x+"px";C.top=B.y+A.offsetHeight+"px"},show:function(A){A.visibility="visible"},_hide:function(A){if(this._isHidden){return}if(this._hasFocus){return}this.onhide(A);if(this.constructor.activeCalendar===this){this.constructor.activeCalendar=null}this.hide(document.getElementById(this.calendarId).style);this._isHidden=true},hide:function(A){A.visibility="hidden"},onshow:function(){},onhide:function(){},onselect:function(){},create:function(){if(this.calendarId){return}this.calendarId=this.id+"-calendar";var J=document;if(J.getElementById(this.calendarId)){return}var F=J.createElement("div"),C=Array.prototype.join,D=C.call({length:7+1},"<td><b>&nbsp;</b></td>"),H=C.call({length:6+1},"<tr>"+D+"</tr>\n"),G=APE.widget,A=G.CalendarLocale,B=A.days.abbr,E="<tbody>"+H+"</tbody>",I="<thead><tr class='calendar-button-row'><th id='"+this.id+"-prev-year' title='"+A.previousYear+"'>&#x00ab;</th><th id='"+this.id+"-prev-month' title='"+A.previousMonth+"'>&#x2039;</th><th colspan='3' class='ape-calendar-header'><div id='"+this.calendarId+"-header'>&nbsp;</div></th><th id='"+this.id+"-next-month' title='"+A.nextMonth+"' class='"+this.calendarClass+"-days'>&#x203A;</th><th id='"+this.id+"-next-year' title='"+A.nextYear+"'>&#x00bb;</th></tr><tr><th>"+B.join("</th><th>")+"</th></tr></thead>";F.onselectstart=this.returnFalse;F.innerHTML="<table>"+I+E+"</table>";F.id=this.calendarId;F.className=this.calendarClass;F.onmousedown=F.onfocus=G.Calendar.mousedownHandler;J.body.appendChild(F)},returnFalse:function(A){return false},setDateOfMonth:function(A){this.displayDate.setDate(A);var B=this.formatDate();document.getElementById(this.id).value=B},getDate:function(){return new Date(this.displayDate)},formatDate:function(){return APE.widget.CalendarLocale.months.abbr[this.displayDate.getMonth()]+" "+this.displayDate.getDate()+", "+this.displayDate.getFullYear()},setDate:function(U){if(!this.calendarId){this.create()}var M=window.APE,F=M.widget.CalendarLocale;if(!F){throw Error("Missing Resource: APE.widget.CalendarLocale")}var X=new Date,T=document,J=U.getFullYear(),V=U.getMonth(),I=F.months.full[V],B=this.days[V],N,R=0,O=0,G=(0==(J%4))&&((0!=(J%100))||(0==(J%400))),K=T.getElementById(this.calendarId),A=K.getElementsByTagName("table")[0].tBodies[0],E=A.getElementsByTagName("b"),W="textContent" in K?"textContent":"innerText",Q=T.getElementById(this.calendarId+"-header"),S=M.dom,D;N=new Date(U);N.setDate(1);N=N.getDay();Q.firstChild.data=J+", "+I;if(V===1&&G){B+=1}while(R<N){D=E[R++];D[W]=" ";D.className=this.hiddenDayClass}while(O++<B){D=E[R++];D[W]=O;D.className=""}for(R=N+B,O=E.length;R<O;R++){D=E[R];D[W]=" ";D.className=this.hiddenDayClass}var L=T.getElementById(this.id+"-selected-day");if(L){L.id=""}if(X.getYear()==U.getYear()&&X.getMonth()==U.getMonth()){var H=N+X.getDate()-1;this.currentDayIndex=H;var P=E[H];S.addClass(P,this.calendarClass+"-today")}if(U.getYear()==U.getYear()&&U.getMonth()==U.getMonth()){var C=N+U.getDate();D=E[C-1];S.addClass(D,this.calendarClass+"-selected-day");D.id=this.id+"-selected-day"}this.displayDate=new Date(U)}};
View
1 build/widget/calendar/Calendar_en-min.js
@@ -1 +0,0 @@
-APE.namespace("APE.widget");APE.widget.CalendarLocale={days:{full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Su","M","Tu","W","Th","F","Sa"]},months:{full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},nextMonth:"next month",previousMonth:"previous month",nextYear:"next year",previousYear:"previous year"};
View
1 build/widget/carousel/Carousel-min.js
@@ -1 +0,0 @@
-APE.namespace("shopping.widget");shopping.widget.Carousel=function(C,B,A){this.id=C;this.timeDuration=B||250;this.isVertical=!!A;this._queue=0;this.init()};shopping.widget.Carousel.prototype={pos:0,init:function(){var B=document.getElementById(this.id),K,H=B.childNodes,E,G,J=APE.dom.Event.addCallback,D=this.isVertical?"offsetTop":"offsetLeft",L=this.isVertical?"offsetHeight":"offsetWidth",I=shopping.widget.Carousel;this.style=B.style;this.clientDimension=this.isVertical?"clientHeight":"clientWidth";this.stylePos=this.isVertical?"top":"left";for(E=0,G=H.length;E<G;E++){K=H[E];if(!K){break}if(!("tagName" in K)){K.parentNode.removeChild(K)}}this.scrollDistance=B.lastChild[D]+B.lastChild[L];this.frameSize=B.parentNode[this.clientDimension];var A=this.isVertical?"height":"width";this.style[A]=this.scrollDistance+10+"px";var C=document.getElementById(this.id+"Prev"),F=document.getElementById(this.id+"Next");if(C){J(C,"click",I.handleButtonClick)}if(F){J(F,"click",I.handleButtonClick)}},moveStart:function(B){if(this.timerId){this._queue+=B?1:-1;return}var D=document.getElementById(this.id+"Frame")[this.clientDimension],C=APE.dom;if(this.scrollDistance<=D){return}if(B){D=-D}this.newPos=this.pos+D;if(!B){C.removeClass(document.getElementById(this.id+"Next"),"carouselButton-disabled");if(this.newPos>=0){D=-this.pos;this.newPos=0;C.addClass(document.getElementById(this.id+"Prev"),"carouselButton-disabled")}}else{if(this.pos===0&&this.newPos){C.removeClass(document.getElementById(this.id+"Prev"),"carouselButton-disabled")}if(this.newPos<=this.frameSize-this.scrollDistance){C.addClass(document.getElementById(this.id+"Next"),"carouselButton-disabled");var A=this.scrollDistance+this.pos-this.frameSize;D=-A;this.newPos=this.pos-A}}this.startTime=new Date().valueOf();this.startPos=this.pos;this.dx=D;this.timerId=window.setInterval("shopping.widget.Carousel.instances['"+this.id+"'].move()",12)},move:function(){var A=new Date-this.startTime,C=A/this.timeDuration,B=(Math.atan(1.4*(2*C-1))/Math.atan(1.4)+1)/2;if(C>=1){return this.moveEnd()}this.style[this.stylePos]=(this.pos=0|this.startPos+this.dx*B)+"px"},moveEnd:function(){window.clearInterval(this.timerId);this.timerId=null;this.style[this.stylePos]=(this.pos=this.newPos)+"px";if(typeof this.onend=="function"){this.onend()}if(this._queue!==0){var A=this._queue>0;this._queue+=A?-1:1;this.moveStart(A)}}};shopping.widget.Carousel.getById=APE.getById;shopping.widget.Carousel.handleButtonClick=function(){var A=this.id.match(/(\w+)(Next|Prev)$/),B=shopping.widget.Carousel.getById(A[1]);B.moveStart(A[2]==="Next")};
View
1 build/widget/scroller/Scroller-min.js
@@ -1 +0,0 @@
-APE.namespace("APE.widget");APE.widget.Scroller=(function(){return APE.createFactory(B,{pos:0,init:function(){var E=document.getElementById(this.id),M,K=E.childNodes,H,J,L=APE.dom.Event.addCallback,G=this.isVertical?"offsetTop":"offsetLeft",N=this.isVertical?"offsetHeight":"offsetWidth";this.style=E.style;this.clientDimension=this.isVertical?"clientHeight":"clientWidth";this.stylePos=this.isVertical?"top":"left";for(H=0,J=K.length;H<J;H++){M=K[H];if(!M){break}if(M.tagName!=="LI"){M.parentNode.removeChild(M)}}this.scrollDistance=E.lastChild[G]+E.lastChild[N];this.frameSize=E.parentNode[this.clientDimension];var D=this.isVertical?"height":"width";this.style[D]=this.scrollDistance+10+"px";var F=document.getElementById(this.id+"Prev"),I=document.getElementById(this.id+"Next");if(F){L(F,"click",C)}if(I){L(I,"click",C)}},moveStart:function(E){if(this.timerId){this._queue+=E?1:-1;return}var G=document.getElementById(this.id+"Frame")[this.clientDimension],F=APE.dom;if(this.scrollDistance<=G){return}if(E){G=-G}this.newPos=this.pos+G;if(!E){F.removeClass(document.getElementById(this.id+"Next"),"scrollerButton-disabled");if(this.newPos>=0){G=-this.pos;this.newPos=0;F.addClass(document.getElementById(this.id+"Prev"),"scrollerButton-disabled")}}else{if(this.pos===0&&this.newPos){F.removeClass(document.getElementById(this.id+"Prev"),"scrollerButton-disabled")}if(this.newPos<=this.frameSize-this.scrollDistance){F.addClass(document.getElementById(this.id+"Next"),"scrollerButton-disabled");var D=this.scrollDistance+this.pos-this.frameSize;G=-D;this.newPos=this.pos-D}}this.startTime=new Date().valueOf();this.startPos=this.pos;this.dx=G;this.timerId=window.setInterval(A(this),12)},move:function(){var D=new Date-this.startTime,F=D/this.timeDuration,E=(Math.atan(1.4*(2*F-1))/Math.atan(1.4)+1)/2;if(F>=1){return this.moveEnd()}this.style[this.stylePos]=(this.pos=0|this.startPos+this.dx*E)+"px"},moveEnd:function(){window.clearInterval(this.timerId);this.timerId=null;this.style[this.stylePos]=(this.pos=this.newPos)+"px";if(typeof this.onend=="function"){this.onend()}if(this._queue!==0){var D=this._queue>0;this._queue+=D?-1:1;this.moveStart(D)}}});function B(F,E,D){this.id=F;this.timeDuration=E||250;this.isVertical=!!D;this._queue=0;this.init()}function A(E){return D;function D(){E.move()}}function C(){var D=this.id.match(/(\w+)(Next|Prev)$/),E=APE.widget.Scroller.getById(D[1]);E.moveStart(D[2]==="Next")}})();
View
93 example/anim/clip.html
@@ -1,93 +0,0 @@
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
- <title>Animation Transitions</title>
-<link type="text/css" rel="stylesheet" href="../resources/example.css"/>
-<script type="text/javascript" src="../../build/APE.js"></script>
-<script type="text/javascript" src="../../build/EventPublisher.js"></script>
-
-<style>
-div.anim-div button {
- position: absolute; left: 0;
- top: 2px; opacity: .8;
- width: 88em;
- display: block;
- font: 12px sans-serif;
- letter-spacing: 0;
- text-align: left;
- background-color: #eee;
- color: #9fa;
- padding: 1px;
- text-align: left;
- clip: rect(0 10em 1.8em 0);
-}
-div.anim-div {
- background: #ddd; width: 90%; border: 1px solid #ccc;height: 40px;position: relative;
- text-transform:small-caps;font-size:30px;letter-spacing: .5em; color: #ccc;text-align: center;
- margin: 2px;
- user-select: none;
- -moz-user-select: none;
- -webkit-user-select: none;
-}
-
-body {
- background: #eee;
-}
-html {
- border: 1px solid #ddd;
-}
-</style>
-
-</head>
-<body>
-<script>
-
-var fatRed = {
- color: "#600",
- backgroundColor: "#f53",
- clip: "rect(0 500px 500px 0)"
-};
-
-function Button(id, styleObj) {
- this.id = id;
- this.anim = new APE.anim.StyleTransition(id, styleObj, 2, APE.anim.Transitions[id]);
-}
-Button.getById = APE.getById;
-
-function doIt( buttonID, styleObj ) {
- Button.getById( buttonID, styleObj ).anim.toggleDirection( );
-};
-
-function animateBack(){
- console.dir(this);
-}
-
-</script>
-<h1>Animation Transitions Example : toggleDirection</h1>
-
-<div class='anim-div'>
- spring &nbsp;example
- <button id='spring' style="width: 100em;background-color: #131;border: 1px solid #030;clip: rect(0 10em 1.8em 0)"
- onclick="doIt('spring', fatRed)">Pomegranate
- Pomegranate
- Pomegranate
- Pomegranate
- Pomegranate
- Pomegranate
- Pomegranate
- Pomegranate</button>
-</div>
-
-<script type="text/javascript" src="../../test/yui-test/build/yahoo-dom-event/yahoo-dom-event.js"></script>
-<script type="text/javascript" src="../../test/yui-test/build/logger/logger.js"></script>
-
-<script type="text/javascript" src="../../build/anim/Animation.js"></script>
-<script type="text/javascript" src="../../build/color/ColorRGB.js"></script>
-<script type="text/javascript" src="../../build/dom/constants.js"></script>
-<script type="text/javascript" src="../../build/dom/style-f.js"></script>
-<script type="text/javascript" src="../../build/dom/getCascadedStyle.js"></script>
-<script type="text/javascript" src="../../build/anim/StyleTransition.js"></script>
-</body>
-</html>
View
53 src/anim/StyleTransition.js
@@ -79,14 +79,8 @@ APE.extend(APE.anim.StyleTransition, APE.anim.Animation, {
this.style.zoom = "1";
fromValue = dom.getFilterOpacity(el);
} else {
- if (prop == 'clip'
- && (!fromValue || fromValue.indexOf("auto") != -1)) {
- fromValue = "rect(0px " + el.offsetWidth + "px "
- + el.offsetHeight + "px 0px)";
- } else {
- units = dom.getStyleUnit(toValue);
- fromValue = dom.findInheritedStyle(el, prop, units);
- }
+ units = dom.getStyleUnit(toValue);
+ fromValue = dom.findInheritedStyle(el, prop, units);
}
// Get a ITransitionAdapter from the factory.
adapter = TransitionAdapterFactory.fromValues(prop, fromValue,
@@ -147,8 +141,6 @@ APE.anim.TransitionAdapterFactory = {
}
if (this.colorExp.test(prop))
return new this.ColorTransitionAdapter(prop, fromValue, toValue);
- if (prop == 'clip')
- return new this.ClipTransitionAdapter(prop, fromValue, toValue);
if (this.lengthExp.test(fromValue)) {
return new this.LengthTransitionAdapter(prop, fromValue, toValue);
}
@@ -183,8 +175,7 @@ APE.anim.TransitionAdapterFactory = {
OpacityTransitionAdapter : OpacityTransitionAdapter,
FontWeightTransitionAdapter : FontWeightTransitionAdapter,
ThresholdTransitionAdapter : ThresholdTransitionAdapter,
- ImmediateThresholdTransitionAdapter : ImmediateThresholdTransitionAdapter,
- ClipTransitionAdapter : ClipTransitionAdapter
+ ImmediateThresholdTransitionAdapter : ImmediateThresholdTransitionAdapter
};
APE.mixin(APE.anim.TransitionAdapterFactory, Adapters);
@@ -262,43 +253,7 @@ APE.anim.TransitionAdapterFactory = {
return v;
};
- var splitClipExp = /,?\s/, clipExp = /rect\(([^\)]+)\)/, zeroToPxExp = /0(\s|\))/g;
-
- function ClipTransitionAdapter(prop, fromValue, toValue) {
- this.prop = "clip";
-
- var fromString = clipExp.exec(fromValue.replace(zeroToPxExp, "0px$1"))[1], toString = clipExp
- .exec(toValue.replace(zeroToPxExp, "0px$1"))[1];
-
- this.fromValues = fromString.split(splitClipExp);
- this.toValues = toString.split(splitClipExp);
- this.clips = [];
- this.values = [];
- this.init();
- }
-
- ClipTransitionAdapter.prototype = {
- init : function() {
- for (var i = 0, f, t; i < 4; i++) {
- f = this.fromValues[i], t = this.toValues[i];
- if (f == "0")
- f = "0px";
- if (t == "0")
- t = "0px";
- this.clips[i] = new LengthTransitionAdapter(this.prop, f, t);
- }
- },
-
- blendTo : function(rationalValue) {
- for (var i = 0; i < 4; i++)
- this.values[i] = this.clips[i].blendTo(rationalValue);
- return "rect(" + this.values.join(" ") + ")";
- },
-
- toString : function() {
- return "ClipTransitionAdapter: \n" + this.clips.join(" \n");
- }
- };
+ var zeroToPxExp = /0(\s|\))/g;
/** @ignore */
function OpacityTransitionAdapter(prop, fromValue, toValue) {
View
8 src/dom/Event.js
@@ -19,7 +19,7 @@ APE.namespace("APE.dom");
});
function getTarget(e) {
- return (e || event)[eventTarget];
+ return (e || window.event)[eventTarget];
}
/**
@@ -76,10 +76,10 @@ APE.namespace("APE.dom");
* @param {Event}
*/
function preventDefault(ev) {
- ev = ev || event;
- if(typeof ev.preventDefault == "function") {
+ ev = ev || window.event;
+ if("preventDefault" in ev) {
ev.preventDefault();
- } else if('returnValue' in ev) {
+ } else if("returnValue" in ev) {
ev.returnValue = false;
}
}
View
10 test/tests/anim/StyleTransition-test.html
@@ -50,7 +50,7 @@
ClipTransitionAdapter : ClipTransitionAdapter
};
*/
-
+
var styleTransitionTestCase = new YAHOO.tool.TestCase({
name : "Style Transition Tests",
@@ -59,6 +59,12 @@
c.style.cssText = "";
},
+ _should : {
+ ignore : {
+ testClip : true
+ }
+ },
+
testWidth : function() {
var css = { width: "100px" };
@@ -204,7 +210,7 @@
},
testToString : function() {
- var css = { clip : "rect(10px 20px 20px -2px)" },
+ var css = { display : "none" },
st = new StyleTransition(c, css, .2);
Assert.isTypeOf("string", st.toString());
View
1 test/tests/dom/viewport-f-test.html
@@ -76,6 +76,7 @@
},
testGetScrollOffsets : function() {
+ document.expando = false;
ds.padding = bs.margin="10px";
bs.border = "10px solid";
ds.width = ds.height = "110%";

0 comments on commit 1a7eee0

Please sign in to comment.