3
* Copyright(c) 2006-2009, Ext JS, LLC.
6
* http://extjs.com/license
10
* Ext JS Library 2.0.1
11
* Copyright(c) 2006-2008, Ext JS, LLC.
14
* http://extjs.com/license
18
Ext = {version: '2.0.1'};
21
window["undefined"] = window["undefined"];
26
Ext.apply = function(o, c, defaults){
29
Ext.apply(o, defaults);
31
if(o && c && typeof c == 'object'){
41
var ua = navigator.userAgent.toLowerCase();
43
var isStrict = document.compatMode == "CSS1Compat",
44
isOpera = ua.indexOf("opera") > -1,
45
isSafari = (/webkit|khtml/).test(ua),
46
isSafari3 = isSafari && ua.indexOf('webkit/5') != -1,
47
isIE = !isOpera && ua.indexOf("msie") > -1,
48
isIE7 = !isOpera && ua.indexOf("msie 7") > -1,
49
isGecko = !isSafari && ua.indexOf("gecko") > -1,
50
isBorderBox = isIE && !isStrict,
51
isWindows = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1),
52
isMac = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1),
53
isAir = (ua.indexOf("adobeair") != -1),
54
isLinux = (ua.indexOf("linux") != -1),
55
isSecure = window.location.href.toLowerCase().indexOf("https") === 0;
60
document.execCommand("BackgroundImageCache", false, true);
73
enableGarbageCollector : true,
76
enableListenerCollection:false,
80
SSL_SECURE_URL : "javascript:false",
83
BLANK_IMAGE_URL : "http:/"+"/extjs.com/s.gif",
86
emptyFn : function(){},
89
applyIf : function(o, c){
92
if(typeof o[p] == "undefined"){ o[p] = c[p]; }
99
addBehaviors : function(o){
101
Ext.onReady(function(){
108
var parts = b.split('@');
112
cache[s] = Ext.select(s);
114
cache[s].on(parts[1], o[b]);
121
id : function(el, prefix){
122
prefix = prefix || "ext-gen";
124
var id = prefix + (++idSeed);
125
return el ? (el.id ? el.id : (el.id = id)) : id;
131
var io = function(o){
136
var oc = Object.prototype.constructor;
138
return function(sb, sp, overrides){
139
if(typeof sp == 'object'){
142
sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);};
144
var F = function(){}, sbp, spp = sp.prototype;
146
sbp = sb.prototype = new F();
149
if(spp.constructor == oc){
152
sb.override = function(o){
156
Ext.override(sb, overrides);
162
override : function(origclass, overrides){
164
var p = origclass.prototype;
165
for(var method in overrides){
166
p[method] = overrides[method];
172
namespace : function(){
173
var a=arguments, o=null, i, j, d, rt;
174
for (i=0; i<a.length; ++i) {
177
eval('if (typeof ' + rt + ' == "undefined"){' + rt + ' = {};} o = ' + rt + ';');
178
for (j=1; j<d.length; ++j) {
179
o[d[j]]=o[d[j]] || {};
186
urlEncode : function(o){
192
var ov = o[key], k = encodeURIComponent(key);
193
var type = typeof ov;
194
if(type == 'undefined'){
196
}else if(type != "function" && type != "object"){
197
buf.push(k, "=", encodeURIComponent(ov), "&");
198
}else if(Ext.isArray(ov)){
200
for(var i = 0, len = ov.length; i < len; i++) {
201
buf.push(k, "=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");
213
urlDecode : function(string, overwrite){
214
if(!string || !string.length){
218
var pairs = string.split('&');
219
var pair, name, value;
220
for(var i = 0, len = pairs.length; i < len; i++){
221
pair = pairs[i].split('=');
222
name = decodeURIComponent(pair[0]);
223
value = decodeURIComponent(pair[1]);
224
if(overwrite !== true){
225
if(typeof obj[name] == "undefined"){
227
}else if(typeof obj[name] == "string"){
228
obj[name] = [obj[name]];
229
obj[name].push(value);
231
obj[name].push(value);
241
each : function(array, fn, scope){
242
if(typeof array.length == "undefined" || typeof array == "string"){
245
for(var i = 0, len = array.length; i < len; i++){
246
if(fn.call(scope || array[i], array[i], i, array) === false){ return i; };
251
combine : function(){
252
var as = arguments, l = as.length, r = [];
253
for(var i = 0; i < l; i++){
257
}else if(a.length !== undefined && !a.substr){
258
r = r.concat(Array.prototype.slice.call(a, 0));
267
escapeRe : function(s) {
268
return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
272
callback : function(cb, scope, args, delay){
273
if(typeof cb == "function"){
275
cb.defer(delay, scope, args || []);
277
cb.apply(scope, args || []);
283
getDom : function(el){
284
if(!el || !document){
287
return el.dom ? el.dom : (typeof el == 'string' ? document.getElementById(el) : el);
292
return Ext.get(document);
296
getBody : function(){
297
return Ext.get(document.body || document.documentElement);
301
getCmp : function(id){
302
return Ext.ComponentMgr.get(id);
306
num : function(v, defaultValue){
307
if(typeof v != 'number'){
314
destroy : function(){
315
for(var i = 0, a = arguments, len = a.length; i < len; i++) {
319
as.removeAllListeners();
323
if(typeof as.destroy == 'function'){
330
removeNode : isIE ? function(){
334
d = d || document.createElement('div');
340
if(n && n.parentNode){
341
n.parentNode.removeChild(n);
348
if(o === undefined || o === null){
355
if(t == 'object' && o.nodeName) {
357
case 1: return 'element';
358
case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';
361
if(t == 'object' || t == 'function') {
362
switch(o.constructor) {
363
case Array: return 'array';
364
case RegExp: return 'regexp';
366
if(typeof o.length == 'number' && typeof o.item == 'function') {
374
isEmpty : function(v, allowBlank){
375
return v === null || v === undefined || (!allowBlank ? v === '' : false);
378
value : function(v, defaultValue, allowBlank){
379
return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
382
isArray : function(v){
383
return v && typeof v.pop == 'function';
386
isDate : function(v){
387
return v && typeof v.getFullYear == 'function';
395
isSafari3 : isSafari3,
397
isSafari2 : isSafari && !isSafari3,
401
isIE6 : isIE && !isIE7,
407
isBorderBox : isBorderBox,
411
isWindows : isWindows,
418
useShims : ((isIE && !isIE7) || (isGecko && isMac))
422
Ext.ns = Ext.namespace;
425
Ext.ns("Ext", "Ext.util", "Ext.grid", "Ext.dd", "Ext.tree", "Ext.data",
426
"Ext.form", "Ext.menu", "Ext.state", "Ext.lib", "Ext.layout", "Ext.app", "Ext.ux");
430
Ext.apply(Function.prototype, {
432
createCallback : function(){
434
var args = arguments;
437
return method.apply(window, args);
442
createDelegate : function(obj, args, appendArgs){
445
var callArgs = args || arguments;
446
if(appendArgs === true){
447
callArgs = Array.prototype.slice.call(arguments, 0);
448
callArgs = callArgs.concat(args);
449
}else if(typeof appendArgs == "number"){
450
callArgs = Array.prototype.slice.call(arguments, 0);
451
var applyArgs = [appendArgs, 0].concat(args);
452
Array.prototype.splice.apply(callArgs, applyArgs);
454
return method.apply(obj || window, callArgs);
459
defer : function(millis, obj, args, appendArgs){
460
var fn = this.createDelegate(obj, args, appendArgs);
462
return setTimeout(fn, millis);
468
createSequence : function(fcn, scope){
469
if(typeof fcn != "function"){
474
var retval = method.apply(this || window, arguments);
475
fcn.apply(scope || this || window, arguments);
481
createInterceptor : function(fcn, scope){
482
if(typeof fcn != "function"){
489
if(fcn.apply(scope || this || window, arguments) === false){
492
return method.apply(this || window, arguments);
498
Ext.applyIf(String, {
501
escape : function(string) {
502
return string.replace(/('|\\)/g, "\\$1");
506
leftPad : function (val, size, ch) {
507
var result = new String(val);
511
while (result.length < size) {
512
result = ch + result;
514
return result.toString();
518
format : function(format){
519
var args = Array.prototype.slice.call(arguments, 1);
520
return format.replace(/\{(\d+)\}/g, function(m, i){
527
String.prototype.toggle = function(value, other){
528
return this == value ? other : value;
532
String.prototype.trim = function(){
533
var re = /^\s+|\s+$/g;
534
return function(){ return this.replace(re, ""); };
537
Ext.applyIf(Number.prototype, {
539
constrain : function(min, max){
540
return Math.min(Math.max(this, min), max);
544
Ext.applyIf(Array.prototype, {
546
indexOf : function(o){
547
for (var i = 0, len = this.length; i < len; i++){
548
if(this[i] == o) return i;
554
remove : function(o){
555
var index = this.indexOf(o);
557
this.splice(index, 1);
564
Date.prototype.getElapsed = function(date) {
565
return Math.abs((date || new Date()).getTime()-this.getTime());
572
getViewWidth : function(full) {
573
return full ? this.getDocumentWidth() : this.getViewportWidth();
576
getViewHeight : function(full) {
577
return full ? this.getDocumentHeight() : this.getViewportHeight();
580
getDocumentHeight: function() {
581
var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight;
582
return Math.max(scrollHeight, this.getViewportHeight());
585
getDocumentWidth: function() {
586
var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth;
587
return Math.max(scrollWidth, this.getViewportWidth());
590
getViewportHeight: function(){
592
return Ext.isStrict ? document.documentElement.clientHeight :
593
document.body.clientHeight;
595
return self.innerHeight;
599
getViewportWidth: function() {
601
return Ext.isStrict ? document.documentElement.clientWidth :
602
document.body.clientWidth;
604
return self.innerWidth;
608
isAncestor : function(p, c) {
615
if (p.contains && !Ext.isSafari) {
616
return p.contains(c);
617
} else if (p.compareDocumentPosition) {
618
return !!(p.compareDocumentPosition(c) & 16);
620
var parent = c.parentNode;
625
else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
628
parent = parent.parentNode;
634
getRegion : function(el) {
635
return Ext.lib.Region.getRegion(el);
638
getY : function(el) {
639
return this.getXY(el)[1];
642
getX : function(el) {
643
return this.getXY(el)[0];
647
getXY : function(el) {
648
var p, pe, b, scroll, bd = (document.body || document.documentElement);
655
if (el.getBoundingClientRect) {
656
b = el.getBoundingClientRect();
657
scroll = fly(document).getScroll();
658
return [b.left + scroll.left, b.top + scroll.top];
664
var hasAbsolute = fly(el).getStyle("position") == "absolute";
671
if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
678
var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
679
var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
686
if (p != el && pe.getStyle('overflow') != 'visible') {
694
if (Ext.isSafari && hasAbsolute) {
699
if (Ext.isGecko && !hasAbsolute) {
701
x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
702
y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
706
while (p && p != bd) {
707
if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
716
setXY : function(el, xy) {
717
el = Ext.fly(el, '_setXY');
719
var pts = el.translatePoints(xy);
720
if (xy[0] !== false) {
721
el.dom.style.left = pts.left + "px";
723
if (xy[1] !== false) {
724
el.dom.style.top = pts.top + "px";
728
setX : function(el, x) {
729
this.setXY(el, [x, false]);
732
setY : function(el, y) {
733
this.setXY(el, [false, y]);
738
Ext.lib.Event = function() {
739
var loadComplete = false;
741
var unloadListeners = [];
743
var onAvailStack = [];
745
var lastError = null;
758
startInterval: function() {
759
if (!this._interval) {
761
var callback = function() {
762
self._tryPreloadAttach();
764
this._interval = setInterval(callback, this.POLL_INTERVAL);
769
onAvailable: function(p_id, p_fn, p_obj, p_override) {
770
onAvailStack.push({ id: p_id,
773
override: p_override,
774
checkReady: false });
776
retryCount = this.POLL_RETRYS;
777
this.startInterval();
781
addListener: function(el, eventName, fn) {
787
if ("unload" == eventName) {
788
unloadListeners[unloadListeners.length] =
794
var wrappedFn = function(e) {
795
return typeof Ext != 'undefined' ? fn(Ext.lib.Event.getEvent(e)) : false;
798
var li = [el, eventName, fn, wrappedFn];
800
var index = listeners.length;
801
listeners[index] = li;
803
this.doAdd(el, eventName, wrappedFn, false);
809
removeListener: function(el, eventName, fn) {
815
return this.purgeElement(el, false, eventName);
819
if ("unload" == eventName) {
821
for (i = 0,len = unloadListeners.length; i < len; i++) {
822
var li = unloadListeners[i];
825
li[1] == eventName &&
827
unloadListeners.splice(i, 1);
835
var cacheItem = null;
838
var index = arguments[3];
840
if ("undefined" == typeof index) {
841
index = this._getCacheIndex(el, eventName, fn);
845
cacheItem = listeners[index];
848
if (!el || !cacheItem) {
852
this.doRemove(el, eventName, cacheItem[this.WFN], false);
854
delete listeners[index][this.WFN];
855
delete listeners[index][this.FN];
856
listeners.splice(index, 1);
863
getTarget: function(ev, resolveTextNode) {
864
ev = ev.browserEvent || ev;
865
var t = ev.target || ev.srcElement;
866
return this.resolveTextNode(t);
870
resolveTextNode: function(node) {
871
if (Ext.isSafari && node && 3 == node.nodeType) {
872
return node.parentNode;
879
getPageX: function(ev) {
880
ev = ev.browserEvent || ev;
886
x += this.getScroll()[1];
894
getPageY: function(ev) {
895
ev = ev.browserEvent || ev;
901
y += this.getScroll()[0];
910
getXY: function(ev) {
911
ev = ev.browserEvent || ev;
912
return [this.getPageX(ev), this.getPageY(ev)];
916
getRelatedTarget: function(ev) {
917
ev = ev.browserEvent || ev;
918
var t = ev.relatedTarget;
920
if (ev.type == "mouseout") {
922
} else if (ev.type == "mouseover") {
927
return this.resolveTextNode(t);
931
getTime: function(ev) {
932
ev = ev.browserEvent || ev;
934
var t = new Date().getTime();
947
stopEvent: function(ev) {
948
this.stopPropagation(ev);
949
this.preventDefault(ev);
953
stopPropagation: function(ev) {
954
ev = ev.browserEvent || ev;
955
if (ev.stopPropagation) {
956
ev.stopPropagation();
958
ev.cancelBubble = true;
963
preventDefault: function(ev) {
964
ev = ev.browserEvent || ev;
965
if(ev.preventDefault) {
968
ev.returnValue = false;
973
getEvent: function(e) {
974
var ev = e || window.event;
976
var c = this.getEvent.caller;
979
if (ev && Event == ev.constructor) {
989
getCharCode: function(ev) {
990
ev = ev.browserEvent || ev;
991
return ev.charCode || ev.keyCode || 0;
995
_getCacheIndex: function(el, eventName, fn) {
996
for (var i = 0,len = listeners.length; i < len; ++i) {
997
var li = listeners[i];
1000
li[this.EL] == el &&
1001
li[this.TYPE] == eventName) {
1013
getEl: function(id) {
1014
return document.getElementById(id);
1018
clearCache: function() {
1022
_load: function(e) {
1023
loadComplete = true;
1024
var EU = Ext.lib.Event;
1028
EU.doRemove(window, "load", EU._load);
1033
_tryPreloadAttach: function() {
1042
var tryAgain = !loadComplete;
1044
tryAgain = (retryCount > 0);
1049
for (var i = 0,len = onAvailStack.length; i < len; ++i) {
1050
var item = onAvailStack[i];
1052
var el = this.getEl(item.id);
1055
if (!item.checkReady ||
1058
(document && document.body)) {
1061
if (item.override) {
1062
if (item.override === true) {
1065
scope = item.override;
1068
item.fn.call(scope, item.obj);
1069
onAvailStack[i] = null;
1072
notAvail.push(item);
1077
retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
1081
this.startInterval();
1083
clearInterval(this._interval);
1084
this._interval = null;
1087
this.locked = false;
1094
purgeElement: function(el, recurse, eventName) {
1095
var elListeners = this.getListeners(el, eventName);
1097
for (var i = 0,len = elListeners.length; i < len; ++i) {
1098
var l = elListeners[i];
1099
this.removeListener(el, l.type, l.fn);
1103
if (recurse && el && el.childNodes) {
1104
for (i = 0,len = el.childNodes.length; i < len; ++i) {
1105
this.purgeElement(el.childNodes[i], recurse, eventName);
1111
getListeners: function(el, eventName) {
1112
var results = [], searchLists;
1114
searchLists = [listeners, unloadListeners];
1115
} else if (eventName == "unload") {
1116
searchLists = [unloadListeners];
1118
searchLists = [listeners];
1121
for (var j = 0; j < searchLists.length; ++j) {
1122
var searchList = searchLists[j];
1123
if (searchList && searchList.length > 0) {
1124
for (var i = 0,len = searchList.length; i < len; ++i) {
1125
var l = searchList[i];
1126
if (l && l[this.EL] === el &&
1127
(!eventName || eventName === l[this.TYPE])) {
1132
adjust: l[this.ADJ_SCOPE],
1140
return (results.length) ? results : null;
1144
_unload: function(e) {
1146
var EU = Ext.lib.Event, i, j, l, len, index;
1148
for (i = 0,len = unloadListeners.length; i < len; ++i) {
1149
l = unloadListeners[i];
1152
if (l[EU.ADJ_SCOPE]) {
1153
if (l[EU.ADJ_SCOPE] === true) {
1156
scope = l[EU.ADJ_SCOPE];
1159
l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ]);
1160
unloadListeners[i] = null;
1166
unloadListeners = null;
1168
if (listeners && listeners.length > 0) {
1169
j = listeners.length;
1172
l = listeners[index];
1174
EU.removeListener(l[EU.EL], l[EU.TYPE],
1184
EU.doRemove(window, "unload", EU._unload);
1189
getScroll: function() {
1190
var dd = document.documentElement, db = document.body;
1191
if (dd && (dd.scrollTop || dd.scrollLeft)) {
1192
return [dd.scrollTop, dd.scrollLeft];
1194
return [db.scrollTop, db.scrollLeft];
1201
doAdd: function () {
1202
if (window.addEventListener) {
1203
return function(el, eventName, fn, capture) {
1204
el.addEventListener(eventName, fn, (capture));
1206
} else if (window.attachEvent) {
1207
return function(el, eventName, fn, capture) {
1208
el.attachEvent("on" + eventName, fn);
1217
doRemove: function() {
1218
if (window.removeEventListener) {
1219
return function (el, eventName, fn, capture) {
1220
el.removeEventListener(eventName, fn, (capture));
1222
} else if (window.detachEvent) {
1223
return function (el, eventName, fn) {
1224
el.detachEvent("on" + eventName, fn);
1235
var E = Ext.lib.Event;
1236
E.on = E.addListener;
1237
E.un = E.removeListener;
1238
if (document && document.body) {
1241
E.doAdd(window, "load", E._load);
1243
E.doAdd(window, "unload", E._unload);
1244
E._tryPreloadAttach();
1247
request : function(method, uri, cb, data, options) {
1249
var hs = options.headers;
1252
if(hs.hasOwnProperty(h)){
1253
this.initHeader(h, hs[h], false);
1257
if(options.xmlData){
1258
this.initHeader('Content-Type', 'text/xml', false);
1260
data = options.xmlData;
1261
}else if(options.jsonData){
1262
this.initHeader('Content-Type', 'text/javascript', false);
1264
data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
1268
return this.asyncRequest(method, uri, cb, data);
1271
serializeForm : function(form) {
1272
if(typeof form == 'string') {
1273
form = (document.getElementById(form) || document.forms[form]);
1276
var el, name, val, disabled, data = '', hasSubmit = false;
1277
for (var i = 0; i < form.elements.length; i++) {
1278
el = form.elements[i];
1279
disabled = form.elements[i].disabled;
1280
name = form.elements[i].name;
1281
val = form.elements[i].value;
1283
if (!disabled && name){
1287
case 'select-multiple':
1288
for (var j = 0; j < el.options.length; j++) {
1289
if (el.options[j].selected) {
1291
data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].attributes['value'].specified ? el.options[j].value : el.options[j].text) + '&';
1294
data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].hasAttribute('value') ? el.options[j].value : el.options[j].text) + '&';
1302
data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
1315
if(hasSubmit == false) {
1316
data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
1321
data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
1326
data = data.substr(0, data.length - 1);
1334
useDefaultHeader:true,
1336
defaultPostHeader:'application/x-www-form-urlencoded',
1338
useDefaultXhrHeader:true,
1340
defaultXhrHeader:'XMLHttpRequest',
1342
hasDefaultHeaders:true,
1354
setProgId:function(id)
1356
this.activeX.unshift(id);
1359
setDefaultPostHeader:function(b)
1361
this.useDefaultHeader = b;
1364
setDefaultXhrHeader:function(b)
1366
this.useDefaultXhrHeader = b;
1369
setPollingInterval:function(i)
1371
if (typeof i == 'number' && isFinite(i)) {
1372
this.pollInterval = i;
1376
createXhrObject:function(transactionId)
1382
http = new XMLHttpRequest();
1384
obj = { conn:http, tId:transactionId };
1388
for (var i = 0; i < this.activeX.length; ++i) {
1392
http = new ActiveXObject(this.activeX[i]);
1394
obj = { conn:http, tId:transactionId };
1407
getConnectionObject:function()
1410
var tId = this.transactionId;
1414
o = this.createXhrObject(tId);
1416
this.transactionId++;
1427
asyncRequest:function(method, uri, callback, postData)
1429
var o = this.getConnectionObject();
1435
o.conn.open(method, uri, true);
1437
if (this.useDefaultXhrHeader) {
1438
if (!this.defaultHeaders['X-Requested-With']) {
1439
this.initHeader('X-Requested-With', this.defaultXhrHeader, true);
1443
if(postData && this.useDefaultHeader){
1444
this.initHeader('Content-Type', this.defaultPostHeader);
1447
if (this.hasDefaultHeaders || this.hasHeaders) {
1451
this.handleReadyState(o, callback);
1452
o.conn.send(postData || null);
1458
handleReadyState:function(o, callback)
1462
if (callback && callback.timeout) {
1463
this.timeout[o.tId] = window.setTimeout(function() {
1464
oConn.abort(o, callback, true);
1465
}, callback.timeout);
1468
this.poll[o.tId] = window.setInterval(
1470
if (o.conn && o.conn.readyState == 4) {
1471
window.clearInterval(oConn.poll[o.tId]);
1472
delete oConn.poll[o.tId];
1474
if (callback && callback.timeout) {
1475
window.clearTimeout(oConn.timeout[o.tId]);
1476
delete oConn.timeout[o.tId];
1479
oConn.handleTransactionResponse(o, callback);
1482
, this.pollInterval);
1485
handleTransactionResponse:function(o, callback, isAbort)
1489
this.releaseObject(o);
1493
var httpStatus, responseObject;
1497
if (o.conn.status !== undefined && o.conn.status != 0) {
1498
httpStatus = o.conn.status;
1510
if (httpStatus >= 200 && httpStatus < 300) {
1511
responseObject = this.createResponseObject(o, callback.argument);
1512
if (callback.success) {
1513
if (!callback.scope) {
1514
callback.success(responseObject);
1519
callback.success.apply(callback.scope, [responseObject]);
1524
switch (httpStatus) {
1532
responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false));
1533
if (callback.failure) {
1534
if (!callback.scope) {
1535
callback.failure(responseObject);
1538
callback.failure.apply(callback.scope, [responseObject]);
1543
responseObject = this.createResponseObject(o, callback.argument);
1544
if (callback.failure) {
1545
if (!callback.scope) {
1546
callback.failure(responseObject);
1549
callback.failure.apply(callback.scope, [responseObject]);
1555
this.releaseObject(o);
1556
responseObject = null;
1559
createResponseObject:function(o, callbackArg)
1566
var headerStr = o.conn.getAllResponseHeaders();
1567
var header = headerStr.split('\n');
1568
for (var i = 0; i < header.length; i++) {
1569
var delimitPos = header[i].indexOf(':');
1570
if (delimitPos != -1) {
1571
headerObj[header[i].substring(0, delimitPos)] = header[i].substring(delimitPos + 2);
1579
obj.status = o.conn.status;
1580
obj.statusText = o.conn.statusText;
1581
obj.getResponseHeader = headerObj;
1582
obj.getAllResponseHeaders = headerStr;
1583
obj.responseText = o.conn.responseText;
1584
obj.responseXML = o.conn.responseXML;
1586
if (typeof callbackArg !== undefined) {
1587
obj.argument = callbackArg;
1593
createExceptionObject:function(tId, callbackArg, isAbort)
1596
var COMM_ERROR = 'communication failure';
1597
var ABORT_CODE = -1;
1598
var ABORT_ERROR = 'transaction aborted';
1604
obj.status = ABORT_CODE;
1605
obj.statusText = ABORT_ERROR;
1608
obj.status = COMM_CODE;
1609
obj.statusText = COMM_ERROR;
1613
obj.argument = callbackArg;
1619
initHeader:function(label, value, isDefault)
1621
var headerObj = (isDefault) ? this.defaultHeaders : this.headers;
1623
if (headerObj[label] === undefined) {
1624
headerObj[label] = value;
1629
headerObj[label] = value + "," + headerObj[label];
1633
this.hasDefaultHeaders = true;
1636
this.hasHeaders = true;
1641
setHeader:function(o)
1643
if (this.hasDefaultHeaders) {
1644
for (var prop in this.defaultHeaders) {
1645
if (this.defaultHeaders.hasOwnProperty(prop)) {
1646
o.conn.setRequestHeader(prop, this.defaultHeaders[prop]);
1651
if (this.hasHeaders) {
1652
for (var prop in this.headers) {
1653
if (this.headers.hasOwnProperty(prop)) {
1654
o.conn.setRequestHeader(prop, this.headers[prop]);
1658
this.hasHeaders = false;
1662
resetDefaultHeaders:function() {
1663
delete this.defaultHeaders;
1664
this.defaultHeaders = {};
1665
this.hasDefaultHeaders = false;
1668
abort:function(o, callback, isTimeout)
1670
if (this.isCallInProgress(o)) {
1672
window.clearInterval(this.poll[o.tId]);
1673
delete this.poll[o.tId];
1675
delete this.timeout[o.tId];
1678
this.handleTransactionResponse(o, callback, true);
1688
isCallInProgress:function(o)
1693
return o.conn.readyState != 4 && o.conn.readyState != 0;
1702
releaseObject:function(o)
1711
'MSXML2.XMLHTTP.3.0',
1720
Ext.lib.Region = function(t, r, b, l) {
1729
Ext.lib.Region.prototype = {
1730
contains : function(region) {
1731
return ( region.left >= this.left &&
1732
region.right <= this.right &&
1733
region.top >= this.top &&
1734
region.bottom <= this.bottom );
1738
getArea : function() {
1739
return ( (this.bottom - this.top) * (this.right - this.left) );
1742
intersect : function(region) {
1743
var t = Math.max(this.top, region.top);
1744
var r = Math.min(this.right, region.right);
1745
var b = Math.min(this.bottom, region.bottom);
1746
var l = Math.max(this.left, region.left);
1748
if (b >= t && r >= l) {
1749
return new Ext.lib.Region(t, r, b, l);
1754
union : function(region) {
1755
var t = Math.min(this.top, region.top);
1756
var r = Math.max(this.right, region.right);
1757
var b = Math.max(this.bottom, region.bottom);
1758
var l = Math.min(this.left, region.left);
1760
return new Ext.lib.Region(t, r, b, l);
1763
constrainTo : function(r) {
1764
this.top = this.top.constrain(r.top, r.bottom);
1765
this.bottom = this.bottom.constrain(r.top, r.bottom);
1766
this.left = this.left.constrain(r.left, r.right);
1767
this.right = this.right.constrain(r.left, r.right);
1771
adjust : function(t, l, b, r) {
1780
Ext.lib.Region.getRegion = function(el) {
1781
var p = Ext.lib.Dom.getXY(el);
1784
var r = p[0] + el.offsetWidth;
1785
var b = p[1] + el.offsetHeight;
1788
return new Ext.lib.Region(t, r, b, l);
1791
Ext.lib.Point = function(x, y) {
1792
if (Ext.isArray(x)) {
1796
this.x = this.right = this.left = this[0] = x;
1797
this.y = this.top = this.bottom = this[1] = y;
1800
Ext.lib.Point.prototype = new Ext.lib.Region();
1804
scroll : function(el, args, duration, easing, cb, scope) {
1805
return this.run(el, args, duration, easing, cb, scope, Ext.lib.Scroll);
1808
motion : function(el, args, duration, easing, cb, scope) {
1809
return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion);
1812
color : function(el, args, duration, easing, cb, scope) {
1813
return this.run(el, args, duration, easing, cb, scope, Ext.lib.ColorAnim);
1816
run : function(el, args, duration, easing, cb, scope, type) {
1817
type = type || Ext.lib.AnimBase;
1818
if (typeof easing == "string") {
1819
easing = Ext.lib.Easing[easing];
1821
var anim = new type(el, args, duration, easing);
1822
anim.animateX(function() {
1823
Ext.callback(cb, scope);
1831
if (!libFlyweight) {
1832
libFlyweight = new Ext.Element.Flyweight();
1834
libFlyweight.dom = el;
1835
return libFlyweight;
1840
function fnCleanUp() {
1841
var p = Function.prototype;
1842
delete p.createSequence;
1844
delete p.createDelegate;
1845
delete p.createCallback;
1846
delete p.createInterceptor;
1848
window.detachEvent("onunload", fnCleanUp);
1850
window.attachEvent("onunload", fnCleanUp);
1853
Ext.lib.AnimBase = function(el, attributes, duration, method) {
1855
this.init(el, attributes, duration, method);
1859
Ext.lib.AnimBase.prototype = {
1861
toString: function() {
1862
var el = this.getEl();
1863
var id = el.id || el.tagName;
1864
return ("Anim " + id);
1868
noNegatives: /width|height|opacity|padding/i,
1869
offsetAttribute: /^((width|height)|(top|left))$/,
1870
defaultUnit: /width|height|top$|bottom$|left$|right$/i,
1871
offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i
1875
doMethod: function(attr, start, end) {
1876
return this.method(this.currentFrame, start, end - start, this.totalFrames);
1880
setAttribute: function(attr, val, unit) {
1881
if (this.patterns.noNegatives.test(attr)) {
1882
val = (val > 0) ? val : 0;
1885
Ext.fly(this.getEl(), '_anim').setStyle(attr, val + unit);
1889
getAttribute: function(attr) {
1890
var el = this.getEl();
1891
var val = fly(el).getStyle(attr);
1893
if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
1894
return parseFloat(val);
1897
var a = this.patterns.offsetAttribute.exec(attr) || [];
1898
var pos = !!( a[3] );
1899
var box = !!( a[2] );
1902
if (box || (fly(el).getStyle('position') == 'absolute' && pos)) {
1903
val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
1912
getDefaultUnit: function(attr) {
1913
if (this.patterns.defaultUnit.test(attr)) {
1920
animateX : function(callback, scope) {
1921
var f = function() {
1922
this.onComplete.removeListener(f);
1923
if (typeof callback == "function") {
1924
callback.call(scope || this, this);
1927
this.onComplete.addListener(f, this);
1932
setRuntimeAttribute: function(attr) {
1935
var attributes = this.attributes;
1937
this.runtimeAttributes[attr] = {};
1939
var isset = function(prop) {
1940
return (typeof prop !== 'undefined');
1943
if (!isset(attributes[attr]['to']) && !isset(attributes[attr]['by'])) {
1947
start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr);
1950
if (isset(attributes[attr]['to'])) {
1951
end = attributes[attr]['to'];
1952
} else if (isset(attributes[attr]['by'])) {
1953
if (start.constructor == Array) {
1955
for (var i = 0, len = start.length; i < len; ++i) {
1956
end[i] = start[i] + attributes[attr]['by'][i];
1959
end = start + attributes[attr]['by'];
1963
this.runtimeAttributes[attr].start = start;
1964
this.runtimeAttributes[attr].end = end;
1967
this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? attributes[attr]['unit'] : this.getDefaultUnit(attr);
1971
init: function(el, attributes, duration, method) {
1973
var isAnimated = false;
1976
var startTime = null;
1979
var actualFrames = 0;
1982
el = Ext.getDom(el);
1985
this.attributes = attributes || {};
1988
this.duration = duration || 1;
1991
this.method = method || Ext.lib.Easing.easeNone;
1994
this.useSeconds = true;
1997
this.currentFrame = 0;
2000
this.totalFrames = Ext.lib.AnimMgr.fps;
2003
this.getEl = function() {
2008
this.isAnimated = function() {
2013
this.getStartTime = function() {
2017
this.runtimeAttributes = {};
2020
this.animate = function() {
2021
if (this.isAnimated()) {
2025
this.currentFrame = 0;
2027
this.totalFrames = ( this.useSeconds ) ? Math.ceil(Ext.lib.AnimMgr.fps * this.duration) : this.duration;
2029
Ext.lib.AnimMgr.registerElement(this);
2033
this.stop = function(finish) {
2035
this.currentFrame = this.totalFrames;
2036
this._onTween.fire();
2038
Ext.lib.AnimMgr.stop(this);
2041
var onStart = function() {
2042
this.onStart.fire();
2044
this.runtimeAttributes = {};
2045
for (var attr in this.attributes) {
2046
this.setRuntimeAttribute(attr);
2051
startTime = new Date();
2055
var onTween = function() {
2057
duration: new Date() - this.getStartTime(),
2058
currentFrame: this.currentFrame
2061
data.toString = function() {
2063
'duration: ' + data.duration +
2064
', currentFrame: ' + data.currentFrame
2068
this.onTween.fire(data);
2070
var runtimeAttributes = this.runtimeAttributes;
2072
for (var attr in runtimeAttributes) {
2073
this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit);
2079
var onComplete = function() {
2080
var actual_duration = (new Date() - startTime) / 1000 ;
2083
duration: actual_duration,
2084
frames: actualFrames,
2085
fps: actualFrames / actual_duration
2088
data.toString = function() {
2090
'duration: ' + data.duration +
2091
', frames: ' + data.frames +
2092
', fps: ' + data.fps
2098
this.onComplete.fire(data);
2102
this._onStart = new Ext.util.Event(this);
2103
this.onStart = new Ext.util.Event(this);
2104
this.onTween = new Ext.util.Event(this);
2105
this._onTween = new Ext.util.Event(this);
2106
this.onComplete = new Ext.util.Event(this);
2107
this._onComplete = new Ext.util.Event(this);
2108
this._onStart.addListener(onStart);
2109
this._onTween.addListener(onTween);
2110
this._onComplete.addListener(onComplete);
2115
Ext.lib.AnimMgr = new function() {
2132
this.registerElement = function(tween) {
2133
queue[queue.length] = tween;
2135
tween._onStart.fire();
2140
this.unRegister = function(tween, index) {
2141
tween._onComplete.fire();
2142
index = index || getIndex(tween);
2144
queue.splice(index, 1);
2148
if (tweenCount <= 0) {
2154
this.start = function() {
2155
if (thread === null) {
2156
thread = setInterval(this.run, this.delay);
2161
this.stop = function(tween) {
2163
clearInterval(thread);
2165
for (var i = 0, len = queue.length; i < len; ++i) {
2166
if (queue[0].isAnimated()) {
2167
this.unRegister(queue[0], 0);
2176
this.unRegister(tween);
2181
this.run = function() {
2182
for (var i = 0, len = queue.length; i < len; ++i) {
2183
var tween = queue[i];
2184
if (!tween || !tween.isAnimated()) {
2188
if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null)
2190
tween.currentFrame += 1;
2192
if (tween.useSeconds) {
2193
correctFrame(tween);
2195
tween._onTween.fire();
2198
Ext.lib.AnimMgr.stop(tween, i);
2203
var getIndex = function(anim) {
2204
for (var i = 0, len = queue.length; i < len; ++i) {
2205
if (queue[i] == anim) {
2213
var correctFrame = function(tween) {
2214
var frames = tween.totalFrames;
2215
var frame = tween.currentFrame;
2216
var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames);
2217
var elapsed = (new Date() - tween.getStartTime());
2220
if (elapsed < tween.duration * 1000) {
2221
tweak = Math.round((elapsed / expected - 1) * tween.currentFrame);
2223
tweak = frames - (frame + 1);
2225
if (tweak > 0 && isFinite(tweak)) {
2226
if (tween.currentFrame + tweak >= frames) {
2227
tweak = frames - (frame + 1);
2230
tween.currentFrame += tweak;
2235
Ext.lib.Bezier = new function() {
2237
this.getPosition = function(points, t) {
2238
var n = points.length;
2241
for (var i = 0; i < n; ++i) {
2242
tmp[i] = [points[i][0], points[i][1]];
2245
for (var j = 1; j < n; ++j) {
2246
for (i = 0; i < n - j; ++i) {
2247
tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
2248
tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
2252
return [ tmp[0][0], tmp[0][1] ];
2258
Ext.lib.ColorAnim = function(el, attributes, duration, method) {
2259
Ext.lib.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
2262
Ext.extend(Ext.lib.ColorAnim, Ext.lib.AnimBase);
2266
var superclass = Y.ColorAnim.superclass;
2267
var proto = Y.ColorAnim.prototype;
2269
proto.toString = function() {
2270
var el = this.getEl();
2271
var id = el.id || el.tagName;
2272
return ("ColorAnim " + id);
2275
proto.patterns.color = /color$/i;
2276
proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
2277
proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
2278
proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
2279
proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/;
2282
proto.parseColor = function(s) {
2283
if (s.length == 3) {
2287
var c = this.patterns.hex.exec(s);
2288
if (c && c.length == 4) {
2289
return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ];
2292
c = this.patterns.rgb.exec(s);
2293
if (c && c.length == 4) {
2294
return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ];
2297
c = this.patterns.hex3.exec(s);
2298
if (c && c.length == 4) {
2299
return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ];
2305
proto.getAttribute = function(attr) {
2306
var el = this.getEl();
2307
if (this.patterns.color.test(attr)) {
2308
var val = fly(el).getStyle(attr);
2310
if (this.patterns.transparent.test(val)) {
2311
var parent = el.parentNode;
2312
val = fly(parent).getStyle(attr);
2314
while (parent && this.patterns.transparent.test(val)) {
2315
parent = parent.parentNode;
2316
val = fly(parent).getStyle(attr);
2317
if (parent.tagName.toUpperCase() == 'HTML') {
2323
val = superclass.getAttribute.call(this, attr);
2329
proto.doMethod = function(attr, start, end) {
2332
if (this.patterns.color.test(attr)) {
2334
for (var i = 0, len = start.length; i < len; ++i) {
2335
val[i] = superclass.doMethod.call(this, attr, start[i], end[i]);
2338
val = 'rgb(' + Math.floor(val[0]) + ',' + Math.floor(val[1]) + ',' + Math.floor(val[2]) + ')';
2341
val = superclass.doMethod.call(this, attr, start, end);
2347
proto.setRuntimeAttribute = function(attr) {
2348
superclass.setRuntimeAttribute.call(this, attr);
2350
if (this.patterns.color.test(attr)) {
2351
var attributes = this.attributes;
2352
var start = this.parseColor(this.runtimeAttributes[attr].start);
2353
var end = this.parseColor(this.runtimeAttributes[attr].end);
2355
if (typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined') {
2356
end = this.parseColor(attributes[attr].by);
2358
for (var i = 0, len = start.length; i < len; ++i) {
2359
end[i] = start[i] + end[i];
2363
this.runtimeAttributes[attr].start = start;
2364
this.runtimeAttributes[attr].end = end;
2373
easeNone: function (t, b, c, d) {
2374
return c * t / d + b;
2378
easeIn: function (t, b, c, d) {
2379
return c * (t /= d) * t + b;
2383
easeOut: function (t, b, c, d) {
2384
return -c * (t /= d) * (t - 2) + b;
2388
easeBoth: function (t, b, c, d) {
2389
if ((t /= d / 2) < 1) {
2390
return c / 2 * t * t + b;
2393
return -c / 2 * ((--t) * (t - 2) - 1) + b;
2397
easeInStrong: function (t, b, c, d) {
2398
return c * (t /= d) * t * t * t + b;
2402
easeOutStrong: function (t, b, c, d) {
2403
return -c * ((t = t / d - 1) * t * t * t - 1) + b;
2407
easeBothStrong: function (t, b, c, d) {
2408
if ((t /= d / 2) < 1) {
2409
return c / 2 * t * t * t * t + b;
2412
return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
2417
elasticIn: function (t, b, c, d, a, p) {
2421
if ((t /= d) == 1) {
2428
if (!a || a < Math.abs(c)) {
2433
var s = p / (2 * Math.PI) * Math.asin(c / a);
2436
return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
2440
elasticOut: function (t, b, c, d, a, p) {
2444
if ((t /= d) == 1) {
2451
if (!a || a < Math.abs(c)) {
2456
var s = p / (2 * Math.PI) * Math.asin(c / a);
2459
return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
2463
elasticBoth: function (t, b, c, d, a, p) {
2468
if ((t /= d / 2) == 2) {
2476
if (!a || a < Math.abs(c)) {
2481
var s = p / (2 * Math.PI) * Math.asin(c / a);
2485
return -.5 * (a * Math.pow(2, 10 * (t -= 1)) *
2486
Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
2488
return a * Math.pow(2, -10 * (t -= 1)) *
2489
Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
2494
backIn: function (t, b, c, d, s) {
2495
if (typeof s == 'undefined') {
2498
return c * (t /= d) * t * ((s + 1) * t - s) + b;
2502
backOut: function (t, b, c, d, s) {
2503
if (typeof s == 'undefined') {
2506
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
2510
backBoth: function (t, b, c, d, s) {
2511
if (typeof s == 'undefined') {
2515
if ((t /= d / 2 ) < 1) {
2516
return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
2518
return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
2522
bounceIn: function (t, b, c, d) {
2523
return c - Ext.lib.Easing.bounceOut(d - t, 0, c, d) + b;
2527
bounceOut: function (t, b, c, d) {
2528
if ((t /= d) < (1 / 2.75)) {
2529
return c * (7.5625 * t * t) + b;
2530
} else if (t < (2 / 2.75)) {
2531
return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
2532
} else if (t < (2.5 / 2.75)) {
2533
return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
2535
return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
2539
bounceBoth: function (t, b, c, d) {
2541
return Ext.lib.Easing.bounceIn(t * 2, 0, c, d) * .5 + b;
2543
return Ext.lib.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
2548
Ext.lib.Motion = function(el, attributes, duration, method) {
2550
Ext.lib.Motion.superclass.constructor.call(this, el, attributes, duration, method);
2554
Ext.extend(Ext.lib.Motion, Ext.lib.ColorAnim);
2558
var superclass = Y.Motion.superclass;
2559
var proto = Y.Motion.prototype;
2561
proto.toString = function() {
2562
var el = this.getEl();
2563
var id = el.id || el.tagName;
2564
return ("Motion " + id);
2567
proto.patterns.points = /^points$/i;
2569
proto.setAttribute = function(attr, val, unit) {
2570
if (this.patterns.points.test(attr)) {
2571
unit = unit || 'px';
2572
superclass.setAttribute.call(this, 'left', val[0], unit);
2573
superclass.setAttribute.call(this, 'top', val[1], unit);
2575
superclass.setAttribute.call(this, attr, val, unit);
2579
proto.getAttribute = function(attr) {
2580
if (this.patterns.points.test(attr)) {
2582
superclass.getAttribute.call(this, 'left'),
2583
superclass.getAttribute.call(this, 'top')
2586
val = superclass.getAttribute.call(this, attr);
2592
proto.doMethod = function(attr, start, end) {
2595
if (this.patterns.points.test(attr)) {
2596
var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100;
2597
val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t);
2599
val = superclass.doMethod.call(this, attr, start, end);
2604
proto.setRuntimeAttribute = function(attr) {
2605
if (this.patterns.points.test(attr)) {
2606
var el = this.getEl();
2607
var attributes = this.attributes;
2609
var control = attributes['points']['control'] || [];
2613
if (control.length > 0 && !Ext.isArray(control[0])) {
2614
control = [control];
2617
for (i = 0,len = control.length; i < len; ++i) {
2618
tmp[i] = control[i];
2623
Ext.fly(el).position();
2625
if (isset(attributes['points']['from'])) {
2626
Ext.lib.Dom.setXY(el, attributes['points']['from']);
2629
Ext.lib.Dom.setXY(el, Ext.lib.Dom.getXY(el));
2632
start = this.getAttribute('points');
2635
if (isset(attributes['points']['to'])) {
2636
end = translateValues.call(this, attributes['points']['to'], start);
2638
var pageXY = Ext.lib.Dom.getXY(this.getEl());
2639
for (i = 0,len = control.length; i < len; ++i) {
2640
control[i] = translateValues.call(this, control[i], start);
2644
} else if (isset(attributes['points']['by'])) {
2645
end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ];
2647
for (i = 0,len = control.length; i < len; ++i) {
2648
control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
2652
this.runtimeAttributes[attr] = [start];
2654
if (control.length > 0) {
2655
this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control);
2658
this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end;
2661
superclass.setRuntimeAttribute.call(this, attr);
2665
var translateValues = function(val, start) {
2666
var pageXY = Ext.lib.Dom.getXY(this.getEl());
2667
val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ];
2672
var isset = function(prop) {
2673
return (typeof prop !== 'undefined');
2679
Ext.lib.Scroll = function(el, attributes, duration, method) {
2681
Ext.lib.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
2685
Ext.extend(Ext.lib.Scroll, Ext.lib.ColorAnim);
2689
var superclass = Y.Scroll.superclass;
2690
var proto = Y.Scroll.prototype;
2692
proto.toString = function() {
2693
var el = this.getEl();
2694
var id = el.id || el.tagName;
2695
return ("Scroll " + id);
2698
proto.doMethod = function(attr, start, end) {
2701
if (attr == 'scroll') {
2703
this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames),
2704
this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames)
2708
val = superclass.doMethod.call(this, attr, start, end);
2713
proto.getAttribute = function(attr) {
2715
var el = this.getEl();
2717
if (attr == 'scroll') {
2718
val = [ el.scrollLeft, el.scrollTop ];
2720
val = superclass.getAttribute.call(this, attr);
2726
proto.setAttribute = function(attr, val, unit) {
2727
var el = this.getEl();
2729
if (attr == 'scroll') {
2730
el.scrollLeft = val[0];
2731
el.scrollTop = val[1];
2733
superclass.setAttribute.call(this, attr, val, unit);