diff --git a/thirdpartyjs/extjs/source/adapter/ext-base.js b/thirdpartyjs/extjs/source/adapter/ext-base.js
new file mode 100644
index 0000000..f39e55d
--- /dev/null
+++ b/thirdpartyjs/extjs/source/adapter/ext-base.js
@@ -0,0 +1,2189 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+(function() {
+ var libFlyweight;
+
+ Ext.lib.Dom = {
+ getViewWidth : function(full) {
+ return full ? this.getDocumentWidth() : this.getViewportWidth();
+ },
+
+ getViewHeight : function(full) {
+ return full ? this.getDocumentHeight() : this.getViewportHeight();
+ },
+
+ getDocumentHeight: function() {
+ var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight;
+ return Math.max(scrollHeight, this.getViewportHeight());
+ },
+
+ getDocumentWidth: function() {
+ var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth;
+ return Math.max(scrollWidth, this.getViewportWidth());
+ },
+
+ getViewportHeight: function(){
+ if(Ext.isIE){
+ return Ext.isStrict ? document.documentElement.clientHeight :
+ document.body.clientHeight;
+ }else{
+ return self.innerHeight;
+ }
+ },
+
+ getViewportWidth: function() {
+ if(Ext.isIE){
+ return Ext.isStrict ? document.documentElement.clientWidth :
+ document.body.clientWidth;
+ }else{
+ return self.innerWidth;
+ }
+ },
+
+ isAncestor : function(p, c) {
+ p = Ext.getDom(p);
+ c = Ext.getDom(c);
+ if (!p || !c) {
+ return false;
+ }
+
+ if (p.contains && !Ext.isSafari) {
+ return p.contains(c);
+ } else if (p.compareDocumentPosition) {
+ return !!(p.compareDocumentPosition(c) & 16);
+ } else {
+ var parent = c.parentNode;
+ while (parent) {
+ if (parent == p) {
+ return true;
+ }
+ else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
+ return false;
+ }
+ parent = parent.parentNode;
+ }
+ return false;
+ }
+ },
+
+ getRegion : function(el) {
+ return Ext.lib.Region.getRegion(el);
+ },
+
+ getY : function(el) {
+ return this.getXY(el)[1];
+ },
+
+ getX : function(el) {
+ return this.getXY(el)[0];
+ },
+
+
+ getXY : function(el) {
+ var p, pe, b, scroll, bd = (document.body || document.documentElement);
+ el = Ext.getDom(el);
+
+ if(el == bd){
+ return [0, 0];
+ }
+
+ if (el.getBoundingClientRect) {
+ b = el.getBoundingClientRect();
+ scroll = fly(document).getScroll();
+ return [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
+ hasAbsolute = true;
+ }
+
+ if (Ext.isGecko) {
+ pe = fly(p);
+
+ var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
+ var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
+
+
+ x += bl;
+ y += bt;
+
+
+ if (p != el && pe.getStyle('overflow') != 'visible') {
+ x += bl;
+ y += bt;
+ }
+ }
+ p = p.offsetParent;
+ }
+
+ if (Ext.isSafari && hasAbsolute) {
+ x -= bd.offsetLeft;
+ y -= bd.offsetTop;
+ }
+
+ if (Ext.isGecko && !hasAbsolute) {
+ var dbd = fly(bd);
+ x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
+ y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
+ }
+
+ p = el.parentNode;
+ while (p && p != bd) {
+ if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
+ x -= p.scrollLeft;
+ y -= p.scrollTop;
+ }
+ p = p.parentNode;
+ }
+ return [x, y];
+ },
+
+ setXY : function(el, xy) {
+ el = Ext.fly(el, '_setXY');
+ el.position();
+ var pts = el.translatePoints(xy);
+ if (xy[0] !== false) {
+ el.dom.style.left = pts.left + "px";
+ }
+ if (xy[1] !== false) {
+ el.dom.style.top = pts.top + "px";
+ }
+ },
+
+ setX : function(el, x) {
+ this.setXY(el, [x, false]);
+ },
+
+ setY : function(el, y) {
+ this.setXY(el, [false, y]);
+ }
+ };
+
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ */
+ Ext.lib.Event = function() {
+ var loadComplete = false;
+ var listeners = [];
+ var unloadListeners = [];
+ var retryCount = 0;
+ var onAvailStack = [];
+ var counter = 0;
+ var lastError = null;
+
+ return {
+ POLL_RETRYS: 200,
+ POLL_INTERVAL: 20,
+ EL: 0,
+ TYPE: 1,
+ FN: 2,
+ WFN: 3,
+ OBJ: 3,
+ ADJ_SCOPE: 4,
+ _interval: null,
+
+ startInterval: function() {
+ if (!this._interval) {
+ var self = this;
+ var callback = function() {
+ self._tryPreloadAttach();
+ };
+ this._interval = setInterval(callback, this.POLL_INTERVAL);
+
+ }
+ },
+
+ onAvailable: function(p_id, p_fn, p_obj, p_override) {
+ onAvailStack.push({ id: p_id,
+ fn: p_fn,
+ obj: p_obj,
+ override: p_override,
+ checkReady: false });
+
+ retryCount = this.POLL_RETRYS;
+ this.startInterval();
+ },
+
+
+ addListener: function(el, eventName, fn) {
+ el = Ext.getDom(el);
+ if (!el || !fn) {
+ return false;
+ }
+
+ if ("unload" == eventName) {
+ unloadListeners[unloadListeners.length] =
+ [el, eventName, fn];
+ return true;
+ }
+
+ // prevent unload errors with simple check
+ var wrappedFn = function(e) {
+ return typeof Ext != 'undefined' ? fn(Ext.lib.Event.getEvent(e)) : false;
+ };
+
+ var li = [el, eventName, fn, wrappedFn];
+
+ var index = listeners.length;
+ listeners[index] = li;
+
+ this.doAdd(el, eventName, wrappedFn, false);
+ return true;
+
+ },
+
+
+ removeListener: function(el, eventName, fn) {
+ var i, len;
+
+ el = Ext.getDom(el);
+
+ if(!fn) {
+ return this.purgeElement(el, false, eventName);
+ }
+
+
+ if ("unload" == eventName) {
+
+ for (i = 0,len = unloadListeners.length; i < len; i++) {
+ var li = unloadListeners[i];
+ if (li &&
+ li[0] == el &&
+ li[1] == eventName &&
+ li[2] == fn) {
+ unloadListeners.splice(i, 1);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ var cacheItem = null;
+
+
+ var index = arguments[3];
+
+ if ("undefined" == typeof index) {
+ index = this._getCacheIndex(el, eventName, fn);
+ }
+
+ if (index >= 0) {
+ cacheItem = listeners[index];
+ }
+
+ if (!el || !cacheItem) {
+ return false;
+ }
+
+ this.doRemove(el, eventName, cacheItem[this.WFN], false);
+
+ delete listeners[index][this.WFN];
+ delete listeners[index][this.FN];
+ listeners.splice(index, 1);
+
+ return true;
+
+ },
+
+
+ getTarget: function(ev, resolveTextNode) {
+ ev = ev.browserEvent || ev;
+ var t = ev.target || ev.srcElement;
+ return this.resolveTextNode(t);
+ },
+
+
+ resolveTextNode: function(node) {
+ if (Ext.isSafari && node && 3 == node.nodeType) {
+ return node.parentNode;
+ } else {
+ return node;
+ }
+ },
+
+
+ getPageX: function(ev) {
+ ev = ev.browserEvent || ev;
+ var x = ev.pageX;
+ if (!x && 0 !== x) {
+ x = ev.clientX || 0;
+
+ if (Ext.isIE) {
+ x += this.getScroll()[1];
+ }
+ }
+
+ return x;
+ },
+
+
+ getPageY: function(ev) {
+ ev = ev.browserEvent || ev;
+ var y = ev.pageY;
+ if (!y && 0 !== y) {
+ y = ev.clientY || 0;
+
+ if (Ext.isIE) {
+ y += this.getScroll()[0];
+ }
+ }
+
+
+ return y;
+ },
+
+
+ getXY: function(ev) {
+ ev = ev.browserEvent || ev;
+ return [this.getPageX(ev), this.getPageY(ev)];
+ },
+
+
+ getRelatedTarget: function(ev) {
+ ev = ev.browserEvent || ev;
+ var t = ev.relatedTarget;
+ if (!t) {
+ if (ev.type == "mouseout") {
+ t = ev.toElement;
+ } else if (ev.type == "mouseover") {
+ t = ev.fromElement;
+ }
+ }
+
+ return this.resolveTextNode(t);
+ },
+
+
+ getTime: function(ev) {
+ ev = ev.browserEvent || ev;
+ if (!ev.time) {
+ var t = new Date().getTime();
+ try {
+ ev.time = t;
+ } catch(ex) {
+ this.lastError = ex;
+ return t;
+ }
+ }
+
+ return ev.time;
+ },
+
+
+ stopEvent: function(ev) {
+ this.stopPropagation(ev);
+ this.preventDefault(ev);
+ },
+
+
+ stopPropagation: function(ev) {
+ ev = ev.browserEvent || ev;
+ if (ev.stopPropagation) {
+ ev.stopPropagation();
+ } else {
+ ev.cancelBubble = true;
+ }
+ },
+
+
+ preventDefault: function(ev) {
+ ev = ev.browserEvent || ev;
+ if(ev.preventDefault) {
+ ev.preventDefault();
+ } else {
+ ev.returnValue = false;
+ }
+ },
+
+
+ getEvent: function(e) {
+ var ev = e || window.event;
+ if (!ev) {
+ var c = this.getEvent.caller;
+ while (c) {
+ ev = c.arguments[0];
+ if (ev && Event == ev.constructor) {
+ break;
+ }
+ c = c.caller;
+ }
+ }
+ return ev;
+ },
+
+
+ getCharCode: function(ev) {
+ ev = ev.browserEvent || ev;
+ return ev.charCode || ev.keyCode || 0;
+ },
+
+
+ _getCacheIndex: function(el, eventName, fn) {
+ for (var i = 0,len = listeners.length; i < len; ++i) {
+ var li = listeners[i];
+ if (li &&
+ li[this.FN] == fn &&
+ li[this.EL] == el &&
+ li[this.TYPE] == eventName) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+
+ elCache: {},
+
+
+ getEl: function(id) {
+ return document.getElementById(id);
+ },
+
+
+ clearCache: function() {
+ },
+
+
+ _load: function(e) {
+ loadComplete = true;
+ var EU = Ext.lib.Event;
+
+
+ if (Ext.isIE) {
+ EU.doRemove(window, "load", EU._load);
+ }
+ },
+
+
+ _tryPreloadAttach: function() {
+
+ if (this.locked) {
+ return false;
+ }
+
+ this.locked = true;
+
+
+ var tryAgain = !loadComplete;
+ if (!tryAgain) {
+ tryAgain = (retryCount > 0);
+ }
+
+
+ var notAvail = [];
+ for (var i = 0,len = onAvailStack.length; i < len; ++i) {
+ var item = onAvailStack[i];
+ if (item) {
+ var el = this.getEl(item.id);
+
+ if (el) {
+ if (!item.checkReady ||
+ loadComplete ||
+ el.nextSibling ||
+ (document && document.body)) {
+
+ var scope = el;
+ if (item.override) {
+ if (item.override === true) {
+ scope = item.obj;
+ } else {
+ scope = item.override;
+ }
+ }
+ item.fn.call(scope, item.obj);
+ onAvailStack[i] = null;
+ }
+ } else {
+ notAvail.push(item);
+ }
+ }
+ }
+
+ retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
+
+ if (tryAgain) {
+
+ this.startInterval();
+ } else {
+ clearInterval(this._interval);
+ this._interval = null;
+ }
+
+ this.locked = false;
+
+ return true;
+
+ },
+
+
+ purgeElement: function(el, recurse, eventName) {
+ var elListeners = this.getListeners(el, eventName);
+ if (elListeners) {
+ for (var i = 0,len = elListeners.length; i < len; ++i) {
+ var l = elListeners[i];
+ this.removeListener(el, l.type, l.fn);
+ }
+ }
+
+ if (recurse && el && el.childNodes) {
+ for (i = 0,len = el.childNodes.length; i < len; ++i) {
+ this.purgeElement(el.childNodes[i], recurse, eventName);
+ }
+ }
+ },
+
+
+ getListeners: function(el, eventName) {
+ var results = [], searchLists;
+ if (!eventName) {
+ searchLists = [listeners, unloadListeners];
+ } else if (eventName == "unload") {
+ searchLists = [unloadListeners];
+ } else {
+ searchLists = [listeners];
+ }
+
+ for (var j = 0; j < searchLists.length; ++j) {
+ var searchList = searchLists[j];
+ if (searchList && searchList.length > 0) {
+ for (var i = 0,len = searchList.length; i < len; ++i) {
+ var l = searchList[i];
+ if (l && l[this.EL] === el &&
+ (!eventName || eventName === l[this.TYPE])) {
+ results.push({
+ type: l[this.TYPE],
+ fn: l[this.FN],
+ obj: l[this.OBJ],
+ adjust: l[this.ADJ_SCOPE],
+ index: i
+ });
+ }
+ }
+ }
+ }
+
+ return (results.length) ? results : null;
+ },
+
+
+ _unload: function(e) {
+
+ var EU = Ext.lib.Event, i, j, l, len, index;
+
+ for (i = 0,len = unloadListeners.length; i < len; ++i) {
+ l = unloadListeners[i];
+ if (l) {
+ var scope = window;
+ if (l[EU.ADJ_SCOPE]) {
+ if (l[EU.ADJ_SCOPE] === true) {
+ scope = l[EU.OBJ];
+ } else {
+ scope = l[EU.ADJ_SCOPE];
+ }
+ }
+ l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ]);
+ unloadListeners[i] = null;
+ l = null;
+ scope = null;
+ }
+ }
+
+ unloadListeners = null;
+
+ if (listeners && listeners.length > 0) {
+ j = listeners.length;
+ while (j) {
+ index = j - 1;
+ l = listeners[index];
+ if (l) {
+ EU.removeListener(l[EU.EL], l[EU.TYPE],
+ l[EU.FN], index);
+ }
+ j = j - 1;
+ }
+ l = null;
+
+ EU.clearCache();
+ }
+
+ EU.doRemove(window, "unload", EU._unload);
+
+ },
+
+
+ getScroll: function() {
+ var dd = document.documentElement, db = document.body;
+ if (dd && (dd.scrollTop || dd.scrollLeft)) {
+ return [dd.scrollTop, dd.scrollLeft];
+ } else if (db) {
+ return [db.scrollTop, db.scrollLeft];
+ } else {
+ return [0, 0];
+ }
+ },
+
+
+ doAdd: function () {
+ if (window.addEventListener) {
+ return function(el, eventName, fn, capture) {
+ el.addEventListener(eventName, fn, (capture));
+ };
+ } else if (window.attachEvent) {
+ return function(el, eventName, fn, capture) {
+ el.attachEvent("on" + eventName, fn);
+ };
+ } else {
+ return function() {
+ };
+ }
+ }(),
+
+
+ doRemove: function() {
+ if (window.removeEventListener) {
+ return function (el, eventName, fn, capture) {
+ el.removeEventListener(eventName, fn, (capture));
+ };
+ } else if (window.detachEvent) {
+ return function (el, eventName, fn) {
+ el.detachEvent("on" + eventName, fn);
+ };
+ } else {
+ return function() {
+ };
+ }
+ }()
+ };
+
+ }();
+
+ var E = Ext.lib.Event;
+ E.on = E.addListener;
+ E.un = E.removeListener;
+ if(document && document.body) {
+ E._load();
+ } else {
+ E.doAdd(window, "load", E._load);
+ }
+ E.doAdd(window, "unload", E._unload);
+ E._tryPreloadAttach();
+
+ Ext.lib.Ajax = {
+ request : function(method, uri, cb, data, options) {
+ if(options){
+ var hs = options.headers;
+ if(hs){
+ for(var h in hs){
+ if(hs.hasOwnProperty(h)){
+ this.initHeader(h, hs[h], false);
+ }
+ }
+ }
+ if(options.xmlData){
+ if (!hs || !hs['Content-Type']){
+ this.initHeader('Content-Type', 'text/xml', false);
+ }
+ method = (method ? method : (options.method ? options.method : 'POST'));
+ data = options.xmlData;
+ }else if(options.jsonData){
+ if (!hs || !hs['Content-Type']){
+ this.initHeader('Content-Type', 'application/json', false);
+ }
+ method = (method ? method : (options.method ? options.method : 'POST'));
+ data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
+ }
+ }
+
+ return this.asyncRequest(method, uri, cb, data);
+ },
+
+ serializeForm : function(form) {
+ if(typeof form == 'string') {
+ form = (document.getElementById(form) || document.forms[form]);
+ }
+
+ var el, name, val, disabled, data = '', hasSubmit = false;
+ for (var i = 0; i < form.elements.length; i++) {
+ el = form.elements[i];
+ disabled = form.elements[i].disabled;
+ name = form.elements[i].name;
+ val = form.elements[i].value;
+
+ if (!disabled && name){
+ switch (el.type)
+ {
+ case 'select-one':
+ case 'select-multiple':
+ for (var j = 0; j < el.options.length; j++) {
+ if (el.options[j].selected) {
+ if (Ext.isIE) {
+ data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].attributes['value'].specified ? el.options[j].value : el.options[j].text) + '&';
+ }
+ else {
+ data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].hasAttribute('value') ? el.options[j].value : el.options[j].text) + '&';
+ }
+ }
+ }
+ break;
+ case 'radio':
+ case 'checkbox':
+ if (el.checked) {
+ data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
+ }
+ break;
+ case 'file':
+
+ case undefined:
+
+ case 'reset':
+
+ case 'button':
+
+ break;
+ case 'submit':
+ if(hasSubmit == false) {
+ data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
+ hasSubmit = true;
+ }
+ break;
+ default:
+ data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
+ break;
+ }
+ }
+ }
+ data = data.substr(0, data.length - 1);
+ return data;
+ },
+
+ headers:{},
+
+ hasHeaders:false,
+
+ useDefaultHeader:true,
+
+ defaultPostHeader:'application/x-www-form-urlencoded; charset=UTF-8',
+
+ useDefaultXhrHeader:true,
+
+ defaultXhrHeader:'XMLHttpRequest',
+
+ hasDefaultHeaders:true,
+
+ defaultHeaders:{},
+
+ poll:{},
+
+ timeout:{},
+
+ pollInterval:50,
+
+ transactionId:0,
+
+ setProgId:function(id)
+ {
+ this.activeX.unshift(id);
+ },
+
+ setDefaultPostHeader:function(b)
+ {
+ this.useDefaultHeader = b;
+ },
+
+ setDefaultXhrHeader:function(b)
+ {
+ this.useDefaultXhrHeader = b;
+ },
+
+ setPollingInterval:function(i)
+ {
+ if (typeof i == 'number' && isFinite(i)) {
+ this.pollInterval = i;
+ }
+ },
+
+ createXhrObject:function(transactionId)
+ {
+ var obj,http;
+ try
+ {
+
+ http = new XMLHttpRequest();
+
+ obj = { conn:http, tId:transactionId };
+ }
+ catch(e)
+ {
+ for (var i = 0; i < this.activeX.length; ++i) {
+ try
+ {
+
+ http = new ActiveXObject(this.activeX[i]);
+
+ obj = { conn:http, tId:transactionId };
+ break;
+ }
+ catch(e) {
+ }
+ }
+ }
+ finally
+ {
+ return obj;
+ }
+ },
+
+ getConnectionObject:function()
+ {
+ var o;
+ var tId = this.transactionId;
+
+ try
+ {
+ o = this.createXhrObject(tId);
+ if (o) {
+ this.transactionId++;
+ }
+ }
+ catch(e) {
+ }
+ finally
+ {
+ return o;
+ }
+ },
+
+ asyncRequest:function(method, uri, callback, postData)
+ {
+ var o = this.getConnectionObject();
+
+ if (!o) {
+ return null;
+ }
+ else {
+ o.conn.open(method, uri, true);
+
+ if (this.useDefaultXhrHeader) {
+ if (!this.defaultHeaders['X-Requested-With']) {
+ this.initHeader('X-Requested-With', this.defaultXhrHeader, true);
+ }
+ }
+
+ if(postData && this.useDefaultHeader && (!this.hasHeaders || !this.headers['Content-Type'])){
+ this.initHeader('Content-Type', this.defaultPostHeader);
+ }
+
+ if (this.hasDefaultHeaders || this.hasHeaders) {
+ this.setHeader(o);
+ }
+
+ this.handleReadyState(o, callback);
+ o.conn.send(postData || null);
+
+ return o;
+ }
+ },
+
+ handleReadyState:function(o, callback)
+ {
+ var oConn = this;
+
+ if (callback && callback.timeout) {
+ this.timeout[o.tId] = window.setTimeout(function() {
+ oConn.abort(o, callback, true);
+ }, callback.timeout);
+ }
+
+ this.poll[o.tId] = window.setInterval(
+ function() {
+ if (o.conn && o.conn.readyState == 4) {
+ window.clearInterval(oConn.poll[o.tId]);
+ delete oConn.poll[o.tId];
+
+ if (callback && callback.timeout) {
+ window.clearTimeout(oConn.timeout[o.tId]);
+ delete oConn.timeout[o.tId];
+ }
+
+ oConn.handleTransactionResponse(o, callback);
+ }
+ }
+ , this.pollInterval);
+ },
+
+ handleTransactionResponse:function(o, callback, isAbort)
+ {
+
+ if (!callback) {
+ this.releaseObject(o);
+ return;
+ }
+
+ var httpStatus, responseObject;
+
+ try
+ {
+ if (o.conn.status !== undefined && o.conn.status != 0) {
+ httpStatus = o.conn.status;
+ }
+ else {
+ httpStatus = 13030;
+ }
+ }
+ catch(e) {
+
+
+ httpStatus = 13030;
+ }
+
+ if (httpStatus >= 200 && httpStatus < 300) {
+ responseObject = this.createResponseObject(o, callback.argument);
+ if (callback.success) {
+ if (!callback.scope) {
+ callback.success(responseObject);
+ }
+ else {
+
+
+ callback.success.apply(callback.scope, [responseObject]);
+ }
+ }
+ }
+ else {
+ switch (httpStatus) {
+
+ case 12002:
+ case 12029:
+ case 12030:
+ case 12031:
+ case 12152:
+ case 13030:
+ responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false));
+ if (callback.failure) {
+ if (!callback.scope) {
+ callback.failure(responseObject);
+ }
+ else {
+ callback.failure.apply(callback.scope, [responseObject]);
+ }
+ }
+ break;
+ default:
+ responseObject = this.createResponseObject(o, callback.argument);
+ if (callback.failure) {
+ if (!callback.scope) {
+ callback.failure(responseObject);
+ }
+ else {
+ callback.failure.apply(callback.scope, [responseObject]);
+ }
+ }
+ }
+ }
+
+ this.releaseObject(o);
+ responseObject = null;
+ },
+
+ createResponseObject:function(o, callbackArg)
+ {
+ var obj = {};
+ var headerObj = {};
+
+ try
+ {
+ var headerStr = o.conn.getAllResponseHeaders();
+ var header = headerStr.split('\n');
+ for (var i = 0; i < header.length; i++) {
+ var delimitPos = header[i].indexOf(':');
+ if (delimitPos != -1) {
+ headerObj[header[i].substring(0, delimitPos)] = header[i].substring(delimitPos + 2);
+ }
+ }
+ }
+ catch(e) {
+ }
+
+ obj.tId = o.tId;
+ obj.status = o.conn.status;
+ obj.statusText = o.conn.statusText;
+ obj.getResponseHeader = headerObj;
+ obj.getAllResponseHeaders = headerStr;
+ obj.responseText = o.conn.responseText;
+ obj.responseXML = o.conn.responseXML;
+
+ if (typeof callbackArg !== undefined) {
+ obj.argument = callbackArg;
+ }
+
+ return obj;
+ },
+
+ createExceptionObject:function(tId, callbackArg, isAbort)
+ {
+ var COMM_CODE = 0;
+ var COMM_ERROR = 'communication failure';
+ var ABORT_CODE = -1;
+ var ABORT_ERROR = 'transaction aborted';
+
+ var obj = {};
+
+ obj.tId = tId;
+ if (isAbort) {
+ obj.status = ABORT_CODE;
+ obj.statusText = ABORT_ERROR;
+ }
+ else {
+ obj.status = COMM_CODE;
+ obj.statusText = COMM_ERROR;
+ }
+
+ if (callbackArg) {
+ obj.argument = callbackArg;
+ }
+
+ return obj;
+ },
+
+ initHeader:function(label, value, isDefault)
+ {
+ var headerObj = (isDefault) ? this.defaultHeaders : this.headers;
+
+ if (headerObj[label] === undefined) {
+ headerObj[label] = value;
+ }
+ else {
+
+
+ headerObj[label] = value + "," + headerObj[label];
+ }
+
+ if (isDefault) {
+ this.hasDefaultHeaders = true;
+ }
+ else {
+ this.hasHeaders = true;
+ }
+ },
+
+
+ setHeader:function(o)
+ {
+ if (this.hasDefaultHeaders) {
+ for (var prop in this.defaultHeaders) {
+ if (this.defaultHeaders.hasOwnProperty(prop)) {
+ o.conn.setRequestHeader(prop, this.defaultHeaders[prop]);
+ }
+ }
+ }
+
+ if (this.hasHeaders) {
+ for (var prop in this.headers) {
+ if (this.headers.hasOwnProperty(prop)) {
+ o.conn.setRequestHeader(prop, this.headers[prop]);
+ }
+ }
+ this.headers = {};
+ this.hasHeaders = false;
+ }
+ },
+
+ resetDefaultHeaders:function() {
+ delete this.defaultHeaders;
+ this.defaultHeaders = {};
+ this.hasDefaultHeaders = false;
+ },
+
+ abort:function(o, callback, isTimeout)
+ {
+ if (this.isCallInProgress(o)) {
+ o.conn.abort();
+ window.clearInterval(this.poll[o.tId]);
+ delete this.poll[o.tId];
+ if (isTimeout) {
+ delete this.timeout[o.tId];
+ }
+
+ this.handleTransactionResponse(o, callback, true);
+
+ return true;
+ }
+ else {
+ return false;
+ }
+ },
+
+
+ isCallInProgress:function(o)
+ {
+
+
+ if (o.conn) {
+ return o.conn.readyState != 4 && o.conn.readyState != 0;
+ }
+ else {
+
+ return false;
+ }
+ },
+
+
+ releaseObject:function(o)
+ {
+
+ o.conn = null;
+
+ o = null;
+ },
+
+ activeX:[
+ 'MSXML2.XMLHTTP.3.0',
+ 'MSXML2.XMLHTTP',
+ 'Microsoft.XMLHTTP'
+ ]
+
+
+ };
+
+
+ Ext.lib.Region = function(t, r, b, l) {
+ this.top = t;
+ this[1] = t;
+ this.right = r;
+ this.bottom = b;
+ this.left = l;
+ this[0] = l;
+ };
+
+ Ext.lib.Region.prototype = {
+ contains : function(region) {
+ return ( region.left >= this.left &&
+ region.right <= this.right &&
+ region.top >= this.top &&
+ region.bottom <= this.bottom );
+
+ },
+
+ getArea : function() {
+ return ( (this.bottom - this.top) * (this.right - this.left) );
+ },
+
+ intersect : function(region) {
+ var t = Math.max(this.top, region.top);
+ var r = Math.min(this.right, region.right);
+ var b = Math.min(this.bottom, region.bottom);
+ var l = Math.max(this.left, region.left);
+
+ if (b >= t && r >= l) {
+ return new Ext.lib.Region(t, r, b, l);
+ } else {
+ return null;
+ }
+ },
+ union : function(region) {
+ var t = Math.min(this.top, region.top);
+ var r = Math.max(this.right, region.right);
+ var b = Math.max(this.bottom, region.bottom);
+ var l = Math.min(this.left, region.left);
+
+ return new Ext.lib.Region(t, r, b, l);
+ },
+
+ constrainTo : function(r) {
+ this.top = this.top.constrain(r.top, r.bottom);
+ this.bottom = this.bottom.constrain(r.top, r.bottom);
+ this.left = this.left.constrain(r.left, r.right);
+ this.right = this.right.constrain(r.left, r.right);
+ return this;
+ },
+
+ adjust : function(t, l, b, r) {
+ this.top += t;
+ this.left += l;
+ this.right += r;
+ this.bottom += b;
+ return this;
+ }
+ };
+
+ Ext.lib.Region.getRegion = function(el) {
+ var p = Ext.lib.Dom.getXY(el);
+
+ var t = p[1];
+ var r = p[0] + el.offsetWidth;
+ var b = p[1] + el.offsetHeight;
+ var l = p[0];
+
+ return new Ext.lib.Region(t, r, b, l);
+ };
+
+ Ext.lib.Point = function(x, y) {
+ if (Ext.isArray(x)) {
+ y = x[1];
+ x = x[0];
+ }
+ this.x = this.right = this.left = this[0] = x;
+ this.y = this.top = this.bottom = this[1] = y;
+ };
+
+ Ext.lib.Point.prototype = new Ext.lib.Region();
+
+
+ Ext.lib.Anim = {
+ scroll : function(el, args, duration, easing, cb, scope) {
+ return this.run(el, args, duration, easing, cb, scope, Ext.lib.Scroll);
+ },
+
+ motion : function(el, args, duration, easing, cb, scope) {
+ return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion);
+ },
+
+ color : function(el, args, duration, easing, cb, scope) {
+ return this.run(el, args, duration, easing, cb, scope, Ext.lib.ColorAnim);
+ },
+
+ run : function(el, args, duration, easing, cb, scope, type) {
+ type = type || Ext.lib.AnimBase;
+ if (typeof easing == "string") {
+ easing = Ext.lib.Easing[easing];
+ }
+ var anim = new type(el, args, duration, easing);
+ anim.animateX(function() {
+ Ext.callback(cb, scope);
+ });
+ return anim;
+ }
+ };
+
+
+ function fly(el) {
+ if (!libFlyweight) {
+ libFlyweight = new Ext.Element.Flyweight();
+ }
+ libFlyweight.dom = el;
+ return libFlyweight;
+ }
+
+
+ if(Ext.isIE) {
+ function fnCleanUp() {
+ var p = Function.prototype;
+ delete p.createSequence;
+ delete p.defer;
+ delete p.createDelegate;
+ delete p.createCallback;
+ delete p.createInterceptor;
+
+ window.detachEvent("onunload", fnCleanUp);
+ }
+ window.attachEvent("onunload", fnCleanUp);
+ }
+
+ Ext.lib.AnimBase = function(el, attributes, duration, method) {
+ if (el) {
+ this.init(el, attributes, duration, method);
+ }
+ };
+
+ Ext.lib.AnimBase.prototype = {
+
+ toString: function() {
+ var el = this.getEl();
+ var id = el.id || el.tagName;
+ return ("Anim " + id);
+ },
+
+ patterns: {
+ noNegatives: /width|height|opacity|padding/i,
+ offsetAttribute: /^((width|height)|(top|left))$/,
+ defaultUnit: /width|height|top$|bottom$|left$|right$/i,
+ offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i
+ },
+
+
+ doMethod: function(attr, start, end) {
+ return this.method(this.currentFrame, start, end - start, this.totalFrames);
+ },
+
+
+ setAttribute: function(attr, val, unit) {
+ if (this.patterns.noNegatives.test(attr)) {
+ val = (val > 0) ? val : 0;
+ }
+
+ Ext.fly(this.getEl(), '_anim').setStyle(attr, val + unit);
+ },
+
+
+ getAttribute: function(attr) {
+ var el = this.getEl();
+ var val = fly(el).getStyle(attr);
+
+ if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
+ return parseFloat(val);
+ }
+
+ var a = this.patterns.offsetAttribute.exec(attr) || [];
+ var pos = !!( a[3] );
+ var box = !!( a[2] );
+
+
+ if (box || (fly(el).getStyle('position') == 'absolute' && pos)) {
+ val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
+ } else {
+ val = 0;
+ }
+
+ return val;
+ },
+
+
+ getDefaultUnit: function(attr) {
+ if (this.patterns.defaultUnit.test(attr)) {
+ return 'px';
+ }
+
+ return '';
+ },
+
+ animateX : function(callback, scope) {
+ var f = function() {
+ this.onComplete.removeListener(f);
+ if (typeof callback == "function") {
+ callback.call(scope || this, this);
+ }
+ };
+ this.onComplete.addListener(f, this);
+ this.animate();
+ },
+
+
+ setRuntimeAttribute: function(attr) {
+ var start;
+ var end;
+ var attributes = this.attributes;
+
+ this.runtimeAttributes[attr] = {};
+
+ var isset = function(prop) {
+ return (typeof prop !== 'undefined');
+ };
+
+ if (!isset(attributes[attr]['to']) && !isset(attributes[attr]['by'])) {
+ return false;
+ }
+
+ start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr);
+
+
+ if (isset(attributes[attr]['to'])) {
+ end = attributes[attr]['to'];
+ } else if (isset(attributes[attr]['by'])) {
+ if (start.constructor == Array) {
+ end = [];
+ for (var i = 0, len = start.length; i < len; ++i) {
+ end[i] = start[i] + attributes[attr]['by'][i];
+ }
+ } else {
+ end = start + attributes[attr]['by'];
+ }
+ }
+
+ this.runtimeAttributes[attr].start = start;
+ this.runtimeAttributes[attr].end = end;
+
+
+ this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? attributes[attr]['unit'] : this.getDefaultUnit(attr);
+ },
+
+
+ init: function(el, attributes, duration, method) {
+
+ var isAnimated = false;
+
+
+ var startTime = null;
+
+
+ var actualFrames = 0;
+
+
+ el = Ext.getDom(el);
+
+
+ this.attributes = attributes || {};
+
+
+ this.duration = duration || 1;
+
+
+ this.method = method || Ext.lib.Easing.easeNone;
+
+
+ this.useSeconds = true;
+
+
+ this.currentFrame = 0;
+
+
+ this.totalFrames = Ext.lib.AnimMgr.fps;
+
+
+ this.getEl = function() {
+ return el;
+ };
+
+
+ this.isAnimated = function() {
+ return isAnimated;
+ };
+
+
+ this.getStartTime = function() {
+ return startTime;
+ };
+
+ this.runtimeAttributes = {};
+
+
+ this.animate = function() {
+ if (this.isAnimated()) {
+ return false;
+ }
+
+ this.currentFrame = 0;
+
+ this.totalFrames = ( this.useSeconds ) ? Math.ceil(Ext.lib.AnimMgr.fps * this.duration) : this.duration;
+
+ Ext.lib.AnimMgr.registerElement(this);
+ };
+
+
+ this.stop = function(finish) {
+ if (finish) {
+ this.currentFrame = this.totalFrames;
+ this._onTween.fire();
+ }
+ Ext.lib.AnimMgr.stop(this);
+ };
+
+ var onStart = function() {
+ this.onStart.fire();
+
+ this.runtimeAttributes = {};
+ for (var attr in this.attributes) {
+ this.setRuntimeAttribute(attr);
+ }
+
+ isAnimated = true;
+ actualFrames = 0;
+ startTime = new Date();
+ };
+
+
+ var onTween = function() {
+ var data = {
+ duration: new Date() - this.getStartTime(),
+ currentFrame: this.currentFrame
+ };
+
+ data.toString = function() {
+ return (
+ 'duration: ' + data.duration +
+ ', currentFrame: ' + data.currentFrame
+ );
+ };
+
+ this.onTween.fire(data);
+
+ var runtimeAttributes = this.runtimeAttributes;
+
+ for (var attr in runtimeAttributes) {
+ this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit);
+ }
+
+ actualFrames += 1;
+ };
+
+ var onComplete = function() {
+ var actual_duration = (new Date() - startTime) / 1000 ;
+
+ var data = {
+ duration: actual_duration,
+ frames: actualFrames,
+ fps: actualFrames / actual_duration
+ };
+
+ data.toString = function() {
+ return (
+ 'duration: ' + data.duration +
+ ', frames: ' + data.frames +
+ ', fps: ' + data.fps
+ );
+ };
+
+ isAnimated = false;
+ actualFrames = 0;
+ this.onComplete.fire(data);
+ };
+
+
+ this._onStart = new Ext.util.Event(this);
+ this.onStart = new Ext.util.Event(this);
+ this.onTween = new Ext.util.Event(this);
+ this._onTween = new Ext.util.Event(this);
+ this.onComplete = new Ext.util.Event(this);
+ this._onComplete = new Ext.util.Event(this);
+ this._onStart.addListener(onStart);
+ this._onTween.addListener(onTween);
+ this._onComplete.addListener(onComplete);
+ }
+ };
+
+
+ Ext.lib.AnimMgr = new function() {
+
+ var thread = null;
+
+
+ var queue = [];
+
+
+ var tweenCount = 0;
+
+
+ this.fps = 1000;
+
+
+ this.delay = 1;
+
+
+ this.registerElement = function(tween) {
+ queue[queue.length] = tween;
+ tweenCount += 1;
+ tween._onStart.fire();
+ this.start();
+ };
+
+
+ this.unRegister = function(tween, index) {
+ tween._onComplete.fire();
+ index = index || getIndex(tween);
+ if (index != -1) {
+ queue.splice(index, 1);
+ }
+
+ tweenCount -= 1;
+ if (tweenCount <= 0) {
+ this.stop();
+ }
+ };
+
+
+ this.start = function() {
+ if (thread === null) {
+ thread = setInterval(this.run, this.delay);
+ }
+ };
+
+
+ this.stop = function(tween) {
+ if (!tween) {
+ clearInterval(thread);
+
+ for (var i = 0, len = queue.length; i < len; ++i) {
+ if (queue[0].isAnimated()) {
+ this.unRegister(queue[0], 0);
+ }
+ }
+
+ queue = [];
+ thread = null;
+ tweenCount = 0;
+ }
+ else {
+ this.unRegister(tween);
+ }
+ };
+
+
+ this.run = function() {
+ for (var i = 0, len = queue.length; i < len; ++i) {
+ var tween = queue[i];
+ if (!tween || !tween.isAnimated()) {
+ continue;
+ }
+
+ if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null)
+ {
+ tween.currentFrame += 1;
+
+ if (tween.useSeconds) {
+ correctFrame(tween);
+ }
+ tween._onTween.fire();
+ }
+ else {
+ Ext.lib.AnimMgr.stop(tween, i);
+ }
+ }
+ };
+
+ var getIndex = function(anim) {
+ for (var i = 0, len = queue.length; i < len; ++i) {
+ if (queue[i] == anim) {
+ return i;
+ }
+ }
+ return -1;
+ };
+
+
+ var correctFrame = function(tween) {
+ var frames = tween.totalFrames;
+ var frame = tween.currentFrame;
+ var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames);
+ var elapsed = (new Date() - tween.getStartTime());
+ var tweak = 0;
+
+ if (elapsed < tween.duration * 1000) {
+ tweak = Math.round((elapsed / expected - 1) * tween.currentFrame);
+ } else {
+ tweak = frames - (frame + 1);
+ }
+ if (tweak > 0 && isFinite(tweak)) {
+ if (tween.currentFrame + tweak >= frames) {
+ tweak = frames - (frame + 1);
+ }
+
+ tween.currentFrame += tweak;
+ }
+ };
+ };
+
+ Ext.lib.Bezier = new function() {
+
+ this.getPosition = function(points, t) {
+ var n = points.length;
+ var tmp = [];
+
+ for (var i = 0; i < n; ++i) {
+ tmp[i] = [points[i][0], points[i][1]];
+ }
+
+ for (var j = 1; j < n; ++j) {
+ for (i = 0; i < n - j; ++i) {
+ tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
+ tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
+ }
+ }
+
+ return [ tmp[0][0], tmp[0][1] ];
+
+ };
+ };
+ (function() {
+
+ Ext.lib.ColorAnim = function(el, attributes, duration, method) {
+ Ext.lib.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
+ };
+
+ Ext.extend(Ext.lib.ColorAnim, Ext.lib.AnimBase);
+
+
+ var Y = Ext.lib;
+ var superclass = Y.ColorAnim.superclass;
+ var proto = Y.ColorAnim.prototype;
+
+ proto.toString = function() {
+ var el = this.getEl();
+ var id = el.id || el.tagName;
+ return ("ColorAnim " + id);
+ };
+
+ proto.patterns.color = /color$/i;
+ proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
+ proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
+ proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
+ proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/;
+
+
+ proto.parseColor = function(s) {
+ if (s.length == 3) {
+ return s;
+ }
+
+ var c = this.patterns.hex.exec(s);
+ if (c && c.length == 4) {
+ return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ];
+ }
+
+ c = this.patterns.rgb.exec(s);
+ if (c && c.length == 4) {
+ return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ];
+ }
+
+ c = this.patterns.hex3.exec(s);
+ if (c && c.length == 4) {
+ return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ];
+ }
+
+ return null;
+ };
+
+ proto.getAttribute = function(attr) {
+ var el = this.getEl();
+ if (this.patterns.color.test(attr)) {
+ var val = fly(el).getStyle(attr);
+
+ if (this.patterns.transparent.test(val)) {
+ var parent = el.parentNode;
+ val = fly(parent).getStyle(attr);
+
+ while (parent && this.patterns.transparent.test(val)) {
+ parent = parent.parentNode;
+ val = fly(parent).getStyle(attr);
+ if (parent.tagName.toUpperCase() == 'HTML') {
+ val = '#fff';
+ }
+ }
+ }
+ } else {
+ val = superclass.getAttribute.call(this, attr);
+ }
+
+ return val;
+ };
+
+ proto.doMethod = function(attr, start, end) {
+ var val;
+
+ if (this.patterns.color.test(attr)) {
+ val = [];
+ for (var i = 0, len = start.length; i < len; ++i) {
+ val[i] = superclass.doMethod.call(this, attr, start[i], end[i]);
+ }
+
+ val = 'rgb(' + Math.floor(val[0]) + ',' + Math.floor(val[1]) + ',' + Math.floor(val[2]) + ')';
+ }
+ else {
+ val = superclass.doMethod.call(this, attr, start, end);
+ }
+
+ return val;
+ };
+
+ proto.setRuntimeAttribute = function(attr) {
+ superclass.setRuntimeAttribute.call(this, attr);
+
+ if (this.patterns.color.test(attr)) {
+ var attributes = this.attributes;
+ var start = this.parseColor(this.runtimeAttributes[attr].start);
+ var end = this.parseColor(this.runtimeAttributes[attr].end);
+
+ if (typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined') {
+ end = this.parseColor(attributes[attr].by);
+
+ for (var i = 0, len = start.length; i < len; ++i) {
+ end[i] = start[i] + end[i];
+ }
+ }
+
+ this.runtimeAttributes[attr].start = start;
+ this.runtimeAttributes[attr].end = end;
+ }
+ };
+ })();
+
+
+ Ext.lib.Easing = {
+
+
+ easeNone: function (t, b, c, d) {
+ return c * t / d + b;
+ },
+
+
+ easeIn: function (t, b, c, d) {
+ return c * (t /= d) * t + b;
+ },
+
+
+ easeOut: function (t, b, c, d) {
+ return -c * (t /= d) * (t - 2) + b;
+ },
+
+
+ easeBoth: function (t, b, c, d) {
+ if ((t /= d / 2) < 1) {
+ return c / 2 * t * t + b;
+ }
+
+ return -c / 2 * ((--t) * (t - 2) - 1) + b;
+ },
+
+
+ easeInStrong: function (t, b, c, d) {
+ return c * (t /= d) * t * t * t + b;
+ },
+
+
+ easeOutStrong: function (t, b, c, d) {
+ return -c * ((t = t / d - 1) * t * t * t - 1) + b;
+ },
+
+
+ easeBothStrong: function (t, b, c, d) {
+ if ((t /= d / 2) < 1) {
+ return c / 2 * t * t * t * t + b;
+ }
+
+ return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
+ },
+
+
+
+ elasticIn: function (t, b, c, d, a, p) {
+ if (t == 0) {
+ return b;
+ }
+ if ((t /= d) == 1) {
+ return b + c;
+ }
+ if (!p) {
+ p = d * .3;
+ }
+
+ if (!a || a < Math.abs(c)) {
+ a = c;
+ var s = p / 4;
+ }
+ else {
+ var s = p / (2 * Math.PI) * Math.asin(c / a);
+ }
+
+ return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
+ },
+
+
+ elasticOut: function (t, b, c, d, a, p) {
+ if (t == 0) {
+ return b;
+ }
+ if ((t /= d) == 1) {
+ return b + c;
+ }
+ if (!p) {
+ p = d * .3;
+ }
+
+ if (!a || a < Math.abs(c)) {
+ a = c;
+ var s = p / 4;
+ }
+ else {
+ var s = p / (2 * Math.PI) * Math.asin(c / a);
+ }
+
+ return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
+ },
+
+
+ elasticBoth: function (t, b, c, d, a, p) {
+ if (t == 0) {
+ return b;
+ }
+
+ if ((t /= d / 2) == 2) {
+ return b + c;
+ }
+
+ if (!p) {
+ p = d * (.3 * 1.5);
+ }
+
+ if (!a || a < Math.abs(c)) {
+ a = c;
+ var s = p / 4;
+ }
+ else {
+ var s = p / (2 * Math.PI) * Math.asin(c / a);
+ }
+
+ if (t < 1) {
+ return -.5 * (a * Math.pow(2, 10 * (t -= 1)) *
+ Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
+ }
+ return a * Math.pow(2, -10 * (t -= 1)) *
+ Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
+ },
+
+
+
+ backIn: function (t, b, c, d, s) {
+ if (typeof s == 'undefined') {
+ s = 1.70158;
+ }
+ return c * (t /= d) * t * ((s + 1) * t - s) + b;
+ },
+
+
+ backOut: function (t, b, c, d, s) {
+ if (typeof s == 'undefined') {
+ s = 1.70158;
+ }
+ return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
+ },
+
+
+ backBoth: function (t, b, c, d, s) {
+ if (typeof s == 'undefined') {
+ s = 1.70158;
+ }
+
+ if ((t /= d / 2 ) < 1) {
+ return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
+ }
+ return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
+ },
+
+
+ bounceIn: function (t, b, c, d) {
+ return c - Ext.lib.Easing.bounceOut(d - t, 0, c, d) + b;
+ },
+
+
+ bounceOut: function (t, b, c, d) {
+ if ((t /= d) < (1 / 2.75)) {
+ return c * (7.5625 * t * t) + b;
+ } else if (t < (2 / 2.75)) {
+ return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
+ } else if (t < (2.5 / 2.75)) {
+ return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
+ }
+ return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
+ },
+
+
+ bounceBoth: function (t, b, c, d) {
+ if (t < d / 2) {
+ return Ext.lib.Easing.bounceIn(t * 2, 0, c, d) * .5 + b;
+ }
+ return Ext.lib.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
+ }
+ };
+
+ (function() {
+ Ext.lib.Motion = function(el, attributes, duration, method) {
+ if (el) {
+ Ext.lib.Motion.superclass.constructor.call(this, el, attributes, duration, method);
+ }
+ };
+
+ Ext.extend(Ext.lib.Motion, Ext.lib.ColorAnim);
+
+
+ var Y = Ext.lib;
+ var superclass = Y.Motion.superclass;
+ var proto = Y.Motion.prototype;
+
+ proto.toString = function() {
+ var el = this.getEl();
+ var id = el.id || el.tagName;
+ return ("Motion " + id);
+ };
+
+ proto.patterns.points = /^points$/i;
+
+ proto.setAttribute = function(attr, val, unit) {
+ if (this.patterns.points.test(attr)) {
+ unit = unit || 'px';
+ superclass.setAttribute.call(this, 'left', val[0], unit);
+ superclass.setAttribute.call(this, 'top', val[1], unit);
+ } else {
+ superclass.setAttribute.call(this, attr, val, unit);
+ }
+ };
+
+ proto.getAttribute = function(attr) {
+ if (this.patterns.points.test(attr)) {
+ var val = [
+ superclass.getAttribute.call(this, 'left'),
+ superclass.getAttribute.call(this, 'top')
+ ];
+ } else {
+ val = superclass.getAttribute.call(this, attr);
+ }
+
+ return val;
+ };
+
+ proto.doMethod = function(attr, start, end) {
+ var val = null;
+
+ if (this.patterns.points.test(attr)) {
+ var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100;
+ val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t);
+ } else {
+ val = superclass.doMethod.call(this, attr, start, end);
+ }
+ return val;
+ };
+
+ proto.setRuntimeAttribute = function(attr) {
+ if (this.patterns.points.test(attr)) {
+ var el = this.getEl();
+ var attributes = this.attributes;
+ var start;
+ var control = attributes['points']['control'] || [];
+ var end;
+ var i, len;
+
+ if (control.length > 0 && !Ext.isArray(control[0])) {
+ control = [control];
+ } else {
+ var tmp = [];
+ for (i = 0,len = control.length; i < len; ++i) {
+ tmp[i] = control[i];
+ }
+ control = tmp;
+ }
+
+ Ext.fly(el, '_anim').position();
+
+ if (isset(attributes['points']['from'])) {
+ Ext.lib.Dom.setXY(el, attributes['points']['from']);
+ }
+ else {
+ Ext.lib.Dom.setXY(el, Ext.lib.Dom.getXY(el));
+ }
+
+ start = this.getAttribute('points');
+
+
+ if (isset(attributes['points']['to'])) {
+ end = translateValues.call(this, attributes['points']['to'], start);
+
+ var pageXY = Ext.lib.Dom.getXY(this.getEl());
+ for (i = 0,len = control.length; i < len; ++i) {
+ control[i] = translateValues.call(this, control[i], start);
+ }
+
+
+ } else if (isset(attributes['points']['by'])) {
+ end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ];
+
+ for (i = 0,len = control.length; i < len; ++i) {
+ control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
+ }
+ }
+
+ this.runtimeAttributes[attr] = [start];
+
+ if (control.length > 0) {
+ this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control);
+ }
+
+ this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end;
+ }
+ else {
+ superclass.setRuntimeAttribute.call(this, attr);
+ }
+ };
+
+ var translateValues = function(val, start) {
+ var pageXY = Ext.lib.Dom.getXY(this.getEl());
+ val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ];
+
+ return val;
+ };
+
+ var isset = function(prop) {
+ return (typeof prop !== 'undefined');
+ };
+ })();
+
+
+ (function() {
+ Ext.lib.Scroll = function(el, attributes, duration, method) {
+ if (el) {
+ Ext.lib.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
+ }
+ };
+
+ Ext.extend(Ext.lib.Scroll, Ext.lib.ColorAnim);
+
+
+ var Y = Ext.lib;
+ var superclass = Y.Scroll.superclass;
+ var proto = Y.Scroll.prototype;
+
+ proto.toString = function() {
+ var el = this.getEl();
+ var id = el.id || el.tagName;
+ return ("Scroll " + id);
+ };
+
+ proto.doMethod = function(attr, start, end) {
+ var val = null;
+
+ if (attr == 'scroll') {
+ val = [
+ this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames),
+ this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames)
+ ];
+
+ } else {
+ val = superclass.doMethod.call(this, attr, start, end);
+ }
+ return val;
+ };
+
+ proto.getAttribute = function(attr) {
+ var val = null;
+ var el = this.getEl();
+
+ if (attr == 'scroll') {
+ val = [ el.scrollLeft, el.scrollTop ];
+ } else {
+ val = superclass.getAttribute.call(this, attr);
+ }
+
+ return val;
+ };
+
+ proto.setAttribute = function(attr, val, unit) {
+ var el = this.getEl();
+
+ if (attr == 'scroll') {
+ el.scrollLeft = val[0];
+ el.scrollTop = val[1];
+ } else {
+ superclass.setAttribute.call(this, attr, val, unit);
+ }
+ };
+ })();
+
+
+})();
\ No newline at end of file
diff --git a/thirdpartyjs/extjs/source/adapter/jquery-bridge.js b/thirdpartyjs/extjs/source/adapter/jquery-bridge.js
new file mode 100644
index 0000000..52855c6
--- /dev/null
+++ b/thirdpartyjs/extjs/source/adapter/jquery-bridge.js
@@ -0,0 +1,541 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+if(typeof jQuery == "undefined"){
+ throw "Unable to load Ext, jQuery not found.";
+}
+
+(function(){
+var libFlyweight;
+
+Ext.lib.Dom = {
+ getViewWidth : function(full){
+ // jQuery doesn't report full window size on document query, so max both
+ return full ? Math.max(jQuery(document).width(),jQuery(window).width()) : jQuery(window).width();
+ },
+
+ getViewHeight : function(full){
+ // jQuery doesn't report full window size on document query, so max both
+ return full ? Math.max(jQuery(document).height(),jQuery(window).height()) : jQuery(window).height();
+ },
+
+ isAncestor : function(p, c){
+ p = Ext.getDom(p);
+ c = Ext.getDom(c);
+ if (!p || !c) {return false;}
+
+ if(p.contains && !Ext.isSafari) {
+ return p.contains(c);
+ }else if(p.compareDocumentPosition) {
+ return !!(p.compareDocumentPosition(c) & 16);
+ }else{
+ var parent = c.parentNode;
+ while (parent) {
+ if (parent == p) {
+ return true;
+ }
+ else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
+ return false;
+ }
+ parent = parent.parentNode;
+ }
+ return false;
+ }
+ },
+
+ getRegion : function(el){
+ return Ext.lib.Region.getRegion(el);
+ },
+
+ //////////////////////////////////////////////////////////////////////////////////////
+ // Use of jQuery.offset() removed to promote consistent behavior across libs.
+ // JVS 05/23/07
+ //////////////////////////////////////////////////////////////////////////////////////
+
+ getY : function(el){
+ return this.getXY(el)[1];
+ },
+
+ getX : function(el){
+ return this.getXY(el)[0];
+ },
+
+ getXY : function(el) {
+ var p, pe, b, scroll, bd = (document.body || document.documentElement);
+ el = Ext.getDom(el);
+
+ if(el == bd){
+ return [0, 0];
+ }
+
+ if (el.getBoundingClientRect) {
+ b = el.getBoundingClientRect();
+ scroll = fly(document).getScroll();
+ return [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
+ hasAbsolute = true;
+ }
+
+ if (Ext.isGecko) {
+ pe = fly(p);
+
+ var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
+ var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
+
+
+ x += bl;
+ y += bt;
+
+
+ if (p != el && pe.getStyle('overflow') != 'visible') {
+ x += bl;
+ y += bt;
+ }
+ }
+ p = p.offsetParent;
+ }
+
+ if (Ext.isSafari && hasAbsolute) {
+ x -= bd.offsetLeft;
+ y -= bd.offsetTop;
+ }
+
+ if (Ext.isGecko && !hasAbsolute) {
+ var dbd = fly(bd);
+ x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
+ y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
+ }
+
+ p = el.parentNode;
+ while (p && p != bd) {
+ if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
+ x -= p.scrollLeft;
+ y -= p.scrollTop;
+ }
+ p = p.parentNode;
+ }
+ return [x, y];
+ },
+
+ setXY : function(el, xy){
+ el = Ext.fly(el, '_setXY');
+ el.position();
+ var pts = el.translatePoints(xy);
+ if(xy[0] !== false){
+ el.dom.style.left = pts.left + "px";
+ }
+ if(xy[1] !== false){
+ el.dom.style.top = pts.top + "px";
+ }
+ },
+
+ setX : function(el, x){
+ this.setXY(el, [x, false]);
+ },
+
+ setY : function(el, y){
+ this.setXY(el, [false, y]);
+ }
+};
+
+// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights
+function fly(el){
+ if(!libFlyweight){
+ libFlyweight = new Ext.Element.Flyweight();
+ }
+ libFlyweight.dom = el;
+ return libFlyweight;
+}
+Ext.lib.Event = {
+ getPageX : function(e){
+ e = e.browserEvent || e;
+ return e.pageX;
+ },
+
+ getPageY : function(e){
+ e = e.browserEvent || e;
+ return e.pageY;
+ },
+
+ getXY : function(e){
+ e = e.browserEvent || e;
+ return [e.pageX, e.pageY];
+ },
+
+ getTarget : function(e){
+ return e.target;
+ },
+
+ // all Ext events will go through event manager which provides scoping
+ on : function(el, eventName, fn, scope, override){
+ jQuery(el).bind(eventName, fn);
+ },
+
+ un : function(el, eventName, fn){
+ jQuery(el).unbind(eventName, fn);
+ },
+
+ purgeElement : function(el){
+ jQuery(el).unbind();
+ },
+
+ preventDefault : function(e){
+ e = e.browserEvent || e;
+ if(e.preventDefault){
+ e.preventDefault();
+ }else{
+ e.returnValue = false;
+ }
+ },
+
+ stopPropagation : function(e){
+ e = e.browserEvent || e;
+ if(e.stopPropagation){
+ e.stopPropagation();
+ }else{
+ e.cancelBubble = true;
+ }
+ },
+
+ stopEvent : function(e){
+ this.preventDefault(e);
+ this.stopPropagation(e);
+ },
+
+ onAvailable : function(id, fn, scope){
+ var start = new Date();
+ var f = function(){
+ if(start.getElapsed() > 10000){
+ clearInterval(iid);
+ }
+ var el = document.getElementById(id);
+ if(el){
+ clearInterval(iid);
+ fn.call(scope||window, el);
+ }
+ };
+ var iid = setInterval(f, 50);
+ },
+
+ resolveTextNode: function(node) {
+ if (node && 3 == node.nodeType) {
+ return node.parentNode;
+ } else {
+ return node;
+ }
+ },
+
+ getRelatedTarget: function(ev) {
+ ev = ev.browserEvent || ev;
+ var t = ev.relatedTarget;
+ if (!t) {
+ if (ev.type == "mouseout") {
+ t = ev.toElement;
+ } else if (ev.type == "mouseover") {
+ t = ev.fromElement;
+ }
+ }
+
+ return this.resolveTextNode(t);
+ }
+};
+
+Ext.lib.Ajax = function(){
+ var createComplete = function(cb){
+ return function(xhr, status){
+ if((status == 'error' || status == 'timeout') && cb.failure){
+ cb.failure.call(cb.scope||window, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ }else if(cb.success){
+ cb.success.call(cb.scope||window, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ }
+ };
+ };
+ return {
+ request : function(method, uri, cb, data, options){
+ var o = {
+ type: method,
+ url: uri,
+ data: data,
+ timeout: cb.timeout,
+ complete: createComplete(cb)
+ };
+
+ if(options){
+ var hs = options.headers;
+ if(options.xmlData){
+ o.data = options.xmlData;
+ o.processData = false;
+ o.type = (method ? method : (options.method ? options.method : 'POST'));
+ if (!hs || !hs['Content-Type']){
+ o.contentType = 'text/xml';
+ }
+ }else if(options.jsonData){
+ o.data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
+ o.processData = false;
+ o.type = (method ? method : (options.method ? options.method : 'POST'));
+ if (!hs || !hs['Content-Type']){
+ o.contentType = 'application/json';
+ }
+ }
+ if(hs){
+ o.beforeSend = function(xhr){
+ for(var h in hs){
+ if(hs.hasOwnProperty(h)){
+ xhr.setRequestHeader(h, hs[h]);
+ }
+ }
+ }
+ }
+ }
+ jQuery.ajax(o);
+ },
+
+ formRequest : function(form, uri, cb, data, isUpload, sslUri){
+ jQuery.ajax({
+ type: Ext.getDom(form).method ||'POST',
+ url: uri,
+ data: jQuery(form).serialize()+(data?'&'+data:''),
+ timeout: cb.timeout,
+ complete: createComplete(cb)
+ });
+ },
+
+ isCallInProgress : function(trans){
+ return false;
+ },
+
+ abort : function(trans){
+ return false;
+ },
+
+ serializeForm : function(form){
+ return jQuery(form.dom||form).serialize();
+ }
+ };
+}();
+
+Ext.lib.Anim = function(){
+ var createAnim = function(cb, scope){
+ var animated = true;
+ return {
+ stop : function(skipToLast){
+ // do nothing
+ },
+
+ isAnimated : function(){
+ return animated;
+ },
+
+ proxyCallback : function(){
+ animated = false;
+ Ext.callback(cb, scope);
+ }
+ };
+ };
+ return {
+ scroll : function(el, args, duration, easing, cb, scope){
+ // scroll anim not supported so just scroll immediately
+ var anim = createAnim(cb, scope);
+ el = Ext.getDom(el);
+ if(typeof args.scroll.to[0] == 'number'){
+ el.scrollLeft = args.scroll.to[0];
+ }
+ if(typeof args.scroll.to[1] == 'number'){
+ el.scrollTop = args.scroll.to[1];
+ }
+ anim.proxyCallback();
+ return anim;
+ },
+
+ motion : function(el, args, duration, easing, cb, scope){
+ return this.run(el, args, duration, easing, cb, scope);
+ },
+
+ color : function(el, args, duration, easing, cb, scope){
+ // color anim not supported, so execute callback immediately
+ var anim = createAnim(cb, scope);
+ anim.proxyCallback();
+ return anim;
+ },
+
+ run : function(el, args, duration, easing, cb, scope, type){
+ var anim = createAnim(cb, scope), e = Ext.fly(el, '_animrun');
+ var o = {};
+ for(var k in args){
+ if(args[k].from){
+ if(k != 'points'){
+ e.setStyle(k, args[k].from);
+ }
+ }
+ switch(k){ // jquery doesn't support, so convert
+ case 'points':
+ var by, pts;
+ e.position();
+ if(by = args.points.by){
+ var xy = e.getXY();
+ pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]);
+ }else{
+ pts = e.translatePoints(args.points.to);
+ }
+ o.left = pts.left;
+ o.top = pts.top;
+ if(!parseInt(e.getStyle('left'), 10)){ // auto bug
+ e.setLeft(0);
+ }
+ if(!parseInt(e.getStyle('top'), 10)){
+ e.setTop(0);
+ }
+ if(args.points.from){
+ e.setXY(args.points.from);
+ }
+ break;
+ case 'width':
+ o.width = args.width.to;
+ break;
+ case 'height':
+ o.height = args.height.to;
+ break;
+ case 'opacity':
+ o.opacity = args.opacity.to;
+ break;
+ case 'left':
+ o.left = args.left.to;
+ break;
+ case 'top':
+ o.top = args.top.to;
+ break;
+ default:
+ o[k] = args[k].to;
+ break;
+ }
+ }
+ // TODO: find out about easing plug in?
+ jQuery(el).animate(o, duration*1000, undefined, anim.proxyCallback);
+ return anim;
+ }
+ };
+}();
+
+
+Ext.lib.Region = function(t, r, b, l) {
+ this.top = t;
+ this[1] = t;
+ this.right = r;
+ this.bottom = b;
+ this.left = l;
+ this[0] = l;
+};
+
+Ext.lib.Region.prototype = {
+ contains : function(region) {
+ return ( region.left >= this.left &&
+ region.right <= this.right &&
+ region.top >= this.top &&
+ region.bottom <= this.bottom );
+
+ },
+
+ getArea : function() {
+ return ( (this.bottom - this.top) * (this.right - this.left) );
+ },
+
+ intersect : function(region) {
+ var t = Math.max( this.top, region.top );
+ var r = Math.min( this.right, region.right );
+ var b = Math.min( this.bottom, region.bottom );
+ var l = Math.max( this.left, region.left );
+
+ if (b >= t && r >= l) {
+ return new Ext.lib.Region(t, r, b, l);
+ } else {
+ return null;
+ }
+ },
+ union : function(region) {
+ var t = Math.min( this.top, region.top );
+ var r = Math.max( this.right, region.right );
+ var b = Math.max( this.bottom, region.bottom );
+ var l = Math.min( this.left, region.left );
+
+ return new Ext.lib.Region(t, r, b, l);
+ },
+
+ constrainTo : function(r) {
+ this.top = this.top.constrain(r.top, r.bottom);
+ this.bottom = this.bottom.constrain(r.top, r.bottom);
+ this.left = this.left.constrain(r.left, r.right);
+ this.right = this.right.constrain(r.left, r.right);
+ return this;
+ },
+
+ adjust : function(t, l, b, r){
+ this.top += t;
+ this.left += l;
+ this.right += r;
+ this.bottom += b;
+ return this;
+ }
+};
+
+Ext.lib.Region.getRegion = function(el) {
+ var p = Ext.lib.Dom.getXY(el);
+
+ var t = p[1];
+ var r = p[0] + el.offsetWidth;
+ var b = p[1] + el.offsetHeight;
+ var l = p[0];
+
+ return new Ext.lib.Region(t, r, b, l);
+};
+
+Ext.lib.Point = function(x, y) {
+ if (Ext.isArray(x)) {
+ y = x[1];
+ x = x[0];
+ }
+ this.x = this.right = this.left = this[0] = x;
+ this.y = this.top = this.bottom = this[1] = y;
+};
+
+Ext.lib.Point.prototype = new Ext.lib.Region();
+
+// prevent IE leaks
+if(Ext.isIE) {
+ function fnCleanUp() {
+ var p = Function.prototype;
+ delete p.createSequence;
+ delete p.defer;
+ delete p.createDelegate;
+ delete p.createCallback;
+ delete p.createInterceptor;
+
+ window.detachEvent("onunload", fnCleanUp);
+ }
+ window.attachEvent("onunload", fnCleanUp);
+}
+})();
\ No newline at end of file
diff --git a/thirdpartyjs/extjs/source/adapter/prototype-bridge.js b/thirdpartyjs/extjs/source/adapter/prototype-bridge.js
new file mode 100644
index 0000000..7f25cd6
--- /dev/null
+++ b/thirdpartyjs/extjs/source/adapter/prototype-bridge.js
@@ -0,0 +1,548 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+(function(){
+
+var libFlyweight;
+
+Ext.lib.Dom = {
+ getViewWidth : function(full){
+ return full ? this.getDocumentWidth() : this.getViewportWidth();
+ },
+
+ getViewHeight : function(full){
+ return full ? this.getDocumentHeight() : this.getViewportHeight();
+ },
+
+ getDocumentHeight: function() { // missing from prototype?
+ var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight;
+ return Math.max(scrollHeight, this.getViewportHeight());
+ },
+
+ getDocumentWidth: function() { // missing from prototype?
+ var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth;
+ return Math.max(scrollWidth, this.getViewportWidth());
+ },
+
+ getViewportHeight: function() { // missing from prototype?
+ var height = self.innerHeight;
+ var mode = document.compatMode;
+
+ if ( (mode || Ext.isIE) && !Ext.isOpera ) {
+ height = (mode == "CSS1Compat") ?
+ document.documentElement.clientHeight : // Standards
+ document.body.clientHeight; // Quirks
+ }
+
+ return height;
+ },
+
+ getViewportWidth: function() { // missing from prototype?
+ var width = self.innerWidth; // Safari
+ var mode = document.compatMode;
+
+ if (mode || Ext.isIE) { // IE, Gecko, Opera
+ width = (mode == "CSS1Compat") ?
+ document.documentElement.clientWidth : // Standards
+ document.body.clientWidth; // Quirks
+ }
+ return width;
+ },
+
+ isAncestor : function(p, c){ // missing from prototype?
+ p = Ext.getDom(p);
+ c = Ext.getDom(c);
+ if (!p || !c) {return false;}
+
+ if(p.contains && !Ext.isSafari) {
+ return p.contains(c);
+ }else if(p.compareDocumentPosition) {
+ return !!(p.compareDocumentPosition(c) & 16);
+ }else{
+ var parent = c.parentNode;
+ while (parent) {
+ if (parent == p) {
+ return true;
+ }
+ else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
+ return false;
+ }
+ parent = parent.parentNode;
+ }
+ return false;
+ }
+ },
+
+ getRegion : function(el){
+ return Ext.lib.Region.getRegion(el);
+ },
+
+ getY : function(el){
+ return this.getXY(el)[1];
+ },
+
+ getX : function(el){
+ return this.getXY(el)[0];
+ },
+
+ getXY : function(el){ // this initially used Position.cumulativeOffset but it is not accurate enough
+ var p, pe, b, scroll, bd = (document.body || document.documentElement);
+ el = Ext.getDom(el);
+
+ if(el == bd){
+ return [0, 0];
+ }
+
+ if (el.getBoundingClientRect) {
+ b = el.getBoundingClientRect();
+ scroll = fly(document).getScroll();
+ return [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
+ hasAbsolute = true;
+ }
+
+ if (Ext.isGecko) {
+ pe = fly(p);
+
+ var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
+ var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
+
+
+ x += bl;
+ y += bt;
+
+
+ if (p != el && pe.getStyle('overflow') != 'visible') {
+ x += bl;
+ y += bt;
+ }
+ }
+ p = p.offsetParent;
+ }
+
+ if (Ext.isSafari && hasAbsolute) {
+ x -= bd.offsetLeft;
+ y -= bd.offsetTop;
+ }
+
+ if (Ext.isGecko && !hasAbsolute) {
+ var dbd = fly(bd);
+ x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
+ y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
+ }
+
+ p = el.parentNode;
+ while (p && p != bd) {
+ if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
+ x -= p.scrollLeft;
+ y -= p.scrollTop;
+ }
+ p = p.parentNode;
+ }
+ return [x, y];
+ },
+
+ setXY : function(el, xy){ // this initially used Position.cumulativeOffset but it is not accurate enough
+ el = Ext.fly(el, '_setXY');
+ el.position();
+ var pts = el.translatePoints(xy);
+ if(xy[0] !== false){
+ el.dom.style.left = pts.left + "px";
+ }
+ if(xy[1] !== false){
+ el.dom.style.top = pts.top + "px";
+ }
+ },
+
+ setX : function(el, x){
+ this.setXY(el, [x, false]);
+ },
+
+ setY : function(el, y){
+ this.setXY(el, [false, y]);
+ }
+};
+
+Ext.lib.Event = {
+ getPageX : function(e){
+ return Event.pointerX(e.browserEvent || e);
+ },
+
+ getPageY : function(e){
+ return Event.pointerY(e.browserEvent || e);
+ },
+
+ getXY : function(e){
+ e = e.browserEvent || e;
+ return [Event.pointerX(e), Event.pointerY(e)];
+ },
+
+ getTarget : function(e){
+ return Event.element(e.browserEvent || e);
+ },
+
+ resolveTextNode: function(node) {
+ if (node && 3 == node.nodeType) {
+ return node.parentNode;
+ } else {
+ return node;
+ }
+ },
+
+ getRelatedTarget: function(ev) { // missing from prototype?
+ ev = ev.browserEvent || ev;
+ var t = ev.relatedTarget;
+ if (!t) {
+ if (ev.type == "mouseout") {
+ t = ev.toElement;
+ } else if (ev.type == "mouseover") {
+ t = ev.fromElement;
+ }
+ }
+
+ return this.resolveTextNode(t);
+ },
+
+ on : function(el, eventName, fn){
+ Event.observe(el, eventName, fn, false);
+ },
+
+ un : function(el, eventName, fn){
+ Event.stopObserving(el, eventName, fn, false);
+ },
+
+ purgeElement : function(el){
+ // no equiv?
+ },
+
+ preventDefault : function(e){ // missing from prototype?
+ e = e.browserEvent || e;
+ if(e.preventDefault) {
+ e.preventDefault();
+ } else {
+ e.returnValue = false;
+ }
+ },
+
+ stopPropagation : function(e){ // missing from prototype?
+ e = e.browserEvent || e;
+ if(e.stopPropagation) {
+ e.stopPropagation();
+ } else {
+ e.cancelBubble = true;
+ }
+ },
+
+ stopEvent : function(e){
+ Event.stop(e.browserEvent || e);
+ },
+
+ onAvailable : function(id, fn, scope){ // no equiv
+ var start = new Date(), iid;
+ var f = function(){
+ if(start.getElapsed() > 10000){
+ clearInterval(iid);
+ }
+ var el = document.getElementById(id);
+ if(el){
+ clearInterval(iid);
+ fn.call(scope||window, el);
+ }
+ };
+ iid = setInterval(f, 50);
+ }
+};
+
+Ext.lib.Ajax = function(){
+ var createSuccess = function(cb){
+ return cb.success ? function(xhr){
+ cb.success.call(cb.scope||window, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ } : Ext.emptyFn;
+ };
+ var createFailure = function(cb){
+ return cb.failure ? function(xhr){
+ cb.failure.call(cb.scope||window, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ } : Ext.emptyFn;
+ };
+ return {
+ request : function(method, uri, cb, data, options){
+ var o = {
+ method: method,
+ parameters: data || '',
+ timeout: cb.timeout,
+ onSuccess: createSuccess(cb),
+ onFailure: createFailure(cb)
+ };
+ if(options){
+ var hs = options.headers;
+ if(hs){
+ o.requestHeaders = hs;
+ }
+ if(options.xmlData){
+ method = (method ? method : (options.method ? options.method : 'POST'));
+ if (!hs || !hs['Content-Type']){
+ o.contentType = 'text/xml';
+ }
+ o.postBody = options.xmlData;
+ delete o.parameters;
+ }
+ if(options.jsonData){
+ method = (method ? method : (options.method ? options.method : 'POST'));
+ if (!hs || !hs['Content-Type']){
+ o.contentType = 'application/json';
+ }
+ o.postBody = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
+ delete o.parameters;
+ }
+ }
+ new Ajax.Request(uri, o);
+ },
+
+ formRequest : function(form, uri, cb, data, isUpload, sslUri){
+ new Ajax.Request(uri, {
+ method: Ext.getDom(form).method ||'POST',
+ parameters: Form.serialize(form)+(data?'&'+data:''),
+ timeout: cb.timeout,
+ onSuccess: createSuccess(cb),
+ onFailure: createFailure(cb)
+ });
+ },
+
+ isCallInProgress : function(trans){
+ return false;
+ },
+
+ abort : function(trans){
+ return false;
+ },
+
+ serializeForm : function(form){
+ return Form.serialize(form.dom||form);
+ }
+ };
+}();
+
+
+Ext.lib.Anim = function(){
+
+ var easings = {
+ easeOut: function(pos) {
+ return 1-Math.pow(1-pos,2);
+ },
+ easeIn: function(pos) {
+ return 1-Math.pow(1-pos,2);
+ }
+ };
+ var createAnim = function(cb, scope){
+ return {
+ stop : function(skipToLast){
+ this.effect.cancel();
+ },
+
+ isAnimated : function(){
+ return this.effect.state == 'running';
+ },
+
+ proxyCallback : function(){
+ Ext.callback(cb, scope);
+ }
+ };
+ };
+ return {
+ scroll : function(el, args, duration, easing, cb, scope){
+ // not supported so scroll immediately?
+ var anim = createAnim(cb, scope);
+ el = Ext.getDom(el);
+ if(typeof args.scroll.to[0] == 'number'){
+ el.scrollLeft = args.scroll.to[0];
+ }
+ if(typeof args.scroll.to[1] == 'number'){
+ el.scrollTop = args.scroll.to[1];
+ }
+ anim.proxyCallback();
+ return anim;
+ },
+
+ motion : function(el, args, duration, easing, cb, scope){
+ return this.run(el, args, duration, easing, cb, scope);
+ },
+
+ color : function(el, args, duration, easing, cb, scope){
+ return this.run(el, args, duration, easing, cb, scope);
+ },
+
+ run : function(el, args, duration, easing, cb, scope, type){
+ var o = {};
+ for(var k in args){
+ switch(k){ // scriptaculous doesn't support, so convert these
+ case 'points':
+ var by, pts, e = Ext.fly(el, '_animrun');
+ e.position();
+ if(by = args.points.by){
+ var xy = e.getXY();
+ pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]);
+ }else{
+ pts = e.translatePoints(args.points.to);
+ }
+ o.left = pts.left+'px';
+ o.top = pts.top+'px';
+ break;
+ case 'width':
+ o.width = args.width.to+'px';
+ break;
+ case 'height':
+ o.height = args.height.to+'px';
+ break;
+ case 'opacity':
+ o.opacity = String(args.opacity.to);
+ break;
+ default:
+ o[k] = String(args[k].to);
+ break;
+ }
+ }
+ var anim = createAnim(cb, scope);
+ anim.effect = new Effect.Morph(Ext.id(el), {
+ duration: duration,
+ afterFinish: anim.proxyCallback,
+ transition: easings[easing] || Effect.Transitions.linear,
+ style: o
+ });
+ return anim;
+ }
+ };
+}();
+
+
+// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights
+function fly(el){
+ if(!libFlyweight){
+ libFlyweight = new Ext.Element.Flyweight();
+ }
+ libFlyweight.dom = el;
+ return libFlyweight;
+}
+
+Ext.lib.Region = function(t, r, b, l) {
+ this.top = t;
+ this[1] = t;
+ this.right = r;
+ this.bottom = b;
+ this.left = l;
+ this[0] = l;
+};
+
+Ext.lib.Region.prototype = {
+ contains : function(region) {
+ return ( region.left >= this.left &&
+ region.right <= this.right &&
+ region.top >= this.top &&
+ region.bottom <= this.bottom );
+
+ },
+
+ getArea : function() {
+ return ( (this.bottom - this.top) * (this.right - this.left) );
+ },
+
+ intersect : function(region) {
+ var t = Math.max( this.top, region.top );
+ var r = Math.min( this.right, region.right );
+ var b = Math.min( this.bottom, region.bottom );
+ var l = Math.max( this.left, region.left );
+
+ if (b >= t && r >= l) {
+ return new Ext.lib.Region(t, r, b, l);
+ } else {
+ return null;
+ }
+ },
+ union : function(region) {
+ var t = Math.min( this.top, region.top );
+ var r = Math.max( this.right, region.right );
+ var b = Math.max( this.bottom, region.bottom );
+ var l = Math.min( this.left, region.left );
+
+ return new Ext.lib.Region(t, r, b, l);
+ },
+
+ constrainTo : function(r) {
+ this.top = this.top.constrain(r.top, r.bottom);
+ this.bottom = this.bottom.constrain(r.top, r.bottom);
+ this.left = this.left.constrain(r.left, r.right);
+ this.right = this.right.constrain(r.left, r.right);
+ return this;
+ },
+
+ adjust : function(t, l, b, r){
+ this.top += t;
+ this.left += l;
+ this.right += r;
+ this.bottom += b;
+ return this;
+ }
+};
+
+Ext.lib.Region.getRegion = function(el) {
+ var p = Ext.lib.Dom.getXY(el);
+
+ var t = p[1];
+ var r = p[0] + el.offsetWidth;
+ var b = p[1] + el.offsetHeight;
+ var l = p[0];
+
+ return new Ext.lib.Region(t, r, b, l);
+};
+
+Ext.lib.Point = function(x, y) {
+ if (Ext.isArray(x)) {
+ y = x[1];
+ x = x[0];
+ }
+ this.x = this.right = this.left = this[0] = x;
+ this.y = this.top = this.bottom = this[1] = y;
+};
+
+Ext.lib.Point.prototype = new Ext.lib.Region();
+
+
+// prevent IE leaks
+if(Ext.isIE) {
+ function fnCleanUp() {
+ var p = Function.prototype;
+ delete p.createSequence;
+ delete p.defer;
+ delete p.createDelegate;
+ delete p.createCallback;
+ delete p.createInterceptor;
+
+ window.detachEvent("onunload", fnCleanUp);
+ }
+ window.attachEvent("onunload", fnCleanUp);
+}
+})();
\ No newline at end of file
diff --git a/thirdpartyjs/extjs/source/adapter/yui-bridge.js b/thirdpartyjs/extjs/source/adapter/yui-bridge.js
new file mode 100644
index 0000000..af2f91e
--- /dev/null
+++ b/thirdpartyjs/extjs/source/adapter/yui-bridge.js
@@ -0,0 +1,342 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+if(typeof YAHOO == "undefined"){
+ throw "Unable to load Ext, core YUI utilities (yahoo, dom, event) not found.";
+}
+
+(function(){
+var E = YAHOO.util.Event;
+var D = YAHOO.util.Dom;
+var CN = YAHOO.util.Connect;
+
+var ES = YAHOO.util.Easing;
+var A = YAHOO.util.Anim;
+var libFlyweight;
+
+Ext.lib.Dom = {
+ getViewWidth : function(full){
+ return full ? D.getDocumentWidth() : D.getViewportWidth();
+ },
+
+ getViewHeight : function(full){
+ return full ? D.getDocumentHeight() : D.getViewportHeight();
+ },
+
+ isAncestor : function(haystack, needle){
+ return D.isAncestor(haystack, needle);
+ },
+
+ getRegion : function(el){
+ return D.getRegion(el);
+ },
+
+ getY : function(el){
+ return this.getXY(el)[1];
+ },
+
+ getX : function(el){
+ return this.getXY(el)[0];
+ },
+
+ // original version based on YahooUI getXY
+ // this version fixes several issues in Safari and FF
+ // and boosts performance by removing the batch overhead, repetitive dom lookups and array index calls
+ getXY : function(el){
+ var p, pe, b, scroll, bd = (document.body || document.documentElement);
+ el = Ext.getDom(el);
+
+ if(el == bd){
+ return [0, 0];
+ }
+
+ if (el.getBoundingClientRect) {
+ b = el.getBoundingClientRect();
+ scroll = fly(document).getScroll();
+ return [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
+ hasAbsolute = true;
+ }
+
+ if (Ext.isGecko) {
+ pe = fly(p);
+
+ var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
+ var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
+
+
+ x += bl;
+ y += bt;
+
+
+ if (p != el && pe.getStyle('overflow') != 'visible') {
+ x += bl;
+ y += bt;
+ }
+ }
+ p = p.offsetParent;
+ }
+
+ if (Ext.isSafari && hasAbsolute) {
+ x -= bd.offsetLeft;
+ y -= bd.offsetTop;
+ }
+
+ if (Ext.isGecko && !hasAbsolute) {
+ var dbd = fly(bd);
+ x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
+ y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
+ }
+
+ p = el.parentNode;
+ while (p && p != bd) {
+ if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
+ x -= p.scrollLeft;
+ y -= p.scrollTop;
+ }
+ p = p.parentNode;
+ }
+ return [x, y];
+ },
+
+ setXY : function(el, xy){
+ el = Ext.fly(el, '_setXY');
+ el.position();
+ var pts = el.translatePoints(xy);
+ if(xy[0] !== false){
+ el.dom.style.left = pts.left + "px";
+ }
+ if(xy[1] !== false){
+ el.dom.style.top = pts.top + "px";
+ }
+ },
+
+ setX : function(el, x){
+ this.setXY(el, [x, false]);
+ },
+
+ setY : function(el, y){
+ this.setXY(el, [false, y]);
+ }
+};
+
+Ext.lib.Event = {
+ getPageX : function(e){
+ return E.getPageX(e.browserEvent || e);
+ },
+
+ getPageY : function(e){
+ return E.getPageY(e.browserEvent || e);
+ },
+
+ getXY : function(e){
+ return E.getXY(e.browserEvent || e);
+ },
+
+ getTarget : function(e){
+ return E.getTarget(e.browserEvent || e);
+ },
+
+ getRelatedTarget : function(e){
+ return E.getRelatedTarget(e.browserEvent || e);
+ },
+
+ on : function(el, eventName, fn, scope, override){
+ E.on(el, eventName, fn, scope, override);
+ },
+
+ un : function(el, eventName, fn){
+ E.removeListener(el, eventName, fn);
+ },
+
+ purgeElement : function(el){
+ E.purgeElement(el);
+ },
+
+ preventDefault : function(e){
+ E.preventDefault(e.browserEvent || e);
+ },
+
+ stopPropagation : function(e){
+ E.stopPropagation(e.browserEvent || e);
+ },
+
+ stopEvent : function(e){
+ E.stopEvent(e.browserEvent || e);
+ },
+
+ onAvailable : function(el, fn, scope, override){
+ return E.onAvailable(el, fn, scope, override);
+ }
+};
+
+Ext.lib.Ajax = {
+ request : function(method, uri, cb, data, options){
+ if(options){
+ var hs = options.headers;
+ if(hs){
+ for(var h in hs){
+ if(hs.hasOwnProperty(h)){
+ CN.initHeader(h, hs[h], false);
+ }
+ }
+ }
+ if(options.xmlData){
+ if (!hs || !hs['Content-Type']){
+ CN.initHeader('Content-Type', 'text/xml', false);
+ }
+ method = (method ? method : (options.method ? options.method : 'POST'));
+ data = options.xmlData;
+ }else if(options.jsonData){
+ if (!hs || !hs['Content-Type']){
+ CN.initHeader('Content-Type', 'application/json', false);
+ }
+ method = (method ? method : (options.method ? options.method : 'POST'));
+ data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
+ }
+ }
+ return CN.asyncRequest(method, uri, cb, data);
+ },
+
+ formRequest : function(form, uri, cb, data, isUpload, sslUri){
+ CN.setForm(form, isUpload, sslUri);
+ return CN.asyncRequest(Ext.getDom(form).method ||'POST', uri, cb, data);
+ },
+
+ isCallInProgress : function(trans){
+ return CN.isCallInProgress(trans);
+ },
+
+ abort : function(trans){
+ return CN.abort(trans);
+ },
+
+ serializeForm : function(form){
+ var d = CN.setForm(form.dom || form);
+ CN.resetFormState();
+ return d;
+ }
+};
+
+Ext.lib.Region = YAHOO.util.Region;
+Ext.lib.Point = YAHOO.util.Point;
+
+
+Ext.lib.Anim = {
+ scroll : function(el, args, duration, easing, cb, scope){
+ this.run(el, args, duration, easing, cb, scope, YAHOO.util.Scroll);
+ },
+
+ motion : function(el, args, duration, easing, cb, scope){
+ this.run(el, args, duration, easing, cb, scope, YAHOO.util.Motion);
+ },
+
+ color : function(el, args, duration, easing, cb, scope){
+ this.run(el, args, duration, easing, cb, scope, YAHOO.util.ColorAnim);
+ },
+
+ run : function(el, args, duration, easing, cb, scope, type){
+ type = type || YAHOO.util.Anim;
+ if(typeof easing == "string"){
+ easing = YAHOO.util.Easing[easing];
+ }
+ var anim = new type(el, args, duration, easing);
+ anim.animateX(function(){
+ Ext.callback(cb, scope);
+ });
+ return anim;
+ }
+};
+
+// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights
+function fly(el){
+ if(!libFlyweight){
+ libFlyweight = new Ext.Element.Flyweight();
+ }
+ libFlyweight.dom = el;
+ return libFlyweight;
+}
+
+// prevent IE leaks
+if(Ext.isIE) {
+ function fnCleanUp() {
+ var p = Function.prototype;
+ delete p.createSequence;
+ delete p.defer;
+ delete p.createDelegate;
+ delete p.createCallback;
+ delete p.createInterceptor;
+
+ window.detachEvent("onunload", fnCleanUp);
+ }
+ window.attachEvent("onunload", fnCleanUp);
+}
+// various overrides
+
+// add ability for callbacks with animations
+if(YAHOO.util.Anim){
+ YAHOO.util.Anim.prototype.animateX = function(callback, scope){
+ var f = function(){
+ this.onComplete.unsubscribe(f);
+ if(typeof callback == "function"){
+ callback.call(scope || this, this);
+ }
+ };
+ this.onComplete.subscribe(f, this, true);
+ this.animate();
+ };
+}
+
+if(YAHOO.util.DragDrop && Ext.dd.DragDrop){
+ YAHOO.util.DragDrop.defaultPadding = Ext.dd.DragDrop.defaultPadding;
+ YAHOO.util.DragDrop.constrainTo = Ext.dd.DragDrop.constrainTo;
+}
+
+YAHOO.util.Dom.getXY = function(el) {
+ var f = function(el) {
+ return Ext.lib.Dom.getXY(el);
+ };
+ return YAHOO.util.Dom.batch(el, f, YAHOO.util.Dom, true);
+};
+
+
+// workaround for Safari anim duration speed problems
+if(YAHOO.util.AnimMgr){
+ YAHOO.util.AnimMgr.fps = 1000;
+}
+
+YAHOO.util.Region.prototype.adjust = function(t, l, b, r){
+ this.top += t;
+ this.left += l;
+ this.right += r;
+ this.bottom += b;
+ return this;
+};
+
+YAHOO.util.Region.prototype.constrainTo = function(r) {
+ this.top = this.top.constrain(r.top, r.bottom);
+ this.bottom = this.bottom.constrain(r.top, r.bottom);
+ this.left = this.left.constrain(r.left, r.right);
+ this.right = this.right.constrain(r.left, r.right);
+ return this;
+};
+
+
+})();
\ No newline at end of file
diff --git a/thirdpartyjs/extjs/source/core/CompositeElement.js b/thirdpartyjs/extjs/source/core/CompositeElement.js
new file mode 100644
index 0000000..71bd420
--- /dev/null
+++ b/thirdpartyjs/extjs/source/core/CompositeElement.js
@@ -0,0 +1,371 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ * licensing@extjs.com
+ *
+ * http://extjs.com/license
+ */
+
+/**
+ * @class Ext.CompositeElement
+ * Standard composite class. Creates a Ext.Element for every element in the collection.
+ *
+ * NOTE: Although they are not listed, this class supports all of the set/update methods of Ext.Element. All Ext.Element
+ * actions will be performed on all the elements in this collection.
+ *
+ * All methods return this and can be chained.
+
+ var els = Ext.select("#some-el div.some-class", true);
+ // or select directly from an existing element
+ var el = Ext.get('some-el');
+ el.select('div.some-class', true);
+
+ els.setWidth(100); // all elements become 100 width
+ els.hide(true); // all elements fade out and hide
+ // or
+ els.setWidth(100).hide(true);
+
+ */
+Ext.CompositeElement = function(els){
+ this.elements = [];
+ this.addElements(els);
+};
+Ext.CompositeElement.prototype = {
+ isComposite: true,
+ addElements : function(els){
+ if(!els) return this;
+ if(typeof els == "string"){
+ els = Ext.Element.selectorFunction(els);
+ }
+ var yels = this.elements;
+ var index = yels.length-1;
+ for(var i = 0, len = els.length; i < len; i++) {
+ yels[++index] = Ext.get(els[i]);
+ }
+ return this;
+ },
+
+ /**
+ * Clears this composite and adds the elements returned by the passed selector.
+ * @param {String/Array} els A string CSS selector, an array of elements or an element
+ * @return {CompositeElement} this
+ */
+ fill : function(els){
+ this.elements = [];
+ this.add(els);
+ return this;
+ },
+
+ /**
+ * Filters this composite to only elements that match the passed selector.
+ * @param {String} selector A string CSS selector
+ * @return {CompositeElement} this
+ */
+ filter : function(selector){
+ var els = [];
+ this.each(function(el){
+ if(el.is(selector)){
+ els[els.length] = el.dom;
+ }
+ });
+ this.fill(els);
+ return this;
+ },
+
+ invoke : function(fn, args){
+ var els = this.elements;
+ for(var i = 0, len = els.length; i < len; i++) {
+ Ext.Element.prototype[fn].apply(els[i], args);
+ }
+ return this;
+ },
+ /**
+ * Adds elements to this composite.
+ * @param {String/Array} els A string CSS selector, an array of elements or an element
+ * @return {CompositeElement} this
+ */
+ add : function(els){
+ if(typeof els == "string"){
+ this.addElements(Ext.Element.selectorFunction(els));
+ }else if(els.length !== undefined){
+ this.addElements(els);
+ }else{
+ this.addElements([els]);
+ }
+ return this;
+ },
+ /**
+ * Calls the passed function passing (el, this, index) for each element in this composite.
+ * @param {Function} fn The function to call
+ * @param {Object} scope (optional) The this object (defaults to the element)
+ * @return {CompositeElement} this
+ */
+ each : function(fn, scope){
+ var els = this.elements;
+ for(var i = 0, len = els.length; i < len; i++){
+ if(fn.call(scope || els[i], els[i], this, i) === false) {
+ break;
+ }
+ }
+ return this;
+ },
+
+ /**
+ * Returns the Element object at the specified index
+ * @param {Number} index
+ * @return {Ext.Element}
+ */
+ item : function(index){
+ return this.elements[index] || null;
+ },
+
+ /**
+ * Returns the first Element
+ * @return {Ext.Element}
+ */
+ first : function(){
+ return this.item(0);
+ },
+
+ /**
+ * Returns the last Element
+ * @return {Ext.Element}
+ */
+ last : function(){
+ return this.item(this.elements.length-1);
+ },
+
+ /**
+ * Returns the number of elements in this composite
+ * @return Number
+ */
+ getCount : function(){
+ return this.elements.length;
+ },
+
+ /**
+ * Returns true if this composite contains the passed element
+ * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
+ * @return Boolean
+ */
+ contains : function(el){
+ return this.indexOf(el) !== -1;
+ },
+
+ /**
+ * Find the index of the passed element within the composite collection.
+ * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection.
+ * @return Number The index of the passed Ext.Element in the composite collection, or -1 if not found.
+ */
+ indexOf : function(el){
+ return this.elements.indexOf(Ext.get(el));
+ },
+
+
+ /**
+ * Removes the specified element(s).
+ * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
+ * or an array of any of those.
+ * @param {Boolean} removeDom (optional) True to also remove the element from the document
+ * @return {CompositeElement} this
+ */
+ removeElement : function(el, removeDom){
+ if(Ext.isArray(el)){
+ for(var i = 0, len = el.length; i < len; i++){
+ this.removeElement(el[i]);
+ }
+ return this;
+ }
+ var index = typeof el == 'number' ? el : this.indexOf(el);
+ if(index !== -1 && this.elements[index]){
+ if(removeDom){
+ var d = this.elements[index];
+ if(d.dom){
+ d.remove();
+ }else{
+ Ext.removeNode(d);
+ }
+ }
+ this.elements.splice(index, 1);
+ }
+ return this;
+ },
+
+ /**
+ * Replaces the specified element with the passed element.
+ * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
+ * to replace.
+ * @param {Mixed} replacement The id of an element or the Element itself.
+ * @param {Boolean} domReplace (Optional) True to remove and replace the element in the document too.
+ * @return {CompositeElement} this
+ */
+ replaceElement : function(el, replacement, domReplace){
+ var index = typeof el == 'number' ? el : this.indexOf(el);
+ if(index !== -1){
+ if(domReplace){
+ this.elements[index].replaceWith(replacement);
+ }else{
+ this.elements.splice(index, 1, Ext.get(replacement))
+ }
+ }
+ return this;
+ },
+
+ /**
+ * Removes all elements.
+ */
+ clear : function(){
+ this.elements = [];
+ }
+};
+(function(){
+Ext.CompositeElement.createCall = function(proto, fnName){
+ if(!proto[fnName]){
+ proto[fnName] = function(){
+ return this.invoke(fnName, arguments);
+ };
+ }
+};
+for(var fnName in Ext.Element.prototype){
+ if(typeof Ext.Element.prototype[fnName] == "function"){
+ Ext.CompositeElement.createCall(Ext.CompositeElement.prototype, fnName);
+ }
+};
+})();
+
+/**
+ * @class Ext.CompositeElementLite
+ * @extends Ext.CompositeElement
+ * Flyweight composite class. Reuses the same Ext.Element for element operations.
+
+ var els = Ext.select("#some-el div.some-class");
+ // or select directly from an existing element
+ var el = Ext.get('some-el');
+ el.select('div.some-class');
+
+ els.setWidth(100); // all elements become 100 width
+ els.hide(true); // all elements fade out and hide
+ // or
+ els.setWidth(100).hide(true);
+
+var dh = Ext.DomHelper;
+var list = dh.append('my-div', {
+ id: 'my-ul', tag: 'ul', cls: 'my-list', children: [
+ {tag: 'li', id: 'item0', html: 'List Item 0'},
+ {tag: 'li', id: 'item1', html: 'List Item 1'},
+ {tag: 'li', id: 'item2', html: 'List Item 2'},
+ {tag: 'li', id: 'item3', html: 'List Item 3'},
+ {tag: 'li', id: 'item4', html: 'List Item 4'}
+ ]
+});
+
+ * Element creation specification parameters in this class may also be passed as an Array of + * specification objects. This can be used to insert multiple sibling nodes into an existing + * container very efficiently. For example, to add more list items to the example above:
+dh.append('my-ul', [
+ {tag: 'li', id: 'item5', html: 'List Item 5'},
+ {tag: 'li', id: 'item6', html: 'List Item 6'} ]);
+
+ * Element creation specification parameters may also be strings. If {@link useDom} is false, then the string is used + * as innerHTML. If {@link useDom} is true, a string specification results in the creation of a text node.
+ * For more information and examples, see the original blog post. + * @singleton + */ +Ext.DomHelper = function(){ + var tempTableEl = null; + var emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i; + var tableRe = /^table|tbody|tr|td$/i; + + // build as innerHTML where available + var createHtml = function(o){ + if(typeof o == 'string'){ + return o; + } + var b = ""; + if (Ext.isArray(o)) { + for (var i = 0, l = o.length; i < l; i++) { + b += createHtml(o[i]); + } + return b; + } + if(!o.tag){ + o.tag = "div"; + } + b += "<" + o.tag; + for(var attr in o){ + if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || typeof o[attr] == "function") continue; + if(attr == "style"){ + var s = o["style"]; + if(typeof s == "function"){ + s = s.call(); + } + if(typeof s == "string"){ + b += ' style="' + s + '"'; + }else if(typeof s == "object"){ + b += ' style="'; + for(var key in s){ + if(typeof s[key] != "function"){ + b += key + ":" + s[key] + ";"; + } + } + b += '"'; + } + }else{ + if(attr == "cls"){ + b += ' class="' + o["cls"] + '"'; + }else if(attr == "htmlFor"){ + b += ' for="' + o["htmlFor"] + '"'; + }else{ + b += " " + attr + '="' + o[attr] + '"'; + } + } + } + if(emptyTags.test(o.tag)){ + b += "/>"; + }else{ + b += ">"; + var cn = o.children || o.cn; + if(cn){ + b += createHtml(cn); + } else if(o.html){ + b += o.html; + } + b += "" + o.tag + ">"; + } + return b; + }; + + // build as dom + /** @ignore */ + var createDom = function(o, parentNode){ + var el; + if (Ext.isArray(o)) { // Allow Arrays of siblings to be inserted + el = document.createDocumentFragment(); // in one shot using a DocumentFragment + for(var i = 0, l = o.length; i < l; i++) { + createDom(o[i], el); + } + } else if (typeof o == "string") { // Allow a string as a child spec. + el = document.createTextNode(o); + } else { + el = document.createElement(o.tag||'div'); + var useSet = !!el.setAttribute; // In IE some elements don't have setAttribute + for(var attr in o){ + if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || attr == "style" || typeof o[attr] == "function") continue; + if(attr=="cls"){ + el.className = o["cls"]; + }else{ + if(useSet) el.setAttribute(attr, o[attr]); + else el[attr] = o[attr]; + } + } + Ext.DomHelper.applyStyles(el, o.style); + var cn = o.children || o.cn; + if(cn){ + createDom(cn, el); + } else if(o.html){ + el.innerHTML = o.html; + } + } + if(parentNode){ + parentNode.appendChild(el); + } + return el; + }; + + var ieTable = function(depth, s, h, e){ + tempTableEl.innerHTML = [s, h, e].join(''); + var i = -1, el = tempTableEl; + while(++i < depth){ + el = el.firstChild; + } + return el; + }; + + // kill repeat to save bytes + var ts = '+DomQuery supports most of the CSS3 selectors spec, along with some custom selectors and basic XPath.
+ ++All selectors, attribute filters and pseudos below can be combined infinitely in any order. For example "div.foo:nth-child(odd)[@foo=bar].bar:first" would be a perfectly valid selector. Node filters are processed in the order in which they appear, which allows you to optimize your queries for your document structure. +
+The use of @ and quotes are optional. For example, div[@foo='bar'] is also a valid attribute selector.
+
+// by id
+var el = Ext.get("my-div");
+
+// by DOM element reference
+var el = Ext.get(myDivElement);
+
+ * Animations+Option Default Description +--------- -------- --------------------------------------------- +duration .35 The duration of the animation in seconds +easing easeOut The easing method +callback none A function to execute when the anim completes +scope this The scope (this) of the callback function ++* Also, the Anim object being used for the animation will be set on your options object as "anim", which allows you to stop or +* manipulate the animation. Here's an example: +
+var el = Ext.get("my-div");
+
+// no animation
+el.setWidth(100);
+
+// default animation
+el.setWidth(100, true);
+
+// animation with some options set
+el.setWidth(100, {
+ duration: 1,
+ callback: this.foo,
+ scope: this
+});
+
+// using the "anim" property to get the Anim object
+var opt = {
+ duration: 1,
+ callback: this.foo,
+ scope: this
+};
+el.setWidth(100, opt);
+...
+if(opt.anim.isAnimated()){
+ opt.anim.stop();
+}
+
+* Composite (Collections of) Elements
+ * Combining Options
+ * In the following examples, the shorthand form {@link #on} is used rather than the more verbose
+ * addListener. The two are equivalent. Using the options argument, it is possible to combine different
+ * types of listeners:
+ *
+ * A normalized, delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the
+ * options object. The options object is available as the third parameter in the handler function.
+el.on('click', this.onClick, this, {
+ single: true,
+ delay: 100,
+ stopEvent : true,
+ forumId: 4
+});
+ *
+ * Attaching multiple handlers in 1 call
+ * The method also allows for a single argument to be passed which is a config object containing properties
+ * which specify multiple handlers.
+ * Code:
+el.on({
+ 'click' : {
+ fn: this.onClick,
+ scope: this,
+ delay: 100
+ },
+ 'mouseover' : {
+ fn: this.onMouseOver,
+ scope: this
+ },
+ 'mouseout' : {
+ fn: this.onMouseOut,
+ scope: this
+ }
+});
+ *
+ * Or a shorthand syntax:
+ * Code:
+el.on({
+ 'click' : this.onClick,
+ 'mouseover' : this.onMouseOver,
+ 'mouseout' : this.onMouseOut,
+ scope: this
+});
+ */
+ addListener : function(eventName, fn, scope, options){
+ Ext.EventManager.on(this.dom, eventName, fn, scope || this, options);
+ },
+
+ /**
+ * Removes an event handler from this element. The shorthand version {@link #un} is equivalent. Example:
+ *
+el.removeListener('click', this.handlerFn);
+// or
+el.un('click', this.handlerFn);
+
+ * @param {String} eventName the type of event to remove
+ * @param {Function} fn the method the event invokes
+ * @param {Object} scope (optional) The scope (The this reference) of the handler function. Defaults
+ * to this Element.
+ * @return {Ext.Element} this
+ */
+ removeListener : function(eventName, fn, scope){
+ Ext.EventManager.removeListener(this.dom, eventName, fn, scope || this);
+ return this;
+ },
+
+ /**
+ * Removes all previous added listeners from this element
+ * @return {Ext.Element} this
+ */
+ removeAllListeners : function(){
+ Ext.EventManager.removeAll(this.dom);
+ return this;
+ },
+
+ /**
+ * Create an event handler on this element such that when the event fires and is handled by this element,
+ * it will be relayed to another object (i.e., fired again as if it originated from that object instead).
+ * @param {String} eventName The type of event to relay
+ * @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context
+ * for firing the relayed event
+ */
+ relayEvent : function(eventName, observable){
+ this.on(eventName, function(e){
+ observable.fireEvent(eventName, e);
+ });
+ },
+
+ /**
+ * Set the opacity of the element
+ * @param {Float} opacity The new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc
+ * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+ * @return {Ext.Element} this
+ */
+ setOpacity : function(opacity, animate){
+ if(!animate || !A){
+ var s = this.dom.style;
+ if(Ext.isIE){
+ s.zoom = 1;
+ s.filter = (s.filter || '').replace(/alpha\([^\)]*\)/gi,"") +
+ (opacity == 1 ? "" : " alpha(opacity=" + opacity * 100 + ")");
+ }else{
+ s.opacity = opacity;
+ }
+ }else{
+ this.anim({opacity: {to: opacity}}, this.preanim(arguments, 1), null, .35, 'easeIn');
+ }
+ return this;
+ },
+
+ /**
+ * Gets the left X coordinate
+ * @param {Boolean} local True to get the local css position instead of page coordinate
+ * @return {Number}
+ */
+ getLeft : function(local){
+ if(!local){
+ return this.getX();
+ }else{
+ return parseInt(this.getStyle("left"), 10) || 0;
+ }
+ },
+
+ /**
+ * Gets the right X coordinate of the element (element X position + element width)
+ * @param {Boolean} local True to get the local css position instead of page coordinate
+ * @return {Number}
+ */
+ getRight : function(local){
+ if(!local){
+ return this.getX() + this.getWidth();
+ }else{
+ return (this.getLeft(true) + this.getWidth()) || 0;
+ }
+ },
+
+ /**
+ * Gets the top Y coordinate
+ * @param {Boolean} local True to get the local css position instead of page coordinate
+ * @return {Number}
+ */
+ getTop : function(local) {
+ if(!local){
+ return this.getY();
+ }else{
+ return parseInt(this.getStyle("top"), 10) || 0;
+ }
+ },
+
+ /**
+ * Gets the bottom Y coordinate of the element (element Y position + element height)
+ * @param {Boolean} local True to get the local css position instead of page coordinate
+ * @return {Number}
+ */
+ getBottom : function(local){
+ if(!local){
+ return this.getY() + this.getHeight();
+ }else{
+ return (this.getTop(true) + this.getHeight()) || 0;
+ }
+ },
+
+ /**
+ * Initializes positioning on this element. If a desired position is not passed, it will make the
+ * the element positioned relative IF it is not already positioned.
+ * @param {String} pos (optional) Positioning to use "relative", "absolute" or "fixed"
+ * @param {Number} zIndex (optional) The zIndex to apply
+ * @param {Number} x (optional) Set the page X position
+ * @param {Number} y (optional) Set the page Y position
+ */
+ position : function(pos, zIndex, x, y){
+ if(!pos){
+ if(this.getStyle('position') == 'static'){
+ this.setStyle('position', 'relative');
+ }
+ }else{
+ this.setStyle("position", pos);
+ }
+ if(zIndex){
+ this.setStyle("z-index", zIndex);
+ }
+ if(x !== undefined && y !== undefined){
+ this.setXY([x, y]);
+ }else if(x !== undefined){
+ this.setX(x);
+ }else if(y !== undefined){
+ this.setY(y);
+ }
+ },
+
+ /**
+ * Clear positioning back to the default when the document was loaded
+ * @param {String} value (optional) The value to use for the left,right,top,bottom, defaults to '' (empty string). You could use 'auto'.
+ * @return {Ext.Element} this
+ */
+ clearPositioning : function(value){
+ value = value ||'';
+ this.setStyle({
+ "left": value,
+ "right": value,
+ "top": value,
+ "bottom": value,
+ "z-index": "",
+ "position" : "static"
+ });
+ return this;
+ },
+
+ /**
+ * Gets an object with all CSS positioning properties. Useful along with setPostioning to get
+ * snapshot before performing an update and then restoring the element.
+ * @return {Object}
+ */
+ getPositioning : function(){
+ var l = this.getStyle("left");
+ var t = this.getStyle("top");
+ return {
+ "position" : this.getStyle("position"),
+ "left" : l,
+ "right" : l ? "" : this.getStyle("right"),
+ "top" : t,
+ "bottom" : t ? "" : this.getStyle("bottom"),
+ "z-index" : this.getStyle("z-index")
+ };
+ },
+
+ /**
+ * Gets the width of the border(s) for the specified side(s)
+ * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,
+ * passing lr would get the border (l)eft width + the border (r)ight width.
+ * @return {Number} The width of the sides passed added together
+ */
+ getBorderWidth : function(side){
+ return this.addStyles(side, El.borders);
+ },
+
+ /**
+ * Gets the width of the padding(s) for the specified side(s)
+ * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,
+ * passing lr would get the padding (l)eft + the padding (r)ight.
+ * @return {Number} The padding of the sides passed added together
+ */
+ getPadding : function(side){
+ return this.addStyles(side, El.paddings);
+ },
+
+ /**
+ * Set positioning with an object returned by getPositioning().
+ * @param {Object} posCfg
+ * @return {Ext.Element} this
+ */
+ setPositioning : function(pc){
+ this.applyStyles(pc);
+ if(pc.right == "auto"){
+ this.dom.style.right = "";
+ }
+ if(pc.bottom == "auto"){
+ this.dom.style.bottom = "";
+ }
+ return this;
+ },
+
+ // private
+ fixDisplay : function(){
+ if(this.getStyle("display") == "none"){
+ this.setStyle("visibility", "hidden");
+ this.setStyle("display", this.originalDisplay); // first try reverting to default
+ if(this.getStyle("display") == "none"){ // if that fails, default to block
+ this.setStyle("display", "block");
+ }
+ }
+ },
+
+ // private
+ setOverflow : function(v){
+ if(v=='auto' && Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug
+ this.dom.style.overflow = 'hidden';
+ (function(){this.dom.style.overflow = 'auto';}).defer(1, this);
+ }else{
+ this.dom.style.overflow = v;
+ }
+ },
+
+ /**
+ * Quick set left and top adding default units
+ * @param {String} left The left CSS property value
+ * @param {String} top The top CSS property value
+ * @return {Ext.Element} this
+ */
+ setLeftTop : function(left, top){
+ this.dom.style.left = this.addUnits(left);
+ this.dom.style.top = this.addUnits(top);
+ return this;
+ },
+
+ /**
+ * Move this element relative to its current position.
+ * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "down").
+ * @param {Number} distance How far to move the element in pixels
+ * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+ * @return {Ext.Element} this
+ */
+ move : function(direction, distance, animate){
+ var xy = this.getXY();
+ direction = direction.toLowerCase();
+ switch(direction){
+ case "l":
+ case "left":
+ this.moveTo(xy[0]-distance, xy[1], this.preanim(arguments, 2));
+ break;
+ case "r":
+ case "right":
+ this.moveTo(xy[0]+distance, xy[1], this.preanim(arguments, 2));
+ break;
+ case "t":
+ case "top":
+ case "up":
+ this.moveTo(xy[0], xy[1]-distance, this.preanim(arguments, 2));
+ break;
+ case "b":
+ case "bottom":
+ case "down":
+ this.moveTo(xy[0], xy[1]+distance, this.preanim(arguments, 2));
+ break;
+ }
+ return this;
+ },
+
+ /**
+ * Store the current overflow setting and clip overflow on the element - use {@link #unclip} to remove
+ * @return {Ext.Element} this
+ */
+ clip : function(){
+ if(!this.isClipped){
+ this.isClipped = true;
+ this.originalClip = {
+ "o": this.getStyle("overflow"),
+ "x": this.getStyle("overflow-x"),
+ "y": this.getStyle("overflow-y")
+ };
+ this.setStyle("overflow", "hidden");
+ this.setStyle("overflow-x", "hidden");
+ this.setStyle("overflow-y", "hidden");
+ }
+ return this;
+ },
+
+ /**
+ * Return clipping (overflow) to original clipping before clip() was called
+ * @return {Ext.Element} this
+ */
+ unclip : function(){
+ if(this.isClipped){
+ this.isClipped = false;
+ var o = this.originalClip;
+ if(o.o){this.setStyle("overflow", o.o);}
+ if(o.x){this.setStyle("overflow-x", o.x);}
+ if(o.y){this.setStyle("overflow-y", o.y);}
+ }
+ return this;
+ },
+
+
+ /**
+ * Gets the x,y coordinates specified by the anchor position on the element.
+ * @param {String} anchor (optional) The specified anchor position (defaults to "c"). See {@link #alignTo}
+ * for details on supported anchor positions.
+ * @param {Boolean} local (optional) True to get the local (element top/left-relative) anchor position instead
+ * of page coordinates
+ * @param {Object} size (optional) An object containing the size to use for calculating anchor position
+ * {width: (target width), height: (target height)} (defaults to the element's current size)
+ * @return {Array} [x, y] An array containing the element's x and y coordinates
+ */
+ getAnchorXY : function(anchor, local, s){
+ //Passing a different size is useful for pre-calculating anchors,
+ //especially for anchored animations that change the el size.
+
+ var w, h, vp = false;
+ if(!s){
+ var d = this.dom;
+ if(d == document.body || d == document){
+ vp = true;
+ w = D.getViewWidth(); h = D.getViewHeight();
+ }else{
+ w = this.getWidth(); h = this.getHeight();
+ }
+ }else{
+ w = s.width; h = s.height;
+ }
+ var x = 0, y = 0, r = Math.round;
+ switch((anchor || "tl").toLowerCase()){
+ case "c":
+ x = r(w*.5);
+ y = r(h*.5);
+ break;
+ case "t":
+ x = r(w*.5);
+ y = 0;
+ break;
+ case "l":
+ x = 0;
+ y = r(h*.5);
+ break;
+ case "r":
+ x = w;
+ y = r(h*.5);
+ break;
+ case "b":
+ x = r(w*.5);
+ y = h;
+ break;
+ case "tl":
+ x = 0;
+ y = 0;
+ break;
+ case "bl":
+ x = 0;
+ y = h;
+ break;
+ case "br":
+ x = w;
+ y = h;
+ break;
+ case "tr":
+ x = w;
+ y = 0;
+ break;
+ }
+ if(local === true){
+ return [x, y];
+ }
+ if(vp){
+ var sc = this.getScroll();
+ return [x + sc.left, y + sc.top];
+ }
+ //Add the element's offset xy
+ var o = this.getXY();
+ return [x+o[0], y+o[1]];
+ },
+
+ /**
+ * Gets the x,y coordinates to align this element with another element. See {@link #alignTo} for more info on the
+ * supported position values.
+ * @param {Mixed} element The element to align to.
+ * @param {String} position The position to align to.
+ * @param {Array} offsets (optional) Offset the positioning by [x, y]
+ * @return {Array} [x, y]
+ */
+ getAlignToXY : function(el, p, o){
+ el = Ext.get(el);
+ if(!el || !el.dom){
+ throw "Element.alignToXY with an element that doesn't exist";
+ }
+ var d = this.dom;
+ var c = false; //constrain to viewport
+ var p1 = "", p2 = "";
+ o = o || [0,0];
+
+ if(!p){
+ p = "tl-bl";
+ }else if(p == "?"){
+ p = "tl-bl?";
+ }else if(p.indexOf("-") == -1){
+ p = "tl-" + p;
+ }
+ p = p.toLowerCase();
+ var m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
+ if(!m){
+ throw "Element.alignTo with an invalid alignment " + p;
+ }
+ p1 = m[1]; p2 = m[2]; c = !!m[3];
+
+ //Subtract the aligned el's internal xy from the target's offset xy
+ //plus custom offset to get the aligned el's new offset xy
+ var a1 = this.getAnchorXY(p1, true);
+ var a2 = el.getAnchorXY(p2, false);
+
+ var x = a2[0] - a1[0] + o[0];
+ var y = a2[1] - a1[1] + o[1];
+
+ if(c){
+ //constrain the aligned el to viewport if necessary
+ var w = this.getWidth(), h = this.getHeight(), r = el.getRegion();
+ // 5px of margin for ie
+ var dw = D.getViewWidth()-5, dh = D.getViewHeight()-5;
+
+ //If we are at a viewport boundary and the aligned el is anchored on a target border that is
+ //perpendicular to the vp border, allow the aligned el to slide on that border,
+ //otherwise swap the aligned el to the opposite border of the target.
+ var p1y = p1.charAt(0), p1x = p1.charAt(p1.length-1);
+ var p2y = p2.charAt(0), p2x = p2.charAt(p2.length-1);
+ var swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t"));
+ var swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r"));
+
+ var doc = document;
+ var scrollX = (doc.documentElement.scrollLeft || doc.body.scrollLeft || 0)+5;
+ var scrollY = (doc.documentElement.scrollTop || doc.body.scrollTop || 0)+5;
+
+ if((x+w) > dw + scrollX){
+ x = swapX ? r.left-w : dw+scrollX-w;
+ }
+ if(x < scrollX){
+ x = swapX ? r.right : scrollX;
+ }
+ if((y+h) > dh + scrollY){
+ y = swapY ? r.top-h : dh+scrollY-h;
+ }
+ if (y < scrollY){
+ y = swapY ? r.bottom : scrollY;
+ }
+ }
+ return [x,y];
+ },
+
+ // private
+ getConstrainToXY : function(){
+ var os = {top:0, left:0, bottom:0, right: 0};
+
+ return function(el, local, offsets, proposedXY){
+ el = Ext.get(el);
+ offsets = offsets ? Ext.applyIf(offsets, os) : os;
+
+ var vw, vh, vx = 0, vy = 0;
+ if(el.dom == document.body || el.dom == document){
+ vw = Ext.lib.Dom.getViewWidth();
+ vh = Ext.lib.Dom.getViewHeight();
+ }else{
+ vw = el.dom.clientWidth;
+ vh = el.dom.clientHeight;
+ if(!local){
+ var vxy = el.getXY();
+ vx = vxy[0];
+ vy = vxy[1];
+ }
+ }
+
+ var s = el.getScroll();
+
+ vx += offsets.left + s.left;
+ vy += offsets.top + s.top;
+
+ vw -= offsets.right;
+ vh -= offsets.bottom;
+
+ var vr = vx+vw;
+ var vb = vy+vh;
+
+ var xy = proposedXY || (!local ? this.getXY() : [this.getLeft(true), this.getTop(true)]);
+ var x = xy[0], y = xy[1];
+ var w = this.dom.offsetWidth, h = this.dom.offsetHeight;
+
+ // only move it if it needs it
+ var moved = false;
+
+ // first validate right/bottom
+ if((x + w) > vr){
+ x = vr - w;
+ moved = true;
+ }
+ if((y + h) > vb){
+ y = vb - h;
+ moved = true;
+ }
+ // then make sure top/left isn't negative
+ if(x < vx){
+ x = vx;
+ moved = true;
+ }
+ if(y < vy){
+ y = vy;
+ moved = true;
+ }
+ return moved ? [x, y] : false;
+ };
+ }(),
+
+ // private
+ adjustForConstraints : function(xy, parent, offsets){
+ return this.getConstrainToXY(parent || document, false, offsets, xy) || xy;
+ },
+
+ /**
+ * Aligns this element with another element relative to the specified anchor points. If the other element is the
+ * document it aligns it to the viewport.
+ * The position parameter is optional, and can be specified in any one of the following formats:
+ * +Value Description +----- ----------------------------- +tl The top left corner (default) +t The center of the top edge +tr The top right corner +l The center of the left edge +c In the center of the element +r The center of the right edge +bl The bottom left corner +b The center of the bottom edge +br The bottom right corner ++Example Usage: +
+// align el to other-el using the default positioning ("tl-bl", non-constrained)
+el.alignTo("other-el");
+
+// align the top left corner of el with the top right corner of other-el (constrained to viewport)
+el.alignTo("other-el", "tr?");
+
+// align the bottom right corner of el with the center left edge of other-el
+el.alignTo("other-el", "br-l?");
+
+// align the center of el with the bottom left corner of other-el and
+// adjust the x position by -6 pixels (and the y position by 0)
+el.alignTo("other-el", "c-bl", [-6, 0]);
+
+ * @param {Mixed} element The element to align to.
+ * @param {String} position The position to align to.
+ * @param {Array} offsets (optional) Offset the positioning by [x, y]
+ * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+ * @return {Ext.Element} this
+ */
+ alignTo : function(element, position, offsets, animate){
+ var xy = this.getAlignToXY(element, position, offsets);
+ this.setXY(xy, this.preanim(arguments, 3));
+ return this;
+ },
+
+ /**
+ * Anchors an element to another element and realigns it when the window is resized.
+ * @param {Mixed} element The element to align to.
+ * @param {String} position The position to align to.
+ * @param {Array} offsets (optional) Offset the positioning by [x, y]
+ * @param {Boolean/Object} animate (optional) True for the default animation or a standard Element animation config object
+ * @param {Boolean/Number} monitorScroll (optional) True to monitor body scroll and reposition. If this parameter
+ * is a number, it is used as the buffer delay (defaults to 50ms).
+ * @param {Function} callback The function to call after the animation finishes
+ * @return {Ext.Element} this
+ */
+ anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){
+ var action = function(){
+ this.alignTo(el, alignment, offsets, animate);
+ Ext.callback(callback, this);
+ };
+ Ext.EventManager.onWindowResize(action, this);
+ var tm = typeof monitorScroll;
+ if(tm != 'undefined'){
+ Ext.EventManager.on(window, 'scroll', action, this,
+ {buffer: tm == 'number' ? monitorScroll : 50});
+ }
+ action.call(this); // align immediately
+ return this;
+ },
+ /**
+ * Clears any opacity settings from this element. Required in some cases for IE.
+ * @return {Ext.Element} this
+ */
+ clearOpacity : function(){
+ if (window.ActiveXObject) {
+ if(typeof this.dom.style.filter == 'string' && (/alpha/i).test(this.dom.style.filter)){
+ this.dom.style.filter = "";
+ }
+ } else {
+ this.dom.style.opacity = "";
+ this.dom.style["-moz-opacity"] = "";
+ this.dom.style["-khtml-opacity"] = "";
+ }
+ return this;
+ },
+
+ /**
+ * Hide this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.
+ * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+ * @return {Ext.Element} this
+ */
+ hide : function(animate){
+ this.setVisible(false, this.preanim(arguments, 0));
+ return this;
+ },
+
+ /**
+ * Show this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.
+ * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+ * @return {Ext.Element} this
+ */
+ show : function(animate){
+ this.setVisible(true, this.preanim(arguments, 0));
+ return this;
+ },
+
+ /**
+ * @private Test if size has a unit, otherwise appends the default
+ */
+ addUnits : function(size){
+ return Ext.Element.addUnits(size, this.defaultUnit);
+ },
+
+ /**
+ * Update the innerHTML of this element, optionally searching for and processing scripts
+ * @param {String} html The new HTML
+ * @param {Boolean} loadScripts (optional) True to look for and process scripts (defaults to false)
+ * @param {Function} callback (optional) For async script loading you can be notified when the update completes
+ * @return {Ext.Element} this
+ */
+ update : function(html, loadScripts, callback){
+ if(typeof html == "undefined"){
+ html = "";
+ }
+ if(loadScripts !== true){
+ this.dom.innerHTML = html;
+ if(typeof callback == "function"){
+ callback();
+ }
+ return this;
+ }
+ var id = Ext.id();
+ var dom = this.dom;
+
+ html += '';
+
+ E.onAvailable(id, function(){
+ var hd = document.getElementsByTagName("head")[0];
+ var re = /(?: