3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.1
11 * Copyright(c) 2006-2010 Sencha Inc.
12 * licensing@sencha.com
13 * http://www.sencha.com/license
17 // shortcuts to aid compression
25 Ext.apply(EXTLIB.Easing, {
27 easeBoth: function (t, b, c, d) {
28 return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b;
31 easeInStrong: function (t, b, c, d) {
32 return c * (t /= d) * t * t * t + b;
35 easeOutStrong: function (t, b, c, d) {
36 return -c * ((t = t / d - 1) * t * t * t - 1) + b;
39 easeBothStrong: function (t, b, c, d) {
40 return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b;
43 elasticIn: function (t, b, c, d, a, p) {
44 if (t == 0 || (t /= d) == 1) {
45 return t == 0 ? b : b + c;
51 s = p / (2 * pi) * asin(c / a);
57 return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b;
61 elasticOut: function (t, b, c, d, a, p) {
62 if (t == 0 || (t /= d) == 1) {
63 return t == 0 ? b : b + c;
69 s = p / (2 * pi) * asin(c / a);
75 return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b;
78 elasticBoth: function (t, b, c, d, a, p) {
79 if (t == 0 || (t /= d / 2) == 2) {
80 return t == 0 ? b : b + c;
83 p = p || (d * (.3 * 1.5));
87 s = p / (2 * pi) * asin(c / a);
94 -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b :
95 a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b;
98 backIn: function (t, b, c, d, s) {
100 return c * (t /= d) * t * ((s + 1) * t - s) + b;
104 backOut: function (t, b, c, d, s) {
108 return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
112 backBoth: function (t, b, c, d, s) {
115 return ((t /= d / 2 ) < 1) ?
116 c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b :
117 c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
121 bounceIn: function (t, b, c, d) {
122 return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b;
126 bounceOut: function (t, b, c, d) {
127 if ((t /= d) < (1 / 2.75)) {
128 return c * (7.5625 * t * t) + b;
129 } else if (t < (2 / 2.75)) {
130 return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
131 } else if (t < (2.5 / 2.75)) {
132 return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
134 return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
138 bounceBoth: function (t, b, c, d) {
140 EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b :
141 EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
147 var EXTLIB = Ext.lib;
149 EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) {
150 return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim);
153 EXTLIB.ColorAnim = function(el, attributes, duration, method) {
154 EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
157 Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase);
159 var superclass = EXTLIB.ColorAnim.superclass,
161 transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/,
162 rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
163 hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
164 hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,
166 return typeof v !== 'undefined';
170 function parseColor(s) {
180 Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){
181 base = (idx % 2 == 0) ? 16 : 10;
183 if(c && c.length == 4){
184 out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)];
191 Ext.apply(EXTLIB.ColorAnim.prototype, {
192 getAttr : function(attr) {
196 if(colorRE.test(attr)){
197 while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){
202 val = superclass.getAttr.call(me, attr);
207 doMethod : function(attr, start, end) {
215 if(colorRE.test(attr)){
219 for(i = 0, len = start.length; i < len; i++) {
221 val[i] = superclass.doMethod.call(me, attr, v, end[i]);
223 val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')';
225 val = superclass.doMethod.call(me, attr, start, end);
230 setRunAttr : function(attr) {
232 a = me.attributes[attr],
237 superclass.setRunAttr.call(me, attr);
238 ra = me.runAttrs[attr];
239 if(colorRE.test(attr)){
240 var start = parseColor(ra.start),
241 end = parseColor(ra.end);
243 if(!isset(to) && isset(by)){
244 end = parseColor(by);
245 for(var i=0,len=start.length; i<len; i++) {
246 end[i] = start[i] + end[i];
259 var EXTLIB = Ext.lib;
260 EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) {
261 return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll);
264 EXTLIB.Scroll = function(el, attributes, duration, method) {
266 EXTLIB.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
270 Ext.extend(EXTLIB.Scroll, EXTLIB.ColorAnim);
272 var superclass = EXTLIB.Scroll.superclass,
275 Ext.apply(EXTLIB.Scroll.prototype, {
277 doMethod : function(attr, start, end) {
280 curFrame = me.curFrame,
281 totalFrames = me.totalFrames;
284 val = [me.method(curFrame, start[0], end[0] - start[0], totalFrames),
285 me.method(curFrame, start[1], end[1] - start[1], totalFrames)];
287 val = superclass.doMethod.call(me, attr, start, end);
292 getAttr : function(attr) {
295 if (attr == SCROLL) {
296 return [me.el.scrollLeft, me.el.scrollTop];
298 return superclass.getAttr.call(me, attr);
302 setAttr : function(attr, val, unit) {
306 me.el.scrollLeft = val[0];
307 me.el.scrollTop = val[1];
309 superclass.setAttr.call(me, attr, val, unit);