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);
319 getHead : function() {
323 if (head == undefined) {
324 head = Ext.get(DOC.getElementsByTagName("head")[0]);
333 removeNode : isIE && !isIE8 ? function(){
336 if(n && n.tagName != 'BODY'){
337 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
338 d = d || DOC.createElement('div');
341 delete Ext.elCache[n.id];
345 if(n && n.parentNode && n.tagName != 'BODY'){
346 (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
347 n.parentNode.removeChild(n);
348 delete Ext.elCache[n.id];
353 isEmpty : function(v, allowBlank){
354 return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false);
358 isArray : function(v){
359 return toString.apply(v) === '[object Array]';
363 isDate : function(v){
364 return toString.apply(v) === '[object Date]';
368 isObject : function(v){
369 return !!v && Object.prototype.toString.call(v) === '[object Object]';
373 isPrimitive : function(v){
374 return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v);
378 isFunction : function(v){
379 return toString.apply(v) === '[object Function]';
383 isNumber : function(v){
384 return typeof v === 'number' && isFinite(v);
388 isString : function(v){
389 return typeof v === 'string';
393 isBoolean : function(v){
394 return typeof v === 'boolean';
398 isElement : function(v) {
399 return v ? !!v.tagName : false;
403 isDefined : function(v){
404 return typeof v !== 'undefined';
416 isSafari3 : isSafari3,
418 isSafari4 : isSafari4,
420 isSafari2 : isSafari2,
436 isBorderBox : isBorderBox,
440 isWindows : isWindows,
448 Ext.ns = Ext.namespace;
451 Ext.ns("Ext.util", "Ext.lib", "Ext.data");
456 Ext.apply(Function.prototype, {
458 createInterceptor : function(fcn, scope){
460 return !Ext.isFunction(fcn) ?
467 return (fcn.apply(scope || me || window, args) !== false) ?
468 method.apply(me || window, args) :
474 createCallback : function(){
476 var args = arguments,
479 return method.apply(window, args);
484 createDelegate : function(obj, args, appendArgs){
487 var callArgs = args || arguments;
488 if (appendArgs === true){
489 callArgs = Array.prototype.slice.call(arguments, 0);
490 callArgs = callArgs.concat(args);
491 }else if (Ext.isNumber(appendArgs)){
492 callArgs = Array.prototype.slice.call(arguments, 0);
493 var applyArgs = [appendArgs, 0].concat(args);
494 Array.prototype.splice.apply(callArgs, applyArgs);
496 return method.apply(obj || window, callArgs);
501 defer : function(millis, obj, args, appendArgs){
502 var fn = this.createDelegate(obj, args, appendArgs);
504 return setTimeout(fn, millis);
512 Ext.applyIf(String, {
514 format : function(format){
515 var args = Ext.toArray(arguments, 1);
516 return format.replace(/\{(\d+)\}/g, function(m, i){
523 Ext.applyIf(Array.prototype, {
525 indexOf : function(o, from){
526 var len = this.length;
528 from += (from < 0) ? len : 0;
529 for (; from < len; ++from){
530 if(this[from] === o){
538 remove : function(o){
539 var index = this.indexOf(o);
541 this.splice(index, 1);
548 Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
549 "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct");
552 Ext.apply(Ext, function(){
559 emptyFn : function(){},
562 BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ?
563 'http:/' + '/www.extjs.com/s.gif' :
564 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
566 extendX : function(supr, fn){
567 return Ext.extend(supr, fn(supr.prototype));
572 return Ext.get(document);
576 num : function(v, defaultValue){
577 v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v);
578 return isNaN(v) ? defaultValue : v;
582 value : function(v, defaultValue, allowBlank){
583 return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
587 escapeRe : function(s) {
588 return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
591 sequence : function(o, name, fn, scope){
592 o[name] = o[name].createSequence(fn, scope);
596 addBehaviors : function(o){
598 Ext.onReady(function(){
607 if ((parts = b.split('@'))[1]) {
610 cache[s] = Ext.select(s);
612 cache[s].on(parts[1], o[b]);
620 getScrollBarWidth: function(force){
625 if(force === true || scrollWidth === null){
627 var div = Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
628 child = div.child('div', true);
629 var w1 = child.offsetWidth;
630 div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll');
631 var w2 = child.offsetWidth;
634 scrollWidth = w1 - w2 + 2;
641 combine : function(){
642 var as = arguments, l = as.length, r = [];
643 for(var i = 0; i < l; i++){
647 }else if(a.length !== undefined && !a.substr){
648 r = r.concat(Array.prototype.slice.call(a, 0));
657 copyTo : function(dest, source, names){
658 if(typeof names == 'string'){
659 names = names.split(/[,;\s]/);
661 Ext.each(names, function(name){
662 if(source.hasOwnProperty(name)){
663 dest[name] = source[name];
670 destroy : function(){
671 Ext.each(arguments, function(arg){
673 if(Ext.isArray(arg)){
674 this.destroy.apply(this, arg);
675 }else if(typeof arg.destroy == 'function'){
685 destroyMembers : function(o, arg1, arg2, etc){
686 for(var i = 1, a = arguments, len = a.length; i < len; i++) {
687 Ext.destroy(o[a[i]]);
693 clean : function(arr){
695 Ext.each(arr, function(v){
704 unique : function(arr){
708 Ext.each(arr, function(v) {
718 flatten : function(arr){
720 function rFlatten(a) {
721 Ext.each(a, function(v) {
730 return rFlatten(arr);
734 min : function(arr, comp){
736 comp = comp || function(a,b){ return a < b ? -1 : 1; };
737 Ext.each(arr, function(v) {
738 ret = comp(ret, v) == -1 ? ret : v;
744 max : function(arr, comp){
746 comp = comp || function(a,b){ return a > b ? 1 : -1; };
747 Ext.each(arr, function(v) {
748 ret = comp(ret, v) == 1 ? ret : v;
754 mean : function(arr){
755 return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined;
761 Ext.each(arr, function(v) {
768 partition : function(arr, truth){
770 Ext.each(arr, function(v, i, a) {
771 ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v);
777 invoke : function(arr, methodName){
779 args = Array.prototype.slice.call(arguments, 2);
780 Ext.each(arr, function(v,i) {
781 if (v && typeof v[methodName] == 'function') {
782 ret.push(v[methodName].apply(v, args));
791 pluck : function(arr, prop){
793 Ext.each(arr, function(v) {
801 var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }),
804 len = Ext.max(Ext.pluck(arrs, "length")),
807 for (var i = 0; i < len; i++) {
810 ret[i] = fn.apply(fn, Ext.pluck(arrs, i));
812 for (var j = 0, aLen = arrs.length; j < aLen; j++){
813 ret[i].push( arrs[j][i] );
821 getCmp : function(id){
822 return Ext.ComponentMgr.get(id);
826 useShims: E.isIE6 || (E.isMac && E.isGecko2),
831 if(o === undefined || o === null){
838 if(t == 'object' && o.nodeName) {
840 case 1: return 'element';
841 case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';
844 if(t == 'object' || t == 'function') {
845 switch(o.constructor) {
846 case Array: return 'array';
847 case RegExp: return 'regexp';
848 case Date: return 'date';
850 if(typeof o.length == 'number' && typeof o.item == 'function') {
857 intercept : function(o, name, fn, scope){
858 o[name] = o[name].createInterceptor(fn, scope);
862 callback : function(cb, scope, args, delay){
863 if(typeof cb == 'function'){
865 cb.defer(delay, scope, args || []);
867 cb.apply(scope, args || []);
875 Ext.apply(Function.prototype, {
877 createSequence : function(fcn, scope){
879 return (typeof fcn != 'function') ?
882 var retval = method.apply(this || window, arguments);
883 fcn.apply(scope || this || window, arguments);
891 Ext.applyIf(String, {
894 escape : function(string) {
895 return string.replace(/('|\\)/g, "\\$1");
899 leftPad : function (val, size, ch) {
900 var result = String(val);
904 while (result.length < size) {
905 result = ch + result;
912 String.prototype.toggle = function(value, other){
913 return this == value ? other : value;
917 String.prototype.trim = function(){
918 var re = /^\s+|\s+$/g;
919 return function(){ return this.replace(re, ""); };
924 Date.prototype.getElapsed = function(date) {
925 return Math.abs((date || new Date()).getTime()-this.getTime());
930 Ext.applyIf(Number.prototype, {
932 constrain : function(min, max){
933 return Math.min(Math.max(this, min), max);
937 Ext.util.TaskRunner = function(interval){
938 interval = interval || 10;
945 stopThread = function(){
952 startThread = function(){
955 id = setInterval(runTasks, interval);
960 removeTask = function(t){
963 t.onStop.apply(t.scope || t);
968 runTasks = function(){
969 var rqLen = removeQueue.length,
970 now = new Date().getTime();
973 for(var i = 0; i < rqLen; i++){
974 tasks.remove(removeQueue[i]);
977 if(tasks.length < 1){
982 for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){
984 itime = now - t.taskRunTime;
985 if(t.interval <= itime){
986 rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]);
988 if(rt === false || t.taskRunCount === t.repeat){
993 if(t.duration && t.duration <= (now - t.taskStartTime)){
1000 this.start = function(task){
1002 task.taskStartTime = new Date().getTime();
1003 task.taskRunTime = 0;
1004 task.taskRunCount = 0;
1010 this.stop = function(task){
1016 this.stopAll = function(){
1018 for(var i = 0, len = tasks.length; i < len; i++){
1019 if(tasks[i].onStop){
1029 Ext.TaskMgr = new Ext.util.TaskRunner();(function(){
1033 if (!libFlyweight) {
1034 libFlyweight = new Ext.Element.Flyweight();
1036 libFlyweight.dom = el;
1037 return libFlyweight;
1042 isCSS1 = doc.compatMode == "CSS1Compat",
1045 PARSEINT = parseInt;
1048 isAncestor : function(p, c) {
1055 return p.contains(c);
1056 } else if (p.compareDocumentPosition) {
1057 return !!(p.compareDocumentPosition(c) & 16);
1059 while (c = c.parentNode) {
1060 ret = c == p || ret;
1067 getViewWidth : function(full) {
1068 return full ? this.getDocumentWidth() : this.getViewportWidth();
1071 getViewHeight : function(full) {
1072 return full ? this.getDocumentHeight() : this.getViewportHeight();
1075 getDocumentHeight: function() {
1076 return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight());
1079 getDocumentWidth: function() {
1080 return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth());
1083 getViewportHeight: function(){
1085 (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
1089 getViewportWidth : function() {
1090 return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth :
1091 Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth;
1094 getY : function(el) {
1095 return this.getXY(el)[1];
1098 getX : function(el) {
1099 return this.getXY(el)[0];
1102 getXY : function(el) {
1113 bd = (doc.body || doc.documentElement),
1116 el = Ext.getDom(el);
1119 if (el.getBoundingClientRect) {
1120 b = el.getBoundingClientRect();
1121 scroll = fly(document).getScroll();
1122 ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)];
1125 hasAbsolute = fly(el).isStyle("position", "absolute");
1132 hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute");
1135 y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0;
1136 x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0;
1138 if (p != el && !pe.isStyle('overflow','visible')) {
1146 if (Ext.isSafari && hasAbsolute) {
1151 if (Ext.isGecko && !hasAbsolute) {
1153 x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0;
1154 y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0;
1158 while (p && p != bd) {
1159 if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) {
1171 setXY : function(el, xy) {
1172 (el = Ext.fly(el, '_setXY')).position();
1174 var pts = el.translatePoints(xy),
1175 style = el.dom.style,
1179 if(!isNaN(pts[pos])) style[pos] = pts[pos] + "px"
1183 setX : function(el, x) {
1184 this.setXY(el, [x, false]);
1187 setY : function(el, y) {
1188 this.setXY(el, [false, y]);
1191 })();Ext.lib.Dom.getRegion = function(el) {
1192 return Ext.lib.Region.getRegion(el);
1193 };Ext.lib.Event = function() {
1194 var loadComplete = false,
1195 unloadListeners = {},
1210 SCROLLLEFT = 'scrollLeft',
1211 SCROLLTOP = 'scrollTop',
1213 MOUSEOVER = 'mouseover',
1214 MOUSEOUT = 'mouseout',
1216 doAdd = function() {
1218 if (win.addEventListener) {
1219 ret = function(el, eventName, fn, capture) {
1220 if (eventName == 'mouseenter') {
1221 fn = fn.createInterceptor(checkRelatedTarget);
1222 el.addEventListener(MOUSEOVER, fn, (capture));
1223 } else if (eventName == 'mouseleave') {
1224 fn = fn.createInterceptor(checkRelatedTarget);
1225 el.addEventListener(MOUSEOUT, fn, (capture));
1227 el.addEventListener(eventName, fn, (capture));
1231 } else if (win.attachEvent) {
1232 ret = function(el, eventName, fn, capture) {
1233 el.attachEvent("on" + eventName, fn);
1242 doRemove = function(){
1244 if (win.removeEventListener) {
1245 ret = function (el, eventName, fn, capture) {
1246 if (eventName == 'mouseenter') {
1247 eventName = MOUSEOVER;
1248 } else if (eventName == 'mouseleave') {
1249 eventName = MOUSEOUT;
1251 el.removeEventListener(eventName, fn, (capture));
1253 } else if (win.detachEvent) {
1254 ret = function (el, eventName, fn) {
1255 el.detachEvent("on" + eventName, fn);
1263 function checkRelatedTarget(e) {
1264 return !elContains(e.currentTarget, pub.getRelatedTarget(e));
1267 function elContains(parent, child) {
1268 if(parent && parent.firstChild){
1270 if(child === parent) {
1273 child = child.parentNode;
1274 if(child && (child.nodeType != 1)) {
1283 function _tryPreloadAttach() {
1286 element, i, v, override,
1287 tryAgain = !loadComplete || (retryCount > 0);
1292 for(i = 0; i < onAvailStack.length; ++i){
1293 v = onAvailStack[i];
1294 if(v && (element = doc.getElementById(v.id))){
1295 if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) {
1296 override = v.override;
1297 element = override ? (override === true ? v.obj : override) : element;
1298 v.fn.call(element, v.obj);
1299 onAvailStack.remove(v);
1307 retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
1312 clearInterval(_interval);
1315 ret = !(locked = false);
1321 function startInterval() {
1323 var callback = function() {
1324 _tryPreloadAttach();
1326 _interval = setInterval(callback, POLL_INTERVAL);
1331 function getScroll() {
1332 var dd = doc.documentElement,
1334 if(dd && (dd[SCROLLTOP] || dd[SCROLLLEFT])){
1335 return [dd[SCROLLLEFT], dd[SCROLLTOP]];
1337 return [db[SCROLLLEFT], db[SCROLLTOP]];
1344 function getPageCoord (ev, xy) {
1345 ev = ev.browserEvent || ev;
1346 var coord = ev['page' + xy];
1347 if (!coord && coord !== 0) {
1348 coord = ev['client' + xy] || 0;
1351 coord += getScroll()[xy == "X" ? 0 : 1];
1360 onAvailable : function(p_id, p_fn, p_obj, p_override) {
1365 override: p_override,
1366 checkReady: false });
1368 retryCount = POLL_RETRYS;
1373 addListener: function(el, eventName, fn) {
1374 el = Ext.getDom(el);
1376 if (eventName == UNLOAD) {
1377 if (unloadListeners[el.id] === undefined) {
1378 unloadListeners[el.id] = [];
1380 unloadListeners[el.id].push([eventName, fn]);
1383 return doAdd(el, eventName, fn, false);
1389 removeListener: function(el, eventName, fn) {
1390 el = Ext.getDom(el);
1391 var i, len, li, lis;
1393 if(eventName == UNLOAD){
1394 if((lis = unloadListeners[el.id]) !== undefined){
1395 for(i = 0, len = lis.length; i < len; i++){
1396 if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){
1397 unloadListeners[el.id].splice(i, 1);
1403 doRemove(el, eventName, fn, false);
1407 getTarget : function(ev) {
1408 ev = ev.browserEvent || ev;
1409 return this.resolveTextNode(ev.target || ev.srcElement);
1412 resolveTextNode : Ext.isGecko ? function(node){
1417 var s = HTMLElement.prototype.toString.call(node);
1418 if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){
1421 return node.nodeType == 3 ? node.parentNode : node;
1423 return node && node.nodeType == 3 ? node.parentNode : node;
1426 getRelatedTarget : function(ev) {
1427 ev = ev.browserEvent || ev;
1428 return this.resolveTextNode(ev.relatedTarget ||
1429 (/(mouseout|mouseleave)/.test(ev.type) ? ev.toElement :
1430 /(mouseover|mouseenter)/.test(ev.type) ? ev.fromElement : null));
1433 getPageX : function(ev) {
1434 return getPageCoord(ev, "X");
1437 getPageY : function(ev) {
1438 return getPageCoord(ev, "Y");
1442 getXY : function(ev) {
1443 return [this.getPageX(ev), this.getPageY(ev)];
1446 stopEvent : function(ev) {
1447 this.stopPropagation(ev);
1448 this.preventDefault(ev);
1451 stopPropagation : function(ev) {
1452 ev = ev.browserEvent || ev;
1453 if (ev.stopPropagation) {
1454 ev.stopPropagation();
1456 ev.cancelBubble = true;
1460 preventDefault : function(ev) {
1461 ev = ev.browserEvent || ev;
1462 if (ev.preventDefault) {
1463 ev.preventDefault();
1465 ev.returnValue = false;
1469 getEvent : function(e) {
1472 var c = this.getEvent.caller;
1475 if (e && Event == e.constructor) {
1484 getCharCode : function(ev) {
1485 ev = ev.browserEvent || ev;
1486 return ev.charCode || ev.keyCode || 0;
1491 getListeners : function(el, eventName) {
1492 Ext.EventManager.getListeners(el, eventName);
1496 purgeElement : function(el, recurse, eventName) {
1497 Ext.EventManager.purgeElement(el, recurse, eventName);
1500 _load : function(e) {
1501 loadComplete = true;
1503 if (Ext.isIE && e !== true) {
1506 doRemove(win, "load", arguments.callee);
1510 _unload : function(e) {
1511 var EU = Ext.lib.Event,
1512 i, v, ul, id, len, scope;
1514 for (id in unloadListeners) {
1515 ul = unloadListeners[id];
1516 for (i = 0, len = ul.length; i < len; i++) {
1520 scope = v[ADJ_SCOPE] ? (v[ADJ_SCOPE] === true ? v[OBJ] : v[ADJ_SCOPE]) : win;
1521 v[FN].call(scope, EU.getEvent(e), v[OBJ]);
1527 Ext.EventManager._unload();
1529 doRemove(win, UNLOAD, EU._unload);
1534 pub.on = pub.addListener;
1535 pub.un = pub.removeListener;
1536 if (doc && doc.body) {
1539 doAdd(win, "load", pub._load);
1541 doAdd(win, UNLOAD, pub._unload);
1542 _tryPreloadAttach();
1547 Ext.lib.Ajax = function() {
1548 var activeX = ['MSXML2.XMLHTTP.3.0',
1550 'Microsoft.XMLHTTP'],
1551 CONTENTTYPE = 'Content-Type';
1554 function setHeader(o) {
1558 function setTheHeaders(conn, headers){
1559 for (prop in headers) {
1560 if (headers.hasOwnProperty(prop)) {
1561 conn.setRequestHeader(prop, headers[prop]);
1566 if (pub.defaultHeaders) {
1567 setTheHeaders(conn, pub.defaultHeaders);
1571 setTheHeaders(conn, pub.headers);
1577 function createExceptionObject(tId, callbackArg, isAbort, isTimeout) {
1580 status : isAbort ? -1 : 0,
1581 statusText : isAbort ? 'transaction aborted' : 'communication failure',
1583 isTimeout: isTimeout,
1584 argument : callbackArg
1589 function initHeader(label, value) {
1590 (pub.headers = pub.headers || {})[label] = value;
1594 function createResponseObject(o, callbackArg) {
1601 isBrokenStatus = conn.status == 1223;
1604 headerStr = o.conn.getAllResponseHeaders();
1605 Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){
1608 s = v.substr(0, t).toLowerCase();
1609 if(v.charAt(t + 1) == ' '){
1612 headerObj[s] = v.substr(t + 1);
1620 status : isBrokenStatus ? 204 : conn.status,
1621 statusText : isBrokenStatus ? 'No Content' : conn.statusText,
1622 getResponseHeader : function(header){return headerObj[header.toLowerCase()];},
1623 getAllResponseHeaders : function(){return headerStr;},
1624 responseText : conn.responseText,
1625 responseXML : conn.responseXML,
1626 argument : callbackArg
1631 function releaseObject(o) {
1633 pub.conn[o.tId] = null;
1640 function handleTransactionResponse(o, callback, isAbort, isTimeout) {
1646 var httpStatus, responseObject;
1649 if (o.conn.status !== undefined && o.conn.status != 0) {
1650 httpStatus = o.conn.status;
1660 if ((httpStatus >= 200 && httpStatus < 300) || (Ext.isIE && httpStatus == 1223)) {
1661 responseObject = createResponseObject(o, callback.argument);
1662 if (callback.success) {
1663 if (!callback.scope) {
1664 callback.success(responseObject);
1667 callback.success.apply(callback.scope, [responseObject]);
1672 switch (httpStatus) {
1679 responseObject = createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false), isTimeout);
1680 if (callback.failure) {
1681 if (!callback.scope) {
1682 callback.failure(responseObject);
1685 callback.failure.apply(callback.scope, [responseObject]);
1690 responseObject = createResponseObject(o, callback.argument);
1691 if (callback.failure) {
1692 if (!callback.scope) {
1693 callback.failure(responseObject);
1696 callback.failure.apply(callback.scope, [responseObject]);
1703 responseObject = null;
1707 function handleReadyState(o, callback){
1708 callback = callback || {};
1712 cbTimeout = callback.timeout || null;
1715 pub.conn[tId] = conn;
1716 pub.timeout[tId] = setTimeout(function() {
1717 pub.abort(o, callback, true);
1721 poll[tId] = setInterval(
1723 if (conn && conn.readyState == 4) {
1724 clearInterval(poll[tId]);
1728 clearTimeout(pub.timeout[tId]);
1729 pub.timeout[tId] = null;
1732 handleTransactionResponse(o, callback);
1739 function asyncRequest(method, uri, callback, postData) {
1740 var o = getConnectionObject() || null;
1743 o.conn.open(method, uri, true);
1745 if (pub.useDefaultXhrHeader) {
1746 initHeader('X-Requested-With', pub.defaultXhrHeader);
1749 if(postData && pub.useDefaultHeader && (!pub.headers || !pub.headers[CONTENTTYPE])){
1750 initHeader(CONTENTTYPE, pub.defaultPostHeader);
1753 if (pub.defaultHeaders || pub.headers) {
1757 handleReadyState(o, callback);
1758 o.conn.send(postData || null);
1764 function getConnectionObject() {
1768 if (o = createXhrObject(pub.transactionId)) {
1769 pub.transactionId++;
1778 function createXhrObject(transactionId) {
1782 http = new XMLHttpRequest();
1784 for (var i = 0; i < activeX.length; ++i) {
1786 http = new ActiveXObject(activeX[i]);
1791 return {conn : http, tId : transactionId};
1796 request : function(method, uri, cb, data, options) {
1799 xmlData = options.xmlData,
1800 jsonData = options.jsonData,
1803 Ext.applyIf(me, options);
1805 if(xmlData || jsonData){
1807 if(!hs || !hs[CONTENTTYPE]){
1808 initHeader(CONTENTTYPE, xmlData ? 'text/xml' : 'application/json');
1810 data = xmlData || (!Ext.isPrimitive(jsonData) ? Ext.encode(jsonData) : jsonData);
1813 return asyncRequest(method || options.method || "POST", uri, cb, data);
1816 serializeForm : function(form) {
1817 var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements,
1819 encoder = encodeURIComponent,
1824 Ext.each(fElements, function(element) {
1825 name = element.name;
1826 type = element.type;
1828 if (!element.disabled && name){
1829 if(/select-(one|multiple)/i.test(type)) {
1830 Ext.each(element.options, function(opt) {
1832 data += String.format("{0}={1}&", encoder(name), encoder((opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttribute('value') !== null) ? opt.value : opt.text));
1835 } else if(!(/file|undefined|reset|button/i.test(type))) {
1836 if(!(/radio|checkbox/i.test(type) && !element.checked) && !(type == 'submit' && hasSubmit)){
1838 data += encoder(name) + '=' + encoder(element.value) + '&';
1839 hasSubmit = /submit/i.test(type);
1844 return data.substr(0, data.length - 1);
1847 useDefaultHeader : true,
1848 defaultPostHeader : 'application/x-www-form-urlencoded; charset=UTF-8',
1849 useDefaultXhrHeader : true,
1850 defaultXhrHeader : 'XMLHttpRequest',
1884 abort : function(o, callback, isTimeout) {
1889 if (me.isCallInProgress(o)) {
1891 clearInterval(me.poll[tId]);
1892 me.poll[tId] = null;
1893 clearTimeout(pub.timeout[tId]);
1894 me.timeout[tId] = null;
1896 handleTransactionResponse(o, callback, (isAbort = true), isTimeout);
1901 isCallInProgress : function(o) {
1903 return o.conn && !{0:true,4:true}[o.conn.readyState];
1907 }(); Ext.lib.Region = function(t, r, b, l) {
1917 Ext.lib.Region.prototype = {
1918 contains : function(region) {
1920 return ( region.left >= me.left &&
1921 region.right <= me.right &&
1922 region.top >= me.top &&
1923 region.bottom <= me.bottom );
1927 getArea : function() {
1929 return ( (me.bottom - me.top) * (me.right - me.left) );
1932 intersect : function(region) {
1934 t = Math.max(me.top, region.top),
1935 r = Math.min(me.right, region.right),
1936 b = Math.min(me.bottom, region.bottom),
1937 l = Math.max(me.left, region.left);
1939 if (b >= t && r >= l) {
1940 return new Ext.lib.Region(t, r, b, l);
1944 union : function(region) {
1946 t = Math.min(me.top, region.top),
1947 r = Math.max(me.right, region.right),
1948 b = Math.max(me.bottom, region.bottom),
1949 l = Math.min(me.left, region.left);
1951 return new Ext.lib.Region(t, r, b, l);
1954 constrainTo : function(r) {
1956 me.top = me.top.constrain(r.top, r.bottom);
1957 me.bottom = me.bottom.constrain(r.top, r.bottom);
1958 me.left = me.left.constrain(r.left, r.right);
1959 me.right = me.right.constrain(r.left, r.right);
1963 adjust : function(t, l, b, r) {
1973 Ext.lib.Region.getRegion = function(el) {
1974 var p = Ext.lib.Dom.getXY(el),
1976 r = p[0] + el.offsetWidth,
1977 b = p[1] + el.offsetHeight,
1980 return new Ext.lib.Region(t, r, b, l);
1981 }; Ext.lib.Point = function(x, y) {
1982 if (Ext.isArray(x)) {
1987 me.x = me.right = me.left = me[0] = x;
1988 me.y = me.top = me.bottom = me[1] = y;
1991 Ext.lib.Point.prototype = new Ext.lib.Region();
1993 var EXTLIB = Ext.lib,
1994 noNegatives = /width|height|opacity|padding/i,
1995 offsetAttribute = /^((width|height)|(top|left))$/,
1996 defaultUnit = /width|height|top$|bottom$|left$|right$/i,
1997 offsetUnit = /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i,
1998 isset = function(v){
1999 return typeof v !== 'undefined';
2006 motion : function(el, args, duration, easing, cb, scope) {
2007 return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion);
2010 run : function(el, args, duration, easing, cb, scope, type) {
2011 type = type || Ext.lib.AnimBase;
2012 if (typeof easing == "string") {
2013 easing = Ext.lib.Easing[easing];
2015 var anim = new type(el, args, duration, easing);
2016 anim.animateX(function() {
2017 if(Ext.isFunction(cb)){
2025 EXTLIB.AnimBase = function(el, attributes, duration, method) {
2027 this.init(el, attributes, duration, method);
2031 EXTLIB.AnimBase.prototype = {
2032 doMethod: function(attr, start, end) {
2034 return me.method(me.curFrame, start, end - start, me.totalFrames);
2038 setAttr: function(attr, val, unit) {
2039 if (noNegatives.test(attr) && val < 0) {
2042 Ext.fly(this.el, '_anim').setStyle(attr, val + unit);
2046 getAttr: function(attr) {
2047 var el = Ext.fly(this.el),
2048 val = el.getStyle(attr),
2049 a = offsetAttribute.exec(attr) || [];
2051 if (val !== 'auto' && !offsetUnit.test(val)) {
2052 return parseFloat(val);
2055 return (!!(a[2]) || (el.getStyle('position') == 'absolute' && !!(a[3]))) ? el.dom['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)] : 0;
2059 getDefaultUnit: function(attr) {
2060 return defaultUnit.test(attr) ? 'px' : '';
2063 animateX : function(callback, scope) {
2066 me.onComplete.removeListener(f);
2067 if (Ext.isFunction(callback)) {
2068 callback.call(scope || me, me);
2071 me.onComplete.addListener(f, me);
2076 setRunAttr: function(attr) {
2078 a = this.attributes[attr],
2083 ra = (this.runAttrs[attr] = {}),
2086 if (!isset(to) && !isset(by)){
2090 var start = isset(from) ? from : me.getAttr(attr);
2093 }else if(isset(by)) {
2094 if (Ext.isArray(start)){
2096 for(var i=0,len=start.length; i<len; i++) {
2097 end[i] = start[i] + by[i];
2107 unit: isset(unit) ? unit : me.getDefaultUnit(attr)
2112 init: function(el, attributes, duration, method) {
2115 mgr = EXTLIB.AnimMgr;
2121 attributes: attributes || {},
2122 duration: duration || 1,
2123 method: method || EXTLIB.Easing.easeNone,
2126 totalFrames: mgr.fps,
2128 animate: function(){
2137 me.totalFrames = me.useSec ? Math.ceil(mgr.fps * d) : d;
2138 mgr.registerElement(me);
2141 stop: function(finish){
2145 me.curFrame = me.totalFrames;
2152 var onStart = function(){
2158 for(attr in this.attributes){
2159 this.setRunAttr(attr);
2162 me.isAnimated = true;
2163 me.startTime = now();
2168 var onTween = function(){
2172 duration: now() - me.startTime,
2173 curFrame: me.curFrame
2176 var ra = me.runAttrs;
2177 for (var attr in ra) {
2178 this.setAttr(attr, me.doMethod(attr, ra[attr].start, ra[attr].end), ra[attr].unit);
2184 var onComplete = function() {
2186 actual = (now() - me.startTime) / 1000,
2189 frames: actualFrames,
2190 fps: actualFrames / actual
2193 me.isAnimated = false;
2195 me.onComplete.fire(data);
2198 me.onStart = new Ext.util.Event(me);
2199 me.onTween = new Ext.util.Event(me);
2200 me.onComplete = new Ext.util.Event(me);
2201 (me._onStart = new Ext.util.Event(me)).addListener(onStart);
2202 (me._onTween = new Ext.util.Event(me)).addListener(onTween);
2203 (me._onComplete = new Ext.util.Event(me)).addListener(onComplete);
2208 Ext.lib.AnimMgr = new function() {
2218 registerElement: function(tween){
2221 tween._onStart.fire();
2225 unRegister: function(tween, index){
2226 tween._onComplete.fire();
2227 index = index || getIndex(tween);
2229 queue.splice(index, 1);
2232 if (--tweenCount <= 0) {
2238 if(thread === null){
2239 thread = setInterval(me.run, me.delay);
2243 stop: function(tween){
2245 clearInterval(thread);
2246 for(var i = 0, len = queue.length; i < len; ++i){
2247 if(queue[0].isAnimated){
2248 me.unRegister(queue[0], 0);
2256 me.unRegister(tween);
2261 var tf, i, len, tween;
2262 for(i = 0, len = queue.length; i<len; i++) {
2264 if(tween && tween.isAnimated){
2265 tf = tween.totalFrames;
2266 if(tween.curFrame < tf || tf === null){
2269 correctFrame(tween);
2271 tween._onTween.fire();
2280 var getIndex = function(anim) {
2282 for(i = 0, len = queue.length; i<len; i++) {
2283 if(queue[i] === anim) {
2290 var correctFrame = function(tween) {
2291 var frames = tween.totalFrames,
2292 frame = tween.curFrame,
2293 duration = tween.duration,
2294 expected = (frame * duration * 1000 / frames),
2295 elapsed = (now() - tween.startTime),
2298 if(elapsed < duration * 1000){
2299 tweak = Math.round((elapsed / expected - 1) * frame);
2301 tweak = frames - (frame + 1);
2303 if(tweak > 0 && isFinite(tweak)){
2304 if(tween.curFrame + tweak >= frames){
2305 tweak = frames - (frame + 1);
2307 tween.curFrame += tweak;
2312 EXTLIB.Bezier = new function() {
2314 this.getPosition = function(points, t) {
2315 var n = points.length,
2321 for (i = 0; i < n; ++i) {
2322 tmp[i] = [points[i][0], points[i][1]];
2325 for (j = 1; j < n; ++j) {
2326 for (i = 0; i < n - j; ++i) {
2327 tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
2328 tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
2332 return [ tmp[0][0], tmp[0][1] ];
2339 easeNone: function (t, b, c, d) {
2340 return c * t / d + b;
2344 easeIn: function (t, b, c, d) {
2345 return c * (t /= d) * t + b;
2349 easeOut: function (t, b, c, d) {
2350 return -c * (t /= d) * (t - 2) + b;
2355 EXTLIB.Motion = function(el, attributes, duration, method) {
2357 EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method);
2361 Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase);
2363 var superclass = EXTLIB.Motion.superclass,
2364 pointsRe = /^points$/i;
2366 Ext.apply(EXTLIB.Motion.prototype, {
2367 setAttr: function(attr, val, unit){
2369 setAttr = superclass.setAttr;
2371 if (pointsRe.test(attr)) {
2372 unit = unit || 'px';
2373 setAttr.call(me, 'left', val[0], unit);
2374 setAttr.call(me, 'top', val[1], unit);
2376 setAttr.call(me, attr, val, unit);
2380 getAttr: function(attr){
2382 getAttr = superclass.getAttr;
2384 return pointsRe.test(attr) ? [getAttr.call(me, 'left'), getAttr.call(me, 'top')] : getAttr.call(me, attr);
2387 doMethod: function(attr, start, end){
2390 return pointsRe.test(attr)
2391 ? EXTLIB.Bezier.getPosition(me.runAttrs[attr], me.method(me.curFrame, 0, 100, me.totalFrames) / 100)
2392 : superclass.doMethod.call(me, attr, start, end);
2395 setRunAttr: function(attr){
2396 if(pointsRe.test(attr)){
2400 points = this.attributes.points,
2401 control = points.control || [],
2413 if(control.length > 0 && !Ext.isArray(control[0])){
2414 control = [control];
2419 Ext.fly(el, '_anim').position();
2420 DOM.setXY(el, isset(from) ? from : DOM.getXY(el));
2421 start = me.getAttr('points');
2425 end = translateValues.call(me, to, start);
2426 for (i = 0,len = control.length; i < len; ++i) {
2427 control[i] = translateValues.call(me, control[i], start);
2429 } else if (isset(by)) {
2430 end = [start[0] + by[0], start[1] + by[1]];
2432 for (i = 0,len = control.length; i < len; ++i) {
2433 control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
2437 ra = this.runAttrs[attr] = [start];
2438 if (control.length > 0) {
2439 ra = ra.concat(control);
2442 ra[ra.length] = end;
2444 superclass.setRunAttr.call(this, attr);
2449 var translateValues = function(val, start) {
2450 var pageXY = EXTLIB.Dom.getXY(this.el);
2451 return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]];
2464 Ext.apply(EXTLIB.Easing, {
2466 easeBoth: function (t, b, c, d) {
2467 return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -c / 2 * ((--t) * (t - 2) - 1) + b;
2470 easeInStrong: function (t, b, c, d) {
2471 return c * (t /= d) * t * t * t + b;
2474 easeOutStrong: function (t, b, c, d) {
2475 return -c * ((t = t / d - 1) * t * t * t - 1) + b;
2478 easeBothStrong: function (t, b, c, d) {
2479 return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b;
2482 elasticIn: function (t, b, c, d, a, p) {
2483 if (t == 0 || (t /= d) == 1) {
2484 return t == 0 ? b : b + c;
2490 s = p / (2 * pi) * asin(c / a);
2496 return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b;
2500 elasticOut: function (t, b, c, d, a, p) {
2501 if (t == 0 || (t /= d) == 1) {
2502 return t == 0 ? b : b + c;
2508 s = p / (2 * pi) * asin(c / a);
2514 return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b;
2517 elasticBoth: function (t, b, c, d, a, p) {
2518 if (t == 0 || (t /= d / 2) == 2) {
2519 return t == 0 ? b : b + c;
2522 p = p || (d * (.3 * 1.5));
2526 s = p / (2 * pi) * asin(c / a);
2533 -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b :
2534 a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b;
2537 backIn: function (t, b, c, d, s) {
2539 return c * (t /= d) * t * ((s + 1) * t - s) + b;
2543 backOut: function (t, b, c, d, s) {
2547 return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
2551 backBoth: function (t, b, c, d, s) {
2554 return ((t /= d / 2 ) < 1) ?
2555 c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b :
2556 c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
2560 bounceIn: function (t, b, c, d) {
2561 return c - EXTLIB.Easing.bounceOut(d - t, 0, c, d) + b;
2565 bounceOut: function (t, b, c, d) {
2566 if ((t /= d) < (1 / 2.75)) {
2567 return c * (7.5625 * t * t) + b;
2568 } else if (t < (2 / 2.75)) {
2569 return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
2570 } else if (t < (2.5 / 2.75)) {
2571 return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
2573 return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
2577 bounceBoth: function (t, b, c, d) {
2578 return (t < d / 2) ?
2579 EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b :
2580 EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
2586 var EXTLIB = Ext.lib;
2588 EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) {
2589 return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim);
2592 EXTLIB.ColorAnim = function(el, attributes, duration, method) {
2593 EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
2596 Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase);
2598 var superclass = EXTLIB.ColorAnim.superclass,
2599 colorRE = /color$/i,
2600 transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/,
2601 rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,
2602 hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,
2603 hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i,
2604 isset = function(v){
2605 return typeof v !== 'undefined';
2609 function parseColor(s) {
2615 if (s.length == 3) {
2619 Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){
2620 base = (idx % 2 == 0) ? 16 : 10;
2622 if(c && c.length == 4){
2623 out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)];
2630 Ext.apply(EXTLIB.ColorAnim.prototype, {
2631 getAttr : function(attr) {
2635 if(colorRE.test(attr)){
2636 while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){
2641 val = superclass.getAttr.call(me, attr);
2646 doMethod : function(attr, start, end) {
2654 if(colorRE.test(attr)){
2658 for(i = 0, len = start.length; i < len; i++) {
2660 val[i] = superclass.doMethod.call(me, attr, v, end[i]);
2662 val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')';
2664 val = superclass.doMethod.call(me, attr, start, end);
2669 setRunAttr : function(attr) {
2671 a = me.attributes[attr],
2676 superclass.setRunAttr.call(me, attr);
2677 ra = me.runAttrs[attr];
2678 if(colorRE.test(attr)){
2679 var start = parseColor(ra.start),
2680 end = parseColor(ra.end);
2682 if(!isset(to) && isset(by)){
2683 end = parseColor(by);
2684 for(var i=0,len=start.length; i<len; i++) {
2685 end[i] = start[i] + end[i];
2698 var EXTLIB = Ext.lib;
2699 EXTLIB.Anim.scroll = function(el, args, duration, easing, cb, scope) {
2700 return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.Scroll);
2703 EXTLIB.Scroll = function(el, attributes, duration, method) {
2705 EXTLIB.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
2709 Ext.extend(EXTLIB.Scroll, EXTLIB.ColorAnim);
2711 var superclass = EXTLIB.Scroll.superclass,
2714 Ext.apply(EXTLIB.Scroll.prototype, {
2716 doMethod : function(attr, start, end) {
2719 curFrame = me.curFrame,
2720 totalFrames = me.totalFrames;
2723 val = [me.method(curFrame, start[0], end[0] - start[0], totalFrames),
2724 me.method(curFrame, start[1], end[1] - start[1], totalFrames)];
2726 val = superclass.doMethod.call(me, attr, start, end);
2731 getAttr : function(attr) {
2734 if (attr == SCROLL) {
2735 return [me.el.scrollLeft, me.el.scrollTop];
2737 return superclass.getAttr.call(me, attr);
2741 setAttr : function(attr, val, unit) {
2745 me.el.scrollLeft = val[0];
2746 me.el.scrollTop = val[1];
2748 superclass.setAttr.call(me, attr, val, unit);
2754 function fnCleanUp() {
2755 var p = Function.prototype;
2756 delete p.createSequence;
2758 delete p.createDelegate;
2759 delete p.createCallback;
2760 delete p.createInterceptor;
2762 window.detachEvent("onunload", fnCleanUp);
2764 window.attachEvent("onunload", fnCleanUp);