+++ /dev/null
-/*\r
- * Ext JS Library 0.30\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/*\r
- * Ext JS Library 2.0.1\r
- * Copyright(c) 2006-2008, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-\r
-Ext = {version: '2.0.1'};\r
-\r
-
-window["undefined"] = window["undefined"];\r
-\r
-\r
-\r
-\r
-Ext.apply = function(o, c, defaults){\r
- if(defaults){\r
-
- Ext.apply(o, defaults);\r
- }\r
- if(o && c && typeof c == 'object'){\r
- for(var p in c){\r
- o[p] = c[p];\r
- }\r
- }\r
- return o;\r
-};\r
-\r
-(function(){\r
- var idSeed = 0;\r
- var ua = navigator.userAgent.toLowerCase();\r
-\r
- var isStrict = document.compatMode == "CSS1Compat",\r
- isOpera = ua.indexOf("opera") > -1,\r
- isSafari = (/webkit|khtml/).test(ua),\r
- isSafari3 = isSafari && ua.indexOf('webkit/5') != -1,\r
- isIE = !isOpera && ua.indexOf("msie") > -1,\r
- isIE7 = !isOpera && ua.indexOf("msie 7") > -1,\r
- isGecko = !isSafari && ua.indexOf("gecko") > -1,\r
- isBorderBox = isIE && !isStrict,\r
- isWindows = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1),\r
- isMac = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1),\r
- isAir = (ua.indexOf("adobeair") != -1),\r
- isLinux = (ua.indexOf("linux") != -1),\r
- isSecure = window.location.href.toLowerCase().indexOf("https") === 0;\r
-\r
-
- if(isIE && !isIE7){\r
- try{\r
- document.execCommand("BackgroundImageCache", false, true);\r
- }catch(e){}\r
- }\r
-\r
- Ext.apply(Ext, {\r
- \r
- isStrict : isStrict,\r
- \r
- isSecure : isSecure,\r
- \r
- isReady : false,\r
-\r
- \r
- enableGarbageCollector : true,\r
-\r
- \r
- enableListenerCollection:false,\r
-\r
-\r
- \r
- SSL_SECURE_URL : "javascript:false",\r
-\r
- \r
- BLANK_IMAGE_URL : "http:/"+"/extjs.com/s.gif",\r
-\r
- \r
- emptyFn : function(){},\r
-\r
- \r
- applyIf : function(o, c){\r
- if(o && c){\r
- for(var p in c){\r
- if(typeof o[p] == "undefined"){ o[p] = c[p]; }\r
- }\r
- }\r
- return o;\r
- },\r
-\r
- \r
- addBehaviors : function(o){\r
- if(!Ext.isReady){\r
- Ext.onReady(function(){\r
- Ext.addBehaviors(o);\r
- });\r
- return;\r
- }\r
- var cache = {};
- for(var b in o){\r
- var parts = b.split('@');\r
- if(parts[1]){
- var s = parts[0];\r
- if(!cache[s]){\r
- cache[s] = Ext.select(s);\r
- }\r
- cache[s].on(parts[1], o[b]);\r
- }\r
- }\r
- cache = null;\r
- },\r
-\r
- \r
- id : function(el, prefix){\r
- prefix = prefix || "ext-gen";\r
- el = Ext.getDom(el);\r
- var id = prefix + (++idSeed);\r
- return el ? (el.id ? el.id : (el.id = id)) : id;\r
- },\r
-\r
- \r
- extend : function(){\r
-
- var io = function(o){\r
- for(var m in o){\r
- this[m] = o[m];\r
- }\r
- };\r
- var oc = Object.prototype.constructor;\r
- \r
- return function(sb, sp, overrides){\r
- if(typeof sp == 'object'){\r
- overrides = sp;\r
- sp = sb;\r
- sb = overrides.constructor != oc ? overrides.constructor : function(){sp.apply(this, arguments);};\r
- }\r
- var F = function(){}, sbp, spp = sp.prototype;\r
- F.prototype = spp;\r
- sbp = sb.prototype = new F();\r
- sbp.constructor=sb;\r
- sb.superclass=spp;\r
- if(spp.constructor == oc){\r
- spp.constructor=sp;\r
- }\r
- sb.override = function(o){\r
- Ext.override(sb, o);\r
- };\r
- sbp.override = io;\r
- Ext.override(sb, overrides);\r
- return sb;\r
- };\r
- }(),\r
-\r
- \r
- override : function(origclass, overrides){\r
- if(overrides){\r
- var p = origclass.prototype;\r
- for(var method in overrides){\r
- p[method] = overrides[method];\r
- }\r
- }\r
- },\r
-\r
- \r
- namespace : function(){\r
- var a=arguments, o=null, i, j, d, rt;\r
- for (i=0; i<a.length; ++i) {\r
- d=a[i].split(".");\r
- rt = d[0];\r
- eval('if (typeof ' + rt + ' == "undefined"){' + rt + ' = {};} o = ' + rt + ';');\r
- for (j=1; j<d.length; ++j) {\r
- o[d[j]]=o[d[j]] || {};\r
- o=o[d[j]];\r
- }\r
- }\r
- },\r
-\r
- \r
- urlEncode : function(o){\r
- if(!o){\r
- return "";\r
- }\r
- var buf = [];\r
- for(var key in o){\r
- var ov = o[key], k = encodeURIComponent(key);\r
- var type = typeof ov;\r
- if(type == 'undefined'){\r
- buf.push(k, "=&");\r
- }else if(type != "function" && type != "object"){\r
- buf.push(k, "=", encodeURIComponent(ov), "&");\r
- }else if(Ext.isArray(ov)){\r
- if (ov.length) {\r
- for(var i = 0, len = ov.length; i < len; i++) {\r
- buf.push(k, "=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");\r
- }\r
- } else {\r
- buf.push(k, "=&");\r
- }\r
- }\r
- }\r
- buf.pop();\r
- return buf.join("");\r
- },\r
-\r
- \r
- urlDecode : function(string, overwrite){\r
- if(!string || !string.length){\r
- return {};\r
- }\r
- var obj = {};\r
- var pairs = string.split('&');\r
- var pair, name, value;\r
- for(var i = 0, len = pairs.length; i < len; i++){\r
- pair = pairs[i].split('=');\r
- name = decodeURIComponent(pair[0]);\r
- value = decodeURIComponent(pair[1]);\r
- if(overwrite !== true){\r
- if(typeof obj[name] == "undefined"){\r
- obj[name] = value;\r
- }else if(typeof obj[name] == "string"){\r
- obj[name] = [obj[name]];\r
- obj[name].push(value);\r
- }else{\r
- obj[name].push(value);\r
- }\r
- }else{\r
- obj[name] = value;\r
- }\r
- }\r
- return obj;\r
- },\r
-\r
- \r
- each : function(array, fn, scope){\r
- if(typeof array.length == "undefined" || typeof array == "string"){\r
- array = [array];\r
- }\r
- for(var i = 0, len = array.length; i < len; i++){\r
- if(fn.call(scope || array[i], array[i], i, array) === false){ return i; };\r
- }\r
- },\r
-\r
-
- combine : function(){\r
- var as = arguments, l = as.length, r = [];\r
- for(var i = 0; i < l; i++){\r
- var a = as[i];\r
- if(Ext.isArray(a)){\r
- r = r.concat(a);\r
- }else if(a.length !== undefined && !a.substr){\r
- r = r.concat(Array.prototype.slice.call(a, 0));\r
- }else{\r
- r.push(a);\r
- }\r
- }\r
- return r;\r
- },\r
-\r
- \r
- escapeRe : function(s) {\r
- return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");\r
- },\r
-\r
-
- callback : function(cb, scope, args, delay){\r
- if(typeof cb == "function"){\r
- if(delay){\r
- cb.defer(delay, scope, args || []);\r
- }else{\r
- cb.apply(scope, args || []);\r
- }\r
- }\r
- },\r
-\r
- \r
- getDom : function(el){\r
- if(!el || !document){\r
- return null;\r
- }\r
- return el.dom ? el.dom : (typeof el == 'string' ? document.getElementById(el) : el);\r
- },\r
-\r
- \r
- getDoc : function(){\r
- return Ext.get(document);\r
- },\r
-\r
- \r
- getBody : function(){\r
- return Ext.get(document.body || document.documentElement);\r
- },\r
-\r
- \r
- getCmp : function(id){\r
- return Ext.ComponentMgr.get(id);\r
- },\r
-\r
- \r
- num : function(v, defaultValue){\r
- if(typeof v != 'number'){\r
- return defaultValue;\r
- }\r
- return v;\r
- },\r
-\r
- \r
- destroy : function(){\r
- for(var i = 0, a = arguments, len = a.length; i < len; i++) {\r
- var as = a[i];\r
- if(as){\r
- if(as.dom){\r
- as.removeAllListeners();\r
- as.remove();\r
- continue;\r
- }\r
- if(typeof as.destroy == 'function'){\r
- as.destroy();\r
- }\r
- }\r
- }\r
- },\r
-\r
- removeNode : isIE ? function(){\r
- var d;\r
- return function(n){\r
- if(n){\r
- d = d || document.createElement('div');\r
- d.appendChild(n);\r
- d.innerHTML = '';\r
- }\r
- }\r
- }() : function(n){\r
- if(n && n.parentNode){\r
- n.parentNode.removeChild(n);\r
- }\r
- },\r
-\r
-
- \r
- type : function(o){\r
- if(o === undefined || o === null){\r
- return false;\r
- }\r
- if(o.htmlElement){\r
- return 'element';\r
- }\r
- var t = typeof o;\r
- if(t == 'object' && o.nodeName) {\r
- switch(o.nodeType) {\r
- case 1: return 'element';\r
- case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';\r
- }\r
- }\r
- if(t == 'object' || t == 'function') {\r
- switch(o.constructor) {\r
- case Array: return 'array';\r
- case RegExp: return 'regexp';\r
- }\r
- if(typeof o.length == 'number' && typeof o.item == 'function') {\r
- return 'nodelist';\r
- }\r
- }\r
- return t;\r
- },\r
-\r
- \r
- isEmpty : function(v, allowBlank){\r
- return v === null || v === undefined || (!allowBlank ? v === '' : false);\r
- },\r
-\r
- value : function(v, defaultValue, allowBlank){\r
- return Ext.isEmpty(v, allowBlank) ? defaultValue : v;\r
- },\r
-\r
- isArray : function(v){\r
- return v && typeof v.pop == 'function';\r
- },\r
-\r
- isDate : function(v){\r
- return v && typeof v.getFullYear == 'function';\r
- },\r
-\r
- \r
- isOpera : isOpera,\r
- \r
- isSafari : isSafari,\r
- \r
- isSafari3 : isSafari3,\r
- \r
- isSafari2 : isSafari && !isSafari3,\r
- \r
- isIE : isIE,\r
- \r
- isIE6 : isIE && !isIE7,\r
- \r
- isIE7 : isIE7,\r
- \r
- isGecko : isGecko,\r
- \r
- isBorderBox : isBorderBox,\r
- \r
- isLinux : isLinux,\r
- \r
- isWindows : isWindows,\r
- \r
- isMac : isMac,\r
- \r
- isAir : isAir,\r
-\r
- \r
- useShims : ((isIE && !isIE7) || (isGecko && isMac))\r
- });\r
-\r
-
- Ext.ns = Ext.namespace;\r
-})();\r
-\r
-Ext.ns("Ext", "Ext.util", "Ext.grid", "Ext.dd", "Ext.tree", "Ext.data",\r
- "Ext.form", "Ext.menu", "Ext.state", "Ext.lib", "Ext.layout", "Ext.app", "Ext.ux");\r
-\r
-\r
-\r
-Ext.apply(Function.prototype, {\r
- \r
- createCallback : function(){\r
-
- var args = arguments;\r
- var method = this;\r
- return function() {\r
- return method.apply(window, args);\r
- };\r
- },\r
-\r
- \r
- createDelegate : function(obj, args, appendArgs){\r
- var method = this;\r
- return function() {\r
- var callArgs = args || arguments;\r
- if(appendArgs === true){\r
- callArgs = Array.prototype.slice.call(arguments, 0);\r
- callArgs = callArgs.concat(args);\r
- }else if(typeof appendArgs == "number"){\r
- callArgs = Array.prototype.slice.call(arguments, 0);
- var applyArgs = [appendArgs, 0].concat(args);
- Array.prototype.splice.apply(callArgs, applyArgs);
- }\r
- return method.apply(obj || window, callArgs);\r
- };\r
- },\r
-\r
- \r
- defer : function(millis, obj, args, appendArgs){\r
- var fn = this.createDelegate(obj, args, appendArgs);\r
- if(millis){\r
- return setTimeout(fn, millis);\r
- }\r
- fn();\r
- return 0;\r
- },\r
- \r
- createSequence : function(fcn, scope){\r
- if(typeof fcn != "function"){\r
- return this;\r
- }\r
- var method = this;\r
- return function() {\r
- var retval = method.apply(this || window, arguments);\r
- fcn.apply(scope || this || window, arguments);\r
- return retval;\r
- };\r
- },\r
-\r
- \r
- createInterceptor : function(fcn, scope){\r
- if(typeof fcn != "function"){\r
- return this;\r
- }\r
- var method = this;\r
- return function() {\r
- fcn.target = this;\r
- fcn.method = method;\r
- if(fcn.apply(scope || this || window, arguments) === false){\r
- return;\r
- }\r
- return method.apply(this || window, arguments);\r
- };\r
- }\r
-});\r
-\r
-\r
-Ext.applyIf(String, {\r
-\r
- \r
- escape : function(string) {\r
- return string.replace(/('|\\)/g, "\\$1");\r
- },\r
-\r
- \r
- leftPad : function (val, size, ch) {\r
- var result = new String(val);\r
- if(!ch) {\r
- ch = " ";\r
- }\r
- while (result.length < size) {\r
- result = ch + result;\r
- }\r
- return result.toString();\r
- },\r
-\r
- \r
- format : function(format){\r
- var args = Array.prototype.slice.call(arguments, 1);\r
- return format.replace(/\{(\d+)\}/g, function(m, i){\r
- return args[i];\r
- });\r
- }\r
-});\r
-\r
-\r
-String.prototype.toggle = function(value, other){\r
- return this == value ? other : value;\r
-};\r
-\r
-\r
-String.prototype.trim = function(){\r
- var re = /^\s+|\s+$/g;\r
- return function(){ return this.replace(re, ""); };\r
-}();\r
-\r
-Ext.applyIf(Number.prototype, {\r
- \r
- constrain : function(min, max){\r
- return Math.min(Math.max(this, min), max);\r
- }\r
-});\r
-\r
-Ext.applyIf(Array.prototype, {\r
- \r
- indexOf : function(o){\r
- for (var i = 0, len = this.length; i < len; i++){\r
- if(this[i] == o) return i;\r
- }\r
- return -1;\r
- },\r
-\r
- \r
- remove : function(o){\r
- var index = this.indexOf(o);\r
- if(index != -1){\r
- this.splice(index, 1);\r
- }\r
- return this;\r
- }\r
-});\r
-\r
-\r
-Date.prototype.getElapsed = function(date) {\r
- return Math.abs((date || new Date()).getTime()-this.getTime());\r
-};\r
-
-(function() {\r
- var libFlyweight;\r
-\r
- Ext.lib.Dom = {\r
- getViewWidth : function(full) {\r
- return full ? this.getDocumentWidth() : this.getViewportWidth();\r
- },\r
-\r
- getViewHeight : function(full) {\r
- return full ? this.getDocumentHeight() : this.getViewportHeight();\r
- },\r
-\r
- getDocumentHeight: function() {\r
- var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight;\r
- return Math.max(scrollHeight, this.getViewportHeight());\r
- },\r
-\r
- getDocumentWidth: function() {\r
- var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth;\r
- return Math.max(scrollWidth, this.getViewportWidth());\r
- },\r
-\r
- getViewportHeight: function(){\r
- if(Ext.isIE){\r
- return Ext.isStrict ? document.documentElement.clientHeight :\r
- document.body.clientHeight;\r
- }else{\r
- return self.innerHeight;\r
- }\r
- },\r
-\r
- getViewportWidth: function() {\r
- if(Ext.isIE){\r
- return Ext.isStrict ? document.documentElement.clientWidth :\r
- document.body.clientWidth;\r
- }else{\r
- return self.innerWidth;\r
- }\r
- },\r
-\r
- isAncestor : function(p, c) {\r
- p = Ext.getDom(p);\r
- c = Ext.getDom(c);\r
- if (!p || !c) {\r
- return false;\r
- }\r
-\r
- if (p.contains && !Ext.isSafari) {\r
- return p.contains(c);\r
- } else if (p.compareDocumentPosition) {\r
- return !!(p.compareDocumentPosition(c) & 16);\r
- } else {\r
- var parent = c.parentNode;\r
- while (parent) {\r
- if (parent == p) {\r
- return true;\r
- }\r
- else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {\r
- return false;\r
- }\r
- parent = parent.parentNode;\r
- }\r
- return false;\r
- }\r
- },\r
-\r
- getRegion : function(el) {\r
- return Ext.lib.Region.getRegion(el);\r
- },\r
-\r
- getY : function(el) {\r
- return this.getXY(el)[1];\r
- },\r
-\r
- getX : function(el) {\r
- return this.getXY(el)[0];\r
- },\r
-\r
-\r
- getXY : function(el) {\r
- var p, pe, b, scroll, bd = (document.body || document.documentElement);\r
- el = Ext.getDom(el);\r
-\r
- if(el == bd){\r
- return [0, 0];\r
- }\r
-\r
- if (el.getBoundingClientRect) {\r
- b = el.getBoundingClientRect();\r
- scroll = fly(document).getScroll();\r
- return [b.left + scroll.left, b.top + scroll.top];\r
- }\r
- var x = 0, y = 0;\r
- \r
- p = el;\r
-\r
- var hasAbsolute = fly(el).getStyle("position") == "absolute";\r
-\r
- while (p) {\r
-\r
- x += p.offsetLeft;\r
- y += p.offsetTop;\r
-\r
- if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {\r
- hasAbsolute = true;\r
- }\r
-\r
- if (Ext.isGecko) {\r
- pe = fly(p);\r
- \r
- var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;\r
- var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;\r
-\r
-\r
- x += bl;\r
- y += bt;\r
-\r
-\r
- if (p != el && pe.getStyle('overflow') != 'visible') {\r
- x += bl;\r
- y += bt;\r
- }\r
- }\r
- p = p.offsetParent;\r
- }\r
-\r
- if (Ext.isSafari && hasAbsolute) {\r
- x -= bd.offsetLeft;\r
- y -= bd.offsetTop;\r
- }\r
-\r
- if (Ext.isGecko && !hasAbsolute) {\r
- var dbd = fly(bd);\r
- x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;\r
- y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;\r
- }\r
-\r
- p = el.parentNode;\r
- while (p && p != bd) {\r
- if (!Ext.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {\r
- x -= p.scrollLeft;\r
- y -= p.scrollTop;\r
- }\r
- p = p.parentNode;\r
- }\r
- return [x, y];\r
- },\r
-\r
- setXY : function(el, xy) {\r
- el = Ext.fly(el, '_setXY');\r
- el.position();\r
- var pts = el.translatePoints(xy);\r
- if (xy[0] !== false) {\r
- el.dom.style.left = pts.left + "px";\r
- }\r
- if (xy[1] !== false) {\r
- el.dom.style.top = pts.top + "px";\r
- }\r
- },\r
-\r
- setX : function(el, x) {\r
- this.setXY(el, [x, false]);\r
- },\r
-\r
- setY : function(el, y) {\r
- this.setXY(el, [false, y]);\r
- }\r
- };\r
-\r
-\r
- Ext.lib.Event = function() {\r
- var loadComplete = false;\r
- var listeners = [];\r
- var unloadListeners = [];\r
- var retryCount = 0;\r
- var onAvailStack = [];\r
- var counter = 0;\r
- var lastError = null;\r
-\r
- return {\r
- POLL_RETRYS: 200,\r
- POLL_INTERVAL: 20,\r
- EL: 0,\r
- TYPE: 1,\r
- FN: 2,\r
- WFN: 3,\r
- OBJ: 3,\r
- ADJ_SCOPE: 4,\r
- _interval: null,\r
-\r
- startInterval: function() {\r
- if (!this._interval) {\r
- var self = this;\r
- var callback = function() {\r
- self._tryPreloadAttach();\r
- };\r
- this._interval = setInterval(callback, this.POLL_INTERVAL);\r
-\r
- }\r
- },\r
-\r
- onAvailable: function(p_id, p_fn, p_obj, p_override) {\r
- onAvailStack.push({ id: p_id,\r
- fn: p_fn,\r
- obj: p_obj,\r
- override: p_override,\r
- checkReady: false });\r
-\r
- retryCount = this.POLL_RETRYS;\r
- this.startInterval();\r
- },\r
-\r
-\r
- addListener: function(el, eventName, fn) {\r
- el = Ext.getDom(el);\r
- if (!el || !fn) {\r
- return false;\r
- }\r
-\r
- if ("unload" == eventName) {\r
- unloadListeners[unloadListeners.length] =\r
- [el, eventName, fn];\r
- return true;\r
- }\r
-\r
-
- var wrappedFn = function(e) {\r
- return typeof Ext != 'undefined' ? fn(Ext.lib.Event.getEvent(e)) : false;\r
- };\r
-\r
- var li = [el, eventName, fn, wrappedFn];\r
-\r
- var index = listeners.length;\r
- listeners[index] = li;\r
-\r
- this.doAdd(el, eventName, wrappedFn, false);\r
- return true;\r
-\r
- },\r
-\r
-\r
- removeListener: function(el, eventName, fn) {\r
- var i, len;\r
-\r
- el = Ext.getDom(el);\r
-\r
- if(!fn) {\r
- return this.purgeElement(el, false, eventName);\r
- }\r
-\r
-\r
- if ("unload" == eventName) {\r
-\r
- for (i = 0,len = unloadListeners.length; i < len; i++) {\r
- var li = unloadListeners[i];\r
- if (li &&\r
- li[0] == el &&\r
- li[1] == eventName &&\r
- li[2] == fn) {\r
- unloadListeners.splice(i, 1);\r
- return true;\r
- }\r
- }\r
-\r
- return false;\r
- }\r
-\r
- var cacheItem = null;\r
-\r
-\r
- var index = arguments[3];\r
-\r
- if ("undefined" == typeof index) {\r
- index = this._getCacheIndex(el, eventName, fn);\r
- }\r
-\r
- if (index >= 0) {\r
- cacheItem = listeners[index];\r
- }\r
-\r
- if (!el || !cacheItem) {\r
- return false;\r
- }\r
-\r
- this.doRemove(el, eventName, cacheItem[this.WFN], false);\r
-\r
- delete listeners[index][this.WFN];\r
- delete listeners[index][this.FN];\r
- listeners.splice(index, 1);\r
-\r
- return true;\r
-\r
- },\r
-\r
-\r
- getTarget: function(ev, resolveTextNode) {\r
- ev = ev.browserEvent || ev;\r
- var t = ev.target || ev.srcElement;\r
- return this.resolveTextNode(t);\r
- },\r
-\r
-\r
- resolveTextNode: function(node) {\r
- if (Ext.isSafari && node && 3 == node.nodeType) {\r
- return node.parentNode;\r
- } else {\r
- return node;\r
- }\r
- },\r
-\r
-\r
- getPageX: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- var x = ev.pageX;\r
- if (!x && 0 !== x) {\r
- x = ev.clientX || 0;\r
-\r
- if (Ext.isIE) {\r
- x += this.getScroll()[1];\r
- }\r
- }\r
-\r
- return x;\r
- },\r
-\r
-\r
- getPageY: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- var y = ev.pageY;\r
- if (!y && 0 !== y) {\r
- y = ev.clientY || 0;\r
-\r
- if (Ext.isIE) {\r
- y += this.getScroll()[0];\r
- }\r
- }\r
-\r
-\r
- return y;\r
- },\r
-\r
-\r
- getXY: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- return [this.getPageX(ev), this.getPageY(ev)];\r
- },\r
-\r
-\r
- getRelatedTarget: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- var t = ev.relatedTarget;\r
- if (!t) {\r
- if (ev.type == "mouseout") {\r
- t = ev.toElement;\r
- } else if (ev.type == "mouseover") {\r
- t = ev.fromElement;\r
- }\r
- }\r
-\r
- return this.resolveTextNode(t);\r
- },\r
-\r
-\r
- getTime: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- if (!ev.time) {\r
- var t = new Date().getTime();\r
- try {\r
- ev.time = t;\r
- } catch(ex) {\r
- this.lastError = ex;\r
- return t;\r
- }\r
- }\r
-\r
- return ev.time;\r
- },\r
-\r
-\r
- stopEvent: function(ev) {\r
- this.stopPropagation(ev);\r
- this.preventDefault(ev);\r
- },\r
-\r
-\r
- stopPropagation: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- if (ev.stopPropagation) {\r
- ev.stopPropagation();\r
- } else {\r
- ev.cancelBubble = true;\r
- }\r
- },\r
-\r
-\r
- preventDefault: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- if(ev.preventDefault) {\r
- ev.preventDefault();\r
- } else {\r
- ev.returnValue = false;\r
- }\r
- },\r
-\r
-\r
- getEvent: function(e) {\r
- var ev = e || window.event;\r
- if (!ev) {\r
- var c = this.getEvent.caller;\r
- while (c) {\r
- ev = c.arguments[0];\r
- if (ev && Event == ev.constructor) {\r
- break;\r
- }\r
- c = c.caller;\r
- }\r
- }\r
- return ev;\r
- },\r
-\r
-\r
- getCharCode: function(ev) {\r
- ev = ev.browserEvent || ev;\r
- return ev.charCode || ev.keyCode || 0;\r
- },\r
-\r
-\r
- _getCacheIndex: function(el, eventName, fn) {\r
- for (var i = 0,len = listeners.length; i < len; ++i) {\r
- var li = listeners[i];\r
- if (li &&\r
- li[this.FN] == fn &&\r
- li[this.EL] == el &&\r
- li[this.TYPE] == eventName) {\r
- return i;\r
- }\r
- }\r
-\r
- return -1;\r
- },\r
-\r
-\r
- elCache: {},\r
-\r
-\r
- getEl: function(id) {\r
- return document.getElementById(id);\r
- },\r
-\r
-\r
- clearCache: function() {\r
- },\r
-\r
-\r
- _load: function(e) {\r
- loadComplete = true;\r
- var EU = Ext.lib.Event;\r
-\r
-\r
- if (Ext.isIE) {\r
- EU.doRemove(window, "load", EU._load);\r
- }\r
- },\r
-\r
-\r
- _tryPreloadAttach: function() {\r
-\r
- if (this.locked) {\r
- return false;\r
- }\r
-\r
- this.locked = true;\r
-\r
-\r
- var tryAgain = !loadComplete;\r
- if (!tryAgain) {\r
- tryAgain = (retryCount > 0);\r
- }\r
-\r
-\r
- var notAvail = [];\r
- for (var i = 0,len = onAvailStack.length; i < len; ++i) {\r
- var item = onAvailStack[i];\r
- if (item) {\r
- var el = this.getEl(item.id);\r
-\r
- if (el) {\r
- if (!item.checkReady ||\r
- loadComplete ||\r
- el.nextSibling ||\r
- (document && document.body)) {\r
-\r
- var scope = el;\r
- if (item.override) {\r
- if (item.override === true) {\r
- scope = item.obj;\r
- } else {\r
- scope = item.override;\r
- }\r
- }\r
- item.fn.call(scope, item.obj);\r
- onAvailStack[i] = null;\r
- }\r
- } else {\r
- notAvail.push(item);\r
- }\r
- }\r
- }\r
-\r
- retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;\r
-\r
- if (tryAgain) {\r
-\r
- this.startInterval();\r
- } else {\r
- clearInterval(this._interval);\r
- this._interval = null;\r
- }\r
-\r
- this.locked = false;\r
-\r
- return true;\r
-\r
- },\r
-\r
-\r
- purgeElement: function(el, recurse, eventName) {\r
- var elListeners = this.getListeners(el, eventName);\r
- if (elListeners) {\r
- for (var i = 0,len = elListeners.length; i < len; ++i) {\r
- var l = elListeners[i];\r
- this.removeListener(el, l.type, l.fn);\r
- }\r
- }\r
-\r
- if (recurse && el && el.childNodes) {\r
- for (i = 0,len = el.childNodes.length; i < len; ++i) {\r
- this.purgeElement(el.childNodes[i], recurse, eventName);\r
- }\r
- }\r
- },\r
-\r
-\r
- getListeners: function(el, eventName) {\r
- var results = [], searchLists;\r
- if (!eventName) {\r
- searchLists = [listeners, unloadListeners];\r
- } else if (eventName == "unload") {\r
- searchLists = [unloadListeners];\r
- } else {\r
- searchLists = [listeners];\r
- }\r
-\r
- for (var j = 0; j < searchLists.length; ++j) {\r
- var searchList = searchLists[j];\r
- if (searchList && searchList.length > 0) {\r
- for (var i = 0,len = searchList.length; i < len; ++i) {\r
- var l = searchList[i];\r
- if (l && l[this.EL] === el &&\r
- (!eventName || eventName === l[this.TYPE])) {\r
- results.push({\r
- type: l[this.TYPE],\r
- fn: l[this.FN],\r
- obj: l[this.OBJ],\r
- adjust: l[this.ADJ_SCOPE],\r
- index: i\r
- });\r
- }\r
- }\r
- }\r
- }\r
-\r
- return (results.length) ? results : null;\r
- },\r
-\r
-\r
- _unload: function(e) {\r
-\r
- var EU = Ext.lib.Event, i, j, l, len, index;\r
-\r
- for (i = 0,len = unloadListeners.length; i < len; ++i) {\r
- l = unloadListeners[i];\r
- if (l) {\r
- var scope = window;\r
- if (l[EU.ADJ_SCOPE]) {\r
- if (l[EU.ADJ_SCOPE] === true) {\r
- scope = l[EU.OBJ];\r
- } else {\r
- scope = l[EU.ADJ_SCOPE];\r
- }\r
- }\r
- l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ]);\r
- unloadListeners[i] = null;\r
- l = null;\r
- scope = null;\r
- }\r
- }\r
-\r
- unloadListeners = null;\r
-\r
- if (listeners && listeners.length > 0) {\r
- j = listeners.length;\r
- while (j) {\r
- index = j - 1;\r
- l = listeners[index];\r
- if (l) {\r
- EU.removeListener(l[EU.EL], l[EU.TYPE],\r
- l[EU.FN], index);\r
- }\r
- j = j - 1;\r
- }\r
- l = null;\r
-\r
- EU.clearCache();\r
- }\r
-\r
- EU.doRemove(window, "unload", EU._unload);\r
-\r
- },\r
-\r
-\r
- getScroll: function() {\r
- var dd = document.documentElement, db = document.body;\r
- if (dd && (dd.scrollTop || dd.scrollLeft)) {\r
- return [dd.scrollTop, dd.scrollLeft];\r
- } else if (db) {\r
- return [db.scrollTop, db.scrollLeft];\r
- } else {\r
- return [0, 0];\r
- }\r
- },\r
-\r
-\r
- doAdd: function () {\r
- if (window.addEventListener) {\r
- return function(el, eventName, fn, capture) {\r
- el.addEventListener(eventName, fn, (capture));\r
- };\r
- } else if (window.attachEvent) {\r
- return function(el, eventName, fn, capture) {\r
- el.attachEvent("on" + eventName, fn);\r
- };\r
- } else {\r
- return function() {\r
- };\r
- }\r
- }(),\r
-\r
-\r
- doRemove: function() {\r
- if (window.removeEventListener) {\r
- return function (el, eventName, fn, capture) {\r
- el.removeEventListener(eventName, fn, (capture));\r
- };\r
- } else if (window.detachEvent) {\r
- return function (el, eventName, fn) {\r
- el.detachEvent("on" + eventName, fn);\r
- };\r
- } else {\r
- return function() {\r
- };\r
- }\r
- }()\r
- };\r
-\r
- }();\r
-\r
- var E = Ext.lib.Event;\r
- E.on = E.addListener;\r
- E.un = E.removeListener;\r
- if (document && document.body) {\r
- E._load();\r
- } else {\r
- E.doAdd(window, "load", E._load);\r
- }\r
- E.doAdd(window, "unload", E._unload);\r
- E._tryPreloadAttach();\r
-\r
- Ext.lib.Ajax = {\r
- request : function(method, uri, cb, data, options) {\r
- if(options){\r
- var hs = options.headers;\r
- if(hs){\r
- for(var h in hs){\r
- if(hs.hasOwnProperty(h)){\r
- this.initHeader(h, hs[h], false);\r
- }\r
- }\r
- }\r
- if(options.xmlData){\r
- this.initHeader('Content-Type', 'text/xml', false);\r
- method = 'POST';\r
- data = options.xmlData;\r
- }else if(options.jsonData){\r
- this.initHeader('Content-Type', 'text/javascript', false);\r
- method = 'POST';\r
- data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;\r
- }\r
- }\r
-\r
- return this.asyncRequest(method, uri, cb, data);\r
- },\r
-\r
- serializeForm : function(form) {\r
- if(typeof form == 'string') {\r
- form = (document.getElementById(form) || document.forms[form]);\r
- }\r
-\r
- var el, name, val, disabled, data = '', hasSubmit = false;\r
- for (var i = 0; i < form.elements.length; i++) {\r
- el = form.elements[i];\r
- disabled = form.elements[i].disabled;\r
- name = form.elements[i].name;\r
- val = form.elements[i].value;\r
-\r
- if (!disabled && name){\r
- switch (el.type)\r
- {\r
- case 'select-one':\r
- case 'select-multiple':\r
- for (var j = 0; j < el.options.length; j++) {\r
- if (el.options[j].selected) {\r
- if (Ext.isIE) {\r
- data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].attributes['value'].specified ? el.options[j].value : el.options[j].text) + '&';\r
- }\r
- else {\r
- data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].hasAttribute('value') ? el.options[j].value : el.options[j].text) + '&';\r
- }\r
- }\r
- }\r
- break;\r
- case 'radio':\r
- case 'checkbox':\r
- if (el.checked) {\r
- data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';\r
- }\r
- break;\r
- case 'file':\r
-\r
- case undefined:\r
-\r
- case 'reset':\r
-\r
- case 'button':\r
-\r
- break;\r
- case 'submit':\r
- if(hasSubmit == false) {\r
- data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';\r
- hasSubmit = true;\r
- }\r
- break;\r
- default:\r
- data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';\r
- break;\r
- }\r
- }\r
- }\r
- data = data.substr(0, data.length - 1);\r
- return data;\r
- },\r
-\r
- headers:{},\r
-\r
- hasHeaders:false,\r
-\r
- useDefaultHeader:true,\r
-\r
- defaultPostHeader:'application/x-www-form-urlencoded',\r
-\r
- useDefaultXhrHeader:true,\r
-\r
- defaultXhrHeader:'XMLHttpRequest',\r
-\r
- hasDefaultHeaders:true,\r
-\r
- defaultHeaders:{},\r
-\r
- poll:{},\r
-\r
- timeout:{},\r
-\r
- pollInterval:50,\r
-\r
- transactionId:0,\r
-\r
- setProgId:function(id)\r
- {\r
- this.activeX.unshift(id);\r
- },\r
-\r
- setDefaultPostHeader:function(b)\r
- {\r
- this.useDefaultHeader = b;\r
- },\r
-\r
- setDefaultXhrHeader:function(b)\r
- {\r
- this.useDefaultXhrHeader = b;\r
- },\r
-\r
- setPollingInterval:function(i)\r
- {\r
- if (typeof i == 'number' && isFinite(i)) {\r
- this.pollInterval = i;\r
- }\r
- },\r
-\r
- createXhrObject:function(transactionId)\r
- {\r
- var obj,http;\r
- try\r
- {\r
-\r
- http = new XMLHttpRequest();\r
-\r
- obj = { conn:http, tId:transactionId };\r
- }\r
- catch(e)\r
- {\r
- for (var i = 0; i < this.activeX.length; ++i) {\r
- try\r
- {\r
-\r
- http = new ActiveXObject(this.activeX[i]);\r
-\r
- obj = { conn:http, tId:transactionId };\r
- break;\r
- }\r
- catch(e) {\r
- }\r
- }\r
- }\r
- finally\r
- {\r
- return obj;\r
- }\r
- },\r
-\r
- getConnectionObject:function()\r
- {\r
- var o;\r
- var tId = this.transactionId;\r
-\r
- try\r
- {\r
- o = this.createXhrObject(tId);\r
- if (o) {\r
- this.transactionId++;\r
- }\r
- }\r
- catch(e) {\r
- }\r
- finally\r
- {\r
- return o;\r
- }\r
- },\r
-\r
- asyncRequest:function(method, uri, callback, postData)\r
- {\r
- var o = this.getConnectionObject();\r
-\r
- if (!o) {\r
- return null;\r
- }\r
- else {\r
- o.conn.open(method, uri, true);\r
-\r
- if (this.useDefaultXhrHeader) {\r
- if (!this.defaultHeaders['X-Requested-With']) {\r
- this.initHeader('X-Requested-With', this.defaultXhrHeader, true);\r
- }\r
- }\r
-\r
- if(postData && this.useDefaultHeader){\r
- this.initHeader('Content-Type', this.defaultPostHeader);\r
- }\r
-\r
- if (this.hasDefaultHeaders || this.hasHeaders) {\r
- this.setHeader(o);\r
- }\r
-\r
- this.handleReadyState(o, callback);\r
- o.conn.send(postData || null);\r
-\r
- return o;\r
- }\r
- },\r
-\r
- handleReadyState:function(o, callback)\r
- {\r
- var oConn = this;\r
-\r
- if (callback && callback.timeout) {\r
- this.timeout[o.tId] = window.setTimeout(function() {\r
- oConn.abort(o, callback, true);\r
- }, callback.timeout);\r
- }\r
-\r
- this.poll[o.tId] = window.setInterval(\r
- function() {\r
- if (o.conn && o.conn.readyState == 4) {\r
- window.clearInterval(oConn.poll[o.tId]);\r
- delete oConn.poll[o.tId];\r
-\r
- if (callback && callback.timeout) {\r
- window.clearTimeout(oConn.timeout[o.tId]);\r
- delete oConn.timeout[o.tId];\r
- }\r
-\r
- oConn.handleTransactionResponse(o, callback);\r
- }\r
- }\r
- , this.pollInterval);\r
- },\r
-\r
- handleTransactionResponse:function(o, callback, isAbort)\r
- {\r
-\r
- if (!callback) {\r
- this.releaseObject(o);\r
- return;\r
- }\r
-\r
- var httpStatus, responseObject;\r
-\r
- try\r
- {\r
- if (o.conn.status !== undefined && o.conn.status != 0) {\r
- httpStatus = o.conn.status;\r
- }\r
- else {\r
- httpStatus = 13030;\r
- }\r
- }\r
- catch(e) {\r
-\r
-\r
- httpStatus = 13030;\r
- }\r
-\r
- if (httpStatus >= 200 && httpStatus < 300) {\r
- responseObject = this.createResponseObject(o, callback.argument);\r
- if (callback.success) {\r
- if (!callback.scope) {\r
- callback.success(responseObject);\r
- }\r
- else {\r
-\r
-\r
- callback.success.apply(callback.scope, [responseObject]);\r
- }\r
- }\r
- }\r
- else {\r
- switch (httpStatus) {\r
-\r
- case 12002:\r
- case 12029:\r
- case 12030:\r
- case 12031:\r
- case 12152:\r
- case 13030:\r
- responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false));\r
- if (callback.failure) {\r
- if (!callback.scope) {\r
- callback.failure(responseObject);\r
- }\r
- else {\r
- callback.failure.apply(callback.scope, [responseObject]);\r
- }\r
- }\r
- break;\r
- default:\r
- responseObject = this.createResponseObject(o, callback.argument);\r
- if (callback.failure) {\r
- if (!callback.scope) {\r
- callback.failure(responseObject);\r
- }\r
- else {\r
- callback.failure.apply(callback.scope, [responseObject]);\r
- }\r
- }\r
- }\r
- }\r
-\r
- this.releaseObject(o);\r
- responseObject = null;\r
- },\r
-\r
- createResponseObject:function(o, callbackArg)\r
- {\r
- var obj = {};\r
- var headerObj = {};\r
-\r
- try\r
- {\r
- var headerStr = o.conn.getAllResponseHeaders();\r
- var header = headerStr.split('\n');\r
- for (var i = 0; i < header.length; i++) {\r
- var delimitPos = header[i].indexOf(':');\r
- if (delimitPos != -1) {\r
- headerObj[header[i].substring(0, delimitPos)] = header[i].substring(delimitPos + 2);\r
- }\r
- }\r
- }\r
- catch(e) {\r
- }\r
-\r
- obj.tId = o.tId;\r
- obj.status = o.conn.status;\r
- obj.statusText = o.conn.statusText;\r
- obj.getResponseHeader = headerObj;\r
- obj.getAllResponseHeaders = headerStr;\r
- obj.responseText = o.conn.responseText;\r
- obj.responseXML = o.conn.responseXML;\r
-\r
- if (typeof callbackArg !== undefined) {\r
- obj.argument = callbackArg;\r
- }\r
-\r
- return obj;\r
- },\r
-\r
- createExceptionObject:function(tId, callbackArg, isAbort)\r
- {\r
- var COMM_CODE = 0;\r
- var COMM_ERROR = 'communication failure';\r
- var ABORT_CODE = -1;\r
- var ABORT_ERROR = 'transaction aborted';\r
-\r
- var obj = {};\r
-\r
- obj.tId = tId;\r
- if (isAbort) {\r
- obj.status = ABORT_CODE;\r
- obj.statusText = ABORT_ERROR;\r
- }\r
- else {\r
- obj.status = COMM_CODE;\r
- obj.statusText = COMM_ERROR;\r
- }\r
-\r
- if (callbackArg) {\r
- obj.argument = callbackArg;\r
- }\r
-\r
- return obj;\r
- },\r
-\r
- initHeader:function(label, value, isDefault)\r
- {\r
- var headerObj = (isDefault) ? this.defaultHeaders : this.headers;\r
-\r
- if (headerObj[label] === undefined) {\r
- headerObj[label] = value;\r
- }\r
- else {\r
-\r
-\r
- headerObj[label] = value + "," + headerObj[label];\r
- }\r
-\r
- if (isDefault) {\r
- this.hasDefaultHeaders = true;\r
- }\r
- else {\r
- this.hasHeaders = true;\r
- }\r
- },\r
-\r
-\r
- setHeader:function(o)\r
- {\r
- if (this.hasDefaultHeaders) {\r
- for (var prop in this.defaultHeaders) {\r
- if (this.defaultHeaders.hasOwnProperty(prop)) {\r
- o.conn.setRequestHeader(prop, this.defaultHeaders[prop]);\r
- }\r
- }\r
- }\r
-\r
- if (this.hasHeaders) {\r
- for (var prop in this.headers) {\r
- if (this.headers.hasOwnProperty(prop)) {\r
- o.conn.setRequestHeader(prop, this.headers[prop]);\r
- }\r
- }\r
- this.headers = {};\r
- this.hasHeaders = false;\r
- }\r
- },\r
-\r
- resetDefaultHeaders:function() {\r
- delete this.defaultHeaders;\r
- this.defaultHeaders = {};\r
- this.hasDefaultHeaders = false;\r
- },\r
-\r
- abort:function(o, callback, isTimeout)\r
- {\r
- if (this.isCallInProgress(o)) {\r
- o.conn.abort();\r
- window.clearInterval(this.poll[o.tId]);\r
- delete this.poll[o.tId];\r
- if (isTimeout) {\r
- delete this.timeout[o.tId];\r
- }\r
-\r
- this.handleTransactionResponse(o, callback, true);\r
-\r
- return true;\r
- }\r
- else {\r
- return false;\r
- }\r
- },\r
-\r
-\r
- isCallInProgress:function(o)\r
- {\r
-\r
-\r
- if (o.conn) {\r
- return o.conn.readyState != 4 && o.conn.readyState != 0;\r
- }\r
- else {\r
-\r
- return false;\r
- }\r
- },\r
-\r
-\r
- releaseObject:function(o)\r
- {\r
-\r
- o.conn = null;\r
-\r
- o = null;\r
- },\r
-\r
- activeX:[\r
- 'MSXML2.XMLHTTP.3.0',\r
- 'MSXML2.XMLHTTP',\r
- 'Microsoft.XMLHTTP'\r
- ]\r
-\r
-\r
- };\r
-\r
-\r
- Ext.lib.Region = function(t, r, b, l) {\r
- this.top = t;\r
- this[1] = t;\r
- this.right = r;\r
- this.bottom = b;\r
- this.left = l;\r
- this[0] = l;\r
- };\r
-\r
- Ext.lib.Region.prototype = {\r
- contains : function(region) {\r
- return ( region.left >= this.left &&\r
- region.right <= this.right &&\r
- region.top >= this.top &&\r
- region.bottom <= this.bottom );\r
-\r
- },\r
-\r
- getArea : function() {\r
- return ( (this.bottom - this.top) * (this.right - this.left) );\r
- },\r
-\r
- intersect : function(region) {\r
- var t = Math.max(this.top, region.top);\r
- var r = Math.min(this.right, region.right);\r
- var b = Math.min(this.bottom, region.bottom);\r
- var l = Math.max(this.left, region.left);\r
-\r
- if (b >= t && r >= l) {\r
- return new Ext.lib.Region(t, r, b, l);\r
- } else {\r
- return null;\r
- }\r
- },\r
- union : function(region) {\r
- var t = Math.min(this.top, region.top);\r
- var r = Math.max(this.right, region.right);\r
- var b = Math.max(this.bottom, region.bottom);\r
- var l = Math.min(this.left, region.left);\r
-\r
- return new Ext.lib.Region(t, r, b, l);\r
- },\r
-\r
- constrainTo : function(r) {\r
- this.top = this.top.constrain(r.top, r.bottom);\r
- this.bottom = this.bottom.constrain(r.top, r.bottom);\r
- this.left = this.left.constrain(r.left, r.right);\r
- this.right = this.right.constrain(r.left, r.right);\r
- return this;\r
- },\r
-\r
- adjust : function(t, l, b, r) {\r
- this.top += t;\r
- this.left += l;\r
- this.right += r;\r
- this.bottom += b;\r
- return this;\r
- }\r
- };\r
-\r
- Ext.lib.Region.getRegion = function(el) {\r
- var p = Ext.lib.Dom.getXY(el);\r
-\r
- var t = p[1];\r
- var r = p[0] + el.offsetWidth;\r
- var b = p[1] + el.offsetHeight;\r
- var l = p[0];\r
-\r
- return new Ext.lib.Region(t, r, b, l);\r
- };\r
-\r
- Ext.lib.Point = function(x, y) {\r
- if (Ext.isArray(x)) {\r
- y = x[1];\r
- x = x[0];\r
- }\r
- this.x = this.right = this.left = this[0] = x;\r
- this.y = this.top = this.bottom = this[1] = y;\r
- };\r
-\r
- Ext.lib.Point.prototype = new Ext.lib.Region();\r
-\r
-\r
- Ext.lib.Anim = {\r
- scroll : function(el, args, duration, easing, cb, scope) {\r
- return this.run(el, args, duration, easing, cb, scope, Ext.lib.Scroll);\r
- },\r
-\r
- motion : function(el, args, duration, easing, cb, scope) {\r
- return this.run(el, args, duration, easing, cb, scope, Ext.lib.Motion);\r
- },\r
-\r
- color : function(el, args, duration, easing, cb, scope) {\r
- return this.run(el, args, duration, easing, cb, scope, Ext.lib.ColorAnim);\r
- },\r
-\r
- run : function(el, args, duration, easing, cb, scope, type) {\r
- type = type || Ext.lib.AnimBase;\r
- if (typeof easing == "string") {\r
- easing = Ext.lib.Easing[easing];\r
- }\r
- var anim = new type(el, args, duration, easing);\r
- anim.animateX(function() {\r
- Ext.callback(cb, scope);\r
- });\r
- return anim;\r
- }\r
- };\r
-\r
-\r
- function fly(el) {\r
- if (!libFlyweight) {\r
- libFlyweight = new Ext.Element.Flyweight();\r
- }\r
- libFlyweight.dom = el;\r
- return libFlyweight;\r
- }\r
-\r
-\r
- if(Ext.isIE) {\r
- function fnCleanUp() {\r
- var p = Function.prototype;\r
- delete p.createSequence;\r
- delete p.defer;\r
- delete p.createDelegate;\r
- delete p.createCallback;\r
- delete p.createInterceptor;\r
-\r
- window.detachEvent("onunload", fnCleanUp);\r
- }\r
- window.attachEvent("onunload", fnCleanUp);\r
- }\r
-\r
- Ext.lib.AnimBase = function(el, attributes, duration, method) {\r
- if (el) {\r
- this.init(el, attributes, duration, method);\r
- }\r
- };\r
-\r
- Ext.lib.AnimBase.prototype = {\r
-\r
- toString: function() {\r
- var el = this.getEl();\r
- var id = el.id || el.tagName;\r
- return ("Anim " + id);\r
- },\r
-\r
- patterns: {\r
- noNegatives: /width|height|opacity|padding/i,\r
- offsetAttribute: /^((width|height)|(top|left))$/,\r
- defaultUnit: /width|height|top$|bottom$|left$|right$/i,\r
- offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i\r
- },\r
-\r
-\r
- doMethod: function(attr, start, end) {\r
- return this.method(this.currentFrame, start, end - start, this.totalFrames);\r
- },\r
-\r
-\r
- setAttribute: function(attr, val, unit) {\r
- if (this.patterns.noNegatives.test(attr)) {\r
- val = (val > 0) ? val : 0;\r
- }\r
-\r
- Ext.fly(this.getEl(), '_anim').setStyle(attr, val + unit);\r
- },\r
-\r
-\r
- getAttribute: function(attr) {\r
- var el = this.getEl();\r
- var val = fly(el).getStyle(attr);\r
-\r
- if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {\r
- return parseFloat(val);\r
- }\r
-\r
- var a = this.patterns.offsetAttribute.exec(attr) || [];\r
- var pos = !!( a[3] );\r
- var box = !!( a[2] );\r
-\r
-\r
- if (box || (fly(el).getStyle('position') == 'absolute' && pos)) {\r
- val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];\r
- } else {\r
- val = 0;\r
- }\r
-\r
- return val;\r
- },\r
-\r
-\r
- getDefaultUnit: function(attr) {\r
- if (this.patterns.defaultUnit.test(attr)) {\r
- return 'px';\r
- }\r
-\r
- return '';\r
- },\r
-\r
- animateX : function(callback, scope) {\r
- var f = function() {\r
- this.onComplete.removeListener(f);\r
- if (typeof callback == "function") {\r
- callback.call(scope || this, this);\r
- }\r
- };\r
- this.onComplete.addListener(f, this);\r
- this.animate();\r
- },\r
-\r
-\r
- setRuntimeAttribute: function(attr) {\r
- var start;\r
- var end;\r
- var attributes = this.attributes;\r
-\r
- this.runtimeAttributes[attr] = {};\r
-\r
- var isset = function(prop) {\r
- return (typeof prop !== 'undefined');\r
- };\r
-\r
- if (!isset(attributes[attr]['to']) && !isset(attributes[attr]['by'])) {\r
- return false;\r
- }\r
-\r
- start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr);\r
-\r
-\r
- if (isset(attributes[attr]['to'])) {\r
- end = attributes[attr]['to'];\r
- } else if (isset(attributes[attr]['by'])) {\r
- if (start.constructor == Array) {\r
- end = [];\r
- for (var i = 0, len = start.length; i < len; ++i) {\r
- end[i] = start[i] + attributes[attr]['by'][i];\r
- }\r
- } else {\r
- end = start + attributes[attr]['by'];\r
- }\r
- }\r
-\r
- this.runtimeAttributes[attr].start = start;\r
- this.runtimeAttributes[attr].end = end;\r
-\r
-\r
- this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? attributes[attr]['unit'] : this.getDefaultUnit(attr);\r
- },\r
-\r
-\r
- init: function(el, attributes, duration, method) {\r
-\r
- var isAnimated = false;\r
-\r
-\r
- var startTime = null;\r
-\r
-\r
- var actualFrames = 0;\r
-\r
-\r
- el = Ext.getDom(el);\r
-\r
-\r
- this.attributes = attributes || {};\r
-\r
-\r
- this.duration = duration || 1;\r
-\r
-\r
- this.method = method || Ext.lib.Easing.easeNone;\r
-\r
-\r
- this.useSeconds = true;\r
-\r
-\r
- this.currentFrame = 0;\r
-\r
-\r
- this.totalFrames = Ext.lib.AnimMgr.fps;\r
-\r
-\r
- this.getEl = function() {\r
- return el;\r
- };\r
-\r
-\r
- this.isAnimated = function() {\r
- return isAnimated;\r
- };\r
-\r
-\r
- this.getStartTime = function() {\r
- return startTime;\r
- };\r
-\r
- this.runtimeAttributes = {};\r
-\r
-\r
- this.animate = function() {\r
- if (this.isAnimated()) {\r
- return false;\r
- }\r
-\r
- this.currentFrame = 0;\r
-\r
- this.totalFrames = ( this.useSeconds ) ? Math.ceil(Ext.lib.AnimMgr.fps * this.duration) : this.duration;\r
-\r
- Ext.lib.AnimMgr.registerElement(this);\r
- };\r
-\r
-\r
- this.stop = function(finish) {\r
- if (finish) {\r
- this.currentFrame = this.totalFrames;\r
- this._onTween.fire();\r
- }\r
- Ext.lib.AnimMgr.stop(this);\r
- };\r
-\r
- var onStart = function() {\r
- this.onStart.fire();\r
-\r
- this.runtimeAttributes = {};\r
- for (var attr in this.attributes) {\r
- this.setRuntimeAttribute(attr);\r
- }\r
-\r
- isAnimated = true;\r
- actualFrames = 0;\r
- startTime = new Date();\r
- };\r
-\r
-\r
- var onTween = function() {\r
- var data = {\r
- duration: new Date() - this.getStartTime(),\r
- currentFrame: this.currentFrame\r
- };\r
-\r
- data.toString = function() {\r
- return (\r
- 'duration: ' + data.duration +\r
- ', currentFrame: ' + data.currentFrame\r
- );\r
- };\r
-\r
- this.onTween.fire(data);\r
-\r
- var runtimeAttributes = this.runtimeAttributes;\r
-\r
- for (var attr in runtimeAttributes) {\r
- this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit);\r
- }\r
-\r
- actualFrames += 1;\r
- };\r
-\r
- var onComplete = function() {\r
- var actual_duration = (new Date() - startTime) / 1000 ;\r
-\r
- var data = {\r
- duration: actual_duration,\r
- frames: actualFrames,\r
- fps: actualFrames / actual_duration\r
- };\r
-\r
- data.toString = function() {\r
- return (\r
- 'duration: ' + data.duration +\r
- ', frames: ' + data.frames +\r
- ', fps: ' + data.fps\r
- );\r
- };\r
-\r
- isAnimated = false;\r
- actualFrames = 0;\r
- this.onComplete.fire(data);\r
- };\r
-\r
-\r
- this._onStart = new Ext.util.Event(this);\r
- this.onStart = new Ext.util.Event(this);\r
- this.onTween = new Ext.util.Event(this);\r
- this._onTween = new Ext.util.Event(this);\r
- this.onComplete = new Ext.util.Event(this);\r
- this._onComplete = new Ext.util.Event(this);\r
- this._onStart.addListener(onStart);\r
- this._onTween.addListener(onTween);\r
- this._onComplete.addListener(onComplete);\r
- }\r
- };\r
-\r
-\r
- Ext.lib.AnimMgr = new function() {\r
-\r
- var thread = null;\r
-\r
-\r
- var queue = [];\r
-\r
-\r
- var tweenCount = 0;\r
-\r
-\r
- this.fps = 1000;\r
-\r
-\r
- this.delay = 1;\r
-\r
-\r
- this.registerElement = function(tween) {\r
- queue[queue.length] = tween;\r
- tweenCount += 1;\r
- tween._onStart.fire();\r
- this.start();\r
- };\r
-\r
-\r
- this.unRegister = function(tween, index) {\r
- tween._onComplete.fire();\r
- index = index || getIndex(tween);\r
- if (index != -1) {\r
- queue.splice(index, 1);\r
- }\r
-\r
- tweenCount -= 1;\r
- if (tweenCount <= 0) {\r
- this.stop();\r
- }\r
- };\r
-\r
-\r
- this.start = function() {\r
- if (thread === null) {\r
- thread = setInterval(this.run, this.delay);\r
- }\r
- };\r
-\r
-\r
- this.stop = function(tween) {\r
- if (!tween) {\r
- clearInterval(thread);\r
-\r
- for (var i = 0, len = queue.length; i < len; ++i) {\r
- if (queue[0].isAnimated()) {\r
- this.unRegister(queue[0], 0);\r
- }\r
- }\r
-\r
- queue = [];\r
- thread = null;\r
- tweenCount = 0;\r
- }\r
- else {\r
- this.unRegister(tween);\r
- }\r
- };\r
-\r
-\r
- this.run = function() {\r
- for (var i = 0, len = queue.length; i < len; ++i) {\r
- var tween = queue[i];\r
- if (!tween || !tween.isAnimated()) {\r
- continue;\r
- }\r
-\r
- if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null)\r
- {\r
- tween.currentFrame += 1;\r
-\r
- if (tween.useSeconds) {\r
- correctFrame(tween);\r
- }\r
- tween._onTween.fire();\r
- }\r
- else {\r
- Ext.lib.AnimMgr.stop(tween, i);\r
- }\r
- }\r
- };\r
-\r
- var getIndex = function(anim) {\r
- for (var i = 0, len = queue.length; i < len; ++i) {\r
- if (queue[i] == anim) {\r
- return i;\r
- }\r
- }\r
- return -1;\r
- };\r
-\r
-\r
- var correctFrame = function(tween) {\r
- var frames = tween.totalFrames;\r
- var frame = tween.currentFrame;\r
- var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames);\r
- var elapsed = (new Date() - tween.getStartTime());\r
- var tweak = 0;\r
-\r
- if (elapsed < tween.duration * 1000) {\r
- tweak = Math.round((elapsed / expected - 1) * tween.currentFrame);\r
- } else {\r
- tweak = frames - (frame + 1);\r
- }\r
- if (tweak > 0 && isFinite(tweak)) {\r
- if (tween.currentFrame + tweak >= frames) {\r
- tweak = frames - (frame + 1);\r
- }\r
-\r
- tween.currentFrame += tweak;\r
- }\r
- };\r
- };\r
-\r
- Ext.lib.Bezier = new function() {\r
-\r
- this.getPosition = function(points, t) {\r
- var n = points.length;\r
- var tmp = [];\r
-\r
- for (var i = 0; i < n; ++i) {\r
- tmp[i] = [points[i][0], points[i][1]];\r
- }\r
-\r
- for (var j = 1; j < n; ++j) {\r
- for (i = 0; i < n - j; ++i) {\r
- tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];\r
- tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];\r
- }\r
- }\r
-\r
- return [ tmp[0][0], tmp[0][1] ];\r
-\r
- };\r
- };\r
- (function() {\r
-\r
- Ext.lib.ColorAnim = function(el, attributes, duration, method) {\r
- Ext.lib.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);\r
- };\r
-\r
- Ext.extend(Ext.lib.ColorAnim, Ext.lib.AnimBase);\r
-\r
-\r
- var Y = Ext.lib;\r
- var superclass = Y.ColorAnim.superclass;\r
- var proto = Y.ColorAnim.prototype;\r
-\r
- proto.toString = function() {\r
- var el = this.getEl();\r
- var id = el.id || el.tagName;\r
- return ("ColorAnim " + id);\r
- };\r
-\r
- proto.patterns.color = /color$/i;\r
- proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;\r
- proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;\r
- proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;\r
- proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/;\r
-\r
-\r
- proto.parseColor = function(s) {\r
- if (s.length == 3) {\r
- return s;\r
- }\r
-\r
- var c = this.patterns.hex.exec(s);\r
- if (c && c.length == 4) {\r
- return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ];\r
- }\r
-\r
- c = this.patterns.rgb.exec(s);\r
- if (c && c.length == 4) {\r
- return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ];\r
- }\r
-\r
- c = this.patterns.hex3.exec(s);\r
- if (c && c.length == 4) {\r
- return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ];\r
- }\r
-\r
- return null;\r
- };\r
-\r
- proto.getAttribute = function(attr) {\r
- var el = this.getEl();\r
- if (this.patterns.color.test(attr)) {\r
- var val = fly(el).getStyle(attr);\r
-\r
- if (this.patterns.transparent.test(val)) {\r
- var parent = el.parentNode;\r
- val = fly(parent).getStyle(attr);\r
-\r
- while (parent && this.patterns.transparent.test(val)) {\r
- parent = parent.parentNode;\r
- val = fly(parent).getStyle(attr);\r
- if (parent.tagName.toUpperCase() == 'HTML') {\r
- val = '#fff';\r
- }\r
- }\r
- }\r
- } else {\r
- val = superclass.getAttribute.call(this, attr);\r
- }\r
-\r
- return val;\r
- };\r
-\r
- proto.doMethod = function(attr, start, end) {\r
- var val;\r
-\r
- if (this.patterns.color.test(attr)) {\r
- val = [];\r
- for (var i = 0, len = start.length; i < len; ++i) {\r
- val[i] = superclass.doMethod.call(this, attr, start[i], end[i]);\r
- }\r
-\r
- val = 'rgb(' + Math.floor(val[0]) + ',' + Math.floor(val[1]) + ',' + Math.floor(val[2]) + ')';\r
- }\r
- else {\r
- val = superclass.doMethod.call(this, attr, start, end);\r
- }\r
-\r
- return val;\r
- };\r
-\r
- proto.setRuntimeAttribute = function(attr) {\r
- superclass.setRuntimeAttribute.call(this, attr);\r
-\r
- if (this.patterns.color.test(attr)) {\r
- var attributes = this.attributes;\r
- var start = this.parseColor(this.runtimeAttributes[attr].start);\r
- var end = this.parseColor(this.runtimeAttributes[attr].end);\r
-\r
- if (typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined') {\r
- end = this.parseColor(attributes[attr].by);\r
-\r
- for (var i = 0, len = start.length; i < len; ++i) {\r
- end[i] = start[i] + end[i];\r
- }\r
- }\r
-\r
- this.runtimeAttributes[attr].start = start;\r
- this.runtimeAttributes[attr].end = end;\r
- }\r
- };\r
- })();\r
-\r
-\r
- Ext.lib.Easing = {\r
-\r
-\r
- easeNone: function (t, b, c, d) {\r
- return c * t / d + b;\r
- },\r
-\r
-\r
- easeIn: function (t, b, c, d) {\r
- return c * (t /= d) * t + b;\r
- },\r
-\r
-\r
- easeOut: function (t, b, c, d) {\r
- return -c * (t /= d) * (t - 2) + b;\r
- },\r
-\r
-\r
- easeBoth: function (t, b, c, d) {\r
- if ((t /= d / 2) < 1) {\r
- return c / 2 * t * t + b;\r
- }\r
-\r
- return -c / 2 * ((--t) * (t - 2) - 1) + b;\r
- },\r
-\r
-\r
- easeInStrong: function (t, b, c, d) {\r
- return c * (t /= d) * t * t * t + b;\r
- },\r
-\r
-\r
- easeOutStrong: function (t, b, c, d) {\r
- return -c * ((t = t / d - 1) * t * t * t - 1) + b;\r
- },\r
-\r
-\r
- easeBothStrong: function (t, b, c, d) {\r
- if ((t /= d / 2) < 1) {\r
- return c / 2 * t * t * t * t + b;\r
- }\r
-\r
- return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\r
- },\r
-\r
-\r
-\r
- elasticIn: function (t, b, c, d, a, p) {\r
- if (t == 0) {\r
- return b;\r
- }\r
- if ((t /= d) == 1) {\r
- return b + c;\r
- }\r
- if (!p) {\r
- p = d * .3;\r
- }\r
-\r
- if (!a || a < Math.abs(c)) {\r
- a = c;\r
- var s = p / 4;\r
- }\r
- else {\r
- var s = p / (2 * Math.PI) * Math.asin(c / a);\r
- }\r
-\r
- return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\r
- },\r
-\r
-\r
- elasticOut: function (t, b, c, d, a, p) {\r
- if (t == 0) {\r
- return b;\r
- }\r
- if ((t /= d) == 1) {\r
- return b + c;\r
- }\r
- if (!p) {\r
- p = d * .3;\r
- }\r
-\r
- if (!a || a < Math.abs(c)) {\r
- a = c;\r
- var s = p / 4;\r
- }\r
- else {\r
- var s = p / (2 * Math.PI) * Math.asin(c / a);\r
- }\r
-\r
- return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;\r
- },\r
-\r
-\r
- elasticBoth: function (t, b, c, d, a, p) {\r
- if (t == 0) {\r
- return b;\r
- }\r
-\r
- if ((t /= d / 2) == 2) {\r
- return b + c;\r
- }\r
-\r
- if (!p) {\r
- p = d * (.3 * 1.5);\r
- }\r
-\r
- if (!a || a < Math.abs(c)) {\r
- a = c;\r
- var s = p / 4;\r
- }\r
- else {\r
- var s = p / (2 * Math.PI) * Math.asin(c / a);\r
- }\r
-\r
- if (t < 1) {\r
- return -.5 * (a * Math.pow(2, 10 * (t -= 1)) *\r
- Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\r
- }\r
- return a * Math.pow(2, -10 * (t -= 1)) *\r
- Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;\r
- },\r
-\r
-\r
-\r
- backIn: function (t, b, c, d, s) {\r
- if (typeof s == 'undefined') {\r
- s = 1.70158;\r
- }\r
- return c * (t /= d) * t * ((s + 1) * t - s) + b;\r
- },\r
-\r
-\r
- backOut: function (t, b, c, d, s) {\r
- if (typeof s == 'undefined') {\r
- s = 1.70158;\r
- }\r
- return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\r
- },\r
-\r
-\r
- backBoth: function (t, b, c, d, s) {\r
- if (typeof s == 'undefined') {\r
- s = 1.70158;\r
- }\r
-\r
- if ((t /= d / 2 ) < 1) {\r
- return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;\r
- }\r
- return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;\r
- },\r
-\r
-\r
- bounceIn: function (t, b, c, d) {\r
- return c - Ext.lib.Easing.bounceOut(d - t, 0, c, d) + b;\r
- },\r
-\r
-\r
- bounceOut: function (t, b, c, d) {\r
- if ((t /= d) < (1 / 2.75)) {\r
- return c * (7.5625 * t * t) + b;\r
- } else if (t < (2 / 2.75)) {\r
- return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;\r
- } else if (t < (2.5 / 2.75)) {\r
- return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;\r
- }\r
- return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;\r
- },\r
-\r
-\r
- bounceBoth: function (t, b, c, d) {\r
- if (t < d / 2) {\r
- return Ext.lib.Easing.bounceIn(t * 2, 0, c, d) * .5 + b;\r
- }\r
- return Ext.lib.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;\r
- }\r
- };\r
-\r
- (function() {\r
- Ext.lib.Motion = function(el, attributes, duration, method) {\r
- if (el) {\r
- Ext.lib.Motion.superclass.constructor.call(this, el, attributes, duration, method);\r
- }\r
- };\r
-\r
- Ext.extend(Ext.lib.Motion, Ext.lib.ColorAnim);\r
-\r
-\r
- var Y = Ext.lib;\r
- var superclass = Y.Motion.superclass;\r
- var proto = Y.Motion.prototype;\r
-\r
- proto.toString = function() {\r
- var el = this.getEl();\r
- var id = el.id || el.tagName;\r
- return ("Motion " + id);\r
- };\r
-\r
- proto.patterns.points = /^points$/i;\r
-\r
- proto.setAttribute = function(attr, val, unit) {\r
- if (this.patterns.points.test(attr)) {\r
- unit = unit || 'px';\r
- superclass.setAttribute.call(this, 'left', val[0], unit);\r
- superclass.setAttribute.call(this, 'top', val[1], unit);\r
- } else {\r
- superclass.setAttribute.call(this, attr, val, unit);\r
- }\r
- };\r
-\r
- proto.getAttribute = function(attr) {\r
- if (this.patterns.points.test(attr)) {\r
- var val = [\r
- superclass.getAttribute.call(this, 'left'),\r
- superclass.getAttribute.call(this, 'top')\r
- ];\r
- } else {\r
- val = superclass.getAttribute.call(this, attr);\r
- }\r
-\r
- return val;\r
- };\r
-\r
- proto.doMethod = function(attr, start, end) {\r
- var val = null;\r
-\r
- if (this.patterns.points.test(attr)) {\r
- var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100;\r
- val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t);\r
- } else {\r
- val = superclass.doMethod.call(this, attr, start, end);\r
- }\r
- return val;\r
- };\r
-\r
- proto.setRuntimeAttribute = function(attr) {\r
- if (this.patterns.points.test(attr)) {\r
- var el = this.getEl();\r
- var attributes = this.attributes;\r
- var start;\r
- var control = attributes['points']['control'] || [];\r
- var end;\r
- var i, len;\r
-\r
- if (control.length > 0 && !Ext.isArray(control[0])) {\r
- control = [control];\r
- } else {\r
- var tmp = [];\r
- for (i = 0,len = control.length; i < len; ++i) {\r
- tmp[i] = control[i];\r
- }\r
- control = tmp;\r
- }\r
-\r
- Ext.fly(el).position();\r
-\r
- if (isset(attributes['points']['from'])) {\r
- Ext.lib.Dom.setXY(el, attributes['points']['from']);\r
- }\r
- else {\r
- Ext.lib.Dom.setXY(el, Ext.lib.Dom.getXY(el));\r
- }\r
-\r
- start = this.getAttribute('points');\r
-\r
-\r
- if (isset(attributes['points']['to'])) {\r
- end = translateValues.call(this, attributes['points']['to'], start);\r
-\r
- var pageXY = Ext.lib.Dom.getXY(this.getEl());\r
- for (i = 0,len = control.length; i < len; ++i) {\r
- control[i] = translateValues.call(this, control[i], start);\r
- }\r
-\r
-\r
- } else if (isset(attributes['points']['by'])) {\r
- end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ];\r
-\r
- for (i = 0,len = control.length; i < len; ++i) {\r
- control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];\r
- }\r
- }\r
-\r
- this.runtimeAttributes[attr] = [start];\r
-\r
- if (control.length > 0) {\r
- this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control);\r
- }\r
-\r
- this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end;\r
- }\r
- else {\r
- superclass.setRuntimeAttribute.call(this, attr);\r
- }\r
- };\r
-\r
- var translateValues = function(val, start) {\r
- var pageXY = Ext.lib.Dom.getXY(this.getEl());\r
- val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ];\r
-\r
- return val;\r
- };\r
-\r
- var isset = function(prop) {\r
- return (typeof prop !== 'undefined');\r
- };\r
- })();\r
-\r
-\r
- (function() {\r
- Ext.lib.Scroll = function(el, attributes, duration, method) {\r
- if (el) {\r
- Ext.lib.Scroll.superclass.constructor.call(this, el, attributes, duration, method);\r
- }\r
- };\r
-\r
- Ext.extend(Ext.lib.Scroll, Ext.lib.ColorAnim);\r
-\r
-\r
- var Y = Ext.lib;\r
- var superclass = Y.Scroll.superclass;\r
- var proto = Y.Scroll.prototype;\r
-\r
- proto.toString = function() {\r
- var el = this.getEl();\r
- var id = el.id || el.tagName;\r
- return ("Scroll " + id);\r
- };\r
-\r
- proto.doMethod = function(attr, start, end) {\r
- var val = null;\r
-\r
- if (attr == 'scroll') {\r
- val = [\r
- this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames),\r
- this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames)\r
- ];\r
-\r
- } else {\r
- val = superclass.doMethod.call(this, attr, start, end);\r
- }\r
- return val;\r
- };\r
-\r
- proto.getAttribute = function(attr) {\r
- var val = null;\r
- var el = this.getEl();\r
-\r
- if (attr == 'scroll') {\r
- val = [ el.scrollLeft, el.scrollTop ];\r
- } else {\r
- val = superclass.getAttribute.call(this, attr);\r
- }\r
-\r
- return val;\r
- };\r
-\r
- proto.setAttribute = function(attr, val, unit) {\r
- var el = this.getEl();\r
-\r
- if (attr == 'scroll') {\r
- el.scrollLeft = val[0];\r
- el.scrollTop = val[1];\r
- } else {\r
- superclass.setAttribute.call(this, attr, val, unit);\r
- }\r
- };\r
- })();\r
-\r
-\r
-})();