3 window.undefined = window.undefined;
18 Ext.apply = function(o, c, defaults){
21 Ext.apply(o, defaults);
23 if(o && c && typeof c == 'object'){
33 toString = Object.prototype.toString,
34 ua = navigator.userAgent.toLowerCase(),
39 isStrict = DOC.compatMode == "CSS1Compat",
40 isOpera = check(/opera/),
41 isChrome = check(/\bchrome\b/),
42 isWebKit = check(/webkit/),
43 isSafari = !isChrome && check(/safari/),
44 isSafari2 = isSafari && check(/applewebkit\/4/),
45 isSafari3 = isSafari && check(/version\/3/),
46 isSafari4 = isSafari && check(/version\/4/),
47 isIE = !isOpera && check(/msie/),
48 isIE7 = isIE && check(/msie 7/),
49 isIE8 = isIE && check(/msie 8/),
50 isIE6 = isIE && !isIE7 && !isIE8,
51 isGecko = !isWebKit && check(/gecko/),
52 isGecko2 = isGecko && check(/rv:1\.8/),
53 isGecko3 = isGecko && check(/rv:1\.9/),
54 isBorderBox = isIE && !isStrict,
55 isWindows = check(/windows|win32/),
56 isMac = check(/macintosh|mac os x/),
57 isAir = check(/adobeair/),
58 isLinux = check(/linux/),
59 isSecure = /^https/i.test(window.location.protocol);
64 DOC.execCommand("BackgroundImageCache", false, true);
70 SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank',
81 enableGarbageCollector : true,
84 enableListenerCollection : false,
87 enableNestedListenerRemoval : false,
90 USE_NATIVE_JSON : false,
93 applyIf : function(o, c){
96 if(!Ext.isDefined(o[p])){
105 id : function(el, prefix){
106 el = Ext.getDom(el, true) || {};
108 el.id = (prefix || "ext-gen") + (++idSeed);
116 var io = function(o){
121 var oc = Object.prototype.constructor;
123 return function(sb, sp, overrides){
124 if(typeof sp == 'object'){
127 sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);};
129 var F = function(){},
134 sbp = sb.prototype = new F();
137 if(spp.constructor == oc){
140 sb.override = function(o){
143 sbp.superclass = sbp.supr = (function(){
147 Ext.override(sb, overrides);
148 sb.extend = function(o){return Ext.extend(sb, o);};
154 override : function(origclass, overrides){
156 var p = origclass.prototype;
157 Ext.apply(p, overrides);
158 if(Ext.isIE && overrides.hasOwnProperty('toString')){
159 p.toString = overrides.toString;
165 namespace : function(){
167 Ext.each(arguments, function(v) {
169 o = window[d[0]] = window[d[0]] || {};
170 Ext.each(d.slice(1), function(v2){
171 o = o[v2] = o[v2] || {};
178 urlEncode : function(o, pre){
181 e = encodeURIComponent;
183 Ext.iterate(o, function(key, item){
184 empty = Ext.isEmpty(item);
185 Ext.each(empty ? key : item, function(val){
186 buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : '');
193 return pre + buf.join('');
197 urlDecode : function(string, overwrite){
198 if(Ext.isEmpty(string)){
202 pairs = string.split('&'),
203 d = decodeURIComponent,
206 Ext.each(pairs, function(pair) {
207 pair = pair.split('=');
210 obj[name] = overwrite || !obj[name] ? value :
211 [].concat(obj[name]).concat(value);
217 urlAppend : function(url, s){
219 return url + (url.indexOf('?') === -1 ? '?' : '&') + s;
225 toArray : function(){
227 function(a, i, j, res){
229 for(var x = 0, len = a.length; x < len; x++) {
232 return res.slice(i || 0, j || res.length);
235 return Array.prototype.slice.call(a, i || 0, j || a.length);
239 isIterable : function(v){
241 if(Ext.isArray(v) || v.callee){
245 if(/NodeList|HTMLCollection/.test(toString.call(v))){
250 return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length));
254 each : function(array, fn, scope){
255 if(Ext.isEmpty(array, true)){
258 if(!Ext.isIterable(array) || Ext.isPrimitive(array)){
261 for(var i = 0, len = array.length; i < len; i++){
262 if(fn.call(scope || array[i], array[i], i, array) === false){
269 iterate : function(obj, fn, scope){
270 if(Ext.isEmpty(obj)){
273 if(Ext.isIterable(obj)){
274 Ext.each(obj, fn, scope);
276 }else if(typeof obj == 'object'){
277 for(var prop in obj){
278 if(obj.hasOwnProperty(prop)){
279 if(fn.call(scope || obj, prop, obj[prop], obj) === false){
288 getDom : function(el, strict){
295 if (typeof el == 'string') {
296 var e = DOC.getElementById(el);
299 if (e && isIE && strict) {
300 if (el == e.getAttribute('id')) {
314 getBody : function(){
315 return Ext.get(DOC.body || DOC.documentElement);
320 removeNode : isIE && !isIE8 ? function(){
323 if(n && n.tagName != 'BODY'){
324 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
325 d = d || DOC.createElement('div');
328 delete Ext.elCache[n.id];
332 if(n && n.parentNode && n.tagName != 'BODY'){
333 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
334 n.parentNode.removeChild(n);
335 delete Ext.elCache[n.id];
340 isEmpty : function(v, allowBlank){
341 return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false);
345 isArray : function(v){
346 return toString.apply(v) === '[object Array]';
350 isDate : function(v){
351 return toString.apply(v) === '[object Date]';
355 isObject : function(v){
356 return !!v && Object.prototype.toString.call(v) === '[object Object]';
360 isPrimitive : function(v){
361 return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v);
365 isFunction : function(v){
366 return toString.apply(v) === '[object Function]';
370 isNumber : function(v){
371 return typeof v === 'number' && isFinite(v);
375 isString : function(v){
376 return typeof v === 'string';
380 isBoolean : function(v){
381 return typeof v === 'boolean';
385 isElement : function(v) {
386 return v ? !!v.tagName : false;
390 isDefined : function(v){
391 return typeof v !== 'undefined';
403 isSafari3 : isSafari3,
405 isSafari4 : isSafari4,
407 isSafari2 : isSafari2,
423 isBorderBox : isBorderBox,
427 isWindows : isWindows,
435 Ext.ns = Ext.namespace;
438 Ext.ns("Ext.util", "Ext.lib", "Ext.data");
443 Ext.apply(Function.prototype, {
445 createInterceptor : function(fcn, scope){
447 return !Ext.isFunction(fcn) ?
454 return (fcn.apply(scope || me || window, args) !== false) ?
455 method.apply(me || window, args) :
461 createCallback : function(){
463 var args = arguments,
466 return method.apply(window, args);
471 createDelegate : function(obj, args, appendArgs){
474 var callArgs = args || arguments;
475 if (appendArgs === true){
476 callArgs = Array.prototype.slice.call(arguments, 0);
477 callArgs = callArgs.concat(args);
478 }else if (Ext.isNumber(appendArgs)){
479 callArgs = Array.prototype.slice.call(arguments, 0);
480 var applyArgs = [appendArgs, 0].concat(args);
481 Array.prototype.splice.apply(callArgs, applyArgs);
483 return method.apply(obj || window, callArgs);
488 defer : function(millis, obj, args, appendArgs){
489 var fn = this.createDelegate(obj, args, appendArgs);
491 return setTimeout(fn, millis);
499 Ext.applyIf(String, {
501 format : function(format){
502 var args = Ext.toArray(arguments, 1);
503 return format.replace(/\{(\d+)\}/g, function(m, i){
510 Ext.applyIf(Array.prototype, {
512 indexOf : function(o, from){
513 var len = this.length;
515 from += (from < 0) ? len : 0;
516 for (; from < len; ++from){
517 if(this[from] === o){
525 remove : function(o){
526 var index = this.indexOf(o);
528 this.splice(index, 1);
535 Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
536 "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct");
539 Ext.apply(Ext, function(){
546 emptyFn : function(){},
549 BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ?
550 'http:/' + '/www.extjs.com/s.gif' :
551 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
553 extendX : function(supr, fn){
554 return Ext.extend(supr, fn(supr.prototype));
559 return Ext.get(document);
563 num : function(v, defaultValue){
564 v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v);
565 return isNaN(v) ? defaultValue : v;
569 value : function(v, defaultValue, allowBlank){
570 return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
574 escapeRe : function(s) {
575 return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
578 sequence : function(o, name, fn, scope){
579 o[name] = o[name].createSequence(fn, scope);
583 addBehaviors : function(o){
585 Ext.onReady(function(){
594 if ((parts = b.split('@'))[1]) {
597 cache[s] = Ext.select(s);
599 cache[s].on(parts[1], o[b]);
607 getScrollBarWidth: function(force){
612 if(force === true || scrollWidth === null){
614 var div = Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
615 child = div.child('div', true);
616 var w1 = child.offsetWidth;
617 div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll');
618 var w2 = child.offsetWidth;
621 scrollWidth = w1 - w2 + 2;
628 combine : function(){
629 var as = arguments, l = as.length, r = [];
630 for(var i = 0; i < l; i++){
634 }else if(a.length !== undefined && !a.substr){
635 r = r.concat(Array.prototype.slice.call(a, 0));
644 copyTo : function(dest, source, names){
645 if(typeof names == 'string'){
646 names = names.split(/[,;\s]/);
648 Ext.each(names, function(name){
649 if(source.hasOwnProperty(name)){
650 dest[name] = source[name];
657 destroy : function(){
658 Ext.each(arguments, function(arg){
660 if(Ext.isArray(arg)){
661 this.destroy.apply(this, arg);
662 }else if(typeof arg.destroy == 'function'){
672 destroyMembers : function(o, arg1, arg2, etc){
673 for(var i = 1, a = arguments, len = a.length; i < len; i++) {
674 Ext.destroy(o[a[i]]);
680 clean : function(arr){
682 Ext.each(arr, function(v){
691 unique : function(arr){
695 Ext.each(arr, function(v) {
705 flatten : function(arr){
707 function rFlatten(a) {
708 Ext.each(a, function(v) {
717 return rFlatten(arr);
721 min : function(arr, comp){
723 comp = comp || function(a,b){ return a < b ? -1 : 1; };
724 Ext.each(arr, function(v) {
725 ret = comp(ret, v) == -1 ? ret : v;
731 max : function(arr, comp){
733 comp = comp || function(a,b){ return a > b ? 1 : -1; };
734 Ext.each(arr, function(v) {
735 ret = comp(ret, v) == 1 ? ret : v;
741 mean : function(arr){
742 return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined;
748 Ext.each(arr, function(v) {
755 partition : function(arr, truth){
757 Ext.each(arr, function(v, i, a) {
758 ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v);
764 invoke : function(arr, methodName){
766 args = Array.prototype.slice.call(arguments, 2);
767 Ext.each(arr, function(v,i) {
768 if (v && typeof v[methodName] == 'function') {
769 ret.push(v[methodName].apply(v, args));
778 pluck : function(arr, prop){
780 Ext.each(arr, function(v) {
788 var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
791 len = Ext.max(Ext.pluck(arrs, "length")),
794 for (var i = 0; i < len; i++) {
797 ret[i] = fn.apply(fn, Ext.pluck(arrs, i));
799 for (var j = 0, aLen = arrs.length; j < aLen; j++){
800 ret[i].push( arrs[j][i] );
808 getCmp : function(id){
809 return Ext.ComponentMgr.get(id);
813 useShims: E.isIE6 || (E.isMac && E.isGecko2),
818 if(o === undefined || o === null){
825 if(t == 'object' && o.nodeName) {
827 case 1: return 'element';
828 case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';
831 if(t == 'object' || t == 'function') {
832 switch(o.constructor) {
833 case Array: return 'array';
834 case RegExp: return 'regexp';
835 case Date: return 'date';
837 if(typeof o.length == 'number' && typeof o.item == 'function') {
844 intercept : function(o, name, fn, scope){
845 o[name] = o[name].createInterceptor(fn, scope);
849 callback : function(cb, scope, args, delay){
850 if(typeof cb == 'function'){
852 cb.defer(delay, scope, args || []);
854 cb.apply(scope, args || []);
862 Ext.apply(Function.prototype, {
864 createSequence : function(fcn, scope){
866 return (typeof fcn != 'function') ?
869 var retval = method.apply(this || window, arguments);
870 fcn.apply(scope || this || window, arguments);
878 Ext.applyIf(String, {
881 escape : function(string) {
882 return string.replace(/('|\\)/g, "\\$1");
886 leftPad : function (val, size, ch) {
887 var result = String(val);
891 while (result.length < size) {
892 result = ch + result;
899 String.prototype.toggle = function(value, other){
900 return this == value ? other : value;
904 String.prototype.trim = function(){
905 var re = /^\s+|\s+$/g;
906 return function(){ return this.replace(re, ""); };
911 Date.prototype.getElapsed = function(date) {
912 return Math.abs((date || new Date()).getTime()-this.getTime());
917 Ext.applyIf(Number.prototype, {
919 constrain : function(min, max){
920 return Math.min(Math.max(this, min), max);
924 Ext.util.TaskRunner = function(interval){
925 interval = interval || 10;
932 stopThread = function(){
939 startThread = function(){
942 id = setInterval(runTasks, interval);
947 removeTask = function(t){
950 t.onStop.apply(t.scope || t);
955 runTasks = function(){
956 var rqLen = removeQueue.length,
957 now = new Date().getTime();
960 for(var i = 0; i < rqLen; i++){
961 tasks.remove(removeQueue[i]);
964 if(tasks.length < 1){
969 for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){
971 itime = now - t.taskRunTime;
972 if(t.interval <= itime){
973 rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]);
975 if(rt === false || t.taskRunCount === t.repeat){
980 if(t.duration && t.duration <= (now - t.taskStartTime)){
987 this.start = function(task){
989 task.taskStartTime = new Date().getTime();
990 task.taskRunTime = 0;
991 task.taskRunCount = 0;
997 this.stop = function(task){
1003 this.stopAll = function(){
1005 for(var i = 0, len = tasks.length; i < len; i++){
1006 if(tasks[i].onStop){
1016 Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
1020 if (!libFlyweight) {
1021 libFlyweight = new Ext.Element.Flyweight();
1023 libFlyweight.dom = el;
1024 return libFlyweight;
1029 isCSS1 = doc.compatMode == "CSS1Compat",
1032 PARSEINT = parseInt;
1035 isAncestor : function(p, c) {
1042 return p.contains(c);
1043 } else if (p.compareDocumentPosition) {
1044 return !!(p.compareDocumentPosition(c) & 16);
1046 while (c = c.parentNode) {
1047 ret = c == p || ret;
1054 getViewWidth : function(full) {
1055 return full ? this.getDocumentWidth() : this.getViewportWidth();
1058 getViewHeight : function(full) {
1059 return full ? this.getDocumentHeight() : this.getViewportHeight();
1062 getDocumentHeight: function() {
1063 return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight());
1066 getDocumentWidth: function() {
1067 return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth());
1070 getViewportHeight: function(){
1072 (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
1076 getViewportWidth : function() {
1077 return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth :
1078 Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth;
1081 getY : function(el) {
1082 return this.getXY(el)[1];
1085 getX : function(el) {
1086 return this.getXY(el)[0];
1089 getXY : function(el) {
1100 bd = (doc.body || doc.documentElement),
1103 el = Ext.getDom(el);
1106 if (el.getBoundingClientRect) {
1107 b = el.getBoundingClientRect();
1108 scroll = fly(document).getScroll();
1109 ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)];
1112 hasAbsolute = fly(el).isStyle("position", "absolute");
1119 hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute");
1122 y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0;
1123 x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0;
1125 if (p != el && !pe.isStyle('overflow','visible')) {
1133 if (Ext.isSafari && hasAbsolute) {
1138 if (Ext.isGecko && !hasAbsolute) {
1140 x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0;
1141 y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0;
1145 while (p && p != bd) {
1146 if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) {
1158 setXY : function(el, xy) {
1159 (el = Ext.fly(el, '_setXY')).position();
1161 var pts = el.translatePoints(xy),
1162 style = el.dom.style,
1166 if(!isNaN(pts[pos])) style[pos] = pts[pos] + "px"
1170 setX : function(el, x) {
1171 this.setXY(el, [x, false]);
1174 setY : function(el, y) {
1175 this.setXY(el, [false, y]);
1178 })();Ext.lib.Dom.getRegion = function(el) {
1179 return Ext.lib.Region.getRegion(el);
1180 };Ext.lib.Event = function() {
1181 var loadComplete = false,
1182 unloadListeners = {},
1199 SCROLLLEFT = 'scrollLeft',
1200 SCROLLTOP = 'scrollTop',
1202 MOUSEOVER = 'mouseover',
1203 MOUSEOUT = 'mouseout',
1205 doAdd = function() {
1207 if (win.addEventListener) {
1208 ret = function(el, eventName, fn, capture) {
1209 if (eventName == 'mouseenter') {
1210 fn = fn.createInterceptor(checkRelatedTarget);
1211 el.addEventListener(MOUSEOVER, fn, (capture));
1212 } else if (eventName == 'mouseleave') {
1213 fn = fn.createInterceptor(checkRelatedTarget);
1214 el.addEventListener(MOUSEOUT, fn, (capture));
1216 el.addEventListener(eventName, fn, (capture));
1220 } else if (win.attachEvent) {
1221 ret = function(el, eventName, fn, capture) {
1222 el.attachEvent("on" + eventName, fn);
1231 doRemove = function(){
1233 if (win.removeEventListener) {
1234 ret = function (el, eventName, fn, capture) {
1235 if (eventName == 'mouseenter') {
1236 eventName = MOUSEOVER;
1237 } else if (eventName == 'mouseleave') {
1238 eventName = MOUSEOUT;
1240 el.removeEventListener(eventName, fn, (capture));
1242 } else if (win.detachEvent) {
1243 ret = function (el, eventName, fn) {
1244 el.detachEvent("on" + eventName, fn);
1252 function checkRelatedTarget(e) {
1253 return !elContains(e.currentTarget, pub.getRelatedTarget(e));
1256 function elContains(parent, child) {
1257 if(parent && parent.firstChild){
1259 if(child === parent) {
1262 child = child.parentNode;
1263 if(child && (child.nodeType != 1)) {
1272 function _tryPreloadAttach() {
1275 element, i, v, override,
1276 tryAgain = !loadComplete || (retryCount > 0);
1281 for(i = 0; i < onAvailStack.length; ++i){
1282 v = onAvailStack[i];
1283 if(v && (element = doc.getElementById(v.id))){
1284 if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) {
1285 override = v.override;
1286 element = override ? (override === true ? v.obj : override) : element;
1287 v.fn.call(element, v.obj);
1288 onAvailStack.remove(v);
1296 retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
1301 clearInterval(_interval);
1304 ret = !(locked = false);
1310 function startInterval() {
1312 var callback = function() {
1313 _tryPreloadAttach();
1315 _interval = setInterval(callback, POLL_INTERVAL);
1320 function getScroll() {
1321 var dd = doc.documentElement,
1323 if(dd && (dd[SCROLLTOP] || dd[SCROLLLEFT])){
1324 return [dd[SCROLLLEFT], dd[SCROLLTOP]];
1326 return [db[SCROLLLEFT], db[SCROLLTOP]];
1333 function getPageCoord (ev, xy) {
1334 ev = ev.browserEvent || ev;
1335 var coord = ev['page' + xy];
1336 if (!coord && coord !== 0) {
1337 coord = ev['client' + xy] || 0;
1340 coord += getScroll()[xy == "X" ? 0 : 1];
1349 onAvailable : function(p_id, p_fn, p_obj, p_override) {
1354 override: p_override,
1355 checkReady: false });
1357 retryCount = POLL_RETRYS;
1362 addListener: function(el, eventName, fn) {
1363 el = Ext.getDom(el);
1365 if (eventName == UNLOAD) {
1366 if (unloadListeners[el.id] === undefined) {
1367 unloadListeners[el.id] = [];
1369 unloadListeners[el.id].push([eventName, fn]);
1372 return doAdd(el, eventName, fn, false);
1378 removeListener: function(el, eventName, fn) {
1379 el = Ext.getDom(el);
1380 var i, len, li, lis;
1382 if(eventName == UNLOAD){
1383 if((lis = unloadListeners[el.id]) !== undefined){
1384 for(i = 0, len = lis.length; i < len; i++){
1385 if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){
1386 unloadListeners[el.id].splice(i, 1);
1392 doRemove(el, eventName, fn, false);
1396 getTarget : function(ev) {
1397 ev = ev.browserEvent || ev;
1398 return this.resolveTextNode(ev.target || ev.srcElement);
1401 resolveTextNode : Ext.isGecko ? function(node){
1406 var s = HTMLElement.prototype.toString.call(node);
1407 if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){
1410 return node.nodeType == 3 ? node.parentNode : node;
1412 return node && node.nodeType == 3 ? node.parentNode : node;
1415 getRelatedTarget : function(ev) {
1416 ev = ev.browserEvent || ev;
1417 return this.resolveTextNode(ev.relatedTarget ||
1418 (ev.type == MOUSEOUT ? ev.toElement :
1419 ev.type == MOUSEOVER ? ev.fromElement : null));
1422 getPageX : function(ev) {
1423 return getPageCoord(ev, "X");
1426 getPageY : function(ev) {
1427 return getPageCoord(ev, "Y");
1431 getXY : function(ev) {
1432 return [this.getPageX(ev), this.getPageY(ev)];
1435 stopEvent : function(ev) {
1436 this.stopPropagation(ev);
1437 this.preventDefault(ev);
1440 stopPropagation : function(ev) {
1441 ev = ev.browserEvent || ev;
1442 if (ev.stopPropagation) {
1443 ev.stopPropagation();
1445 ev.cancelBubble = true;
1449 preventDefault : function(ev) {
1450 ev = ev.browserEvent || ev;
1451 if (ev.preventDefault) {
1452 ev.preventDefault();
1454 ev.returnValue = false;
1458 getEvent : function(e) {
1461 var c = this.getEvent.caller;
1464 if (e && Event == e.constructor) {
1473 getCharCode : function(ev) {
1474 ev = ev.browserEvent || ev;
1475 return ev.charCode || ev.keyCode || 0;
1480 getListeners : function(el, eventName) {
1481 Ext.EventManager.getListeners(el, eventName);
1485 purgeElement : function(el, recurse, eventName) {
1486 Ext.EventManager.purgeElement(el, recurse, eventName);
1489 _load : function(e) {
1490 loadComplete = true;
1491 var EU = Ext.lib.Event;
1492 if (Ext.isIE && e !== true) {
1495 doRemove(win, "load", arguments.callee);
1499 _unload : function(e) {
1500 var EU = Ext.lib.Event,
1501 i, j, l, v, ul, id, len, index, scope;
1504 for (id in unloadListeners) {
1505 ul = unloadListeners[id];
1506 for (i = 0, len = ul.length; i < len; i++) {
1510 scope = v[ADJ_SCOPE] ? (v[ADJ_SCOPE] === true ? v[OBJ] : v[ADJ_SCOPE]) : win;
1511 v[FN].call(scope, EU.getEvent(e), v[OBJ]);
1517 Ext.EventManager._unload();
1519 doRemove(win, UNLOAD, EU._unload);
1524 pub.on = pub.addListener;
1525 pub.un = pub.removeListener;
1526 if (doc && doc.body) {
1529 doAdd(win, "load", pub._load);
1531 doAdd(win, UNLOAD, pub._unload);
1532 _tryPreloadAttach();
1537 Ext.lib.Ajax = function() {
1538 var activeX = ['MSXML2.XMLHTTP.3.0',
1540 'Microsoft.XMLHTTP'],
1541 CONTENTTYPE = 'Content-Type';
1544 function setHeader(o) {
1548 function setTheHeaders(conn, headers){
1549 for (prop in headers) {
1550 if (headers.hasOwnProperty(prop)) {
1551 conn.setRequestHeader(prop, headers[prop]);
1556 if (pub.defaultHeaders) {
1557 setTheHeaders(conn, pub.defaultHeaders);
1561 setTheHeaders(conn, pub.headers);
1567 function createExceptionObject(tId, callbackArg, isAbort, isTimeout) {
1570 status : isAbort ? -1 : 0,
1571 statusText : isAbort ? 'transaction aborted' : 'communication failure',
1573 isTimeout: isTimeout,
1574 argument : callbackArg
1579 function initHeader(label, value) {
1580 (pub.headers = pub.headers || {})[label] = value;
1584 function createResponseObject(o, callbackArg) {
1591 isBrokenStatus = conn.status == 1223;
1594 headerStr = o.conn.getAllResponseHeaders();
1595 Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){
1598 s = v.substr(0, t).toLowerCase();
1599 if(v.charAt(t + 1) == ' '){
1602 headerObj[s] = v.substr(t + 1);
1610 status : isBrokenStatus ? 204 : conn.status,
1611 statusText : isBrokenStatus ? 'No Content' : conn.statusText,
1612 getResponseHeader : function(header){return headerObj[header.toLowerCase()];},
1613 getAllResponseHeaders : function(){return headerStr},
1614 responseText : conn.responseText,
1615 responseXML : conn.responseXML,
1616 argument : callbackArg
1621 function releaseObject(o) {
1623 pub.conn[o.tId] = null;
1630 function handleTransactionResponse(o, callback, isAbort, isTimeout) {
1636 var httpStatus, responseObject;
1639 if (o.conn.status !== undefined && o.conn.status != 0) {
1640 httpStatus = o.conn.status;
1650 if ((httpStatus >= 200 && httpStatus < 300) || (Ext.isIE && httpStatus == 1223)) {
1651 responseObject = createResponseObject(o, callback.argument);
1652 if (callback.success) {
1653 if (!callback.scope) {
1654 callback.success(responseObject);
1657 callback.success.apply(callback.scope, [responseObject]);
1662 switch (httpStatus) {
1669 responseObject = createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false), isTimeout);
1670 if (callback.failure) {
1671 if (!callback.scope) {
1672 callback.failure(responseObject);
1675 callback.failure.apply(callback.scope, [responseObject]);
1680 responseObject = createResponseObject(o, callback.argument);
1681 if (callback.failure) {
1682 if (!callback.scope) {
1683 callback.failure(responseObject);
1686 callback.failure.apply(callback.scope, [responseObject]);
1693 responseObject = null;
1697 function handleReadyState(o, callback){
1698 callback = callback || {};
1702 cbTimeout = callback.timeout || null;
1705 pub.conn[tId] = conn;
1706 pub.timeout[tId] = setTimeout(function() {
1707 pub.abort(o, callback, true);
1711 poll[tId] = setInterval(
1713 if (conn && conn.readyState == 4) {
1714 clearInterval(poll[tId]);
1718 clearTimeout(pub.timeout[tId]);
1719 pub.timeout[tId] = null;
1722 handleTransactionResponse(o, callback);
1729 function asyncRequest(method, uri, callback, postData) {
1730 var o = getConnectionObject() || null;
1733 o.conn.open(method, uri, true);
1735 if (pub.useDefaultXhrHeader) {
1736 initHeader('X-Requested-With', pub.defaultXhrHeader);
1739 if(postData && pub.useDefaultHeader && (!pub.headers || !pub.headers[CONTENTTYPE])){
1740 initHeader(CONTENTTYPE, pub.defaultPostHeader);
1743 if (pub.defaultHeaders || pub.headers) {
1747 handleReadyState(o, callback);
1748 o.conn.send(postData || null);
1754 function getConnectionObject() {
1758 if (o = createXhrObject(pub.transactionId)) {
1759 pub.transactionId++;
1768 function createXhrObject(transactionId) {
1772 http = new XMLHttpRequest();
1774 for (var i = 0; i < activeX.length; ++i) {
1776 http = new ActiveXObject(activeX[i]);
1781 return {conn : http, tId : transactionId};
1786 request : function(method, uri, cb, data, options) {
1789 xmlData = options.xmlData,
1790 jsonData = options.jsonData,
1793 Ext.applyIf(me, options);
1795 if(xmlData || jsonData){
1797 if(!hs || !hs[CONTENTTYPE]){
1798 initHeader(CONTENTTYPE, xmlData ? 'text/xml' : 'application/json');
1800 data = xmlData || (!Ext.isPrimitive(jsonData) ? Ext.encode(jsonData) : jsonData);
1803 return asyncRequest(method || options.method || "POST", uri, cb, data);
1806 serializeForm : function(form) {
1807 var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements,
1809 encoder = encodeURIComponent,
1817 Ext.each(fElements, function(element) {
1818 name = element.name;
1819 type = element.type;
1821 if (!element.disabled && name){
1822 if(/select-(one|multiple)/i.test(type)) {
1823 Ext.each(element.options, function(opt) {
1825 data += String.format("{0}={1}&", encoder(name), encoder((opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttribute('value') !== null) ? opt.value : opt.text));
1828 } else if(!/file|undefined|reset|button/i.test(type)) {
1829 if(!(/radio|checkbox/i.test(type) && !element.checked) && !(type == 'submit' && hasSubmit)){
1831 data += encoder(name) + '=' + encoder(element.value) + '&';
1832 hasSubmit = /submit/i.test(type);
1837 return data.substr(0, data.length - 1);
1840 useDefaultHeader : true,
1841 defaultPostHeader : 'application/x-www-form-urlencoded; charset=UTF-8',
1842 useDefaultXhrHeader : true,
1843 defaultXhrHeader : 'XMLHttpRequest',
1877 abort : function(o, callback, isTimeout) {
1882 if (me.isCallInProgress(o)) {
1884 clearInterval(me.poll[tId]);
1885 me.poll[tId] = null;
1886 clearTimeout(pub.timeout[tId]);
1887 me.timeout[tId] = null;
1889 handleTransactionResponse(o, callback, (isAbort = true), isTimeout);
1894 isCallInProgress : function(o) {
1896 return o.conn && !{0:true,4:true}[o.conn.readyState];
1900 }(); Ext.lib.Region = function(t, r, b, l) {
1910 Ext.lib.Region.prototype = {
1911 contains : function(region) {
1913 return ( region.left >= me.left &&
1914 region.right <= me.right &&
1915 region.top >= me.top &&
1916 region.bottom <= me.bottom );
1920 getArea : function() {
1922 return ( (me.bottom - me.top) * (me.right - me.left) );
1925 intersect : function(region) {
1927 t = Math.max(me.top, region.top),
1928 r = Math.min(me.right, region.right),
1929 b = Math.min(me.bottom, region.bottom),
1930 l = Math.max(me.left, region.left);
1932 if (b >= t && r >= l) {
1933 return new Ext.lib.Region(t, r, b, l);
1937 union : function(region) {
1939 t = Math.min(me.top, region.top),
1940 r = Math.max(me.right, region.right),
1941 b = Math.max(me.bottom, region.bottom),
1942 l = Math.min(me.left, region.left);
1944 return new Ext.lib.Region(t, r, b, l);
1947 constrainTo : function(r) {
1949 me.top = me.top.constrain(r.top, r.bottom);
1950 me.bottom = me.bottom.constrain(r.top, r.bottom);
1951 me.left = me.left.constrain(r.left, r.right);
1952 me.right = me.right.constrain(r.left, r.right);
1956 adjust : function(t, l, b, r) {
1966 Ext.lib.Region.getRegion = function(el) {
1967 var p = Ext.lib.Dom.getXY(el),
1969 r = p[0] + el.offsetWidth,
1970 b = p[1] + el.offsetHeight,
1973 return new Ext.lib.Region(t, r, b, l);
1974 }; Ext.lib.Point = function(x, y) {
1975 if (Ext.isArray(x)) {
1980 me.x = me.right = me.left = me[0] = x;
1981 me.y = me.top = me.bottom = me[1] = y;
1984 Ext.lib.Point.prototype = new Ext.lib.Region();
1986 var EXTLIB = Ext.lib,
1987 noNegatives = /width|height|opacity|padding/i,
1988 offsetAttribute = /^((width|height)|(top|left))$/,
1989 defaultUnit = /width|height|top$|bottom$|left$|right$/i,
1990 offsetUnit = /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i,
1991 isset = function(v){
1992 return typeof v !== 'undefined';
1999 motion : function(el, args, duration, easing, cb, scope) {
2000 return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion);
2003 run : function(el, args, duration, easing, cb, scope, type) {
2004 type = type || Ext.lib.AnimBase;
2005 if (typeof easing == "string") {
2006 easing = Ext.lib.Easing[easing];
2008 var anim = new type(el, args, duration, easing);
2009 anim.animateX(function() {
2010 if(Ext.isFunction(cb)){
2018 EXTLIB.AnimBase = function(el, attributes, duration, method) {
2020 this.init(el, attributes, duration, method);
2024 EXTLIB.AnimBase.prototype = {
2025 doMethod: function(attr, start, end) {
2027 return me.method(me.curFrame, start, end - start, me.totalFrames);
2031 setAttr: function(attr, val, unit) {
2032 if (noNegatives.test(attr) && val < 0) {
2035 Ext.fly(this.el, '_anim').setStyle(attr, val + unit);
2039 getAttr: function(attr) {
2040 var el = Ext.fly(this.el),
2041 val = el.getStyle(attr),
2042 a = offsetAttribute.exec(attr) || [];
2044 if (val !== 'auto' && !offsetUnit.test(val)) {
2045 return parseFloat(val);
2048 return (!!(a[2]) || (el.getStyle('position') == 'absolute' && !!(a[3]))) ? el.dom['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)] : 0;
2052 getDefaultUnit: function(attr) {
2053 return defaultUnit.test(attr) ? 'px' : '';
2056 animateX : function(callback, scope) {
2059 me.onComplete.removeListener(f);
2060 if (Ext.isFunction(callback)) {
2061 callback.call(scope || me, me);
2064 me.onComplete.addListener(f, me);
2069 setRunAttr: function(attr) {
2071 a = this.attributes[attr],
2076 ra = (this.runAttrs[attr] = {}),
2079 if (!isset(to) && !isset(by)){
2083 var start = isset(from) ? from : me.getAttr(attr);
2086 }else if(isset(by)) {
2087 if (Ext.isArray(start)){
2089 for(var i=0,len=start.length; i<len; i++) {
2090 end[i] = start[i] + by[i];
2100 unit: isset(unit) ? unit : me.getDefaultUnit(attr)
2105 init: function(el, attributes, duration, method) {
2108 mgr = EXTLIB.AnimMgr;
2114 attributes: attributes || {},
2115 duration: duration || 1,
2116 method: method || EXTLIB.Easing.easeNone,
2119 totalFrames: mgr.fps,
2121 animate: function(){
2130 me.totalFrames = me.useSec ? Math.ceil(mgr.fps * d) : d;
2131 mgr.registerElement(me);
2134 stop: function(finish){
2138 me.curFrame = me.totalFrames;
2145 var onStart = function(){
2151 for(attr in this.attributes){
2152 this.setRunAttr(attr);
2155 me.isAnimated = true;
2156 me.startTime = now();
2161 var onTween = function(){
2165 duration: now() - me.startTime,
2166 curFrame: me.curFrame
2169 var ra = me.runAttrs;
2170 for (var attr in ra) {
2171 this.setAttr(attr, me.doMethod(attr, ra[attr].start, ra[attr].end), ra[attr].unit);
2177 var onComplete = function() {
2179 actual = (now() - me.startTime) / 1000,
2182 frames: actualFrames,
2183 fps: actualFrames / actual
2186 me.isAnimated = false;
2188 me.onComplete.fire(data);
2191 me.onStart = new Ext.util.Event(me);
2192 me.onTween = new Ext.util.Event(me);
2193 me.onComplete = new Ext.util.Event(me);
2194 (me._onStart = new Ext.util.Event(me)).addListener(onStart);
2195 (me._onTween = new Ext.util.Event(me)).addListener(onTween);
2196 (me._onComplete = new Ext.util.Event(me)).addListener(onComplete);
2201 Ext.lib.AnimMgr = new function() {
2211 registerElement: function(tween){
2214 tween._onStart.fire();
2218 unRegister: function(tween, index){
2219 tween._onComplete.fire();
2220 index = index || getIndex(tween);
2222 queue.splice(index, 1);
2225 if (--tweenCount <= 0) {
2231 if(thread === null){
2232 thread = setInterval(me.run, me.delay);
2236 stop: function(tween){
2238 clearInterval(thread);
2239 for(var i = 0, len = queue.length; i < len; ++i){
2240 if(queue[0].isAnimated){
2241 me.unRegister(queue[0], 0);
2249 me.unRegister(tween);
2254 var tf, i, len, tween;
2255 for(i = 0, len = queue.length; i<len; i++) {
2257 if(tween && tween.isAnimated){
2258 tf = tween.totalFrames;
2259 if(tween.curFrame < tf || tf === null){
2262 correctFrame(tween);
2264 tween._onTween.fire();
2273 var getIndex = function(anim) {
2275 for(i = 0, len = queue.length; i<len; i++) {
2276 if(queue[i] === anim) {
2283 var correctFrame = function(tween) {
2284 var frames = tween.totalFrames,
2285 frame = tween.curFrame,
2286 duration = tween.duration,
2287 expected = (frame * duration * 1000 / frames),
2288 elapsed = (now() - tween.startTime),
2291 if(elapsed < duration * 1000){
2292 tweak = Math.round((elapsed / expected - 1) * frame);
2294 tweak = frames - (frame + 1);
2296 if(tweak > 0 && isFinite(tweak)){
2297 if(tween.curFrame + tweak >= frames){
2298 tweak = frames - (frame + 1);
2300 tween.curFrame += tweak;
2305 EXTLIB.Bezier = new function() {
2307 this.getPosition = function(points, t) {
2308 var n = points.length,
2314 for (i = 0; i < n; ++i) {
2315 tmp[i] = [points[i][0], points[i][1]];
2318 for (j = 1; j < n; ++j) {
2319 for (i = 0; i < n - j; ++i) {
2320 tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
2321 tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
2325 return [ tmp[0][0], tmp[0][1] ];
2332 easeNone: function (t, b, c, d) {
2333 return c * t / d + b;
2337 easeIn: function (t, b, c, d) {
2338 return c * (t /= d) * t + b;
2342 easeOut: function (t, b, c, d) {
2343 return -c * (t /= d) * (t - 2) + b;
2348 EXTLIB.Motion = function(el, attributes, duration, method) {
2350 EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method);
2354 Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase);
2356 var superclass = EXTLIB.Motion.superclass,
2357 proto = EXTLIB.Motion.prototype,
2358 pointsRe = /^points$/i;
2360 Ext.apply(EXTLIB.Motion.prototype, {
2361 setAttr: function(attr, val, unit){
2363 setAttr = superclass.setAttr;
2365 if (pointsRe.test(attr)) {
2366 unit = unit || 'px';
2367 setAttr.call(me, 'left', val[0], unit);
2368 setAttr.call(me, 'top', val[1], unit);
2370 setAttr.call(me, attr, val, unit);
2374 getAttr: function(attr){
2376 getAttr = superclass.getAttr;
2378 return pointsRe.test(attr) ? [getAttr.call(me, 'left'), getAttr.call(me, 'top')] : getAttr.call(me, attr);
2381 doMethod: function(attr, start, end){
2384 return pointsRe.test(attr)
2385 ? EXTLIB.Bezier.getPosition(me.runAttrs[attr], me.method(me.curFrame, 0, 100, me.totalFrames) / 100)
2386 : superclass.doMethod.call(me, attr, start, end);
2389 setRunAttr: function(attr){
2390 if(pointsRe.test(attr)){
2394 points = this.attributes.points,
2395 control = points.control || [],
2407 if(control.length > 0 && !Ext.isArray(control[0])){
2408 control = [control];
2413 Ext.fly(el, '_anim').position();
2414 DOM.setXY(el, isset(from) ? from : DOM.getXY(el));
2415 start = me.getAttr('points');
2419 end = translateValues.call(me, to, start);
2420 for (i = 0,len = control.length; i < len; ++i) {
2421 control[i] = translateValues.call(me, control[i], start);
2423 } else if (isset(by)) {
2424 end = [start[0] + by[0], start[1] + by[1]];
2426 for (i = 0,len = control.length; i < len; ++i) {
2427 control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
2431 ra = this.runAttrs[attr] = [start];
2432 if (control.length > 0) {
2433 ra = ra.concat(control);
2436 ra[ra.length] = end;
2438 superclass.setRunAttr.call(this, attr);
2443 var translateValues = function(val, start) {
2444 var pageXY = EXTLIB.Dom.getXY(this.el);
2445 return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]];
2458 Ext.apply(EXTLIB.Easing, {
2460 easeBoth: function (t, b, c, d) {
2461 return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b;
2464 easeInStrong: function (t, b, c, d) {
2465 return c * (t /= d) * t * t * t + b;
2468 easeOutStrong: function (t, b, c, d) {
2469 return -c * ((t = t / d - 1) * t * t * t - 1) + b;
2472 easeBothStrong: function (t, b, c, d) {
2473 return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b;
2476 elasticIn: function (t, b, c, d, a, p) {
2477 if (t == 0 || (t /= d) == 1) {
2478 return t == 0 ? b : b + c;
2484 s = p / (2 * pi) * asin(c / a);
2490 return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b;
2494 elasticOut: function (t, b, c, d, a, p) {
2495 if (t == 0 || (t /= d) == 1) {
2496 return t == 0 ? b : b + c;
2502 s = p / (2 * pi) * asin(c / a);
2508 return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b;
2511 elasticBoth: function (t, b, c, d, a, p) {
2512 if (t == 0 || (t /= d / 2) == 2) {
2513 return t == 0 ? b : b + c;
2516 p = p || (d * (.3 * 1.5));
2520 s = p / (2 * pi) * asin(c / a);
2527 -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b :
2528 a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b;
2531 backIn: function (t, b, c, d, s) {
2533 return c * (t /= d) * t * ((s + 1) * t - s) + b;
2537 backOut: function (t, b, c, d, s) {
2541 return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
2545 backBoth: function (t, b, c, d, s) {
2548 return ((t /= d / 2 ) < 1) ?
2549 c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b :
2550 c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
2554 bounceIn: function (t, b, c, d) {
2555 return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b;
2559 bounceOut: function (t, b, c, d) {
2560 if ((t /= d) < (1 / 2.75)) {
2561 return c * (7.5625 * t * t) + b;
2562 } else if (t < (2 / 2.75)) {
2563 return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
2564 } else if (t < (2.5 / 2.75)) {
2565 return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
2567 return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
2571 bounceBoth: function (t, b, c, d) {
2572 return (t < d / 2) ?
2573 EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b :
2574 EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
2580 var EXTLIB = Ext.lib;
2582 EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) {
2583 return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim);
2586 EXTLIB.ColorAnim = function(el, attributes, duration, method) {
2587 EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
2590 Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase);
2592 var superclass = EXTLIB.ColorAnim.superclass,
2593 colorRE = /color$/i,
2594 transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/,
2595 rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
2596 hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
2597 hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,
2598 isset = function(v){
2599 return typeof v !== 'undefined';
2603 function parseColor(s) {
2609 if (s.length == 3) {
2613 Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){
2614 base = (idx % 2 == 0) ? 16 : 10;
2616 if(c && c.length == 4){
2617 out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)];
2624 Ext.apply(EXTLIB.ColorAnim.prototype, {
2625 getAttr : function(attr) {
2629 if(colorRE.test(attr)){
2630 while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){
2635 val = superclass.getAttr.call(me, attr);
2640 doMethod : function(attr, start, end) {
2648 if(colorRE.test(attr)){
2652 for(i = 0, len = start.length; i < len; i++) {
2654 val[i] = superclass.doMethod.call(me, attr, v, end[i]);
2656 val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')';
2658 val = superclass.doMethod.call(me, attr, start, end);
2663 setRunAttr : function(attr) {
2665 a = me.attributes[attr],
2670 superclass.setRunAttr.call(me, attr);
2671 ra = me.runAttrs[attr];
2672 if(colorRE.test(attr)){
2673 var start = parseColor(ra.start),
2674 end = parseColor(ra.end);
2676 if(!isset(to) && isset(by)){
2677 end = parseColor(by);
2678 for(var i=0,len=start.length; i<len; i++) {
2679 end[i] = start[i] + end[i];
2692 var EXTLIB = Ext.lib;
2693 EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) {
2694 return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll);
2697 EXTLIB.Scroll = function(el, attributes, duration, method) {
2699 EXTLIB.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
2703 Ext.extend(EXTLIB.Scroll, EXTLIB.ColorAnim);
2705 var superclass = EXTLIB.Scroll.superclass,
2708 Ext.apply(EXTLIB.Scroll.prototype, {
2710 doMethod : function(attr, start, end) {
2713 curFrame = me.curFrame,
2714 totalFrames = me.totalFrames;
2717 val = [me.method(curFrame, start[0], end[0] - start[0], totalFrames),
2718 me.method(curFrame, start[1], end[1] - start[1], totalFrames)];
2720 val = superclass.doMethod.call(me, attr, start, end);
2725 getAttr : function(attr) {
2728 if (attr == SCROLL) {
2729 return [me.el.scrollLeft, me.el.scrollTop];
2731 return superclass.getAttr.call(me, attr);
2735 setAttr : function(attr, val, unit) {
2739 me.el.scrollLeft = val[0];
2740 me.el.scrollTop = val[1];
2742 superclass.setAttr.call(me, attr, val, unit);
2748 function fnCleanUp() {
2749 var p = Function.prototype;
2750 delete p.createSequence;
2752 delete p.createDelegate;
2753 delete p.createCallback;
2754 delete p.createInterceptor;
2756 window.detachEvent("onunload", fnCleanUp);
2758 window.attachEvent("onunload", fnCleanUp);